git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Hostetler <git@jeffhostetler.com>
To: Stefan Beller <sbeller@google.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>,
	Jeff King <peff@peff.net>,
	Jonathan Tan <jonathantanmy@google.com>,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH v5 4/6] list-objects: filter objects in traverse_commit_list
Date: Mon, 27 Nov 2017 14:39:43 -0500	[thread overview]
Message-ID: <21fbd685-2c96-91b9-700e-8902a6e99c08@jeffhostetler.com> (raw)
In-Reply-To: <CAGZ79kZR-W-_JJi7zptiGgv=W7KpNMaSEbmmxrXcKovznK9E7Q@mail.gmail.com>



On 11/22/2017 5:56 PM, Stefan Beller wrote:
> On Tue, Nov 21, 2017 at 12:58 PM, Jeff Hostetler <git@jeffhostetler.com> wrote:
>> +       assert(arg);
>> +       assert(!unset);
> 
> I count 16 asserts in this patch. Is that really needed?
> Either omit them or use BUG if we want to rely on user
> bug reports when these conditions trigger, as assert is unreliable
> due to its dependence on the NDEBUG flag.

Yes, there are a few asserts in the code.  Old habits....

I could remove some/all of them, but personally I feel they
have merit and hint to the mindset of the author for future
readers of the code.  Are there other opinions?

Personally, I think it might be awkward to keep repeating
something like:

     if (!c)
         BUG(msg);

Do we want to think about a macro that builds on BUG() and
does the test?

Something like:
     #define ASSERT_OR_BUG(c) do { if (!(c)) BUG("%s", #c); } while (0)

Jeff

  reply	other threads:[~2017-11-27 19:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 20:58 [PATCH v5 0/6] Partial clone part 1: object filtering Jeff Hostetler
2017-11-21 20:58 ` [PATCH v5 1/6] dir: allow exclusions from blob in addition to file Jeff Hostetler
2017-11-21 20:58 ` [PATCH v5 2/6] oidmap: add oidmap iterator methods Jeff Hostetler
2017-11-21 20:58 ` [PATCH v5 3/6] oidset: add iterator methods to oidset Jeff Hostetler
2017-11-21 20:58 ` [PATCH v5 4/6] list-objects: filter objects in traverse_commit_list Jeff Hostetler
2017-11-22 22:56   ` Stefan Beller
2017-11-27 19:39     ` Jeff Hostetler [this message]
2017-11-30 22:03       ` Jeff King
2017-11-21 20:58 ` [PATCH v5 5/6] rev-list: add list-objects filtering support Jeff Hostetler
2017-11-22 20:08   ` Jonathan Nieder
2017-11-29 14:51     ` Jeff Hostetler
2017-11-21 20:58 ` [PATCH v5 6/6] pack-objects: add list-objects filtering Jeff Hostetler
2017-11-22  1:37 ` [PATCH v5 0/6] Partial clone part 1: object filtering Jonathan Tan
2017-11-22  5:14   ` 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=21fbd685-2c96-91b9-700e-8902a6e99c08@jeffhostetler.com \
    --to=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=jonathantanmy@google.com \
    --cc=peff@peff.net \
    --cc=sbeller@google.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).