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

[BUG] "git commit" after "cherry-pick -n" conflict clobbers .git/COMMIT_EDITMSG

From
YDYann Dirson <dirson@bertin.fr>
Date
Oct 11, 2012, 09:33 UTC
Message-ID
<20121011113352.006efa25@chalon.bertin.fr>
(only tested with 1.7.10.x for now)

~/softs/linux$ echo foo > .git/COMMIT_EDITMSG ~/softs/linux$ git cherry-pick -n b55f3d92cd error: could not apply b55f3d9... Linux 2.6.32.26 hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' ~/softs/linux$ cat .git/COMMIT_EDITMSG foo

So far, so good. But then "git commit" brings me the message from the cherry-picked commit plus the list of conflicted files, and I can verify that it is now the contents of .git/COMMIT_EDITMSG.

Surely the fact I passed "-n" should prevent cloberring the message, even in the event of a conflict. I suppose that would imply not creating .git/MERGE_MSG in that case, but just removing it still causes .git/COMMIT_EDITMSG to be clobbered, this time with nothing but the "git status"-derived comments.

-- 
Yann Dirson - Bertin Technologies
Next: Junio C Hamano
Message 1 of 2 in “[BUG] "git commit" after "cherry-pick -n" conflict clobbers .git/COMMIT_EDITMSG”
  1. Yann DirsonOct 11, 2012
  2. Junio C HamanoOct 11, 2012

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.