{"thread":{"id":"28613","subject":"[PATCH] merge-one-file: fix \"expr: non-numeric argument\"","startedAt":"2011-10-06T18:25:55Z","lastAt":"2011-10-06T20:25:04Z","messageCount":2,"participants":["Jay Soffian","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177089","messageId":"1317925555-65237-1-git-send-email-jaysoffian@gmail.com","threadId":"28613","inReplyTo":null,"subject":"[PATCH] merge-one-file: fix \"expr: non-numeric argument\"","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-06T18:25:55Z","receivedAt":"2011-10-06T18:25:55Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"When invoking expr to compare two numbers, don't quote the\nvariables which are the output of 'wc -c'. On OS X, this output\nincludes spaces, which expr balks at:\n\n  $ sz0=`wc -c </etc/passwd`\n  $ sz1=`wc -c </etc/passwd`\n  $ echo \"'$sz0'\"\n  '    3667'\n\n  $ expr \"$sz0\" \\< \"$sz1\" \\* 2\n  expr: non-numeric argument\n\n  $ expr $sz0 \\< $sz1 \\* 2\n  1\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\nNoticed this while working on the CHERRY_PICK_HEAD issue.\n\n git-merge-one-file.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-merge-one-file.sh b/git-merge-one-file.sh\nindex 7aeb96952f..f612cb847a 100755\n--- a/git-merge-one-file.sh\n+++ b/git-merge-one-file.sh\n@@ -117,7 +117,7 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \n \t\t# If we do not have enough common material, it is not\n \t\t# worth trying two-file merge using common subsections.\n-\t\texpr \"$sz0\" \\< \"$sz1\" \\* 2 >/dev/null || : >$orig\n+\t\texpr $sz0 \\< $sz1 \\* 2 >/dev/null || : >$orig\n \t\t;;\n \t*)\n \t\techo \"Auto-merging $4\"\n-- \n1.7.7.144.gbfcf9.dirty\n"},{"id":"177105","messageId":"7vk48hzx3z.fsf@alter.siamese.dyndns.org","threadId":"28613","inReplyTo":"1317925555-65237-1-git-send-email-jaysoffian@gmail.com","subject":"Re: [PATCH] merge-one-file: fix \"expr: non-numeric argument\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-06T20:25:04Z","receivedAt":"2011-10-06T20:25:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}