Re: [PATCHv2 1/2] revlist.c: introduce --left/right-only for unsymmetric picking
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 22, 2011, 00:48 UTC
- Message-ID
- <7vvd0cgahg.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <a3224c4269b26c366bb5b5df691f22f17b767f83.1298304396.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> 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.