From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Wincent Colaiuta <win@wincent.com>
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
git@vger.kernel.org
Subject: Re: [PATCH] Re-re-re-fix common tail optimization
Date: Mon, 17 Dec 2007 11:57:29 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0712171151490.9446@racer.site> (raw)
In-Reply-To: <36E62F9B-26FF-4DC0-99B8-D6DC2B960E67@wincent.com>
Hi,
On Mon, 17 Dec 2007, Wincent Colaiuta wrote:
> El 17/12/2007, a las 11:39, Johannes Schindelin escribi?:
>
> > On Mon, 17 Dec 2007, Wincent Colaiuta wrote:
> >
> > > El 16/12/2007, a las 23:29, Jeff King escribi?:
> > >
> > > > On Sun, Dec 16, 2007 at 02:23:27PM -0800, Junio C Hamano wrote:
> > > >
> > > > > > Aren't we using "git diff" for the second diff there nowadays?
> > > > >
> > > > > Some people seem to think that is a good idea, but I generally
> > > > > do not like using "git diff" between expect and actual (both
> > > > > untracked) inside tests. The last "diff" is about validating
> > > > > what git does and using "git diff" there would make the test
> > > > > meaningless when "git diff" itself is broken.
> > > >
> > > > I think that is a valid concern. But ISTR that were some issues
> > > > with using GNU diff. Commit 5bd74506 mentions getting rid of the
> > > > dependency in all existing tests, but gives no reason.
> > >
> > > I'd say it's safe and sensible to use "git diff" in all tests
> > > *except* for tests of "git diff" itself.
> >
> > To the contrary. It has to test "git diff", so it must use "git
> > diff".
>
> Obviously, you can only test "git diff" by actually running it.
Sorry, I should have made clear that I meant this as funny:
;-)
> > As for the reference output: we include the expected diffs as texts,
> > and therefore do not really have to rely on having GNU diff installed.
> >
> > Besides, we cannot even test the goodies like "rename from" by
> > comparing to GNU diff's output.
>
> Sorry, I didn't make myself clear. That's not what I was proposing at
> all. I was talking about this kind of example:
>
> > + git diff -U0 | sed -e "/^index/d" -e "s/$z2047/Z/g" >actual &&
> > + diff -u expect actual
>
> First line uses "git diff", if the second line uses "git diff" as well
> and "git diff" happens to be broken then you're using a broken tool to
> test a broken tool, as Junio already pointed out.
Hmm. There is some chicken-and-egg problem here (I read the thread, but
did not really see a problem, as I assumed that _other_ tests would assure
that "git diff --no-index" works as expected).
But as at least one released version of GNU diff has a pretty serious bug,
I would rather not rely too much on diff. (BTW this was the reason I
wanted --no-index so badly.)
So yeah, the second "diff" cannot be "git diff". Maybe "cmp", but not
"git diff".
Ciao,
Dscho
next prev parent reply other threads:[~2007-12-17 11:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-15 11:16 trim_common_tail bug? Jeff King
2007-12-15 15:51 ` Jeff King
2007-12-15 17:49 ` Junio C Hamano
2007-12-15 20:02 ` Jeff King
2007-12-16 7:06 ` Jeff King
2007-12-16 19:43 ` Junio C Hamano
2007-12-16 21:16 ` Junio C Hamano
2007-12-16 21:21 ` Jeff King
2007-12-16 21:49 ` [PATCH] Re-re-re-fix common tail optimization Junio C Hamano
2007-12-16 22:15 ` Jeff King
2007-12-16 22:23 ` Junio C Hamano
2007-12-16 22:28 ` Junio C Hamano
2007-12-16 22:29 ` Jeff King
2007-12-17 8:42 ` Wincent Colaiuta
2007-12-17 10:39 ` Johannes Schindelin
2007-12-17 10:59 ` Wincent Colaiuta
2007-12-17 11:57 ` Johannes Schindelin [this message]
2007-12-17 12:08 ` Wincent Colaiuta
2007-12-17 12:12 ` Jeff King
2007-12-17 12:20 ` Johannes Sixt
2007-12-17 12:51 ` Johannes Schindelin
2007-12-17 17:58 ` Junio C Hamano
2007-12-17 18:05 ` Johannes Schindelin
2007-12-19 14:18 ` Charles Bailey
2007-12-19 14:27 ` Jeff King
2007-12-19 14:37 ` Charles Bailey
2007-12-20 0:21 ` Junio C Hamano
2007-12-20 1:38 ` Wincent Colaiuta
2007-12-20 9:23 ` Charles Bailey
2007-12-20 9:40 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0712171151490.9446@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=torvalds@linux-foundation.org \
--cc=win@wincent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).