git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Nathaniel P Dawson <nathaniel.dawson@gmail.com>,
	Johannes Sixt <j.sixt@viscovery.net>,
	git@vger.kernel.org
Subject: Re: [PATCH 0/5] Header includes cleanup
Date: Fri, 3 Apr 2009 06:14:26 +0200	[thread overview]
Message-ID: <200904030614.26310.chriscool@tuxfamily.org> (raw)
In-Reply-To: <20090402112705.GD14599@sigill.intra.peff.net>

Hi,

Le jeudi 2 avril 2009, Jeff King a écrit :
> On Wed, Apr 01, 2009 at 10:25:09PM -0700, Junio C Hamano wrote:
> > > - a header file should be included in a C file only if it is needed
> > > to compile the C file (it is not ok to include it only because it
> > > includes many other headers that are needed)
> >
> > If that is the rule, perhaps the problem lies not in a .c program that
> > includes such a .h header, but in the .h itself that includes many
> > other header files.
>
> If this were combined with splitting gigantic .h files (like cache.h)
> into smaller logical units, then we could in theory speed up
> recompilation times with make (we would also need to correctly track
> header dependencies, but gcc -M can do this fairly easily).
>
> But it does come at the price of actually having to consider which
> include files are necessary. I can't think of more than half a dozen
> times in the last year I have actually had to add a #include while
> working on a git .c file, mostly because everything and the kitchen sink
> is included by cache.h.

Yeah, I think the best feature of the actual design is the simplicity, and 
that's why we don't have to add new #include very often. So let's keep this 
simplicity by having and applying rules to keep things simple for the 
developer.

> So I don't know if it is worth it.

I am not sure what you are talking about here, but if you mean that you 
don't think it's worth splitting gigantic .h files (like cache.h) into 
smaller logical units, then I agree.

Best regards,
Christian.

  reply	other threads:[~2009-04-03  4:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-30  9:55 [PATCH 0/5] Header includes cleanup Nathaniel P Dawson
2009-03-30  9:55 ` [PATCH 1/5] " Nathaniel P Dawson
2009-03-30  9:55   ` [PATCH 2/5] " Nathaniel P Dawson
2009-03-30  9:55     ` [PATCH 3/5] " Nathaniel P Dawson
2009-03-30  9:55       ` [PATCH 4/5] " Nathaniel P Dawson
2009-03-30  9:55         ` [PATCH 5/5] " Nathaniel P Dawson
2009-03-30 10:50 ` [PATCH 0/5] " Johannes Sixt
2009-03-30 17:33   ` Nathaniel P Dawson
2009-03-31  6:59     ` Christian Couder
2009-03-31 16:04       ` Junio C Hamano
2009-04-02  3:57         ` Christian Couder
2009-04-02  5:25           ` Junio C Hamano
2009-04-02 11:27             ` Jeff King
2009-04-03  4:14               ` Christian Couder [this message]
2009-04-03 12:24                 ` Jeff King
2009-04-03  3:58             ` Christian Couder
2009-03-31  5:53   ` Christian Couder

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=200904030614.26310.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=nathaniel.dawson@gmail.com \
    --cc=peff@peff.net \
    /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).