Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status indicators for branches in Git Browser #398

Open
LinqLover opened this issue Dec 29, 2022 · 4 comments
Open

Status indicators for branches in Git Browser #398

LinqLover opened this issue Dec 29, 2022 · 4 comments

Comments

@LinqLover
Copy link
Contributor

LinqLover commented Dec 29, 2022

Possible status indicators that would make my life easier could include:

  • indication whether a branch has stashed changes (are they called so? uncommitted changes that will be loaded into the working copy when switching to the branch)
  • number of commits ahead/behind its parent branch (e.g., for feature branches)
  • number of commits ahead/behind its upstream branch

The indicators could be visualized with a mix of icons in the branch list and tooltips. (Note that not everyone can spot the difference between e.g. testGreen and testYellow, so a tooltip would be a must in this case.)

(I spiked the "stashed changes" point earlier but quickly realized that it requires more time and a deeper understanding of the object model than I currently have ... :-))

@j4yk
Copy link
Collaborator

j4yk commented Dec 29, 2022

Especially the latter two points would consume quite an amount of screen real estate, and the branch list is rather narrow by default today. It might require another tool that gives more details about branches.

Also note that Git has zero knowledge about "parent" branches because commits do not carry the information on which branch they were created. So all that would be conceivable is a heuristic to guess which of the following branches might be the "correct" parent branch: main, release/1.0.0, release/1.1.0, feature/the-next-big-thing, or anything else that was "forked" after the feature branch but has a common history with it.

Yes, I also call those "uncommitted" changes "stashed changes" even though it might confuse somebody else because this does not use the Git stash.

@LinqLover
Copy link
Contributor Author

Especially the latter two points would consume quite an amount of screen real estate, and the branch list is rather narrow by default today. It might require another tool that gives more details about branches.

What about a simple tooltip, plus maybe an icon indicating that there is at least one different commit?

Also note that Git has zero knowledge about "parent" branches because commits do not carry the information on which branch they were created. So all that would be conceivable is a heuristic to guess which of the following branches might be the "correct" parent branch: main, release/1.0.0, release/1.1.0, feature/the-next-big-thing, or anything else that was "forked" after the feature branch but has a common history with it.

Sure, you're right ... probably too many heuristics ... GitHub does have this information (PR target branch), but that's a different story. Maybe let's ignore this point. :-)

@j4yk
Copy link
Collaborator

j4yk commented Dec 29, 2022

GitHub also only knows the destination branch because you tell it which one to use, or otherwise the "main" branch as configured in the GitHub project (for this Squot project, it is the develop branch). But a plain Git repository does not know which branch is the "main" one.

A tooltip would get around the real estate issue, right. So what remains is an indication that there are stashed changes on a branch, an indication that there are any commits that the upstream branch (if any!) does not have, and in the tooltip how many commits these are.

@LinqLover
Copy link
Contributor Author

Exactly! :-)

Last comment:

an indication that there are any commits that the upstream branch (if any!) does not have, and in the tooltip how many commits these are.

I would be interested in both the number of commits ahead (that only the local branch has) and behind (that only the upstream branch has). I like the representation of these numbers in VS Code:

image

... so maybe, three new icons would be required. And some of them should be combinable. Maybe prepend an asterisk (*) to branches with uncommitted changes instead of using a true icon for them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants