feat: add git-continue#1176
Conversation
Also refactor `git-abort` to parse action from the called file name. There's a promise for this in tj#865 but that was a long time ago.
hyperupcall
left a comment
There was a problem hiding this comment.
Thanks! Looks good, I have a few suggestions
|
|
||
| action=$(discover_action "$(basename "$0")") | ||
| op=$(discover_op) | ||
| validate_op "$op" |
There was a problem hiding this comment.
If I am reading the code correctly, if validate_op fails, then the script does not exit early (and the git command will erroneously execute) because errexit is not set. (the same is the case with discover_action). I think errexit should be set at the top?
| f=${f/-/_} | ||
| test -f "${gitdir}/${f}_HEAD" && fcnt=1$fcnt && opfound=$i | ||
| done | ||
| set -xuo pipefail |
There was a problem hiding this comment.
| set -xuo pipefail | |
| set -euo pipefail |
Recommend setting errexit (for the reasons mentioned below). And unsetting xtrace because xtrace is not set for any other scripts.
There was a problem hiding this comment.
Hey thanks for the catch, looks like copilot had a clitch that i didn't notice 🥹
| fi | ||
| } | ||
|
|
||
| function discover_action() { |
There was a problem hiding this comment.
I'm not a huge fan of this function (feel like there is a better way to go about this), but I'm good with this for now.
27ac89b to
0b381f4
Compare
0b381f4 to
e2224c9
Compare
There was a problem hiding this comment.
These were not used, sorry for whitespace change for the file that ruff caused.
address review comments, fix the script, remove unnecessary testpath import.
e2224c9 to
d359df9
Compare
|
Thanks for the changes, LGTM. @spacewander what do you think? |
|
Merged. Thanks! |
Also refactor
git-abortto parse action from the called file name.There's a promise for this in #865 but that was a long time ago.