threads / discuss / 17769

git log --graph and root commits

Subject: git log --graph and root commits

## tl;dr

5 messages between Feb 13, 2009 and Feb 14, 2009.

replies: 4people: 3as markdown or json

Sitaram Chamarty· Feb 13, 2009, 04:16 UTC · lore

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· Feb 13, 2009, 11:41 UTC · re: Sitaram Chamarty · lore

Re: git log --graph and root commits

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· Feb 13, 2009, 14:56 UTC · re: Johannes Schindelin · lore

Re: git log --graph and root commits

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· Feb 13, 2009, 16:39 UTC · re: Sitaram Chamarty · lore

Re: git log --graph and root commits

Sitaram Chamarty <sitaramc@gmail.com> writes:
Show 17 quoted lines
> 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· Feb 14, 2009, 00:40 UTC · re: Jakub Narebski · lore

Re: git log --graph and root commits

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'
Show 8 quoted lines
>> 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...!

← back to recent threads