From 9d2ff81c619128053295d8635e5ea7d0f0ed5bf5 Mon Sep 17 00:00:00 2001 From: Dylan Lom Date: Sun, 25 Apr 2021 16:02:44 +1000 Subject: [PATCH] Order gut functions alphabetically --- src/gut.sh | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/gut.sh b/src/gut.sh index 41b2275..40efb80 100755 --- a/src/gut.sh +++ b/src/gut.sh @@ -17,14 +17,6 @@ # THIS SOFTWARE. # -root() { - git rev-parse --show-toplevel -} - -whoami() { - echo "$(git config user.name) ($(git config user.email))" -} - add() { truthy "$1" \ && git add $1 \ @@ -32,29 +24,6 @@ add() { confirm "Add $f?" && git add "$(root)/$f"; done) } -alias co='checkout' -checkout() { - truthy "$1" && target="$1" || target="$(git config init.defaultBranch)" - git checkout "$target" -} - - -alias save='stash' -stash() { - truthy "$1" \ - && git stash push -m "$1" \ - || git stash push -} - -# If anything already added (staged): -# then commit that -# else prompt user to stage then commit -commit() { - git status --porcelain | grep -q '^[^ ]*A' \ - && git commit \ - || (status; add; git commit) -} - # If anything already added (staged): # then amend that # else amend all @@ -64,8 +33,39 @@ amend() { || git commit --amend -a } +alias co='checkout' +checkout() { + truthy "$1" && target="$1" || target="$(git config init.defaultBranch)" + git checkout "$target" +} + + +# If anything already added (staged): +# then commit that +# else prompt user to stage then commit +commit() { + git status --porcelain | grep -q '^[^ ]*A' \ + && git commit \ + || (status; add; git commit) +} + +root() { + git rev-parse --show-toplevel +} + +alias save='stash' +stash() { + truthy "$1" \ + && git stash push -m "$1" \ + || git stash push +} + status() { git status --short } +whoami() { + echo "$(git config user.name) ($(git config user.email))" +} + $@