Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364956 - EGit handles executable bit incorrectly on Windows
Summary: EGit handles executable bit incorrectly on Windows
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 1.3-M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-28 09:28 EST by Artur Signell CLA
Modified: 2012-03-29 06:47 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 Artur Signell CLA 2011-11-28 09:28:08 EST
Build Identifier: 20110615-0604

EGit handles executable flags on files in Windows completely wrong. Committing a file with mode 755 (+x) causes a file with mode 644 (-x) to end up in the repository. If there is a file with mode 755 in the repository and on the disk, EGit will show that the file has changed. 

It seems to me that EGit incorrectly internally removes the executable flag for both comparison and commit, which breaks compatibility with other Git software like command line git.

This is possibly related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=361570

I consider this a major pain as it requires manual work for every file added to an EGit project (chmod 644), which I do pretty much every day.


Reproducible: Always

Steps to Reproduce:
1. Create a new class in Eclipse in a Egit project. This automatically sets the executable bit on the file.
2. Commit the file using EGit. This commits the file with mode 644 to the repository. Expected would be a commit with the actual mode of the file.
3. "git diff" in Cygwin shows that the file has changed since the last commit (old mode 100644, new mode 100755). This is correct. EGit on the other hand shows that there are no changes. This is wrong.

To make it even more interesting:
4. Commit the file using Cygwin git commit. This commits the file with mode 755.
5. EGit now shows the file has changed and there seems to be no way to resolve it in EGit (except committing again, as 644). "Replace with" -> "HEAD revision" or "File in Git Index" have no effect.
Comment 1 Adolfo Sanchez-Barbudo Herrera CLA 2011-12-16 12:50:07 EST
I think that my problem is related with this bug.

On windows, every time I commit a file using EGIT, such a file loses its executable permission.

This is an inconvenience when I'm dealing for example with .sh scripts which needs to be executed.

Every time I have to change such files, I have to do the following:
1. Commit a file
2. Change the permission via command file (git update-index --chmod=+x "file")
3. Commit such a change in the Git Staging View.


Eclipse Indigo SR1
Eclipse EGit	1.1.0.201109151100-r	org.eclipse.egit.feature.group	Eclipse EGit
Comment 2 Kevin Sawicki CLA 2011-12-16 12:55:36 EST
I pushed a potential fix for this issue for review: http://egit.eclipse.org/r/#change,4828
Comment 3 Kevin Sawicki CLA 2012-01-08 16:58:36 EST
Merged into master as commit c15c46e41e10283858c151a7ddf8451d1cd0cc6c
Comment 4 Artur Signell CLA 2012-03-29 06:47:08 EDT
Still broken the same way in  1.3.0.201202151440-r