Order gut functions alphabetically
This commit is contained in:
parent
56eb7cc206
commit
9d2ff81c61
62
src/gut.sh
62
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))"
|
||||
}
|
||||
|
||||
$@
|
||||
|
|
Loading…
Reference in New Issue