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

Re: Left-over COMMIT_EDITMSG file in gitdir

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 8, 2018, 22:18 UTC
Message-ID
<xmqqpo5fp1l1.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CA+55aFzaxTrki92C8ih3M3BtYHU3BG8P2SWwvdWiTXZWFDH=1Q@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 25 quoted lines
> In that rewrite, removing some temporary files seems to have been left
> out. At least one: .git/COMMIT_EDITMSG.
>
> In the original commit.sh shell script, we can find this:
>
>   rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
>
> after creating the commit.  In the C implementation, we do have a
> number of "unlink(...)" calls:
> ...
>
> but no
>
>         unlink(git_path_commit_editmsg());
>
> and that *seems* to be an oversight.
>
> Similarly, builtin/tag,c leaves a stale TAG_EDITMSG file behind.
> Again, that actually did exist in the original shell script, which
> used to do
>
>   trap 'rm -f "$GIT_DIR"/TAG_TMP* "$GIT_DIR"/TAG_FINALMSG
> "$GIT_DIR"/TAG_EDITMSG' 0
>
> which caused that file to be removed at exit.
I do not think it was intentional---just a bug in the rewrite.
Previous: Linus Torvalds
Message 2 of 2 in “Left-over COMMIT_EDITMSG file in gitdir”
  1. Linus TorvaldsFeb 8, 2018
  2. Junio C HamanoFeb 8, 2018

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.