scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

Git branches sorted by committer date not having numbered aliases #266

Open axsuul opened 5 years ago

axsuul commented 5 years ago

I have an issue with lots of branches and sorting by last commit makes everything more sane. But it appears that --sort=committerdate is not an argument that scm_breeze recognizes so doing something like

gb --sort=committerdate

uses the vanilla git command without numbered aliases. What's the best way to go about getting numbered alias support with the --sort argument? I've tried

__git_alias "$git_branch_delete_force_alias" "_scmb_git_branch_shortcuts" "--sort=committerdate"

And thank you for this great tool!

ghthor commented 5 years ago

It would need to be incorporated into the _scmb_git_branch_shortcuts function. This might be nice hidden behind an environmental flag, such that your gb shortcut either uses it or it doesn't based on the env variable setting.

axsuul commented 5 years ago

@ghthor Happy to make a PR for this. Any suggestions on what the environment flag should be?

SCM_BREEZE_FORCE_GIT_BRANCH?

ghthor commented 5 years ago

@axsuul How about GIT_BRANCH_SORT_COMMITER_DATE, if you find any time to PR this, no judgement, just a little nudge =)