Karthik Nayak <karthik.188@xxxxxxxxx> writes: >> I was commenting on the exit status check done here: >> >> +gitLogOutput=$(git log --check --pretty=format:"---% h% s" "${baseCommit}"..) >> +if test $? -ne 0 >> +then >> + echo -n $gitLogOutput >> + exit 1 >> +fi >> >> Even though the output is captured in a variable, the exit status of >> "git log --check" is still seen by the shell and "if test $? = 0" >> next line say "ah, the thing exited with non-zero status so lets >> echo the whole thing and exit with 1", before it gets to the while >> loop we have below the above piece of code, no? > > My bad, I thought you were referring to the code before my changes. Yes, > here you're right, we don't need the check since the shell would capture > the non-zero status. OK. Because in the next round, you'd be checking the error condition of "git rev-parse $baseCommit" or something that is specifically designed to check the validity of user input, and not the error result from the actual "log --check", the above becomes moot ;-) Thanks.