git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [minor BUG] cherry-pick -x doesn't work if a conflict occurs
@ 2010-12-29 14:16 Uwe Kleine-König
  2011-01-05  6:31 ` Robin Rosenberg
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2010-12-29 14:16 UTC (permalink / raw)
  To: git

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/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs
  2010-12-29 14:16 [minor BUG] cherry-pick -x doesn't work if a conflict occurs Uwe Kleine-König
@ 2011-01-05  6:31 ` Robin Rosenberg
  2011-01-05  6:50   ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Robin Rosenberg @ 2011-01-05  6:31 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: git


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs
  2011-01-05  6:31 ` Robin Rosenberg
@ 2011-01-05  6:50   ` Uwe Kleine-König
  2011-01-05 16:28     ` Jay Soffian
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2011-01-05  6:50 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

On Wed, Jan 05, 2011 at 07:31:05AM +0100, Robin Rosenberg wrote:
> 
> 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.
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/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs
  2011-01-05  6:50   ` Uwe Kleine-König
@ 2011-01-05 16:28     ` Jay Soffian
  2011-01-05 16:37       ` Jay Soffian
  0 siblings, 1 reply; 6+ messages in thread
From: Jay Soffian @ 2011-01-05 16:28 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Robin Rosenberg, git

2011/1/5 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
>> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs
  2011-01-05 16:28     ` Jay Soffian
@ 2011-01-05 16:37       ` Jay Soffian
  2011-01-05 18:33         ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Jay Soffian @ 2011-01-05 16:37 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Robin Rosenberg, git, Shawn O. Pearce

2011/1/5 Jay Soffian <jaysoffian@gmail.com>:
> 2011/1/5 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
>> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [minor BUG] cherry-pick -x doesn't work if a conflict occurs
  2011-01-05 16:37       ` Jay Soffian
@ 2011-01-05 18:33         ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2011-01-05 18:33 UTC (permalink / raw)
  To: Jay Soffian; +Cc: Uwe Kleine-König, Robin Rosenberg, git, Shawn O. Pearce

Jay Soffian <jaysoffian@gmail.com> writes:

> Ah, seems to be a documented short-coming after-all:
>
>   http://thread.gmane.org/gmane.comp.version-control.git/61737/focus=61933

Well, it is not.

Shawn might have accepted a documentation patch as such during my absence,
but when I originally wrote the "cherry-picked-from", it was a conscious
design decision not to carry the information forward in a conflicted case,
and the reasoning was exactly what you wrote in your first response.

Because -x has become an optional feature that a user has to explicitly
ask, I however tend to agree with Uwe that it may make sense to throw the
original commit object name in the commit log template these days.  That
would allow the user to edit it further and say something like "Originally
done by Foo in commit 1234, forward ported with conflict resolution."

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-05 18:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-29 14:16 [minor BUG] cherry-pick -x doesn't work if a conflict occurs Uwe Kleine-König
2011-01-05  6:31 ` Robin Rosenberg
2011-01-05  6:50   ` Uwe Kleine-König
2011-01-05 16:28     ` Jay Soffian
2011-01-05 16:37       ` Jay Soffian
2011-01-05 18:33         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).