[PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
When t7510 was introduced, the author made sure that a for loop in a subshell would return with the appropriate error code. Make sure this is true also the for the first line in each loop, which was missed. Signed-off-by: Michael J Gruber g...@drmicha.warpmail.net --- t/t7510-signed-commit.sh |

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 12:42:46PM +0200, Michael J Gruber wrote: When t7510 was introduced, the author made sure that a for loop in a subshell would return with the appropriate error code. Make sure this is true also the for the first line in each loop, which was missed. Signed-off-by:

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Jeff King venit, vidit, dixit 13.06.2014 13:46: On Fri, Jun 13, 2014 at 12:42:46PM +0200, Michael J Gruber wrote: When t7510 was introduced, the author made sure that a for loop in a subshell would return with the appropriate error code. Make sure this is true also the for the first line in

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Michael J Gruber venit, vidit, dixit 13.06.2014 14:04: Jeff King venit, vidit, dixit 13.06.2014 13:46: On Fri, Jun 13, 2014 at 12:42:46PM +0200, Michael J Gruber wrote: When t7510 was introduced, the author made sure that a for loop in a subshell would return with the appropriate error code.

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Michael J Gruber venit, vidit, dixit 13.06.2014 14:22: Michael J Gruber venit, vidit, dixit 13.06.2014 14:04: Jeff King venit, vidit, dixit 13.06.2014 13:46: On Fri, Jun 13, 2014 at 12:42:46PM +0200, Michael J Gruber wrote: When t7510 was introduced, the author made sure that a for loop in a

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 02:33:02PM +0200, Michael J Gruber wrote: With X Y || exit 1 inside the loop, the loop statement will return false, but the loop will continue (if X returns false), which is exactly the problem that the exit avoids. Make your example iterate over false true

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Johannes Sixt
Am 6/13/2014 14:33, schrieb Michael J Gruber: with this loop, sorry: for X in true false; do for Y in false true; do ($X $Y || exit 1) done echo $X/last inner $Y: $? done gives true/last inner true: 0 false/last inner true: 1 even though on both cases

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Johannes Sixt venit, vidit, dixit 13.06.2014 14:54: Am 6/13/2014 14:33, schrieb Michael J Gruber: with this loop, sorry: for X in true false; do for Y in false true; do ($X $Y || exit 1) done echo $X/last inner $Y: $? done gives true/last inner true: 0

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Johannes Sixt
Am 6/13/2014 15:06, schrieb Michael J Gruber: Johannes Sixt venit, vidit, dixit 13.06.2014 14:54: Am 6/13/2014 14:33, schrieb Michael J Gruber: with this loop, sorry: for X in true false; do for Y in false true; do ($X $Y || exit 1) done echo $X/last inner $Y:

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 03:21:55PM +0200, Johannes Sixt wrote: I don't think so. What is the outcome of false # simulate a regression grep foo exit 1 ! grep bar || exit 1 assuming that the '! grep bar' happens to be true? Answer: The regression is not diagnosed

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Johannes Sixt venit, vidit, dixit 13.06.2014 15:21: Am 6/13/2014 15:06, schrieb Michael J Gruber: Johannes Sixt venit, vidit, dixit 13.06.2014 14:54: Am 6/13/2014 14:33, schrieb Michael J Gruber: with this loop, sorry: for X in true false; do for Y in false true; do ($X

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Johannes Sixt
Am 6/13/2014 15:31, schrieb Michael J Gruber: rewrite of the form a b test_must_fail c d || exit 1 hoping that will make things both readable (by avoiding !) and concise (by avoiding repeated exits). Thanks! Please note that we use 'test_must_fail' only for git invocations, but we

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Junio C Hamano
Jeff King p...@peff.net writes: ( for commit in initial second merge fourth-signed fifth-signed sixth-signed master do -git show --pretty=short --show-signature $commit actual +git show --pretty=short