From e8d02f521f738e567111742fc4990339a8406166 Mon Sep 17 00:00:00 2001 From: Alan Norton Date: Fri, 6 Sep 2024 13:13:41 -0400 Subject: [PATCH] git lb - list recent branches --- .bashrc.perses | 1 + .gitconfig | 3 +++ .githelpers | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.bashrc.perses b/.bashrc.perses index 910d5f6..e3463f5 100644 --- a/.bashrc.perses +++ b/.bashrc.perses @@ -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" diff --git a/.gitconfig b/.gitconfig index 9e775d0..fc6667d 100644 --- a/.gitconfig +++ b/.gitconfig @@ -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" diff --git a/.githelpers b/.githelpers index 1d9d765..9283115 100644 --- a/.githelpers +++ b/.githelpers @@ -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() {