diff options
author | Timmy Keller <tjk@tjkeller.xyz> | 2022-11-05 14:39:31 -0500 |
---|---|---|
committer | Timmy Keller <tjk@tjkeller.xyz> | 2022-11-05 14:39:31 -0500 |
commit | fcb1d4fa276bb1544d3ad47c27931c63fde3d297 (patch) | |
tree | f4d5bedd220d6128f21e0360d87e35cd123c1af0 /zsh/zscripts/nicegit.zsh | |
parent | 46a49ab7bd980a85c4fd772b74639a87fc153b0c (diff) | |
download | dotconfig-fcb1d4fa276bb1544d3ad47c27931c63fde3d297.tar.xz dotconfig-fcb1d4fa276bb1544d3ad47c27931c63fde3d297.zip |
make nicegit better
Diffstat (limited to 'zsh/zscripts/nicegit.zsh')
-rwxr-xr-x[-rw-r--r--] | zsh/zscripts/nicegit.zsh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/zsh/zscripts/nicegit.zsh b/zsh/zscripts/nicegit.zsh index 5aab8e0..faa7987 100644..100755 --- a/zsh/zscripts/nicegit.zsh +++ b/zsh/zscripts/nicegit.zsh @@ -3,11 +3,16 @@ alias \ ga="git add" \ gpl="git pull" \ - gps="git push" \ + gph="git push" \ gl="git log" \ function gc() { + if ! __is_diff; then + echo "Nothing to commit, working tree clean" + return + fi + if [[ "$@" != "" ]]; then commit="$@" else @@ -15,3 +20,11 @@ function gc() { fi git commit -m "$commit" } + +function __is_diff() { + ! git diff --quiet HEAD $REF -- $DIR +} + +function gdf() { + __is_diff && git diff HEAD $RED -- $DIR || echo "Repo is unchanged" +} |