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

Re: [PATCH] log --graph: draw '>' and '<' with --left-right

From
Adam Simpkins <adam@adamsimpkins.net>
Date
May 25, 2008, 06:43 UTC
Message-ID
<20080525064324.GA16827@adamsimpkins.net>
In-Reply-To
<7v63t3j6mn.fsf@gitster.siamese.dyndns.org>
On Sat, May 24, 2008 at 10:27:12PM -0700, Junio C Hamano wrote:
Show 32 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > When calling "git log --left-right <branch1>...<branch2>", a single "<" or 
> > ">" is shown in front of the commit line, to indicate which branch1 this 
> > commit comes from, branch1 or branch2.
> >
> > However, it is easy to miss in the output of "git log --graph ...", since 
> > the graph still has "*" for regular commits and "M" for merge commits.  So 
> > imitate gitk, and show the "<" and ">" characters in the graph, too, 
> > instead of "*" (or "M").
> 
> This certainly makes it more visible which one is left and which one is
> right:
>
> ...
> 
> But is it just me who now finds the original marker redundant and ugly?
> IOW, I wonder if it is better to show this:
> 
>     < commit 205ffa9...
>     | Author: Gustaf Hendeby <hendeby@isy.liu.se>
>     |
>     |     Make git add -n and git -u -n output consistent
>     |
>     < commit 38ed1d8...
>     | Author: Junio C Hamano <gitster@pobox.com>
>     |
>     |     "git-add -n -u" should not add but just report
>     ...
> 
> This is with --pretty=short, --pretty=oneline makes the issue even more
> obvious.

Yes, I agree that the original marker is now redundant, and it looks better without it.

My recent patch to fix the "log --graph --boundary" behavior also changes the graph code to print boundary commits as 'o' instead of '*'. We could probably also remove the original '-' prefix for boundary commits when the graph output is enabled.

I was looking at the code, and noticed that it also outputs a '^' prefix for non-boundary commits that are marked UNINTERESTING. In what situations will get_revision() return a commit that is UNINTERESTING but not BOUNDARY? I'm asking since the graph code currently treats these commits as uninteresting, and won't print branch lines for them. If there are situations where these commits are included in the log output, the graph code probably needs to be updated to handle it.

-- 
Adam Simpkins
adam@adamsimpkins.net
Previous: Junio C HamanoNext: Adam Simpkins
Message 5 of 6 in “log --graph: draw '>' and '<' with --left-right”
  1. log --graph: draw '>' and '<' with --left-rightJohannes Schindelin, May 22, 2008
  2. Johannes SchindelinMay 22, 2008
  3. Sverre RabbelierMay 22, 2008
  4. Junio C HamanoMay 25, 2008
  5. Adam SimpkinsMay 25, 2008
  6. log and rev-list: don't print extra prefixes already shown in the graphAdam Simpkins, May 25, 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.