From 5c17af6d6f31337ed570046bc9825c22f2c4d7d1 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 22 Jun 2022 18:37:27 +0200 Subject: [PATCH] config/git: document a few shortcuts --- .config/git/config | 4 ++-- .config/git/prepare-commit-msg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/git/config b/.config/git/config index d5432d2..df34977 100644 --- a/.config/git/config +++ b/.config/git/config @@ -113,9 +113,9 @@ co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++' when = !git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates - find = log --patch --all --full-history + find = log --patch --all --full-history # Find a filename in all git knows ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' - hf = log --patch --follow --find-renames=1 -- + history = log --patch --follow --find-renames=1 -- # Show the history of the given file # diffs d = diff diff --git a/.config/git/prepare-commit-msg b/.config/git/prepare-commit-msg index 81dd9b5..d981e09 100755 --- a/.config/git/prepare-commit-msg +++ b/.config/git/prepare-commit-msg @@ -27,7 +27,7 @@ if beginswith $'\n#' "$original"; then do let count-- done done <<<"$(git -P diff --cached --name-only -r)" && - expr substr "$common" 1 "$count") || exit 0 + expr substr "$common" 1 "$count" | sed 's|.local/bin/scripts|bin|') || exit 0 case "$path" in ([0-9]*) path="${path#*/}";; esac path="${path#.}" {