{"thread":{"id":"11879","subject":"[PATCH 8/9] Use git diff instead of diff in t7201","startedAt":"2008-02-04T18:36:04Z","lastAt":"2008-02-06T05:21:48Z","messageCount":8,"participants":["Daniel Barkalow","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"67404","messageId":"alpine.LNX.1.00.0802041336030.13593@iabervon.org","threadId":"11879","inReplyTo":null,"subject":"[PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-04T18:36:04Z","receivedAt":"2008-02-04T18:36:04Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"If the test failed, it was giving really unclear ed script\noutput. Instead, give a diff that sort of suggests the problem.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n t/t7201-co.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 73d8a00..c6f93a9 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -143,7 +143,7 @@ test_expect_success \"checkout -m with dirty tree, renamed\" '\n \n \tgit checkout -m renamer &&\n \tfill 1 3 4 5 7 8 >expect &&\n-\tdiff expect uno &&\n+\tgit diff expect uno &&\n \t! test -f one &&\n \tgit diff --cached >current &&\n \t! test -s current\n@@ -168,7 +168,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tgit diff master:one :3:uno |\n \tsed -e \"1,/^@@/d\" -e \"/^ /d\" -e \"s/^-/d/\" -e \"s/^+/a/\" >current &&\n \tfill d2 aT d7 aS >expect &&\n-\tdiff current expect &&\n+\tgit diff current expect &&\n \tgit diff --cached two >current &&\n \t! test -s current\n '\n-- \n1.5.4\n"},{"id":"67469","messageId":"alpine.LSU.1.00.0802050139470.8543@racer.site","threadId":"11879","inReplyTo":"alpine.LNX.1.00.0802041336030.13593@iabervon.org","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-05T01:40:53Z","receivedAt":"2008-02-05T01:40:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 4 Feb 2008, Daniel Barkalow wrote:\n\n> If the test failed, it was giving really unclear ed script\n> output. Instead, give a diff that sort of suggests the problem.\n> \n> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> ---\n>  t/t7201-co.sh |    4 ++--\n\nThis is not really a part of the series leading to builtin checkout.  But \nas a standalone patch, I like it (obviously... I tried to push for more \n--no-index uses in the test suite).\n\nCiao,\nDscho\n"},{"id":"67550","messageId":"alpine.LNX.1.00.0802042152560.13593@iabervon.org","threadId":"11879","inReplyTo":"alpine.LSU.1.00.0802050139470.8543@racer.site","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-05T20:39:05Z","receivedAt":"2008-02-05T20:39:05Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 5 Feb 2008, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Mon, 4 Feb 2008, Daniel Barkalow wrote:\n> \n> > If the test failed, it was giving really unclear ed script\n> > output. Instead, give a diff that sort of suggests the problem.\n> > \n> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> > ---\n> >  t/t7201-co.sh |    4 ++--\n> \n> This is not really a part of the series leading to builtin checkout.  But \n> as a standalone patch, I like it (obviously... I tried to push for more \n> --no-index uses in the test suite).\n\nWell, it's something I tripped over when builtin-checkout wasn't passing \nthe tests and I couldn't figure out what it was doing wrong from the \noutput. Like [3/9], it's relevant to evaluating whether the series works, \neven if it's not important for whether it actually does work.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"67585","messageId":"7v1w7r7yv0.fsf@gitster.siamese.dyndns.org","threadId":"11879","inReplyTo":"alpine.LNX.1.00.0802042152560.13593@iabervon.org","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-05T23:44:03Z","receivedAt":"2008-02-05T23:44:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> Well, it's something I tripped over when builtin-checkout wasn't passing \n> the tests and I couldn't figure out what it was doing wrong from the \n> output. Like [3/9], it's relevant to evaluating whether the series works, \n> even if it's not important for whether it actually does work.\n\nYeah, using \"diff -u\" instead of just \"diff\" is an improvement\nfor debuggability which matters a lot in the test scripts.\n"},{"id":"67599","messageId":"alpine.LNX.1.00.0802052011290.13593@iabervon.org","threadId":"11879","inReplyTo":"7v1w7r7yv0.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-06T01:13:51Z","receivedAt":"2008-02-06T01:13:51Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 5 Feb 2008, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > Well, it's something I tripped over when builtin-checkout wasn't passing \n> > the tests and I couldn't figure out what it was doing wrong from the \n> > output. Like [3/9], it's relevant to evaluating whether the series works, \n> > even if it's not important for whether it actually does work.\n> \n> Yeah, using \"diff -u\" instead of just \"diff\" is an improvement\n> for debuggability which matters a lot in the test scripts.\n\nI think I asked before and didn't hear back (or maybe I got distracted \nand didn't ask); do you want this to use \"diff -u\" everywhere or \"git \ndiff\" everywhere? This test is currently part \"diff\" and part \"git diff\", \nand I went for git diff\" everywhere, but you seemed to prefer \"diff -u\".\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"67604","messageId":"7vr6fq6di0.fsf@gitster.siamese.dyndns.org","threadId":"11879","inReplyTo":"alpine.LNX.1.00.0802052011290.13593@iabervon.org","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T02:10:47Z","receivedAt":"2008-02-06T02:10:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> On Tue, 5 Feb 2008, Junio C Hamano wrote:\n>\n>> Daniel Barkalow <barkalow@iabervon.org> writes:\n>> \n>> > Well, it's something I tripped over when builtin-checkout wasn't passing \n>> > the tests and I couldn't figure out what it was doing wrong from the \n>> > output. Like [3/9], it's relevant to evaluating whether the series works, \n>> > even if it's not important for whether it actually does work.\n>> \n>> Yeah, using \"diff -u\" instead of just \"diff\" is an improvement\n>> for debuggability which matters a lot in the test scripts.\n>\n> I think I asked before and didn't hear back (or maybe I got distracted \n> and didn't ask); do you want this to use \"diff -u\" everywhere or \"git \n> diff\" everywhere? This test is currently part \"diff\" and part \"git diff\", \n> and I went for git diff\" everywhere, but you seemed to prefer \"diff -u\".\n\nTypically the test sequence is \"do this with git, do that with\ngit, produce the output with git, now what happened?  did we\nproduce a correct result?\"  And we often compare 'expect' and\n'actual' to see if there are discrepancies.\n\nMy preference is NEVER using \"git diff\" when comparing expected\nresult and the actual output from git.  When \"git diff\" has\nbreakage, it would break unrelated tests and make debugging\nneedlessly harder.\n\nWe need to have tests for regressions in \"git diff\", but such a\ntest would use \"git diff\" in earlier parts of the test sequence\nthat _produce_ the output to be compared with expected result.\n"},{"id":"67610","messageId":"alpine.LNX.1.00.0802052306450.13593@iabervon.org","threadId":"11879","inReplyTo":"7vr6fq6di0.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-06T04:30:00Z","receivedAt":"2008-02-06T04:30:00Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 5 Feb 2008, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > On Tue, 5 Feb 2008, Junio C Hamano wrote:\n> >\n> >> Daniel Barkalow <barkalow@iabervon.org> writes:\n> >> \n> >> > Well, it's something I tripped over when builtin-checkout wasn't passing \n> >> > the tests and I couldn't figure out what it was doing wrong from the \n> >> > output. Like [3/9], it's relevant to evaluating whether the series works, \n> >> > even if it's not important for whether it actually does work.\n> >> \n> >> Yeah, using \"diff -u\" instead of just \"diff\" is an improvement\n> >> for debuggability which matters a lot in the test scripts.\n> >\n> > I think I asked before and didn't hear back (or maybe I got distracted \n> > and didn't ask); do you want this to use \"diff -u\" everywhere or \"git \n> > diff\" everywhere? This test is currently part \"diff\" and part \"git diff\", \n> > and I went for git diff\" everywhere, but you seemed to prefer \"diff -u\".\n> \n> Typically the test sequence is \"do this with git, do that with\n> git, produce the output with git, now what happened?  did we\n> produce a correct result?\"  And we often compare 'expect' and\n> 'actual' to see if there are discrepancies.\n> \n> My preference is NEVER using \"git diff\" when comparing expected\n> result and the actual output from git.  When \"git diff\" has\n> breakage, it would break unrelated tests and make debugging\n> needlessly harder.\n\nCertainly, although we seem to do a lousy job of ordering tests currently \nsuch that the tests that fail are the ones for the thing that's broken; it \ntook a lot of work to get builtin-checkout to the point to reaching \nt7201-co.sh, and by that point it just about all worked. In any case, I'll \ngo for \"diff -u\" all around in that test, since I'm changing it.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"67612","messageId":"7v3as664nn.fsf@gitster.siamese.dyndns.org","threadId":"11879","inReplyTo":"alpine.LNX.1.00.0802052306450.13593@iabervon.org","subject":"Re: [PATCH 8/9] Use git diff instead of diff in t7201","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T05:21:48Z","receivedAt":"2008-02-06T05:21:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> On Tue, 5 Feb 2008, Junio C Hamano wrote:\n> ...\n>> My preference is NEVER using \"git diff\" when comparing expected\n>> result and the actual output from git.  When \"git diff\" has\n>> breakage, it would break unrelated tests and make debugging\n>> needlessly harder.\n>\n> Certainly, although we seem to do a lousy job of ordering tests currently \n> such that the tests that fail are the ones for the thing that's broken;\n\nYeah, Porcelains have become we take for granted ;-).\n"}]}