Skip to content

Commit 1ca1ff7

Browse files
committed
git-recent. my upgraded recent branch listing.
1 parent 789e40a commit 1ca1ff7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

bin/git-recent

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# list all local branches, but formatted reall purdy
4+
5+
# format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|%(color:bold red)%(objectname:short) %(color:bold blue)%(committerdate:relative) %(color:dim white)%(authorname)%0a %(color:black) %(color:reset)|%(contents:subject)%0a |%0a"
6+
format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|\
7+
%(color:bold blue)%(objectname:short) %(color:bold red)%(committerdate:relative) %(color:dim white)%(authorname)%0a\
8+
%(color:black) %(color:reset)|%(contents:subject)%0a\
9+
|"
10+
11+
# for all known branches..
12+
# sort descending by last commit,
13+
# show local branches instead of remotes. (omit "refs/heads/" to include both local and remote branches)
14+
# break into columns
15+
# use the pager only if there's not enough space
16+
17+
git for-each-ref \
18+
--sort=-committerdate refs/heads/ \
19+
--format="$format" \
20+
| column -ts '|' \
21+
| less --tabs=4 -RFX

0 commit comments

Comments
 (0)