From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Christian Couder <chriscool@tuxfamily.org>,
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: Thu, 2 Apr 2009 07:27:05 -0400 [thread overview]
Message-ID: <20090402112705.GD14599@sigill.intra.peff.net> (raw)
In-Reply-To: <7v8wmjk4p6.fsf@gitster.siamese.dyndns.org>
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.
So I don't know if it is worth it.
-Peff
next prev parent reply other threads:[~2009-04-02 11:28 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 [this message]
2009-04-03 4:14 ` Christian Couder
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=20090402112705.GD14599@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=nathaniel.dawson@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).