summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2024-03-31 17:23:50 +0800
committerSean Whitton <spwhitton@spwhitton.name>2024-03-31 17:23:50 +0800
commit37883b69199715feff7b7826ad5bfba904aea3fb (patch)
tree45b77b582bc7d71ee2c5d3b53b5302b9ee3d0bfb /bin
parent372bdd3a3f716671948a1f13d3c97561df34725c (diff)
downloaddotfiles-37883b69199715feff7b7826ad5bfba904aea3fb.tar.gz
add git-rl{,h} & archive remaining Magit config to git history
I find that having two different kinds of display of browseable git logs and diffs in Emacs can break my flow.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-rl18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/git-rl b/bin/git-rl
new file mode 100755
index 00000000..060ba744
--- /dev/null
+++ b/bin/git-rl
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Copyright © 2024 Sean Whitton
+# SPDX-License-Identifier: MIT
+
+if [ $# -gt 1 ]; then
+ echo >&2 "usage: git rl [<ref>]"
+ exit 255
+fi
+
+git reflog show -10 --color=always \
+ --format="* %C(black white)%h%Creset..:%x09\
+%C(red bold)%gd%Creset%x09\
+%C(black white)%>(15)%cr %Creset%x09\
+%C(cyan bold)%gs%Creset" \
+ "${1:-$(git symbolic-ref --short HEAD)}" \
+ | sed -e 's# ago \[m\t# \[m\t#' -e 's#: #\[m\t#' \
+ | column -t -s\ -o\ -l5 -T5