git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Michael J GruberNext: Junio C Hamano
Message 8 of 15 in “revlist.c: introduce --cherry for unsymmetric picking”
  1. 1/3 revlist.c: introduce --cherry for unsymmetric pickingMichael J Gruber, Feb 18, 2011
  2. 2/3 t6007: Make sure we test --cherry-pickMichael J Gruber, Feb 18, 2011
  3. 3/3 rev-list: documentation and test for --cherryMichael J Gruber, Feb 18, 2011
  4. Junio C HamanoFeb 18, 2011
  5. Jay SoffianFeb 19, 2011
  6. Michael J GruberFeb 21, 2011
  7. 1/2 revlist.c: introduce --left/right-only for unsymmetric pickingMichael J Gruber, Feb 21, 2011
  8. Junio C HamanoFeb 22, 2011
  9. Junio C HamanoFeb 22, 2011
  10. Junio C HamanoFeb 22, 2011
  11. t6007: test rev-list --cherryMichael J Gruber, Feb 22, 2011
  12. 2/2 rev-list: documentation and test for --left/right-onlyMichael J Gruber, Feb 21, 2011
  13. Jay SoffianFeb 21, 2011
  14. Michael J GruberFeb 22, 2011
  15. Junio C HamanoFeb 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.