git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: PATCH] remove duplicate #include directives
Date: Sun, 6 Oct 2019 12:16:12 +0200	[thread overview]
Message-ID: <5af3ad29-5127-b5f7-46c9-f1d3d45b4e67@web.de> (raw)
In-Reply-To: <xmqqv9t269qk.fsf@gitster-ct.c.googlers.com>

Am 06.10.19 um 01:41 schrieb Junio C Hamano:
> René Scharfe <l.s.r@web.de> writes:
>> This one here requires one more piece of information, though, namely our
>> convention of wrapping header files in guard defines to make repeated
>> includes of them no-ops.  We do that for those removed by the patch, but
>> we have a few exceptions to that rule in our repo (at least
>> command-list.h, kwset.h, sha1dc_git.h, tar.h, unicode-width.h).  So in
>> that sense it's not such a good example of a self-sufficient patch. :)
>
> Not really.  "We use header guards" is an argument that demotes this
> cleanup from "must have" to "nice to have".  If a project did not
> use header guards or including the same header twice were an error,
> the patch in question would have been more necessary, but that
> wouldn't have changed the correctness of the patch, I think.

You start with "No", but make my point -- a reader would need more
information than the content of the patch itself to classify it as a
trivial cleanup, namely knowledge of our use of include guards.

Here is an example of a non-idempotent header:

   #define NDEBUG
   ...
   #include <assert.h>
   ...
   #undef NDEBUG
   ...
   #include <assert.h>

(That's the only one we use that I'm aware of.)

René

      reply	other threads:[~2019-10-06 10:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 12:18 PATCH] remove duplicate #include directives René Scharfe
2019-10-03 23:15 ` Junio C Hamano
2019-10-05 16:18   ` René Scharfe
2019-10-05 23:41     ` Junio C Hamano
2019-10-06 10:16       ` René Scharfe [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

  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=5af3ad29-5127-b5f7-46c9-f1d3d45b4e67@web.de \
    --to=l.s.r@web.de \
    --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).