Order gut functions alphabetically

This commit is contained in:
Dylan Lom 2021-04-25 16:02:44 +10:00
parent 56eb7cc206
commit 9d2ff81c61
1 changed files with 31 additions and 31 deletions

View File

@ -17,14 +17,6 @@
# THIS SOFTWARE. # THIS SOFTWARE.
# #
root() {
git rev-parse --show-toplevel
}
whoami() {
echo "$(git config user.name) ($(git config user.email))"
}
add() { add() {
truthy "$1" \ truthy "$1" \
&& git add $1 \ && git add $1 \
@ -32,29 +24,6 @@ add() {
confirm "Add $f?" && git add "$(root)/$f"; done) 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): # If anything already added (staged):
# then amend that # then amend that
# else amend all # else amend all
@ -64,8 +33,39 @@ amend() {
|| git commit --amend -a || 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() { status() {
git status --short git status --short
} }
whoami() {
echo "$(git config user.name) ($(git config user.email))"
}
$@ $@