TortoiseGit log does not show branch names

2,145 views
Skip to first unread message

Jelle

unread,
Aug 7, 2011, 6:06:49 PM8/7/11
to tortoisegit-users
Hi,

When I use TortoiseGit log on a specific file, I can check 'all
branches' to show all relevant commits for this file in all branches
(if any). However, TortoiseGit does not show the branch name if the
last commit was not the latest commit in that branch. Image
illustrating the problem:

http://gmta.nl/forum/git-log-branches.png

I can't tell what the blue or green branches represent. Compare this
with TortoiseCVS revision graph, where all the branch names are
clearly named:

http://cedric.babault.free.fr/TortoiseCVSDoc/images/img0034.gif

My inability to see the branch names from the log window is preventing
me from really using TortoiseGit. Am I missing something?

Regards,
Jelle Raaijmakers

Frank Li

unread,
Aug 8, 2011, 2:20:21 AM8/8/11
to tortoise...@googlegroups.com
That's git problem.
branch reference to a hash value.
If hash is not log list, branch will no show.

2011/8/8 Jelle <jelle.ra...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "tortoisegit-users" group.
> To post to this group, send email to tortoise...@googlegroups.com.
> To unsubscribe from this group, send email to tortoisegit-us...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tortoisegit-users?hl=en.
>
>

Robert Pollak

unread,
Aug 8, 2011, 3:23:29 AM8/8/11
to tortoisegit-users
Maybe having "git describe" available in the log window would be
helpful?
I have filed http://code.google.com/p/tortoisegit/issues/detail?id=843
for this.

Frank Li

unread,
Aug 8, 2011, 3:31:13 AM8/8/11
to tortoise...@googlegroups.com
2011/8/8 Robert Pollak <robert...@gmail.com>:

> ribe" available in the log window would be

git-describe - Show the most recent tag that is reachable from a commit

Jelle want to know branch information.

Jelle

unread,
Aug 8, 2011, 11:45:47 AM8/8/11
to tortoisegit-users
That would explain why TortoiseGit can show a visual difference
between branches but not name them.

If a branch name must be unique, an option could be added to git which
would make 'git log' show the branch names. On the other hand,
TortoiseGit could maintain a 'branch hash ref' => 'branch name'
mapping so it could show the branch name at every commit, right?

Robert Pollak

unread,
Aug 8, 2011, 1:55:43 PM8/8/11
to tortoisegit-users
Jelle wrote:
> If a branch name must be unique [...]

But a commit can be on many branches at the same time, see e.g. the
field "Branches:" at the bottom left in the gitk screenshot
http://orestis.gr/static/upload/blog_images/2009/06/17/gitk.png .

Maybe TortoiseGit could copy gitk's method to find this info?

Frank Li

unread,
Aug 8, 2011, 9:52:59 PM8/8/11
to tortoise...@googlegroups.com
2011/8/8 Jelle <jelle.ra...@gmail.com>:

> That would explain why TortoiseGit can show a visual difference
> between branches but not name them.
>
> If a branch name must be unique, an option could be added to git which
> would make 'git log' show the branch names. On the other hand,
> TortoiseGit could maintain a 'branch hash ref' => 'branch name'
> mapping so it could show the branch name at every commit, right?

Show 'branch name' at every commit does not make sense.
git branch just map to hash value of branch head.


>
> On Aug 8, 8:20 am, Frank Li <lzn...@gmail.com> wrote:
>> That's git problem.
>> branch reference to a hash value.
>> If hash is not log list, branch will no show.
>

Frank Li

unread,
Aug 8, 2011, 9:55:04 PM8/8/11
to tortoise...@googlegroups.com
2011/8/9 Robert Pollak <robert...@gmail.com>:

The key problem, gitk show full log. At this case, tortoisegit have
not problem at the same case.

when tortoisegit show part of log, (such as git log -- files), branch
head hash have not showed. so branch name is not showed.

Robert Pollak

unread,
Aug 9, 2011, 4:31:59 AM8/9/11
to tortoise...@googlegroups.com
2011/8/9 Frank Li <lzn...@gmail.com>:
> 2011/8/9 Robert Pollak <robert...@gmail.com>:
[...]

>> see e.g. the field "Branches:" at the bottom left in the gitk screenshot
>> http://orestis.gr/static/upload/blog_images/2009/06/17/gitk.png .
>>
>> Maybe TortoiseGit could copy gitk's method to find this info?
>
> The key problem, gitk show full log.  At this case, tortoisegit have
> not problem at the same case.

But gitk also lists the branches when I call it for single files "gitk
-- <path>".
This is what we want. I had a quick look at its tcl/tk code, but I
didn't understand it.

Jelle

unread,
Aug 10, 2011, 3:55:42 PM8/10/11
to tortoisegit-users
On Aug 8, 7:55 pm, Robert Pollak <robert.pol...@gmail.com> wrote:
> But a commit can be on many branches at the same time, see e.g. the
> field "Branches:" at the bottom left in the gitk screenshothttp://orestis.gr/static/upload/blog_images/2009/06/17/gitk.png.

I don't understand how a commit can be 'on' many branches at the same
time. A commit can influence many branches, sure, and you could make
the same change on different branches. But these would be separate
commits, right?

On Aug 8, 7:55 pm, Robert Pollak <robert.pol...@gmail.com> wrote:
> Maybe TortoiseGit could copy gitk's method to find this info?

Looking at gitk, I found the following information about it's
'branches' information:

> http://stackoverflow.com/questions/1570535/guide-to-understanding-gitk
> "Branches" is equivalent to git branch -a --contains=<commit>

And using man git-branch:

> -a List both remote-tracking branches and local branches.
> --contains <commit> is used to find all branches which will need special attention if <commit> were to be rebased or amended, since those branches contain the specified <commit>.

I don't think this method gives enough information to draw both the
graph and show the branch names. The method people normally use for
this without a GUI tool:

> http://stackoverflow.com/questions/1841405/how-can-i-show-the-name-of-branches-in-git-log
> git log --graph --all --decorate [-- filename]

If you leave out the filename, all the branch names are shown next to
the graph. However, when a filename is supplied, branch names are only
shown if they are the latest commit in the branch.

So it seems this is a git problem, and not so much in the GUI?

The general consensus seems to be that branch names in log information
are not important, as detailed in
http://stackoverflow.com/questions/6915969/how-can-i-view-branches-and-file-changes-using-git-log.
My branch names are very important however, as they tell me why and
how a change was made to the code.

Robert Pollak

unread,
Aug 11, 2011, 6:06:24 AM8/11/11
to tortoisegit-users

On Aug 10, 9:55 pm, Jelle <jelle.raaijmak...@gmail.com> wrote:
> Looking at gitk, I found the following information about it's
> 'branches' information:
>
> >http://stackoverflow.com/questions/1570535/guide-to-understanding-gitk
> > "Branches" is equivalent to git branch -a --contains=<commit>
>
> And using man git-branch:
>
> > -a     List both remote-tracking branches and local branches.
> > --contains <commit> is used to find all branches which will need special attention if <commit> were to be rebased or amended, since those branches contain the specified <commit>.

Ah! So that's what TortoiseGit log also should use.

Jelle

unread,
Aug 11, 2011, 2:10:23 PM8/11/11
to tortoisegit-users
On Aug 11, 12:06 pm, Robert Pollak <robert.pol...@gmail.com> wrote:
> Ah! So that's what TortoiseGit log also should use.

I don't think so. For example: I have a commit A on master, and create
two new branches based on master. The git branch contains command will
show commit A to be on master, and on both of the two new branches.
This is useful information on the influence of commits on all the
branches, but useless for branch graphing.

If you look closely in gitk, you can see that the information after
'branches' is loaded asynchronously, because of the nature of the
technique of finding out which branches contain a commit. Trying to
graph thousands of commits would be impossible. The reason why
TortoiseCVS can do this quickly, is because every file and commit has
branch information stored with it.

Could you elaborate on your 'a commit can exist on multiple branches'?

derek....@questdiagnostics.com

unread,
Mar 28, 2012, 2:54:39 PM3/28/12
to tortoise...@googlegroups.com
I'm only half following this discussion, but the way I was hoping to use the information is to see if a commit has been cherry-picked to another branch (or a patch applied).  Looking at a commit via gitk that I know has been picked to master frmo a branch, however, it doesn't look like that is what gitk is showing in the "Branches: " field either.

Derek

ashishka...@gmail.com

unread,
Mar 25, 2015, 8:08:38 AM3/25/15
to tortoise...@googlegroups.com
Hi, 
Can any one tell me why in show log for file in tortoise git for message column master origin/master origin/ORDER is coming and rest thing are coming in bold letter.
please help

Yue Lin Ho

unread,
Mar 31, 2015, 4:54:58 AM3/31/15
to tortoise...@googlegroups.com, ashishka...@gmail.com
Hi:

master is red => HEAD attached on master branch.
bold letter => HEAD is on this commit.

ashishka...@gmail.com於 2015年3月25日星期三 UTC+8下午8時08分38秒寫道:
Reply all
Reply to author
Forward
0 new messages