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
|
|| git stash push
|
||||||
}
|
}
|
||||||
|
|
||||||
# Is anything already added (staged)
|
# If anything already added (staged):
|
||||||
# then: commit that
|
# then commit that
|
||||||
# else: stage and commit everything
|
# else prompt user to stage then commit
|
||||||
commit() {
|
commit() {
|
||||||
status
|
|
||||||
git status --porcelain | grep -q '^[^ ]*A' \
|
git status --porcelain | grep -q '^[^ ]*A' \
|
||||||
&& git commit \
|
&& git commit \
|
||||||
|| (add; git commit)
|
|| (status; add; git commit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If anything already added (staged):
|
||||||
|
# then amend that
|
||||||
|
# else amend all
|
||||||
amend() {
|
amend() {
|
||||||
git commit --amend -a
|
git status --porcelain | grep -q '^[^ ]*A' \
|
||||||
|
&& git commit --amend \
|
||||||
|
|| git commit --amend -a
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
|
|
Loading…
Reference in New Issue