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

Re: Suggestion: make --left-right work with --merge

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2008, 07:18 UTC
Message-ID
<7v7igqyii9.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<18372.53155.854763.12637@cargo.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> writes:
Show 5 quoted lines
> It would be nice if git-log --merge --left-right did what git log
> --merge does but additionally, if the merge is a 2-way merge, marked
> commits with '<' or '>' according to which side of the merge they came
> from.  Would that be possible?  I think the visual indication that
> --left-right gives in gitk would be useful with --merge.
Like this?
A trivial feature that can be implemented in -4 lines ;-)
 revision.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/revision.c b/revision.c
index 4e36b95..38d7d94 100644
--- a/revision.c
+++ b/revision.c
@@ -771,14 +771,9 @@ static void prepare_show_merge(struct rev_info *revs)
 	add_pending_object(revs, &head->object, "HEAD");
 	add_pending_object(revs, &other->object, "MERGE_HEAD");
 	bases = get_merge_bases(head, other, 1);
-	while (bases) {
-		struct commit *it = bases->item;
-		struct commit_list *n = bases->next;
-		free(bases);
-		bases = n;
-		it->object.flags |= UNINTERESTING;
-		add_pending_object(revs, &it->object, "(merge-base)");
-	}
+	add_pending_commit_list(revs, bases, UNINTERESTING);
+	free_commit_list(bases);
+	head->object.flags |= SYMMETRIC_LEFT;
 
 	if (!active_nr)
 		read_cache();
@@ -797,6 +792,7 @@ static void prepare_show_merge(struct rev_info *revs)
 			i++;
 	}
 	revs->prune_data = prune;
+	revs->limited = 1;
 }
 
 int handle_revision_arg(const char *arg, struct rev_info *revs,
Previous: Paul MackerrasNext: Paul Mackerras
Message 2 of 13 in “Suggestion: make --left-right work with --merge”
  1. Paul MackerrasFeb 27, 2008
  2. Junio C HamanoFeb 27, 2008
  3. Paul MackerrasFeb 27, 2008
  4. Junio C HamanoFeb 27, 2008
  5. Paul MackerrasFeb 28, 2008
  6. Junio C HamanoFeb 29, 2008
  7. Paul MackerrasFeb 29, 2008
  8. Junio C HamanoFeb 29, 2008
  9. Paul MackerrasMar 1, 2008
  10. Junio C HamanoMar 1, 2008
  11. Paul MackerrasMar 1, 2008
  12. Linus TorvaldsFeb 29, 2008
  13. Junio C HamanoFeb 29, 2008

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.