wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.33k stars 136 forks source link

Do not "set -e" in standalone forgit #238

Closed carlfriedrich closed 1 year ago

carlfriedrich commented 1 year ago

Setting the error option in bash bypasses error handling in the forgit functions, because the script immediatley exits in case of an error. Remove the option to make error handling possible. Bash scripts automatically return the exit code of the last statement, so standalone forgit will still return useful error codes.

Check list

Description

Type of change

Test environment

carlfriedrich commented 1 year ago

Hey @wren, since you added the git-forgit script, can you check if this PR would break anything I don't see? In #236 we added error handling to some of the forgit functions. Those are are rendered useless when using forgit via git-forgit due to the error option, so I would like to remove it.

wren commented 1 year ago

@carlfriedrich I don't think it would break anything, but I haven't gone through to test the new error handling, so I can't say for sure.

carlfriedrich commented 1 year ago

@carlfriedrich I don't think it would break anything, but I haven't gone through to test the new error handling, so I can't say for sure.

@wren Thanks for your reply! Then I'm gonna merge this. If any error case does not behave as it should, please create an issue, so that we can improve the error handling.