git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, B.Steinbrink@gmx.de
Subject: Re: [PATCH 1/2] t6101: add a test for rev-parse $garbage^@
Date: Wed, 23 May 2018 18:12:49 -0400	[thread overview]
Message-ID: <20180523221249.GC32171@sigill.intra.peff.net> (raw)
In-Reply-To: <20180523204613.11333-1-newren@gmail.com>

On Wed, May 23, 2018 at 01:46:12PM -0700, Elijah Newren wrote:

> diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
> index 8c617981a3..7b1b2dbdf2 100755
> --- a/t/t6101-rev-parse-parents.sh
> +++ b/t/t6101-rev-parse-parents.sh
> @@ -214,4 +214,8 @@ test_expect_success 'rev-list merge^-1x (garbage after ^-1)' '
>  	test_must_fail git rev-list merge^-1x
>  '
>  
> +test_expect_failure 'rev-parse $garbage^@ should not segfault' '
> +	git rev-parse ffffffffffffffffffffffffffffffffffffffff^@
> +'

Two small nits. :)

It may just be me, but for a trivial test+fix like this, I'd rather see
them in the same commit (both for reviewing, and when I'm digging in the
history later).

The second nit is that we may want to use something a little more
symbolic and easier to read here. Thirty-nine f's behaves quite
differently than forty. And eventually we'd like to move away from
having hard-coded commit ids anyway (this is obviously a fake one, but
the length may end up changing).

Perhaps "git rev-parse $EMPTY_TREE^@", which triggers the same bug?

-Peff

      parent reply	other threads:[~2018-05-23 22:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 19:52 BUG: rev-parse segfault with invalid input Todd Zullinger
2018-05-23 20:23 ` Elijah Newren
2018-05-23 20:45   ` Todd Zullinger
2018-05-23 20:46   ` [PATCH 1/2] t6101: add a test for rev-parse $garbage^@ Elijah Newren
2018-05-23 20:46     ` [PATCH 2/2] rev-parse: verify that commit looked up is not NULL Elijah Newren
2018-05-23 22:09       ` Jeff King
2018-05-24  6:27         ` [PATCH v2] rev-parse: check lookup'ed commit references for NULL Elijah Newren
2018-05-24 14:04           ` Todd Zullinger
2018-05-24 15:11             ` Florian Weimer
2018-05-24 17:06           ` Jeff King
2018-05-25  1:07           ` Junio C Hamano
2018-05-23 22:19       ` [PATCH 2/2] rev-parse: verify that commit looked up is not NULL Todd Zullinger
2018-05-23 22:23         ` Todd Zullinger
2018-05-23 22:12     ` Jeff King [this message]

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=20180523221249.GC32171@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=B.Steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.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).