git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH] parse_color: fix return value for numeric color values 0-8
Date: Tue, 20 Jan 2015 19:03:52 -0500	[thread overview]
Message-ID: <20150121000352.GA12543@peff.net> (raw)
In-Reply-To: <xmqqvbk1ypie.fsf@gitster.dls.corp.google.com>

On Tue, Jan 20, 2015 at 03:57:13PM -0800, Junio C Hamano wrote:

> > -- >8 --
> > When commit 695d95d refactored the color parsing, it missed
> > a "return 0" when parsing literal numbers 0-8 (which
> > represent basic ANSI colors), leading us to report these
> > colors as an error.
> >
> > Signed-off-by: Jeff King <peff@peff.net>
> > ---
> 
> Thanks; somebody should have caught this before we applied and
> merged to 'master', but the process obviously did not work well.

I am not too surprised. The use of numeric values for colors was
completely undocumented, and we did not have any test coverage for it. I
did not even know it existed until I started refactoring the function,
and wondered what was going on (though I did try to preserve it once I
found it).

So I suspect that almost nobody is using this undocumented "feature",
which is why it was not caught while cooking in 'next'.  The system
cannot always have perfect output, but hopefully the number of people
affected by a bug is proportional to the quickness with which it is
caught.

-Peff

PS All that being said, I think it is a good example of why it is a good
   idea to beef up test coverage in an area before refactoring. A
   trivial test would have caught this.

  reply	other threads:[~2015-01-21  0:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 23:57 [ANNOUNCE] Git v2.3.0-rc0 Junio C Hamano
2015-01-14 13:11 ` Christian Neukirchen
2015-01-20 21:49 ` Ævar Arnfjörð Bjarmason
2015-01-20 22:14   ` [PATCH] parse_color: fix return value for numeric color values 0-8 Jeff King
2015-01-20 23:57     ` Junio C Hamano
2015-01-21  0:03       ` Jeff King [this message]
2015-01-21  0:36         ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150121000352.GA12543@peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).