git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SBSanti 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.
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “Write .editmsg in GIT_DIR to avoid being in git-status.”
  1. Write .editmsg in GIT_DIR to avoid being in git-status.Santi Béjar, Oct 5, 2005
  2. Junio C HamanoOct 5, 2005
  3. Santi BejarOct 6, 2005
  4. Junio C HamanoOct 6, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.