{"thread":{"id":"26116","subject":"[PATCH] t3419-*.sh: Fix arithmetic expansion syntax error","startedAt":"2010-12-21T18:50:47Z","lastAt":"2010-12-22T18:42:42Z","messageCount":3,"participants":["Ramsay Jones","Junio C Hamano","Clemens Buchacher"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"158451","messageId":"4D10F707.1000206@ramsay1.demon.co.uk","threadId":"26116","inReplyTo":null,"subject":"[PATCH] t3419-*.sh: Fix arithmetic expansion syntax error","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-21T18:50:47Z","receivedAt":"2010-12-21T18:50:47Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSome shells, for example dash versions older than 0.5.4, need to\nspell a variable reference as '$N' rather than 'N' in an arithmetic\nexpansion. In order to avoid the syntax error, we change the\noffending variable reference from 'i' to '$i' in function scramble.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nNote that this test is unique in having an '#!/bin/bash' line (rather\nthan '#!/bin/sh'), which was (indirectly) responsible for me not\nnoticing this failure for a while. I don't see anything that would\nrequire bash, so I suspect this is not intensional.\n\nATB,\nRamsay Jones\n\n t/t3419-rebase-patch-id.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh\nindex 1aee483..6972b49 100755\n--- a/t/t3419-rebase-patch-id.sh\n+++ b/t/t3419-rebase-patch-id.sh\n@@ -27,7 +27,7 @@ scramble()\n \t\tthen\n \t\t\techo \"$x\"\n \t\tfi\n-\t\ti=$(((i+1) % 10))\n+\t\ti=$((($i+1) % 10))\n \tdone < \"$1\" > \"$1.new\"\n \tmv -f \"$1.new\" \"$1\"\n }\n-- \n1.7.3\n"},{"id":"158454","messageId":"7vei9a98mw.fsf@alter.siamese.dyndns.org","threadId":"26116","inReplyTo":"4D10F707.1000206@ramsay1.demon.co.uk","subject":"Re: [PATCH] t3419-*.sh: Fix arithmetic expansion syntax error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-12-21T20:24:39Z","receivedAt":"2010-12-21T20:24:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Note that this test is unique in having an '#!/bin/bash' line (rather\n> than '#!/bin/sh'),...\n\nThanks for spotting, and that is idiotic for us to have such a script.\nWe should fix the shebang line as well.\n\nA quick git-grep shows that this is the only instance of this problem\n(outside contrib/completion/git-completion.bash, that is).\n"},{"id":"158494","messageId":"20101222184242.GA6088@localhost","threadId":"26116","inReplyTo":"4D10F707.1000206@ramsay1.demon.co.uk","subject":"Re: [PATCH] t3419-*.sh: Fix arithmetic expansion syntax error","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2010-12-22T18:42:42Z","receivedAt":"2010-12-22T18:42:42Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Tue, Dec 21, 2010 at 06:50:47PM +0000, Ramsay Jones wrote:\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n\nThanks.\n\n> Note that this test is unique in having an '#!/bin/bash' line (rather\n> than '#!/bin/sh'), which was (indirectly) responsible for me not\n> noticing this failure for a while. I don't see anything that would\n> require bash, so I suspect this is not intensional.\n\nIndeed. I actually removed all bashisms from the script, but then\napparently forgot to get rid of #!/bin/bash as well.\n\nClemens\n"}]}