# [bug] Graph log and orphan branches

6 messages from 2015-12-30 to 2015-12-30. Participants: Carlos Pita, Junio C Hamano, Dennis Kaarsemaker.
Thread: https://gitlist.dev/t/41100

## Carlos Pita, 2015-12-30 19:46

Subject: [bug] Graph log and orphan branches
Message-ID: <CAELgYhe4u2qU0-+mBKGwf8CpdZ=MuWMFZmeOhojtdMQZ3-nfhQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAELgYhe4u2qU0-%2BmBKGwf8CpdZ%3DMuWMFZmeOhojtdMQZ3-nfhQ%40mail.gmail.com

```
Hi all,

the graph output of log show orphan branches in a way that suggests
they have a parent. See for example:

http://stackoverflow.com/questions/22541261/git-log-of-all-branchs-in-only-the-current-tree

I think this is a bug in the UI.

Cheers
--
Carlos

```

## Carlos Pita, 2015-12-30 19:48

Subject: Re: [bug] Graph log and orphan branches
Message-ID: <CAELgYhe3Nosq3iPGsvqxJTnmZu5a_ayi4eKVdhPMfNaXVLZOXA@mail.gmail.com>
URL: https://gitlist.dev/e/CAELgYhe3Nosq3iPGsvqxJTnmZu5a_ayi4eKVdhPMfNaXVLZOXA%40mail.gmail.com
In-Reply-To: <CAELgYhe4u2qU0-+mBKGwf8CpdZ=MuWMFZmeOhojtdMQZ3-nfhQ@mail.gmail.com>

```
> http://stackoverflow.com/questions/22541261/git-log-of-all-branchs-in-only-the-current-tree
>
> I think this is a bug in the UI.

Please notice this happens only for the --oneline output.

```

## Junio C Hamano, 2015-12-30 19:54

Subject: Re: [bug] Graph log and orphan branches
Message-ID: <xmqqziwremqh.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqziwremqh.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CAELgYhe4u2qU0-+mBKGwf8CpdZ=MuWMFZmeOhojtdMQZ3-nfhQ@mail.gmail.com>

```
Carlos Pita <carlosjosepita@gmail.com> writes:

> the graph output of log show orphan branches in a way that suggests
> they have a parent.

Reminds me of this ancient RFH topic

  http://thread.gmane.org/gmane.comp.version-control.git/236708/focus=239580

which unfortunately got no help...

```

## Dennis Kaarsemaker, 2015-12-30 20:43

Subject: Re: [bug] Graph log and orphan branches
Message-ID: <1451508209.9251.13.camel@kaarsemaker.net>
URL: https://gitlist.dev/e/1451508209.9251.13.camel%40kaarsemaker.net
In-Reply-To: <xmqqziwremqh.fsf@gitster.mtv.corp.google.com>

```
On wo, 2015-12-30 at 11:54 -0800, Junio C Hamano wrote:
> Carlos Pita <carlosjosepita@gmail.com> writes:
> 
> > the graph output of log show orphan branches in a way that suggests
> > they have a parent.
> 
> Reminds me of this ancient RFH topic
> 
>   http://thread.gmane.org/gmane.comp.version-control.git/236708/focus
> =239580
> 
> which unfortunately got no help...

Instead of a blank line, why not something like this to make root
commits stand out a bit?

diff --git a/revision.c b/revision.c
index 0a282f5..e69a992 100644
--- a/revision.c
+++ b/revision.c
@@ -3346,7 +3346,7 @@ char *get_revision_mark(const struct rev_info *revs, const struct commit *commit
                else
                        return ">";
        } else if (revs->graph)
-               return "*";
+               return commit->parents ? "*" : "^" ;
        else if (revs->cherry_mark)
                return "+";
        return "";

-- 
Dennis Kaarsemaker
www.kaarsemaker.net

```

## Carlos Pita, 2015-12-30 20:46

Subject: Re: [bug] Graph log and orphan branches
Message-ID: <CAELgYhf+EvcTHmZw3w4+WRg_wzJCo0b_Ft87J+1-rqJxeZ+r+g@mail.gmail.com>
URL: https://gitlist.dev/e/CAELgYhf%2BEvcTHmZw3w4%2BWRg_wzJCo0b_Ft87J%2B1-rqJxeZ%2Br%2Bg%40mail.gmail.com
In-Reply-To: <1451508209.9251.13.camel@kaarsemaker.net>

```
> -               return "*";
> +               return commit->parents ? "*" : "^" ;

I like this idea.

```

## Junio C Hamano, 2015-12-30 21:24

Subject: Re: [bug] Graph log and orphan branches
Message-ID: <xmqqa8oreijr.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqa8oreijr.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1451508209.9251.13.camel@kaarsemaker.net>

```
Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:

> On wo, 2015-12-30 at 11:54 -0800, Junio C Hamano wrote:
>> Carlos Pita <carlosjosepita@gmail.com> writes:
>> 
>> > the graph output of log show orphan branches in a way that suggests
>> > they have a parent.
>> 
>> Reminds me of this ancient RFH topic
>> 
>>   http://thread.gmane.org/gmane.comp.version-control.git/236708/focus
>> =239580
>> 
>> which unfortunately got no help...
>
> Instead of a blank line, why not something like this to make root
> commits stand out a bit?
>

That approach will lose information when a root commit is at the
boundary, marked as uninteresting, or on the left/right side of
traversal (when --left-right is requested).  As these pieces of
information that will be lost with such an approach are a lot more
relevant than "have we hit the root?", especially in the majority of
repositories where there is only one root commit, I do not think it
is acceptable.

```
