hello,
recently i started using sourcetree, and i must say that this is a first gui for git that i really like. thank you!
but i have a big problem:
do you know how to set it up so that the sourcetree/git does works correctly with line endings?
what is happening:
i work on some files on windows project (i.e. mostly CRLF) with visual studio. some of the operations of sourcetree (stage/discard hunk? stashing? stage/discard line?) does messes with line endings in the way that when reloading the file in visual studio says that there are inconsistent line endings.
if i identify the file by file utility:
original file: C++ source, UTF-8 Unicode (with BOM) text, with CRLF line terminators
modified file: C source, UTF-8 Unicode (with BOM) text, with CRLF, LF line terminators
it does not happen often, but by now i "infected" at least 5 files in a project which annoys other users.
i watched it for a while and maybe i personally suspect stage line (s)/ discard selected line(s) functionality of sourcetree. but maybe i am wrong.
hi, this is ticket i created
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like a bug, report it here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
nah there's something more... it did it again while i watched, now i have 1oo% repro.
i have a file in stash, that has only one hunk in it. i can send it to you in form of patch, probably.
1) clean repository:
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
2) apply stash:
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
3) select green line
discard green line by clicking at 'discard lines'
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
4) discard hunk
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF, LF line terminators
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i do have that
PS D:\> git config --list | grep crlf core.autocrlf=true core.autocrlf=true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That will make sure that you don't "infect" more files later. For the already "infected" ones, you might need to fix the line endings once with a text editor and commit the change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, but i have this setting for a very long time. and still observe new files with 'inconsistent line endings' appearing (after certain operations of git or sourcetree). that's why i am asking... i've been googling on this a lot. okay, i will fix the infected ones with unix2dos.exe and we'll see
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should set autocrlf = true.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.