From: Christian Couder <chriscool@tuxfamily.org>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Nathaniel P Dawson <nathaniel.dawson@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 0/5] Header includes cleanup
Date: Tue, 31 Mar 2009 07:53:11 +0200 [thread overview]
Message-ID: <200903310753.11595.chriscool@tuxfamily.org> (raw)
In-Reply-To: <49D0A3DF.4000203@viscovery.net>
Le lundi 30 mars 2009, Johannes Sixt a écrit :
> Please wrap your lines at ca. 75 columns.
>
> Nathaniel P Dawson schrieb:
> > This is just the beginning for this project. I'm slowly cleaning up
> > the header includes one chunk at a time. I hope my patches aren't too
> > messy, I've learned how to better utilize git to make patches and
> > organize my commits logically so I'll submit neater chunks henceforth.
> > You can expect patches from me nightly until I've finished this
> > project.
>
> You have removed includes that are implied by other includes, i.e. if
> foo.h includes bar.h, then you removed #include "bar.h" from *.c if there
> is #include "foo.h".
>
> IMO, this is not a good guiding principle to reduce includes. A better
> principle is to keep #include "bar.h" in a source or header file iff a
> feature that is declared or defined in bar.h is *used* *directly* in that
> source or header file, regardless of whether bar.h is included in foo.h
> that is itself included in that source or header file.
In theory, it's perhaps the best way to do it. But we don't do that for
system header includes. And I think it makes it very difficult to cleanup
header includes, because you have to check what is needed for each feature
in a file. So I think we have to choose between basically no header include
cleanup or a cleanup like the one Nathaniel started.
> If this latter principle is obeyed, then the build won't break by
> removing the include of foo.h (for the reason that nothing of foo.h is
> *use* *directly* anymore).
I think it's more likely that we will add features rather than remove some.
And it's not very difficult if we remove some, to remove "foo.h" and
add "bar.h" at the same time.
For example, many files include "cache.h", does it really make sense to try
to remove these #include because we could replace them by only includes
of "git-compat-util.h" and "hash.h"? I don't think so.
Best regards,
Christian.
prev parent reply other threads:[~2009-03-31 5:55 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
2009-04-03 12:24 ` Jeff King
2009-04-03 3:58 ` Christian Couder
2009-03-31 5:53 ` Christian Couder [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=200903310753.11595.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--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).