{"thread":{"id":"31785","subject":"[BUG] \"git commit\" after \"cherry-pick -n\" conflict clobbers .git/COMMIT_EDITMSG","startedAt":"2012-10-11T09:33:52Z","lastAt":"2012-10-11T17:00:53Z","messageCount":2,"participants":["Yann Dirson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200980","messageId":"20121011113352.006efa25@chalon.bertin.fr","threadId":"31785","inReplyTo":null,"subject":"[BUG] \"git commit\" after \"cherry-pick -n\" conflict clobbers .git/COMMIT_EDITMSG","fromName":"Yann Dirson","fromEmail":"dirson@bertin.fr","sentAt":"2012-10-11T09:33:52Z","receivedAt":"2012-10-11T09:33:52Z","isPatch":false,"sender":{"key":"dirson@bertin.fr","avatar":null},"body":"(only tested with 1.7.10.x for now)\n\n~/softs/linux$ echo foo > .git/COMMIT_EDITMSG\n~/softs/linux$ git cherry-pick -n b55f3d92cd\nerror: could not apply b55f3d9... Linux 2.6.32.26\nhint: after resolving the conflicts, mark the corrected paths\nhint: with 'git add <paths>' or 'git rm <paths>'\n~/softs/linux$ cat .git/COMMIT_EDITMSG\nfoo\n\nSo far, so good.  But then \"git commit\" brings me the message from the\ncherry-picked commit plus the list of conflicted files, and I can verify that\nit is now the contents of .git/COMMIT_EDITMSG.\n\nSurely the fact I passed \"-n\" should prevent cloberring the message, even in the\nevent of a conflict.  I suppose that would imply not creating .git/MERGE_MSG in that\ncase, but just removing it still causes .git/COMMIT_EDITMSG to be clobbered, this\ntime with nothing but the \"git status\"-derived comments.\n\n-- \nYann Dirson - Bertin Technologies\n"},{"id":"200998","messageId":"7vzk3t6j0a.fsf@alter.siamese.dyndns.org","threadId":"31785","inReplyTo":"20121011113352.006efa25@chalon.bertin.fr","subject":"Re: [BUG] \"git commit\" after \"cherry-pick -n\" conflict clobbers .git/COMMIT_EDITMSG","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-11T17:00:53Z","receivedAt":"2012-10-11T17:00:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <dirson@bertin.fr> writes:\n\n> (only tested with 1.7.10.x for now)\n>\n> ~/softs/linux$ echo foo > .git/COMMIT_EDITMSG\n\nWhy are you mucking with such an internal implementation detail in\nthe first place?\n\n> ~/softs/linux$ git cherry-pick -n b55f3d92cd\n> error: could not apply b55f3d9... Linux 2.6.32.26\n> hint: after resolving the conflicts, mark the corrected paths\n> hint: with 'git add <paths>' or 'git rm <paths>'\n> ~/softs/linux$ cat .git/COMMIT_EDITMSG\n> foo\n>\n> So far, so good.  But then \"git commit\" brings me the message from the\n> cherry-picked commit plus the list of conflicted files, and I can verify that\n> it is now the contents of .git/COMMIT_EDITMSG.\n\nYou verified that \"what\" is now in .git/COMMIT_EDITMSG?  The commit\nlog message for you to edit to record the result of the cherry-pick?\n\nIf that is the case, what is the problem?\n\nIf anything you had in .git/COMMIT_EDITMSG before you started\n\"'cherry-pick -n', edit further to adjust, and then 'commit'\"\nsequence were to appear in the editor to edit the commit log,\nit would be a bug, I would think.\n"}]}