Sublime Forum

Always display branch name in the information pannel



When selecting a commit on the tip of a branch, there is a “Branches” field in the information panel that provides the name of the current branch.

Is there a way to display the name of the branch a commit belongs to whenever any commit is selected, not just the one on the tip of the branch?




I don’t think that’s possible, no. The post linked below shows a way that you can get at this information if you want it though; it requires you to pick a item from the context menu and then click in the info bar at the top of the window to see the output of the command.

Essentially the problem is that behind the scenes the fact that a particular commit is on a particular branch is solely the result of a ref that associates the branch tip with that commit; commits themselves don’t know what branch they are on now or were on in the past, and the information from the commit is what’s displayed in that panel.

That information is available after a fashion by tracing the commit graph to see what current branches a particular commit belongs to, which is what the post below does by asking git to compute that information and display it.

1 Like