All of lore.kernel.org
 help / color / mirror / Atom feed
* shared permissions on COMMIT_EDITMSG
@ 2010-01-28  9:19 William Pursell
  2010-01-28 11:14 ` Ilari Liusvaara
  0 siblings, 1 reply; 4+ messages in thread
From: William Pursell @ 2010-01-28  9:19 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: shared permissions on COMMIT_EDITMSG
  2010-01-28  9:19 shared permissions on COMMIT_EDITMSG William Pursell
@ 2010-01-28 11:14 ` Ilari Liusvaara
  2010-01-28 17:03   ` William Pursell
  0 siblings, 1 reply; 4+ messages in thread
From: Ilari Liusvaara @ 2010-01-28 11:14 UTC (permalink / raw)
  To: William Pursell; +Cc: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: shared permissions on COMMIT_EDITMSG
  2010-01-28 11:14 ` Ilari Liusvaara
@ 2010-01-28 17:03   ` William Pursell
  2010-01-28 17:57     ` demerphq
  0 siblings, 1 reply; 4+ messages in thread
From: William Pursell @ 2010-01-28 17:03 UTC (permalink / raw)
  To: Ilari Liusvaara; +Cc: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: shared permissions on COMMIT_EDITMSG
  2010-01-28 17:03   ` William Pursell
@ 2010-01-28 17:57     ` demerphq
  0 siblings, 0 replies; 4+ messages in thread
From: demerphq @ 2010-01-28 17:57 UTC (permalink / raw)
  To: William Pursell; +Cc: Ilari Liusvaara, git

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/"

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-28 17:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-28  9:19 shared permissions on COMMIT_EDITMSG William Pursell
2010-01-28 11:14 ` Ilari Liusvaara
2010-01-28 17:03   ` William Pursell
2010-01-28 17:57     ` demerphq

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.