All of lore.kernel.org
 help / color / mirror / Atom feed
* git log --graph --oneline - false parent-child visualization
@ 2012-11-05 12:57 martyone
  2012-11-05 14:17 ` Michael J Gruber
  0 siblings, 1 reply; 2+ messages in thread
From: martyone @ 2012-11-05 12:57 UTC (permalink / raw)
  To: git

Hello,

the combination of --graph and --oneline sometimes produces output
which is -- at least for me -- not clear about parent-child relation
between commits. I noticed it when using with --simplify-by-decoration
switch but it should not be specific to the use of this switch.

See this example output (git version 1.7.11.3)

| | | * eead15f (origin/branchA) Lorem ipsum dolor sit amet
| |_|/
|/| |
| | | * 8da3b9f (origin/branchB) Consectetur adipisicing elit
| | |/
| | | * c4d6b9a (origin/branchC) Sed do eiusmod tempor incididunt ut labore
| | | * d623246 (origin/branchD) Ut enim ad minim veniam
| | |/
| | | * 458d305 (origin/btanchE) Quis nostrud exercitation ullamco laboris
| | |/

Here it seems commit c4d6b9a is based on d623246. But when the format
is more-than-oneline (or when checked with gitk), it is clear there is
no relation between commits c4d6b9a and d623246.

| | | * commit eead15f (origin/branchA)
| |_|/  Author: John Doe <john.doe@example.net>
|/| |
| | |       Lorem ipsum dolor sit amet
| | |
| | | * commit 8da3b9f (origin/branchB)
| | |/  Author: John Doe <john.doe@example.net>
| | |
| | |       Consectetur adipisicing elit
| | |
| | | * commit c4d6b9a (origin/branchC)
| | |   Author: John Doe <john.doe@example.net>
| | |
| | |       Sed do eiusmod tempor incididunt ut labore
| | |
| | | * commit d623246 (origin/branchD)
| | |/  Author: John Doe <john.doe@example.net>
| | |
| | |       Ut enim ad minim veniam
| | |
| | | * commit 458d305 (origin/branchE)
| | |/  Author: John Doe <john.doe@example.net>
| | |
| | |       Quis nostrud exercitation ullamco laboris
| | |

Correct output produced with --oneline switch should output an extra
newline when commit has no parent listed:

| | | * eead15f (origin/branchA) Lorem ipsum dolor sit amet
| |_|/
|/| |
| | | * 8da3b9f (origin/branchB) Consectetur adipisicing elit
| | |/
| | | * c4d6b9a (origin/branchC) Sed do eiusmod tempor incididunt ut labore
| | |
| | | * d623246 (origin/branchD) Ut enim ad minim veniam
| | |/
| | | * 458d305 (origin/btanchE) Quis nostrud exercitation ullamco laboris
| | |/

Best Regards,
Martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git log --graph --oneline - false parent-child visualization
  2012-11-05 12:57 git log --graph --oneline - false parent-child visualization martyone
@ 2012-11-05 14:17 ` Michael J Gruber
  0 siblings, 0 replies; 2+ messages in thread
From: Michael J Gruber @ 2012-11-05 14:17 UTC (permalink / raw)
  To: martyone; +Cc: git

martyone venit, vidit, dixit 05.11.2012 13:57:
> Hello,
> 
> the combination of --graph and --oneline sometimes produces output
> which is -- at least for me -- not clear about parent-child relation
> between commits. I noticed it when using with --simplify-by-decoration
> switch but it should not be specific to the use of this switch.
> 
> See this example output (git version 1.7.11.3)
> 
> | | | * eead15f (origin/branchA) Lorem ipsum dolor sit amet
> | |_|/
> |/| |
> | | | * 8da3b9f (origin/branchB) Consectetur adipisicing elit
> | | |/
> | | | * c4d6b9a (origin/branchC) Sed do eiusmod tempor incididunt ut labore
> | | | * d623246 (origin/branchD) Ut enim ad minim veniam
> | | |/
> | | | * 458d305 (origin/btanchE) Quis nostrud exercitation ullamco laboris
> | | |/
> 
> Here it seems commit c4d6b9a is based on d623246. But when the format
> is more-than-oneline (or when checked with gitk), it is clear there is
> no relation between commits c4d6b9a and d623246.
> 
> | | | * commit eead15f (origin/branchA)
> | |_|/  Author: John Doe <john.doe@example.net>
> |/| |
> | | |       Lorem ipsum dolor sit amet
> | | |
> | | | * commit 8da3b9f (origin/branchB)
> | | |/  Author: John Doe <john.doe@example.net>
> | | |
> | | |       Consectetur adipisicing elit
> | | |
> | | | * commit c4d6b9a (origin/branchC)
> | | |   Author: John Doe <john.doe@example.net>
> | | |
> | | |       Sed do eiusmod tempor incididunt ut labore
> | | |
> | | | * commit d623246 (origin/branchD)
> | | |/  Author: John Doe <john.doe@example.net>
> | | |
> | | |       Ut enim ad minim veniam
> | | |
> | | | * commit 458d305 (origin/branchE)
> | | |/  Author: John Doe <john.doe@example.net>
> | | |
> | | |       Quis nostrud exercitation ullamco laboris
> | | |
> 
> Correct output produced with --oneline switch should output an extra
> newline when commit has no parent listed:
> 
> | | | * eead15f (origin/branchA) Lorem ipsum dolor sit amet
> | |_|/
> |/| |
> | | | * 8da3b9f (origin/branchB) Consectetur adipisicing elit
> | | |/
> | | | * c4d6b9a (origin/branchC) Sed do eiusmod tempor incididunt ut labore
> | | |
> | | | * d623246 (origin/branchD) Ut enim ad minim veniam
> | | |/
> | | | * 458d305 (origin/btanchE) Quis nostrud exercitation ullamco laboris
> | | |/
> 
> Best Regards,
> Martin
> 

Yes, you have the same problem when you simply have two disjoint
branches: They're listed "concatenated". The problem is that log --graph
uses the single symbol "*" for many different cases, independent of the
number of ingoing or outgoing lines. There are two solutions:

- use more spacing
- use more symbols (like tig does) and stay compact

Feel free to experiment ;)

Michael

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-05 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 12:57 git log --graph --oneline - false parent-child visualization martyone
2012-11-05 14:17 ` Michael J Gruber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.