8000 For consistency and summary in sidebar, show the number of branches and remotes as well · Issue #1306 · sourcegit-scm/sourcegit · GitHub
[go: up one dir, main page]

Skip to content

For consistency and summary in sidebar, show the number of branches and remotes as well #1306

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

Open
goran-w opened this issue May 13, 2025 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@goran-w
Copy link
Contributor
goran-w commented May 13, 2025

The left sidebar shows the number of Tags, Submodules and Worktrees, which gives a good quick overview / summary.

We could add a similar counter for the number of Local Branches, the number of Remotes and additionally for the number of branches on each remote. This would be more consistent and would give at-a-glance info even when the corresponding category is collapsed.

Image

@love-linger
Copy link
Collaborator

I don't think this is necessary.

  • Doing so would look messy, and I really don't like this effect.

Image

  • The reason why the number of TAGS is displayed is that it may change after fetching. Displaying the number can make it more convenient for users to know that a new version has been released.
  • The reason why the number of SUBMODULES is displayed is also that it may change after fetching.
  • There really isn't much point in displaying the number of WORKTREES either, because SourceGit currently supports opening a worktree by switching branches in the normal way. The number is displayed here only because it is too close to the above two, and it doesn't look good if not displayed. While LOCAL BRANCHES and REMOTES are in the upper part, and usually LOCAL BRANCHES is in an expanded state, so visually it is naturally separated from the lower part. So there is no need to add it.

@goran-w
Copy link
Contributor Author
goran-w commented May 13, 2025

I disagree rather strongly - it's much more consistent to have the count displayed on each category. I'm always frustrated when UIs fail to present the number of items in a list, making me have to count them manually or look elsewhere for the count. (We have a lot of branches and tags in our main repos, so a count is definitely needed.)

Also, the count is very useful when a category is collapsed, since you don't have to expand it to see how many items it has.

But, since we have different opinions, surely this could be made a Preference option ("Show item counts in sidebar" or similar) ?

@goran-w
Copy link
Contributor Author
goran-w commented May 13, 2025

BTW, the number of Branches under each Remote may also change after fetching. Displaying the number can make it more convenient for users to know that new branches have been pushed (or old ones pruned).

@goran-w
Copy link
Contributor Author
goran-w commented May 13, 2025

NOTE: The count of branches should be the "flat list" counts per Local/Remote (rather than the count of root-items from the BranchTrees lists).

@love-linger
Copy link
Collaborator

Done.

Image

@love-linger love-linger self-assigned this May 13, 2025
@love-linger love-linger added the enhancement New feature or request label May 13, 2025
@goran-w
Copy link
Contributor Author
goran-w commented May 13, 2025

This is perfect! Now there are even counts on the branch "parent-folders"! 💯 Thank you, @love-linger!

@goran-w
Copy link
Contributor Author
goran-w commented May 13, 2025

Oohh... Missed a spot - for consistency, we should now do the same for "parent-folders" under TAGS (when enabling Show Tags as Tree). 😬

Image

love-linger added a commit that referenced this issue May 13, 2025
Signed-off-by: leo <longshuang@msn.cn>
@love-linger
Copy link
Collaborator

Done

@goran-w
Copy link
Contributor Author
goran-w commented May 13, 2025

Thank you, that's excellent!

And don't get mad at me now, but I found one more place where we can be more consistent with counts. 😅

We show a count (badge) for LOCAL CHANGES, but we could similarly show the count of CHANGES in the selected history-commit...

Image

@love-linger
Copy link
Collaborator

We show a count (badge) for LOCAL CHANGES, but we could similarly show the count of CHANGES in the selected history-commit.

No. Please do NOT change the others. This has nothing to do with consistent. They are totally different things (also in different areas). I've never seen any other Git clients do this. And as I said above, I do not like this feature at all.

@goran-w
Copy link
Contributor Author
goran-w commented May 14, 2025

The thing is, we show the count of Unstaged and Staged changes, and the total count of Local Changes. It WOULD be consistent to show the count of Changes for a historic commit SOMEWHERE (doesn't have to be on the "tab" itself).

My point is, that when there's a potentially long list (of varying size) we shouldn't have to count hundreds of items "manually" to answer the simple question of (for example) "how many changes were there in this commit".

Our earlier VCS was Plastic SCM, and their UI does indeed show the count of changed items for historic commits. It is not far-fetched. (Plastic even shows separately the number of Changed / Added / Deleted / Moved files, which is great...)

I've never seen any other Git clients do this.

GitHub Desktop shows the number of changed files when looking at historic commits. They do it just above the list, which makes perfect sense:

Image

Similarly, in GitHub on the web, the number of changed files (along with the total number of lines changed) are displayed at the top when visiting a commit from history:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
0