{"thread":{"id":"26154","subject":"[minor BUG] cherry-pick -x doesn't work if a conflict occurs","startedAt":"2010-12-29T14:16:38Z","lastAt":"2011-01-05T18:33:07Z","messageCount":6,"participants":["Uwe Kleine-König","Robin Rosenberg","Jay Soffian","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158711","messageId":"20101229141638.GA14865@pengutronix.de","threadId":"26154","inReplyTo":null,"subject":"[minor BUG] cherry-pick -x doesn't work if a conflict occurs","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2010-12-29T14:16:38Z","receivedAt":"2010-12-29T14:16:38Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nwhen hitting a conflict cherry-pick suggests using\n\n\tgit commit -c $sha1\n\nbut the resulting (suggested) commit log doesn't have the extra\nreference requested by -x.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | http://www.pengutronix.de/  |\n"},{"id":"158947","messageId":"24C35180-AED6-4848-9F05-908831F911F9@dewire.com","threadId":"26154","inReplyTo":"20101229141638.GA14865@pengutronix.de","subject":"Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2011-01-05T06:31:05Z","receivedAt":"2011-01-05T06:31:05Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"\n29 dec 2010 kl. 15:16 skrev Uwe Kleine-König:\n\n> Hello,\n> \n> when hitting a conflict cherry-pick suggests using\n> \n> \tgit commit -c $sha1\n> \n> but the resulting (suggested) commit log doesn't have the extra\n> reference requested by -x.\n> \n\nThe man page says -x only takes effect when you do not have a conflict, so there\nis no bug.\n\n-- robin\n"},{"id":"158949","messageId":"20110105065047.GJ25121@pengutronix.de","threadId":"26154","inReplyTo":"24C35180-AED6-4848-9F05-908831F911F9@dewire.com","subject":"Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2011-01-05T06:50:47Z","receivedAt":"2011-01-05T06:50:47Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"On Wed, Jan 05, 2011 at 07:31:05AM +0100, Robin Rosenberg wrote:\n> \n> 29 dec 2010 kl. 15:16 skrev Uwe Kleine-König:\n> \n> > Hello,\n> > \n> > when hitting a conflict cherry-pick suggests using\n> > \n> > \tgit commit -c $sha1\n> > \n> > but the resulting (suggested) commit log doesn't have the extra\n> > reference requested by -x.\n> > \n> \n> The man page says -x only takes effect when you do not have a conflict, so there\n> is no bug.\nah, I wonder if this is intended or just documenting a short-coming :-)\n\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | http://www.pengutronix.de/  |\n"},{"id":"158966","messageId":"AANLkTimi8s7QRYuEgr2x=bqwEuFPqUUQF4E=f=_PsoV0@mail.gmail.com","threadId":"26154","inReplyTo":"20110105065047.GJ25121@pengutronix.de","subject":"Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-01-05T16:28:58Z","receivedAt":"2011-01-05T16:28:58Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"2011/1/5 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:\n>> The man page says -x only takes effect when you do not have a conflict, so there\n>> is no bug.\n> ah, I wonder if this is intended or just documenting a short-coming :-)\n\nI think it's intended as it's no longer the original commit, but\npersonally I think it should be configurable (I'd like -x to be\nconfigurable as well). For now, I use the following \"recommit\" script\nafter a cherry-pick conflict.\n\n#!/bin/sh\n# Used after a cherry-pick conflicts to commit with the original\n# authorship (commit -c) but keep the newly generated commit message\n#\nself=$(cd \"$(dirname \"$0\")\" && pwd -P)/$(basename \"$0\")\n. \"$(git --exec-path)/git-sh-setup\"\nrequire_work_tree\ncd_to_toplevel\ntest -f .git/MERGE_MSG || die \"No .git/MERGE_MSG\"\n\nif test \"$GIT_EDITOR\" = \"$self\"\nthen\n  cat .git/MERGE_MSG > .GIT/COMMIT_EDITMSG\n  exit 0\nfi\n\nif sha1=$(sed -ne \\\n  's/^(cherry picked from commit \\([a-f0-9]\\{40\\}\\))$/\\1/p' .git/MERGE_MSG)\nthen\n  export GIT_EDITOR=\"$self\"\n  git commit -c $sha1\nfi\n\nj.\n"},{"id":"158967","messageId":"AANLkTi==nMhcN538ekww3FEYFxhOqDqj4_Z7xg0a0B0Z@mail.gmail.com","threadId":"26154","inReplyTo":"AANLkTimi8s7QRYuEgr2x=bqwEuFPqUUQF4E=f=_PsoV0@mail.gmail.com","subject":"Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-01-05T16:37:39Z","receivedAt":"2011-01-05T16:37:39Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"2011/1/5 Jay Soffian <jaysoffian@gmail.com>:\n> 2011/1/5 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:\n>> ah, I wonder if this is intended or just documenting a short-coming :-)\n>\n> I think it's intended as it's no longer the original commit, but\n\nAh, seems to be a documented short-coming after-all:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/61737/focus=61933\n\nj.\n"},{"id":"158975","messageId":"7v1v4rdwv0.fsf@alter.siamese.dyndns.org","threadId":"26154","inReplyTo":"AANLkTi==nMhcN538ekww3FEYFxhOqDqj4_Z7xg0a0B0Z@mail.gmail.com","subject":"Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-05T18:33:07Z","receivedAt":"2011-01-05T18:33:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> Ah, seems to be a documented short-coming after-all:\n>\n>   http://thread.gmane.org/gmane.comp.version-control.git/61737/focus=61933\n\nWell, it is not.\n\nShawn might have accepted a documentation patch as such during my absence,\nbut when I originally wrote the \"cherry-picked-from\", it was a conscious\ndesign decision not to carry the information forward in a conflicted case,\nand the reasoning was exactly what you wrote in your first response.\n\nBecause -x has become an optional feature that a user has to explicitly\nask, I however tend to agree with Uwe that it may make sense to throw the\noriginal commit object name in the commit log template these days.  That\nwould allow the user to edit it further and say something like \"Originally\ndone by Foo in commit 1234, forward ported with conflict resolution.\"\n"}]}