i have some bash scripts in my repo and when i edit with the inline editor and then pull the changes to the server two strange things happen.
it replace ALL the text, not just the lines changed (git diff show all as minus and then adding back everything. i believe this is related to 2.
it changes the mode to dos. when i run the shell script again (after pulling the new changes) it get "/bin/bash^M: bad interpreter"
running :set ff=unix in vim fixes it.
also the permissions are changed (the file was 770 and after pull becomes something like 755)
all my machines involved are linux of mac so no chances to get dos. and for this example everything was happening on the server, ubuntu 10.04.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I'm sorry but I can't reproduce this. The editor's new line mode is set to "auto", so it should pick up whatever is used in the file.
You can check this by pasting the following line in the JS console when you have the edit page open:
editor.getSession().getNewLineMode() (see the ACE docs for it)
By Administrator on 2012-12-17T17:54:24 (imported from GitLab project)
By Administrator on 2012-12-17T17:54:24 (imported from GitLab)
I can confirm this behavior. When using the GITLAB edit feature it defaults to CRLF line terminators, which breaks shell scripts.
GITLAB branch: 4-1-stable
OS: Ubuntu 12.04.1 LTS
After editing a UNIX shell script in GITLAB's editor.
$ file deploy.sh deploy.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators
After applying the setting recommended by @jojosch files are now being created correctly for UNIX line terminators.
And also resetting deploy.sh back to UNIX line terminators.
$ git config --global core.autocrlf input # for gitlab user
Make edit to deploy.sh in GITLAB
$ git pull $ file deploy.sh deploy.sh: Bourne-Again shell script, ASCII text executable
By Administrator on 2013-01-23T16:34:14 (imported from GitLab project)
By Administrator on 2013-01-23T16:34:14 (imported from GitLab)
I tried the core.autocrlf = input trick and that breaks auto-merge on some projects, depending on the types of line endings in the files (just an FYI for others).
By Administrator on 2013-04-08T19:53:57 (imported from GitLab project)
By Administrator on 2013-04-08T19:53:57 (imported from GitLab)