From: Junio C Hamano Date: Wed, 05 Oct 2005 21:54:58 GMT Subject: Re: [PATCH] Write .editmsg in GIT_DIR to avoid being in git-status. Message-ID: <7vk6griq8d.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <87achnq4z7.fsf@gmail.com> Santi Béjar 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 ;-). > 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. 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/? > 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.