Skip to content

Commit

Permalink
git lb - list recent branches
Browse files Browse the repository at this point in the history
  • Loading branch information
nonrational committed Sep 6, 2024
1 parent 5b85d2c commit e8d02f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .bashrc.perses
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

export ERL_AFLAGS="-kernel shell_history enabled"
export KERL_BUILD_DOCS="yes"
export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
export PATH="$HOME/.parallelize/bin:$PATH"

Expand Down
3 changes: 3 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@
ra = !git r --all
l = "!. ~/.githelpers && pretty_git_log"
la = !git l --all

lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
b = "!. ~/.githelpers && pretty_git_branch"
bs = "!. ~/.githelpers && pretty_git_branch_sorted"
brr = branch --sort=-committerdate


lt = "!git tag | sort -n -t. -k1,1 -k2,2 -k3,3"
stag = "!git tag | sort -n -t. -k1,1 -k2,2 -k3,3 -k4,4"

Expand Down
2 changes: 1 addition & 1 deletion .githelpers
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pretty_git_branch() {
}

pretty_git_branch_sorted() {
git branch -v --format=${BRANCH_FORMAT} --sort=-committerdate $* | pretty_git_format
git branch -v --format=${BRANCH_FORMAT} --sort=-committerdate $* | head -n${1:-5} | pretty_git_format
}

pretty_git_format() {
Expand Down

0 comments on commit e8d02f5

Please sign in to comment.