Using the Bash set command changes the parameters of the current shell. Changes to shell parameters are NOT inherited by the subshell. The reason is that the script writer might want to change the environment settings for the subshell!
These examples go to the parent shell without printing 'hai'
( set -e; git push; echo 'hai' )
Same:
( set -e; git push; printf '\nhai' )
Same:
( set -e git push printf '\nhai' )
Creating a Compond Team with '&& or ||' Operators following a subshell keeps the subshell open until all commands are resolved.
Use these two commands to find the quoted section of the bash manual:
man bash /errexit
Exit immediately if the pipeline (which may consist of one simple command), list, or compound command (see Wrapper SAMPLE) terminates with a nonzero state. The shell does not finish if the failed command is part of the list of commands immediately following the keyword some time before, part of the test after the reserved words if or elif, part of any command executed in the characters && or || a list, with the exception of the command following the last character && or ||, any command in the pipeline except the last, or if the return value of the command is inverted with !. If a compound command other than a subshell returns a nonzero state due to a command failure, when -e is ignored, the shell does not terminate. The ERR trap, if installed, runs before exiting the shell. This parameter is applied to the shell environment and each subshell environment separately (see above, the EXECUTION EXECUTION COMMAND) and may cause the subshells to exit after all the commands in the subshell have been executed.
This part of the bash manual mentions this again:
The ERR trap is not executed if the failed command is part of the list of commands immediately following the keyword for a while or before, part of the test in the if statement, part of the command executed in && or || a list, with the exception of the command following the last character && or ||, any command in the pipeline except the last, or if the return value of the command is inverted with !. These are the same conditions that the errexit (-e) option obeys.
Finally, this section of the Bash manual indicates that set -e inherited by the subshells of set -e compatible Bash:
The subshells generated to perform command substitutions inherit the value of the -e option from the parent shell. When not in posix mode, bash clears the -e option in such subshells.