threads / bug / 41100

[bug] Graph log and orphan branches

Subject: [bug] Graph log and orphan branches

## tl;dr

6 messages between Dec 30, 2015 and Dec 30, 2015.

replies: 5people: 3as markdown or json

Carlos Pita· Dec 30, 2015, 19:46 UTC · lore
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· Dec 30, 2015, 19:48 UTC · re: Carlos Pita · lore

Re: [bug] Graph log and orphan branches

> 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· Dec 30, 2015, 19:54 UTC · re: Carlos Pita · lore

Re: [bug] Graph log and orphan branches

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· Dec 30, 2015, 20:43 UTC · re: Junio C Hamano · lore

Re: [bug] Graph log and orphan branches

On wo, 2015-12-30 at 11:54 -0800, Junio C Hamano wrote:
Show 11 quoted lines
> 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
Junio C Hamano· Dec 30, 2015, 21:24 UTC · re: Dennis Kaarsemaker · lore

Re: [bug] Graph log and orphan branches

Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
Show 16 quoted lines
> 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.

← back to recent threads