config/git: document a few shortcuts

This commit is contained in:
xeruf 2022-06-22 18:37:27 +02:00
parent e98754a1e0
commit 5c17af6d6f
2 changed files with 3 additions and 3 deletions

View File

@ -113,9 +113,9 @@
co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++' 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 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' 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 # diffs
d = diff d = diff

View File

@ -27,7 +27,7 @@ if beginswith $'\n#' "$original"; then
do let count-- do let count--
done done
done <<<"$(git -P diff --cached --name-only -r)" && 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 case "$path" in ([0-9]*) path="${path#*/}";; esac
path="${path#.}" path="${path#.}"
{ {