# shared permissions on COMMIT_EDITMSG

4 messages from 2010-01-28 to 2010-01-28. Participants: William Pursell, Ilari Liusvaara, demerphq.
Thread: https://gitlist.dev/t/22422

## William Pursell, 2010-01-28 09:19

Subject: shared permissions on COMMIT_EDITMSG
Message-ID: <4B61569A.1010808@gmail.com>
URL: https://gitlist.dev/e/4B61569A.1010808%40gmail.com

```
With git-init --shared=0660 and a umask of 022,
the first commit to the repository creates
the file COMMIT_EDITMSG with mode 0644
instead of 0660.  I believe this is incorrect
behavior.  Simple fix:

diff --git a/builtin-commit.c b/builtin-commit.c
index 55676fd..06ce94d 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -687,6 +687,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 	}

 	fclose(fp);
+	adjust_shared_perm(git_path(commit_editmsg));

 	if (!commitable && !in_merge && !allow_empty &&
 	    !(amend && is_a_merge(head_sha1))) {


-- 
William Pursell

```

## Ilari Liusvaara, 2010-01-28 11:14

Subject: Re: shared permissions on COMMIT_EDITMSG
Message-ID: <20100128111425.GA29577@Knoppix>
URL: https://gitlist.dev/e/20100128111425.GA29577%40Knoppix
In-Reply-To: <4B61569A.1010808@gmail.com>

```
On Wed, Jan 27, 2010 at 11:19:22PM -1000, William Pursell wrote:
> With git-init --shared=0660 and a umask of 022,
> the first commit to the repository creates
> the file COMMIT_EDITMSG with mode 0644
> instead of 0660.  I believe this is incorrect
> behavior.  Simple fix:
 
COMMIT_EDITMSG is related to committing, committing needs
working copy, and shared working copies don't work all too
well (and Git can't do anything about that because all kinds
of stuff edits the files there, not just Git).

Shared repository settings are meant to override umasks
for files in actual repository itself.

-Ilari

```

## William Pursell, 2010-01-28 17:03

Subject: Re: shared permissions on COMMIT_EDITMSG
Message-ID: <4B61C371.4050903@gmail.com>
URL: https://gitlist.dev/e/4B61C371.4050903%40gmail.com
In-Reply-To: <20100128111425.GA29577@Knoppix>

```
Ilari Liusvaara wrote:
> On Wed, Jan 27, 2010 at 11:19:22PM -1000, William Pursell wrote:
>> With git-init --shared=0660 and a umask of 022,
>> the first commit to the repository creates
>> the file COMMIT_EDITMSG with mode 0644
>> instead of 0660.  I believe this is incorrect
>> behavior.  Simple fix:
>  
> COMMIT_EDITMSG is related to committing, committing needs
> working copy, and shared working copies don't work all too
> well (and Git can't do anything about that because all kinds
> of stuff edits the files there, not just Git).
> 
> Shared repository settings are meant to override umasks
> for files in actual repository itself.

For simple work flows (eg recording linear history
of config files), sharing a working directory
works okay except for COMMIT_EDITMSG.  Since
COMMIT_EDITMSG is in the git repository and only
written by git, it makes sense for core.sharedrepository
to be honored.

-- 
William Pursell

```

## demerphq, 2010-01-28 17:57

Subject: Re: shared permissions on COMMIT_EDITMSG
Message-ID: <9b18b3111001280957q3806667ci88b9ec58b94d81cc@mail.gmail.com>
URL: https://gitlist.dev/e/9b18b3111001280957q3806667ci88b9ec58b94d81cc%40mail.gmail.com
In-Reply-To: <4B61C371.4050903@gmail.com>

```
2010/1/28 William Pursell <bill.pursell@gmail.com>:
> Ilari Liusvaara wrote:
>> On Wed, Jan 27, 2010 at 11:19:22PM -1000, William Pursell wrote:
>>> With git-init --shared=0660 and a umask of 022,
>>> the first commit to the repository creates
>>> the file COMMIT_EDITMSG with mode 0644
>>> instead of 0660.  I believe this is incorrect
>>> behavior.  Simple fix:
>>
>> COMMIT_EDITMSG is related to committing, committing needs
>> working copy, and shared working copies don't work all too
>> well (and Git can't do anything about that because all kinds
>> of stuff edits the files there, not just Git).
>>
>> Shared repository settings are meant to override umasks
>> for files in actual repository itself.
>
> For simple work flows (eg recording linear history
> of config files), sharing a working directory
> works okay except for COMMIT_EDITMSG.  Since
> COMMIT_EDITMSG is in the git repository and only
> written by git, it makes sense for core.sharedrepository
> to be honored.

I agree.  And personally ive used shared working directories quite a
bit without issue. Thanks be to git --interactive.

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

```
