# git log --graph and root commits

5 messages from 2009-02-13 to 2009-02-14. Participants: Sitaram Chamarty, Johannes Schindelin, Jakub Narebski.
Thread: https://gitlist.dev/t/17769

## Sitaram Chamarty, 2009-02-13 04:16

Subject: git log --graph and root commits
Message-ID: <slrngp9t0u.va9.sitaramc@sitaramc.homelinux.net>
URL: https://gitlist.dev/e/slrngp9t0u.va9.sitaramc%40sitaramc.homelinux.net

```
I was wondering if there was any way, when using 'git log
--graph --pretty=oneline' to get a different marker (perhaps
an underscore) for a root commit.

I have a couple of repos in which there are multiple roots
(a bit like the git tree itself, which has separately rooted
html and man branches), and it would be nice to see some
sign of that break in the git log graph.

Thanks,

Sitaram

```

## Johannes Schindelin, 2009-02-13 11:41

Subject: Re: git log --graph and root commits
Message-ID: <alpine.DEB.1.00.0902131237490.10279@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0902131237490.10279%40pacific.mpi-cbg.de
In-Reply-To: <slrngp9t0u.va9.sitaramc@sitaramc.homelinux.net>

```
Hi,

On Fri, 13 Feb 2009, Sitaram Chamarty wrote:

> I was wondering if there was any way, when using 'git log
> --graph --pretty=oneline' to get a different marker (perhaps
> an underscore) for a root commit.

Is it not enough that the line ends?  That is a pretty obvious visual 
marker for me that this is a root commit.  But I see that you are _asking_ 
for the lines not to be shown, by using --pretty=oneline.

You might be interested in this instead:

	git log --graph --pretty=format:'%h %s%n'

Hth,
Dscho

```

## Sitaram Chamarty, 2009-02-13 14:56

Subject: Re: git log --graph and root commits
Message-ID: <slrngpb2gl.rhg.sitaramc@sitaramc.homelinux.net>
URL: https://gitlist.dev/e/slrngpb2gl.rhg.sitaramc%40sitaramc.homelinux.net
In-Reply-To: <alpine.DEB.1.00.0902131237490.10279@pacific.mpi-cbg.de>

```
On 2009-02-13, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Fri, 13 Feb 2009, Sitaram Chamarty wrote:

>> I was wondering if there was any way, when using 'git log
>> --graph --pretty=oneline' to get a different marker (perhaps
>> an underscore) for a root commit.

> Is it not enough that the line ends?  That is a pretty obvious visual 
> marker for me that this is a root commit.  But I see that you are _asking_ 
> for the lines not to be shown, by using --pretty=oneline.

Yes; I'm short on vertical space here.

> You might be interested in this instead:
>
> 	git log --graph --pretty=format:'%h %s%n'

It doubles the height requirement, but you gave me an idea:

    git log --graph --pretty=tformat:'%h <%p> %s' --all |
        perl -pe '$_.="----\n" if /<>/; s/<.*?> //'

Thanks for pointing me in the right direction.

Regards,

Sitaram

```

## Jakub Narebski, 2009-02-13 16:39

Subject: Re: git log --graph and root commits
Message-ID: <m3wsbuthp1.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3wsbuthp1.fsf%40localhost.localdomain
In-Reply-To: <slrngpb2gl.rhg.sitaramc@sitaramc.homelinux.net>

```
Sitaram Chamarty <sitaramc@gmail.com> writes:
> On 2009-02-13, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> On Fri, 13 Feb 2009, Sitaram Chamarty wrote:
> 
>>> I was wondering if there was any way, when using 'git log
>>> --graph --pretty=oneline' to get a different marker (perhaps
>>> an underscore) for a root commit.
>>
>> You might be interested in this instead:
>>
>> 	git log --graph --pretty=format:'%h %s%n'
> 
> It doubles the height requirement, but you gave me an idea:
> 
>     git log --graph --pretty=tformat:'%h <%p> %s' --all |
>         perl -pe '$_.="----\n" if /<>/; s/<.*?> //'
> 
> Thanks for pointing me in the right direction.

Gaaah... I tried running it on git.git :-))))

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## Sitaram Chamarty, 2009-02-14 00:40

Subject: Re: git log --graph and root commits
Message-ID: <slrngpc4op.jdo.sitaramc@sitaramc.homelinux.net>
URL: https://gitlist.dev/e/slrngpc4op.jdo.sitaramc%40sitaramc.homelinux.net
In-Reply-To: <m3wsbuthp1.fsf@localhost.localdomain>

```
On 2009-02-13, Jakub Narebski <jnareb@gmail.com> wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
>> On 2009-02-13, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

>>> 	git log --graph --pretty=format:'%h %s%n'

>> It doubles the height requirement, but you gave me an idea:
>> 
>>     git log --graph --pretty=tformat:'%h <%p> %s' --all |
>>         perl -pe '$_.="----\n" if /<>/; s/<.*?> //'
>> 
>> Thanks for pointing me in the right direction.
>
> Gaaah... I tried running it on git.git :-))))

:-)

Seriously, I find 'log --graph' is useful on projects where
not everyone is an expert and things might go a little
haywire here and there.  People merge the wrong thing with
the wrong other thing, maybe, and you want to see how
precisely they got there.

A project managed by git.gods can become a lot more complex
and not have to actually care about this visualisation.

Of course, gitk is really good and manages a lot more
complexity, obviously, but I like 'log --graph' also.  And
I've sort of fallen in love with --simplify-by-decoration
too.  Very cool stuff.

The things you can do on an xterm...!

```
