git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Simpkins <adam@adamsimpkins.net>
To: git@vger.kernel.org
Cc: Adam Simpkins <adam@adamsimpkins.net>
Subject: [PATCH 0/2] Fix output of "git log --graph --boundary"
Date: Sat, 24 May 2008 16:02:03 -0700	[thread overview]
Message-ID: <1211670125-10215-1-git-send-email-adam@adamsimpkins.net> (raw)

These two patches fix the graph output when --boundary is used.  They
apply on top of a merge of my recent fixes for handling uninteresting
commits (since they use the new graph_is_interesting() function I
added), and Dscho's "--graph --left-right" changes (since these changes
also need the struct rev_info).

There were two small conflicts when merging Dscho's and my changes.
I've including a merge diff below showing how I resolved them.


Adam Simpkins (2):
  Fix output of "git log --graph --boundary"
  get_revision(): honor the topo_order flag for boundary commits

 graph.c    |   87 ++++++++++++++++++++++++++++++++++++++++-------------------
 revision.c |   75 ++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 117 insertions(+), 45 deletions(-)


8acd45e94a0d42a0ceb164e294049104e0c0f663
diff --cc graph.c
index ba9ede0,85a9ba0..479035d
--- a/graph.c
+++ b/graph.c
@@@ -55,11 -55,13 +55,15 @@@ struct git_graph 
  	 */
  	struct commit *commit;
  	/*
+ 	 * For the --left-right option.
+ 	 */
+ 	struct rev_info *revs;
+ 	/*
 -	 * The number of parents this commit has.
 -	 * (Stored so we don't have to walk over them each time we need
 -	 * this number)
 +	 * The number of interesting parents that this commit has.
 +	 *
 +	 * Note that this is not the same as the actual number of parents.
 +	 * This count excludes parents that won't be printed in the graph
 +	 * output, as determined by graph_is_interesting().
  	 */
  	int num_parents;
  	/*
@@@ -565,18 -545,14 +570,28 @@@ void graph_output_commit_line(struct gi
  
  		if (col_commit == graph->commit) {
  			seen_this = 1;
 +			/*
- 			 * If the commit is a merge, print 'M'.  Otherwise,
- 			 * print '*'.
++			 * If revs->left_right is set, print the '<' or '>'
++			 * depending on which side this commit came from.
++			 *
++			 * If revs->left_right is not set and the commit is
++			 * a merge, print 'M'.  Otherwise, print '*'.
 +			 *
 +			 * Note that we don't check graph->num_parents to
 +			 * determine if the commit is a merge, since that
 +			 * only tracks the number of "interesting" parents.
 +			 * We want to print 'M' for merge commits even if
 +			 * they have less than 2 interesting parents.
 +			 */
- 			if (graph->commit->parents != NULL &&
- 			    graph->commit->parents->next != NULL)
+ 			if (graph->revs && graph->revs->left_right) {
+ 				if (graph->commit->object.flags
+ 						& SYMMETRIC_LEFT)
+ 					strbuf_addch(sb, '<');
+ 				else
+ 					strbuf_addch(sb, '>');
+ 			}
 -			else if (graph->num_parents > 1)
++			else if (graph->commit->parents != NULL &&
++				 graph->commit->parents->next != NULL)
  				strbuf_addch(sb, 'M');
  			else
  				strbuf_addch(sb, '*');

             reply	other threads:[~2008-05-24 23:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-24 23:02 Adam Simpkins [this message]
2008-05-24 23:02 ` [PATCH 1/2] Fix output of "git log --graph --boundary" Adam Simpkins
2008-05-24 23:02   ` [PATCH 2/2] get_revision(): honor the topo_order flag for boundary commits Adam Simpkins
2008-05-25 19:20   ` [PATCH 1/2] Fix output of "git log --graph --boundary" Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1211670125-10215-1-git-send-email-adam@adamsimpkins.net \
    --to=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).