Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCHv2 1/2] revlist.c: introduce --left/right-only for unsymmetric picking

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:37
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Michael J Gruber [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help