{"thread":{"id":"14299","subject":"[RFC/PATCH] Fix t7601-merge-pull-config.sh on AIX","startedAt":"2008-07-05T14:23:58Z","lastAt":"2008-07-06T08:15:16Z","messageCount":2,"participants":["Miklos Vajna","Brian Gernhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82285","messageId":"1215267838-19402-1-git-send-email-vmiklos@frugalware.org","threadId":"14299","inReplyTo":null,"subject":"[RFC/PATCH] Fix t7601-merge-pull-config.sh on AIX","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-07-05T14:23:58Z","receivedAt":"2008-07-05T14:23:58Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"The test failed on AIX (and likely other OS, such as apparently OSX)\nwhere wc -l outputs whitespace.\n\nAlso, avoid unnecessary eval in conflict_count().\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Fri, Jul 04, 2008 at 06:49:03PM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n> In any case, this feels like an unnecessary use of eval.  The call\n> site\n> you have look like this:\n>\n>       conflict_count resolve_count\n>\n> but it is more natural if you are programming in shell to call it\n> like:\n>\n>       resolve_count=$(count_conflicts)\n\nChanged.\n\n> If you are going to do numerical comparison in later versions, you can\n> just drop the dq around parameters of test:\n>\n>       test $count_three = $count_two\n\nChanged.\n\nMike, could you please confirm that this solves your problem as well?\n\n t/t7601-merge-pull-config.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh\nindex 32585f8..95b4d71 100755\n--- a/t/t7601-merge-pull-config.sh\n+++ b/t/t7601-merge-pull-config.sh\n@@ -70,10 +70,10 @@ test_expect_success 'merge c1 with c2 and c3 (recursive and octopus in pull.octo\n \n conflict_count()\n {\n-\teval $1=`{\n+\t{\n \t\tgit diff-files --name-only\n \t\tgit ls-files --unmerged\n-\t} | wc -l`\n+\t} | wc -l\n }\n \n # c4 - c5\n@@ -115,15 +115,15 @@ test_expect_success 'merge picks up the best result' '\n \tgit config pull.twohead \"recursive resolve\" &&\n \tgit reset --hard c5 &&\n \tgit merge -s resolve c6\n-\tconflict_count resolve_count &&\n+\tresolve_count=$(conflict_count) &&\n \tgit reset --hard c5 &&\n \tgit merge -s recursive c6\n-\tconflict_count recursive_count &&\n+\trecursive_count=$(conflict_count) &&\n \tgit reset --hard c5 &&\n \tgit merge c6\n-\tconflict_count auto_count &&\n-\ttest \"$auto_count\" = \"$recursive_count\" &&\n-\ttest \"$auto_count\" != \"$resolve_count\"\n+\tauto_count=$(conflict_count) &&\n+\ttest $auto_count = $recursive_count &&\n+\ttest $auto_count != $resolve_count\n '\n \n test_done\n-- \n1.5.6.1.322.ge904b.dirty\n"},{"id":"82342","messageId":"F378B75D-AC1B-4AA6-9DBD-616568DBADA4@silverinsanity.com","threadId":"14299","inReplyTo":"1215267838-19402-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [RFC/PATCH] Fix t7601-merge-pull-config.sh on AIX","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2008-07-06T08:15:16Z","receivedAt":"2008-07-06T08:15:16Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Jul 5, 2008, at 10:23 AM, Miklos Vajna wrote:\n\n> The test failed on AIX (and likely other OS, such as apparently OSX)\n> where wc -l outputs whitespace.\n\nACK.  This test does break on OS X and this patch fixes it.\n\nTook me a while to realize why it was saying \"8: command not found\".   \nApparently \"resolve_count= 8\" means something very different than  \n\"resolve_count=8\".  Then I remembered seeing a patch recently that hit  \nconflict_count and I didn't have to think about how to fix it.\n\nThanks,\n~~ Brian\n"}]}