fix(shell): git recommit command
When running git commit it was supposed to update the commit message you are currently working on. When running commit with git hooks setup the commit may fail due to a invalid message. This now splits out the command so you can run `grc` (git recommit) to reedit the commit message that failed rather then having to enter the message again in a new commit message.
This commit is contained in:
parent
92c00ca15c
commit
13845d5098
1 changed files with 8 additions and 5 deletions
|
|
@ -22,10 +22,13 @@ function ggpushpr() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function gc() {
|
function grc() {
|
||||||
if [[ -f "$(git rev-parse --show-toplevel)/.git/COMMIT_EDITMSG" ]]; then
|
cat "$(git rev-parse --show-toplevel)/.git/COMMIT_EDITMSG" \
|
||||||
git commit -t "$(git rev-parse --show-toplevel)/.git/COMMIT_EDITMSG"
|
| grep -B 99999999 '# ------------------------ >8 ------------------------' \
|
||||||
else
|
> "$(git rev-parse --show-toplevel)/.git/COMMIT_TEMPLATE"
|
||||||
git commit -v
|
|
||||||
|
git commit -t "$(git rev-parse --show-toplevel)/.git/COMMIT_TEMPLATE"
|
||||||
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue