Skip to contentSkip to conversation

shared permissions on COMMIT_EDITMSG

PATCH William Pursell 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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:

builtin-commit.c +1 -0
index 55676fd..06ce94d 100644
@@ -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))) {
Signature · 1 line
William Pursell
#1 lore raw
Quoted 5 lines · William Pursell

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

#2 lore raw
Quoted 7 lines · Ilari Liusvaara
Quoted 5 lines · William Pursell

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:

Quoted 7 lines

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.

Signature · 1 line
William Pursell
#3 lore raw

2010/1/28 William Pursell <[email protected]>:

Quoted 16 lines
Quoted 7 lines · Ilari Liusvaara
Quoted 5 lines · William Pursell

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:

Quoted 7 lines

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.

Quoted 6 lines

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

Signature · 1 line
perl -Mre=debug -e "/just|another|perl|hacker/"