From: Junio C Hamano Date: Tue, 22 Feb 2011 00:48:43 GMT Subject: Re: [PATCHv2 1/2] revlist.c: introduce --left/right-only for unsymmetric picking Message-ID: <7vvd0cgahg.fsf@alter.siamese.dyndns.org> In-Reply-To: Michael J Gruber writes: > The existing "--cherry-pick" does not work with unsymmetric ranges > (A..B) for obvious reasons. The implementation of this round looks a lot simpler and cleaner. We might want to make sure that l/r only are mutually exclusive at the command parser, though. diff --git a/revision.c b/revision.c index 0681c7c..02aa788 100644 --- a/revision.c +++ b/revision.c @@ -1906,6 +1906,9 @@ int prepare_revision_walk(struct rev_info *revs) int nr = revs->pending.nr; struct object_array_entry *e, *list; + if (revs->left_only && revs->right_only) + die("left-only and right-only are mutually exclusive"); + e = list = revs->pending.objects; revs->pending.nr = 0; revs->pending.alloc = 0; Also, I wonder if we want to enhance cherry_pick_list() a bit to give it an option to show only the commits that have equivalent commits on the other side (i.e. "the ones that I can now discard"); it obviously is a separate topic. > It could be followed up by introducing --cherry as equivalent to > --cherry-pick --right-only --no-merges. Yeah, I think that is a good idea. Thanks.