Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337129

Summary: permissions not properly set when repo is configured as sharedrepository
Product: [Technology] JGit Reporter: Alvaro Sanchez-Leon <alvaro.sanchez-leon>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: caniszczyk, lmcbout, sebastien.dubois, sop, stefan.lay
Version: 0.11   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alvaro Sanchez-Leon CLA 2011-02-14 09:30:10 EST
If a git repository is configured using the option
  sharedrepository e.g. = 0666

the permissions of the created files or directories are expected to follow the shared flags e.g. above should provide read and write permissions for everyone.

However, when using Egit/Jgit the permissions applied seem to follow the umask set at the user level (in Linux), in Windows the write flag is not set.

The testing configuration is as follows:

a bare repository created in a central linux file system using the following config.
the bare repository was created from a packed repository.

$ cat config
[core]
        repositoryformatversion = 0
        filemode = false
        bare = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
        sharedrepository = 0666


a windows client clone configuration set to e.g.
[core]
	repositoryformatversion = 0
	filemode = false
	logallrefupdates = true
	autocrlf = false
	bare = false
	sharedrepository = 0666
[remote "origin"]
	url = file:///X:/share_r4e_test/org.eclipse.mylyn.reviews.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master


a similar configuration for a client in Linux was also used.


NOTE: When using msysGit (c implementation) the permissions are reflecting the sharerepository flag.
Comment 1 Alvaro Sanchez-Leon CLA 2011-02-15 14:30:11 EST
The behavior is a bit different when the bare repository is packed vs unpacked. However the interesting areas where the file permissions need to be updated seem to be in the following files and folders (i.e. experienced push permission errors).

   refs/heads/*
   logs/refs/heads/*

The following folders may also need to be considered:
   file: packed-refs