Re: [PATCH] Write .editmsg in GIT_DIR to avoid being in git-status.
- From
- Santi Bejar <sbejar@gmail.com>
- Date
- Oct 6, 2005, 13:30 UTC
- Message-ID
- <8aa486160510060630m2afb18ffx@mail.gmail.com>
- In-Reply-To
- <7vk6griq8d.fsf@assigned-by-dhcp.cox.net>
2005/10/5, Junio C Hamano <junkio@cox.net>:
Show 7 quoted lines
> Santi B.ANijar <sbejar@gmail.com> 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.
Show 5 quoted lines
> > 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.
Show 9 quoted lines
> 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.
Show 7 quoted lines
>
> > 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.