Re: [PATCH 1/3] var: add support for listing the shell
On 2023-06-22 at 20:42:31, Eric Sunshine wrote:
Show 7 quoted lines
> This can be implemented more simply without a temporary file:
>
> shpath=$(git var GIT_SHELL_PATH) &&
> test -x "$shpath"
>
> This is safe since the exit code of the Git command is preserved
> across the `shpath=...` assignment.
Show 8 quoted lines
> Similarly, there is no need for a temporary file or an extra process.
> This can all be done entirely in the shell itself:
>
> shpath=$(git var GIT_SHELL_PATH) &&
> case "$shpath" in
> *sh) ;;
> *) return 1
> esac
That's true, but this is much uglier and harder to read.
--
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA