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

Add the ability to sort remote and local branches #745

Closed
federal977 opened this issue May 10, 2019 · 4 comments
Assignees

Comments

@federal977
Copy link

@federal977 federal977 commented May 10, 2019

We have hundreds of remote and local branches. After fetching either remote or local branches new branches appear in the end of the corresponding branch list. To find some new branches in the list becomes a stressful and expensive activity because you need to scroll through the old branches down. Could you please add the ability to sort these lists by the creation date. Thus, they will appear in the beginning of the branch list. Thank you.

@eamodio

This comment has been minimized.

Copy link
Owner

@eamodio eamodio commented May 10, 2019

Unfortunately git doesn't have a notion of a created date for a branch or remote -- and while technically I could find a pseudo-created date by looking at the first commit of the branch/remote it would be prohibitively expensive performance-wise (as I would need to make an individual git call for each branch).

Although I'm curious as to why the new branches would always show up at the end -- as the branches/remotes are currently sorted alphabetically by their name. Are you seeing something different?

@federal977

This comment has been minimized.

Copy link
Author

@federal977 federal977 commented May 11, 2019

Correct, branches/remotes are sorted alphabetically. In my case almost all branch names begin with numbers. Thus, they show up at the end of the list. Probably we can add an option to sort the list in a different order (ascending or descending).Therefore, we could see them at the beginning.
sort_branches

@eamodio

This comment has been minimized.

Copy link
Owner

@eamodio eamodio commented May 11, 2019

@federal977 thanks for the info. Adding an option to change the sort order is certainly doable.

@eamodio eamodio added this to the Soonish™ milestone May 11, 2019
@haojun99

This comment has been minimized.

Copy link

@haojun99 haojun99 commented Jul 30, 2019

"sort by latest commit" seems most useful to me for local branches.

@eamodio eamodio self-assigned this Sep 4, 2019
@eamodio eamodio modified the milestones: Soonish™, Soon™ Sep 4, 2019
@eamodio eamodio closed this in 6555d59 Sep 20, 2019
@eamodio eamodio removed this from the Soon™ milestone Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.