Subject: Re: [PATCH] Write .editmsg in GIT_DIR to avoid being in git-status.

From: Santi Bejar <[email-masked]>
Date: Thu, 6 Oct 2005 15:30:30 +0200

2005/10/5, Junio C Hamano <[email-masked]>:
> Santi B.ANijar <[email-masked]> writes:
>
> > It appears in the git-status output during a git-commit if you have
> > something in info/exclude.
>
> ... which does not worry me too much; you'll get used to it ;-).
>

I'm used too, but I don't think it's a 1.0 thing.

> > Also for .cmitmsg and .cmitchk to make git-commit work
> > in read-only working trees.
>
> If a working tree is read-only, I wonder what you are committing.
>

I keep my /etc modifications in git, and I want to commit as a user not as root.

> It might not be a bad idea to think about this a bit more before
> actually coding.  You are moving things out of the working tree
> root level, which is a valid thing to do when worrying about a
> repository (or working tree) that you do not have write access
> to.  We've had a fix similar to this for temporary files used by
> diff commands, which moved them to $TMPDIR or something like
> that.  If the working tree root level is not writable for you,
> is it valid/reasonable to assume that $GIT_DIR is?  Are there
> better places?  E.g. perhaps $HOME/.gittmp/?

Yes, it was just quick. I think the best way would be to write to /tmp
but honor $TMPDIR.

>
> >  ret="$?"
> > -rm -f .cmitmsg .editmsg .cmitchk
> > +rm -f "$GIT_DIR"/{.cmitmsg,.editmsg,.cmitchk}
>
> Please do not do "{a,b,c}".  I think ksh can grok the rest of
> the git-commit.sh code, but not this.

OK.