Tidy up gut commit some more, improve gut amend
This commit is contained in:
parent
e5ab9fa976
commit
4cf693abd0
16
src/gut.sh
16
src/gut.sh
|
@ -42,18 +42,22 @@ stash() {
|
|||
|| git stash push
|
||||
}
|
||||
|
||||
# Is anything already added (staged)
|
||||
# then: commit that
|
||||
# else: stage and commit everything
|
||||
# If anything already added (staged):
|
||||
# then commit that
|
||||
# else prompt user to stage then commit
|
||||
commit() {
|
||||
status
|
||||
git status --porcelain | grep -q '^[^ ]*A' \
|
||||
&& git commit \
|
||||
|| (add; git commit)
|
||||
|| (status; add; git commit)
|
||||
}
|
||||
|
||||
# If anything already added (staged):
|
||||
# then amend that
|
||||
# else amend all
|
||||
amend() {
|
||||
git commit --amend -a
|
||||
git status --porcelain | grep -q '^[^ ]*A' \
|
||||
&& git commit --amend \
|
||||
|| git commit --amend -a
|
||||
}
|
||||
|
||||
status() {
|
||||
|
|
Loading…
Reference in New Issue