{"thread":{"id":"15467","subject":"[PATCH] t7501: always use test_cmp instead of diff","startedAt":"2008-09-09T23:41:06Z","lastAt":"2008-09-10T17:32:44Z","messageCount":5,"participants":["Miklos Vajna","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"90295","messageId":"1221003666-17115-1-git-send-email-vmiklos@frugalware.org","threadId":"15467","inReplyTo":null,"subject":"[PATCH] t7501: always use test_cmp instead of diff","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-09-09T23:41:06Z","receivedAt":"2008-09-09T23:41:06Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"This should make the output more readable (by default using diff -u)\nwhen some tests fail.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\n t/t7501-commit.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 0edd9dd..6f8c038 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -141,7 +141,7 @@ EOF\n \n test_expect_success \\\n     'validate git-rev-list output.' \\\n-    'diff current expected'\n+    'test_cmp current expected'\n \n test_expect_success 'partial commit that involves removal (1)' '\n \n@@ -151,7 +151,7 @@ test_expect_success 'partial commit that involves removal (1)' '\n \tgit commit -m \"Partial: add elif\" elif &&\n \tgit diff-tree --name-status HEAD^ HEAD >current &&\n \techo \"A\telif\" >expected &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -160,7 +160,7 @@ test_expect_success 'partial commit that involves removal (2)' '\n \tgit commit -m \"Partial: remove file\" file &&\n \tgit diff-tree --name-status HEAD^ HEAD >current &&\n \techo \"D\tfile\" >expected &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -171,7 +171,7 @@ test_expect_success 'partial commit that involves removal (3)' '\n \tgit commit -m \"Partial: modify elif\" elif &&\n \tgit diff-tree --name-status HEAD^ HEAD >current &&\n \techo \"M\telif\" >expected &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '\n \t\texpected &&\n \tgit commit --amend --author=\"$author\" &&\n \tgit cat-file -p HEAD > current &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -256,7 +256,7 @@ test_expect_success 'amend commit to fix author' '\n \t\texpected &&\n \tgit commit --amend --author=\"$author\" &&\n \tgit cat-file -p HEAD > current &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n-- \n1.6.0.1\n"},{"id":"90297","messageId":"20080909234924.GN4829@genesis.frugalware.org","threadId":"15467","inReplyTo":"1221003666-17115-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [PATCH] t7501: always use test_cmp instead of diff","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-09-09T23:49:24Z","receivedAt":"2008-09-09T23:49:24Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Wed, Sep 10, 2008 at 01:41:06AM +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> This should make the output more readable (by default using diff -u)\n> when some tests fail.\n\nSorry for the duplication, I didn't want to send it twice. I also just\nrealised after sending that I forgot to rebase it again current master,\nwhere git-rev-list is replaced by git rev-list, but I guess git am -3\nhandles it. ;-)\n"},{"id":"90298","messageId":"20080909235414.GA4768@coredump.intra.peff.net","threadId":"15467","inReplyTo":"1221003666-17115-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [PATCH] t7501: always use test_cmp instead of diff","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-09-09T23:54:14Z","receivedAt":"2008-09-09T23:54:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Sep 10, 2008 at 01:41:06AM +0200, Miklos Vajna wrote:\n\n>  test_expect_success \\\n>      'validate git-rev-list output.' \\\n> -    'diff current expected'\n> +    'test_cmp current expected'\n\nWe seem to use the convention of\n\n  test_cmp <expected> <actual>\n\nelsewhere, rather than\n\n  test_cmp <actual> <expected>\n\nas you have here.  Most noticeably, that means the diff will show\ndeviations from expected, rather \"what should be done to make this as\nexpected\".  But it is also possible that in the future test_cmp could be\nenhanced to do something more interesting.\n\nI don't think it is worth it to go fix all such instances, but while you\nare here...\n\n-Peff\n"},{"id":"90301","messageId":"7vljy03m2m.fsf@gitster.siamese.dyndns.org","threadId":"15467","inReplyTo":"20080909235414.GA4768@coredump.intra.peff.net","subject":"Re: [PATCH] t7501: always use test_cmp instead of diff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-10T00:02:09Z","receivedAt":"2008-09-10T00:02:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Sep 10, 2008 at 01:41:06AM +0200, Miklos Vajna wrote:\n>\n>>  test_expect_success \\\n>>      'validate git-rev-list output.' \\\n>> -    'diff current expected'\n>> +    'test_cmp current expected'\n>\n> We seem to use the convention of\n>\n>   test_cmp <expected> <actual>\n>\n> elsewhere, rather than\n>\n>   test_cmp <actual> <expected>\n>\n> as you have here.  Most noticeably, that means the diff will show\n> deviations from expected, rather \"what should be done to make this as\n> expected\".\n\nYes, please.  I am glad to see somebody noticed it (I've been fixing these\nwhenever I touched vicinity of the ones that had comparisons swapped).\n"},{"id":"90372","messageId":"1221067964-12287-1-git-send-email-vmiklos@frugalware.org","threadId":"15467","inReplyTo":"7vljy03m2m.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] t7501: always use test_cmp instead of diff","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-09-10T17:32:44Z","receivedAt":"2008-09-10T17:32:44Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"This should make the output more readable (by default using diff -u)\nwhen some tests fail.\n\nAlso changed the diff order from \"current expected\" to \"expected\ncurrent\".\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Tue, Sep 09, 2008 at 05:02:09PM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n> > We seem to use the convention of\n> >\n> >   test_cmp <expected> <actual>\n> >\n> > elsewhere, rather than\n> >\n> >   test_cmp <actual> <expected>\n> >\n> > as you have here.  Most noticeably, that means the diff will show\n> > deviations from expected, rather \"what should be done to make this\n> > as expected\".\n>\n> Yes, please.\n\nHere is an updated patch that does this as well.\n\n t/t7501-commit.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 469bff8..63bfc6d 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -141,7 +141,7 @@ EOF\n \n test_expect_success \\\n     'validate git rev-list output.' \\\n-    'diff current expected'\n+    'test_cmp expected current'\n \n test_expect_success 'partial commit that involves removal (1)' '\n \n@@ -151,7 +151,7 @@ test_expect_success 'partial commit that involves removal (1)' '\n \tgit commit -m \"Partial: add elif\" elif &&\n \tgit diff-tree --name-status HEAD^ HEAD >current &&\n \techo \"A\telif\" >expected &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -160,7 +160,7 @@ test_expect_success 'partial commit that involves removal (2)' '\n \tgit commit -m \"Partial: remove file\" file &&\n \tgit diff-tree --name-status HEAD^ HEAD >current &&\n \techo \"D\tfile\" >expected &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -171,7 +171,7 @@ test_expect_success 'partial commit that involves removal (3)' '\n \tgit commit -m \"Partial: modify elif\" elif &&\n \tgit diff-tree --name-status HEAD^ HEAD >current &&\n \techo \"M\telif\" >expected &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '\n \t\texpected &&\n \tgit commit --amend --author=\"$author\" &&\n \tgit cat-file -p HEAD > current &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n@@ -256,7 +256,7 @@ test_expect_success 'amend commit to fix author' '\n \t\texpected &&\n \tgit commit --amend --author=\"$author\" &&\n \tgit cat-file -p HEAD > current &&\n-\tdiff expected current\n+\ttest_cmp expected current\n \n '\n \n-- \n1.6.0.1\n"}]}