1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-18 01:53:22 -07:00

add gdp command to diff a single commit

This commit is contained in:
Connor Olding 2021-10-07 12:26:41 -07:00
parent 76415f4742
commit f7c85ae9e5

View File

@ -99,6 +99,11 @@ alias gr='git remote -v' ### @- display remote git repositories verbosely.
alias gb='git --no-pager branch' ### @- display the current git branch.
### **NOTE:** there also exists a gb(1) program provided by
### the *gb* package that i don't use.
gdp() { ### @- invoke `gd` to diff a commit from its parent. the commit defaults to "HEAD".
local commit="${1:-HEAD}"
[ $# -le 1 ] || { printf '%s: %s\n' gdp "too many arguments" >&2; return 2; }
gd "$commit~" "$commit"
}
# being specific {{{2