hpi-swa / Squot

Squeak Object Tracker - Version control for arbitrary objects, currently with Git storage
Other
58 stars 29 forks source link

Status indicators for branches in Git Browser #398

Open LinqLover opened 1 year ago

LinqLover commented 1 year ago

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

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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?