Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit clone as root loses the executable bit of shell script file
JGit clone as root loses the executable bit of shell script file [message #1734504] Thu, 09 June 2016 02:37 Go to next message
Don Henry is currently offline Don HenryFriend
Messages: 2
Registered: June 2016
Junior Member
I have a git repo that contains a shell script that has the executable bit set.

When I clone the repo with jgit (version 4.3.1.201605051710-r), running as a non-root user, the executable bit is preserved.

When I clone this same repo, running as root, the executable bit is lost. What's interesting is a "git status" reports no change.

I have seen this problem on both ubuntu and centos, both Java 7 and 8.

This is not a problem when I use the git command.

Did a search through the forum and saw reports of problems similar to this back on a 3.X version that indicated that problem was resolved, so either
Re: JGit clone as root loses the executable bit of shell script file [message #1734615 is a reply to message #1734504] Thu, 09 June 2016 23:23 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Can you provide links to the problem reports you mentioned ?
Re: JGit clone as root loses the executable bit of shell script file [message #1734923 is a reply to message #1734615] Mon, 13 June 2016 18:32 Go to previous messageGo to next message
Don Henry is currently offline Don HenryFriend
Messages: 2
Registered: June 2016
Junior Member
Below is an illustration of what I'm seeing. Note how the permissions changes for the "edit-service-wrapper" file from 777 to 644 when I clone as root.


$ ~/Downloads/org.eclipse.jgit.pgm-4.3.1.201605051710-r.sh --version
jgit version 4.3.1.201605051710-r

$ ~/Downloads/org.eclipse.jgit.pgm-4.3.1.201605051710-r.sh clone git@atom-git.turner.com:subgit/editservice.git
Cloning into 'editservice'...
remote: Counting objects: 7872
remote: Compressing objects: 100% (1848/1848)
Receiving objects: 100% (7872/7872)
Resolving deltas: 100% (4589/4589)
Updating references: 100% (283/283)

$ ll editservice/src/main/resources/
total 28
-rw-rw-r-- 1 dohenry dohenry 2849 Jun 13 14:19 application.conf
drwxrwxr-x 2 dohenry dohenry 4096 Jun 13 14:19 cluster
drwxrwxr-x 2 dohenry dohenry 4096 Jun 13 14:19 configs
drwxrwxr-x 2 dohenry dohenry 4096 Jun 13 14:19 data
drwxrwxr-x 3 dohenry dohenry 4096 Jun 13 14:19 docker
-rwxrwxr-x 1 dohenry dohenry 3330 Jun 13 14:19 edit-service-wrapper
drwxrwxr-x 2 dohenry dohenry 4096 Jun 13 14:19 html

$ sudo bash

# ~dohenry/Downloads/org.eclipse.jgit.pgm-4.3.1.201605051710-r.sh clone git@atom-git.turner.com:subgit/editservice.git

# rm -rf editservice/

# ~dohenry/Downloads/org.eclipse.jgit.pgm-4.3.1.201605051710-r.sh clone git@atom-git.turner.com:subgit/editservice.git
Cloning into 'editservice'...
remote: Counting objects: 7872
remote: Compressing objects: 100% (1848/1848)
Receiving objects: 100% (7872/7872)
Resolving deltas: 100% (4589/4589)
Updating references: 100% (283/283)

# ll editservice/src/main/resources/
total 28
-rw-r--r-- 1 root root 2849 Jun 13 14:20 application.conf
drwxr-xr-x 2 root root 4096 Jun 13 14:20 cluster
drwxr-xr-x 2 root root 4096 Jun 13 14:20 configs
drwxr-xr-x 2 root root 4096 Jun 13 14:20 data
drwxr-xr-x 3 root root 4096 Jun 13 14:20 docker
-rw-r--r-- 1 root root 3330 Jun 13 14:20 edit-service-wrapper
drwxr-xr-x 2 root root 4096 Jun 13 14:20 html
Re: JGit clone as root loses the executable bit of shell script file [message #1734981 is a reply to message #1734923] Tue, 14 June 2016 11:27 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
maybe something is wrong with JGit's umask handling.
See http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
Previous Topic:AST-based algorithm for Egit
Next Topic:How to Create a Note for a BLOB Object?
Goto Forum:
  


Current Time: Tue Apr 16 18:34:25 GMT 2024

Powered by FUDForum. Page generated in 1.19634 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top