diff --git a/.config/linux/system/module/common/bash/module/Git.sh b/.config/linux/system/module/common/bash/module/Git.sh index 8d993cc..3e4ffb9 100644 --- a/.config/linux/system/module/common/bash/module/Git.sh +++ b/.config/linux/system/module/common/bash/module/Git.sh @@ -165,10 +165,12 @@ function gg() { git clone https://git.voronind.com/voronind/"${repo}" } -# See diff for a specific commit. -# Usage: gdc +# See diff for a specific commit. Last commit by default. +# Usage: gdc [COMMITHASH] function gdc() { - git diff "${1}^!" + local hash="${1}" + [[ "${hash}" = "" ]] && hash="HEAD~" + git diff "${hash}^!" } # Get version number based on commit count.