Skip to contentSkip to conversation

git leaves behind .git/COMMIT_EDITMSG non-shared in --shared non-bare repo

DISCUSSION Yaroslav Halchenko 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Not sure for what batch operations that file is actually useful, but the story is that if we have a shared git repo (I know -- might not be as common of a situation but possible and allowed to happen), then if one from the shared group commits within that repository, it becomes impossible for another person to commit.

git does take care about chmod'ing all the files under .git/objects etc for --shared operation, but leaves .git/COMMIT_EDITMSG at the mercy of user's umask. IMHO correct resolution, if leaving that file behind is necessary, is to chmod it in the same fashion as any other internal .git file in --shared mode -- with group write permission.

I have reproduced that behavior with today's version of git as of 2.7.0.rc1.5.gf3adf45.

Signature · 5 lines
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        
#1 lore raw

Hi Yaroslav,

Quoted 1 line · Yaroslav Halchenko

Not sure for what batch operations that file is actually useful,

None. This file is written when you commit interactively. It is deleted afterwards, unless aborted in a fatal manner.

So I would try to find out who the heck is working interactively without finishing their commit message in that shared directory.

Ciao,
Johannes

#2 lore raw
Quoted 6 lines · Yaroslav Halchenko
Quoted 2 lines

Not sure for what batch operations that file is actually useful,

None. This file is written when you commit interactively. It is deleted afterwards, unless aborted in a fatal manner.

Is it? I have a COMMIT_EDITMSG lying around in just about every git repository I have and couldn't find any unlink() in builtin/commit.c or elsewhere that would remove it. In fact, not deleting it seems to be the desired bahavior, because many tests in t7502-commit.sh depend on this file still being present after a successful 'git commit'.

Gábor

#3 lore raw

Hi Gábor,

Quoted 10 lines · SZEDER Gábor
Quoted 6 lines · Yaroslav Halchenko
Quoted 2 lines

Not sure for what batch operations that file is actually useful,

None. This file is written when you commit interactively. It is deleted afterwards, unless aborted in a fatal manner.

Is it? I have a COMMIT_EDITMSG lying around in just about every git repository I have and couldn't find any unlink() in builtin/commit.c or elsewhere that would remove it.

Oops. My mistake. Patch sent.

Ciao,
Dscho

#4 lore raw
In reply to Johannes Schindelin

fwiw that file is created not only by interactive tasks by with a regular commit -m msg as well.

Quoted 15 lines · Johannes Schindelin

Hi Yaroslav,

Quoted 1 line · Yaroslav Halchenko

Not sure for what batch operations that file is actually useful,

None. This file is written when you commit interactively. It is deleted afterwards, unless aborted in a fatal manner.

So I would try to find out who the heck is working interactively without
finishing their commit message in that shared directory.

Ciao,
Johannes

Signature · 1 line
Sent from a phone which beats iPhone.