Bug 444365 - EGit changes permissions on Replace With -> HEAD Revision
Summary: EGit changes permissions on Replace With -> HEAD Revision
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-17 09:55 EDT by David Matheson CLA
Modified: 2014-09-18 08:00 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Matheson CLA 2014-09-17 09:55:30 EDT
I have text files chmod'd 644 through Cygwin (Everyone Read, me Read & Write through Windows Properties -> Security).  If I edit a file and save it, this permission setting is preserved, and the file is marked with a ">".  If I right-click and select Replace With -> HEAD Revision, the ">" goes away, but if I do "git status" from the command-line, the file is marked as modified due to a change in the permissions.  They are now 755 (Everyone Read & Write, me Full Control in Windows Properties -> Security).

I have core.fileMode=false in Git.
Comment 1 Christian Halstrick CLA 2014-09-18 04:02:32 EDT
Maybe HEAD really contained an executable file. If you then say "replace with head" then obviously the filemode has to change.

Maybe reproduce the problem again until you are just before the "replace with HEAD" step. Then in cygwin/msysgit/... switch to your repo-root 
and execute 

git ls-tree HEAD -- <path-of-your-file> 
git ls-files -s -- <path-of-your-file>
ls -l <path-of-your-file>

Then do the replace with HEAD and repeat the commands. What's the output?
Comment 2 David Matheson CLA 2014-09-18 08:00:34 EDT
Throughout this comment <file> is the relative path to the file from the root of the repo.

Before "replace with HEAD"

git ls-tree HEAD -- <file>
100644 blob bb813c1c7e21fe24ca6266ad40c6fd815fbab839    <file>

git ls-files -s -- <file>
100644 bb813c1c7e21fe24ca6266ad40c6fd815fbab839 0       <file>

ls -l <file>
-rw-r--r-- 1 <me> <my-group> 3.2K Sep 18 07:49 <file>


After "replace with HEAD"

git ls-tree HEAD -- <file>
100644 blob bb813c1c7e21fe24ca6266ad40c6fd815fbab839    <file>

git ls-files -s -- <file>
100644 bb813c1c7e21fe24ca6266ad40c6fd815fbab839 0       <file>

ls -l <file>
-rwxr-xr-x 1 <me> <my-group> 3.2K Sep 18 07:53 <file>