git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Workaround for strange cmp bug
Date: Wed, 09 Aug 2006 03:50:23 -0700	[thread overview]
Message-ID: <7v3bc65gk0.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0608091221550.1800@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Wed, 9 Aug 2006 12:24:06 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> The cmp(1) (cmp (GNU diffutils) 2.8.7) distributed with openSUSE 10.1 has
> a subtle "shortcoming":
>
> 	$ echo a > a
> 	$ echo b > b
> 	$ cmp a b && echo nonono
> 	a b differ: char 1, line 1
> 	$ cmp a b >/dev/null && echo nonono
> 	nonono
> 	$ cmp -s a b >/dev/null && echo nonono
>
> So, if cmp should _not_ be quiet, _and_ the output is redirected to
> /dev/null, it has a bogus exit value. Our test suite redirects to
> /dev/null, which triggers that bug. (Obviously, the tests pass when
> running with '-v', which made that a real bugger to debug.)

While I sympathize unfortunate users who are stuck with such a
broken implementation of an important basic tool, such a rewrite
unnecessarily makes debugging of both test scripts _and_ real
breakage harder.

It actually is very useful, in the chain of &&, to see that
these steps in our tests output something when they shouldn't
when the tests are run under -v; you may have noticed that the
tests written by me have seemingly useless "echo happy" (which
always returns true) and such, and they are there for a reason.

Please get the distribution fixed.

  reply	other threads:[~2006-08-09 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09 10:24 [PATCH] Workaround for strange cmp bug Johannes Schindelin
2006-08-09 10:50 ` Junio C Hamano [this message]
2006-08-09 11:12   ` Johannes Schindelin
2006-08-09 13:42     ` Johannes Schindelin
2006-08-10  8:20     ` Johannes Schindelin

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=7v3bc65gk0.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /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).