[minor BUG] cherry-pick -x doesn't work if a conflict occurs

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

[minor BUG] cherry-pick -x doesn't work if a conflict occurs

From: Uwe Kleine-König <hidden>
Date: 2016-06-15 22:50:18

Hello,

when hitting a conflict cherry-pick suggests using

	git commit -c $sha1

but the resulting (suggested) commit log doesn't have the extra
reference requested by -x.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:50:20

29 dec 2010 kl. 15:16 skrev Uwe Kleine-König:
Hello,

when hitting a conflict cherry-pick suggests using

	git commit -c $sha1

but the resulting (suggested) commit log doesn't have the extra
reference requested by -x.
The man page says -x only takes effect when you do not have a conflict, so there
is no bug.

-- robin

Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs

From: Uwe Kleine-König <hidden>
Date: 2016-06-15 22:50:20

On Wed, Jan 05, 2011 at 07:31:05AM +0100, Robin Rosenberg wrote:
29 dec 2010 kl. 15:16 skrev Uwe Kleine-König:
quoted
Hello,

when hitting a conflict cherry-pick suggests using

	git commit -c $sha1

but the resulting (suggested) commit log doesn't have the extra
reference requested by -x.
The man page says -x only takes effect when you do not have a conflict, so there
is no bug.
ah, I wonder if this is intended or just documenting a short-coming :-)

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs

From: Jay Soffian <hidden>
Date: 2016-06-15 22:50:20

2011/1/5 Uwe Kleine-König [off-list ref]:
quoted
The man page says -x only takes effect when you do not have a conflict, so there
is no bug.
ah, I wonder if this is intended or just documenting a short-coming :-)
I think it's intended as it's no longer the original commit, but
personally I think it should be configurable (I'd like -x to be
configurable as well). For now, I use the following "recommit" script
after a cherry-pick conflict.

#!/bin/sh
# Used after a cherry-pick conflicts to commit with the original
# authorship (commit -c) but keep the newly generated commit message
#
self=$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")
. "$(git --exec-path)/git-sh-setup"
require_work_tree
cd_to_toplevel
test -f .git/MERGE_MSG || die "No .git/MERGE_MSG"

if test "$GIT_EDITOR" = "$self"
then
  cat .git/MERGE_MSG > .GIT/COMMIT_EDITMSG
  exit 0
fi

if sha1=$(sed -ne \
  's/^(cherry picked from commit \([a-f0-9]\{40\}\))$/\1/p' .git/MERGE_MSG)
then
  export GIT_EDITOR="$self"
  git commit -c $sha1
fi

j.

Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs

From: Jay Soffian <hidden>
Date: 2016-06-15 22:50:20

2011/1/5 Jay Soffian [off-list ref]:
2011/1/5 Uwe Kleine-König [off-list ref]:
quoted
ah, I wonder if this is intended or just documenting a short-coming :-)
I think it's intended as it's no longer the original commit, but
Ah, seems to be a documented short-coming after-all:

  http://thread.gmane.org/gmane.comp.version-control.git/61737/focus=61933

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help