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

5 messages from 2015-12-18 to 2015-12-19. Participants: Yaroslav Halchenko, Johannes Schindelin, SZEDER Gábor.
Thread: https://gitlist.dev/t/41037

## Yaroslav Halchenko, 2015-12-18 19:55

Subject: git leaves behind .git/COMMIT_EDITMSG non-shared in --shared non-bare repo
Message-ID: <20151218195503.GA4554@onerussian.com>
URL: https://gitlist.dev/e/20151218195503.GA4554%40onerussian.com

```
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.

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

```

## Johannes Schindelin, 2015-12-19 10:40

Subject: Re: git leaves behind .git/COMMIT_EDITMSG non-shared in --shared non-bare repo
Message-ID: <alpine.DEB.2.20.1512191137450.6483@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1512191137450.6483%40virtualbox
In-Reply-To: <20151218195503.GA4554@onerussian.com>

```
Hi Yaroslav,

On Fri, 18 Dec 2015, Yaroslav Halchenko wrote:

> 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

```

## SZEDER Gábor, 2015-12-19 12:40

Subject: Re: git leaves behind .git/COMMIT_EDITMSG non-shared in --shared non-bare repo
Message-ID: <1450528804-669-1-git-send-email-szeder@ira.uka.de>
URL: https://gitlist.dev/e/1450528804-669-1-git-send-email-szeder%40ira.uka.de
In-Reply-To: <alpine.DEB.2.20.1512191137450.6483@virtualbox>

```
> On Fri, 18 Dec 2015, Yaroslav Halchenko wrote:
> 
> > 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

```

## Yaroslav Halchenko, 2015-12-19 15:01

Subject: Re: git leaves behind .git/COMMIT_EDITMSG non-shared in --shared non-bare repo
Message-ID: <1CDB6F0D-B48B-473D-A043-0AA38A808B43@onerussian.com>
URL: https://gitlist.dev/e/1CDB6F0D-B48B-473D-A043-0AA38A808B43%40onerussian.com
In-Reply-To: <alpine.DEB.2.20.1512191137450.6483@virtualbox>

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

On December 19, 2015 5:40:43 AM EST, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>Hi Yaroslav,
>
>On Fri, 18 Dec 2015, Yaroslav Halchenko wrote:
>
>> 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

-- 
Sent from a phone which beats iPhone.

```

## Johannes Schindelin, 2015-12-19 18:24

Subject: Re: git leaves behind .git/COMMIT_EDITMSG non-shared in --shared non-bare repo
Message-ID: <alpine.DEB.2.20.1512191923220.6483@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1512191923220.6483%40virtualbox
In-Reply-To: <1450528804-669-1-git-send-email-szeder@ira.uka.de>

```
Hi Gábor,

On Sat, 19 Dec 2015, SZEDER Gábor wrote:

> > On Fri, 18 Dec 2015, Yaroslav Halchenko wrote:
> > 
> > > 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
```
