TIL Git can do this without a shell script. I’ve been manually sorting through branches like an idiot
zahlman 8 hours ago||
How many branches would you need to have to make this worthwhile?
jamietanna 8 hours ago||
At any time I'm working across 5-30 branches (some when I'm reviewing other folks' code) so it's handy to see my latest branches
spike021 6 hours ago|||
At my current job it's fairly frequent that I have 5+ active branches open for a repo. Not ideal and that's another topic, but it is nice to be able to sort branches because of that.
woodruffw 8 hours ago||
I've seen monorepos with over 10k active branches. But even at a smaller scale (10-100 branches), it becomes useful when manually stacking and/or rebasing, especially if you have a smaller terminal.
rglover 4 hours ago||
Nice. Will help solve some mysteries on older projects.
thr0waway001 3 hours ago||
nice. I made myself pretty much the same command couple years ago but called it 'latestbranches'.
mcdow 6 hours ago||
yep, i have a little helper in my zshrc for this sort of thing:
alias git-hot-refs="git branch --sort=committerdate | tail"
bewareofscams 9 hours ago||
Or just have `jj log` custom-configured.
woodruffw 8 hours ago||
Another useful one if you have a large number of tags and want to see the most recently created ones first:
git config --global tag.sort -creatordate
(`-creatordate` reverses the sort so that the newest come first.)
tikhonj 4 hours ago||
Let's sort git branches by quality, better branches towards the top, slop at the bottom.
jeffbee 6 hours ago|
Feels like the type of problem you could simply choose to not have in the first place (by not using git).