diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2024-10-18 21:52:28 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2024-10-18 21:52:28 -0500 |
commit | 2dc486fb891e65658dff83ab34ca8878756a6a90 (patch) | |
tree | 03b39eb93f38534ab0972beadb770fecbd2243b8 /zscripts/nicegit.zsh | |
download | zsh-2dc486fb891e65658dff83ab34ca8878756a6a90.tar.xz zsh-2dc486fb891e65658dff83ab34ca8878756a6a90.zip |
initial commit
Diffstat (limited to 'zscripts/nicegit.zsh')
-rwxr-xr-x | zscripts/nicegit.zsh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/zscripts/nicegit.zsh b/zscripts/nicegit.zsh new file mode 100755 index 0000000..276d98e --- /dev/null +++ b/zscripts/nicegit.zsh @@ -0,0 +1,31 @@ +#!/usr/bin/env zsh + +alias \ + ga="git add" \ + gpl="git pull" \ + gph="git push" \ + gl="git log" \ + gldaily='git log --pretty="format:- %s" --after="00:00" --before="24:00"' \ + + +function gc() { + if ! __is_diff; then + echo "Nothing to commit, working tree clean" + return + fi + + if [[ "$@" != "" ]]; then + commit="$@" + else + echo "Enter commit message:" && read commit + 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" +} |