-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Sort all branches by last update #5155
Comments
I'm actually more interested in this part of the issue than changing the sorting, because I've spent a bit of time in there thinking about how it works. I think the core of your problem is that we don't consider whether a branch exists in the list when we're reading the reflog. I can see this in my local Desktop clone after pruning some merge branches: Are you pruning your merged branches? I think the fact that our desktop/app/src/lib/git/reflog.ts Lines 5 to 8 in 56b1fe7
|
The remote branches are being deleted when they're merged, but the local branches aren't being pruned. Does the list take account of which branches are in the origin repository and which have been merged, or is it literally just the most recently-edited local branches? If I run the There could easily be more than 5 branches edited in the last 24hr, as well. I'm interested to know when it's useful to have branches listed in alphabetical order, rather than by date. |
@hubgit thanks for the extra details
No, the code has zero context on the actual branch details and just walks the reflog to find the N most recent branches that were checked out locally. This is what we consider "recent" - branches that you've checked out locally, and we don't look at the most recent commit to each branch.
This makes sense - we mark
This is mostly just mirroring the defaults of |
@billygriffin would love your thoughts on two related questions here:
|
@shiftkey @hubgit Thanks for clarifying this, and sorry for the delay in responding. The potential for misaligned expectations vs what's actually presented makes total sense. I added this to our research list (and the label is helpful in reinforcing that). I don't see it as insanely high priority, but definitely worth examination in the next few months as we dig into usability more generally. I think there are two things here:
Also want to make sure @ampinsk and @donokuda have visibility on this. |
It would be also great if I could increase the number of recent branches displayed in there. Once a branch I'm trying to get is 6th most recent one, finding it takes a bit time |
Thanks for the bump here @oguzyildiz1991 ! There's another conversation happening in #7755 that I've linked this issue to. |
I'll just add another user story for this feature. I often use "recent branches" to switch between the last few branches when I'm working on a couple of things at once. But if I start working on something and then move away for a little longer, I'll have to do something like |
Exactly. If you're working on 5 branches it's alright, but once you're looking for the 6th most recent branch, suddenly you gotta go on an adventure |
In #13105 it was brought up that remote branches do not appear in the
|
The way I perceive recent, is "locally recent" - which branches I have actually recently used/switched to, on this machine). However, it is very annoying that I cannot see new branches that have been added remotely (we have a lot of branches). |
Another option could be to add a "show more..." button at the bottom of the 5 most recent branches, to increase the list with 5 more. |
Requested in #14828 |
From #16897:
|
Is your feature request related to a problem? Please describe.
Showing recent branches is a great feature, but I often have trouble finding a fairly recent branch because it's disappeared from the short "Recent Branches" list.
Describe the solution you'd like
Divide the list of branches into "Local Branches" (sorted by date) and "Remote Branches" (sorted by date), instead of "Recent Branches" (sorted by date) and "Other Branches" (sorted alphabetically).
It's not very useful to have branches sorted alphabetically, as you can already type to filter them.
Describe alternatives you've considered
Switching to the command line and using a custom
git branches
alias:for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
Teachability, Documentation, Adoption, Migration Strategy
This would replace the current dropdown list of branches.
The text was updated successfully, but these errors were encountered: