Re: git merge changes file mode from 644 to 755

2015-08-14 Thread Johannes Sixt

Am 14.08.2015 um 14:02 schrieb Dmitry Oksenchuk:

Hello,

I've noticed strange behavior of git merge on Windows with
core.filemode=false (set by default). Git changed mode of some files
from 644 to 755 for unknown reason. One of the files is stdafx.cpp,
it's absent in the common ancestor, it was added in the first branch
(master) with mode 644 and it's still absent in the second branch
(feature). So, git merges the file without conflicts but changes mode
from 644 to 755.


I do know the git-merge-recursive does not honor core.filemode. However, 
I am surprised to see a mode change from 644 to 755. I usually observe 
only mode changes from 755 to 644, but then the case where the file is 
not present on one branch is uncommon for me.



Why git merge changes mode from 644 to 755? Is it a known issue?


So, well, yes, it is known that with git merge mode changes do occur, 
but no, 644 to 755 is news to me.


The work-around is to unstage the file and stage it again, e.g. with 
git-gui and then to amend the merge commit.


-- Hannes

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


git merge changes file mode from 644 to 755

2015-08-14 Thread Dmitry Oksenchuk
Hello,

I've noticed strange behavior of git merge on Windows with
core.filemode=false (set by default). Git changed mode of some files
from 644 to 755 for unknown reason. One of the files is stdafx.cpp,
it's absent in the common ancestor, it was added in the first branch
(master) with mode 644 and it's still absent in the second branch
(feature). So, git merges the file without conflicts but changes mode
from 644 to 755.

Example with git merge:
$ git reset --hard 9b90bac - the first branch
$ git merge-base 9b90bac f41bd44 - the second branch
e44b025b000fe71cf621b5aadad88e71d209e301 - the common ancestor
$ git ls-tree 9b90bac stdafx.cpp
100644 blob 0bf386d4ae494503129921f5b5077a74976c8f91stdafx.cpp -
644 in the first branch
$ git ls-tree e44b025 stdafx.cpp - absent in the common ancestor
$ git ls-tree f41bd44 stdafx.cpp - absent in the second branch
$ git merge f41bd44
Auto-merging stdafx.cpp
$ git ls-files -s stdafx.cpp
100755 0bf386d4ae494503129921f5b5077a74976c8f91 0   stdafx.cpp -
755 after merge

Example with git read-tree:
$ git reset --hard 9b90bac
$ git read-tree -m e44b025 9b90bac f41bd44
$ git ls-files -s stdafx.cpp
100644 0bf386d4ae494503129921f5b5077a74976c8f91 0   stdafx.cpp -
644 after read-tree -m

Why git merge changes mode from 644 to 755? Is it a known issue?

I use git version 1.9.5.msysgit.0. Maybe the issue was fixed in a later version?

Regards,
Dmitry
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html