From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH 0/5] Header includes cleanup Date: Tue, 31 Mar 2009 09:04:38 -0700 Message-ID: <7vk56565m1.fsf@gitster.siamese.dyndns.org> References: <1238406925-15907-1-git-send-email-nathaniel.dawson@gmail.com> <49D0A3DF.4000203@viscovery.net> <20090330173319.GC25950@eiku.org> <200903310859.36035.chriscool@tuxfamily.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Nathaniel P Dawson , Johannes Sixt , git@vger.kernel.org To: Christian Couder X-From: git-owner@vger.kernel.org Tue Mar 31 18:07:14 2009 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1LogTk-00006Q-Sl for gcvg-git-2@gmane.org; Tue, 31 Mar 2009 18:06:21 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759180AbZCaQEv (ORCPT ); Tue, 31 Mar 2009 12:04:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757702AbZCaQEu (ORCPT ); Tue, 31 Mar 2009 12:04:50 -0400 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:35336 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755856AbZCaQEt (ORCPT ); Tue, 31 Mar 2009 12:04:49 -0400 Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 8EA07A601A; Tue, 31 Mar 2009 12:04:46 -0400 (EDT) Received: from pobox.com (unknown [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 0B1B5A600F; Tue, 31 Mar 2009 12:04:40 -0400 (EDT) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: A7C1E5AA-1E0D-11DE-999B-32B0EBB1AA3C-77302942!a-sasl-fastnet.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Christian Couder writes: > I think it's a good thing that you started working on it even if in the end > we decide that we want these cleanup to be done otherwise. At least we will > hopefully have clarified our include header policy. Before seeing a lot of patches to change #include all over the place, I'd like to see a simple guiding principle described, not just a subjective "I think this makes things better" but with "... because of X and Y and Z". The document Documentation/CodingGuidelines describes the only policy that exists currently: git-compat-util.h must be the first thing the compiler sees. The language should probably be stronger than what appears there: - The first #include in C files, except in platform specific compat/ implementations, should be git-compat-util.h or another well-known header file that includes it at the beginning, namely cache.h or builtin.h. Even though http.h may include "cache.h" at the very beginning, I'd rather not to see http-walker.c lose inclusion of "cache.h". It will force us to remember that http.h is Ok to include as the first file, and that won't scale. The reason git-compat-util.h must be the first is because inclusion of all the system header files is supposed to happen there, and there are some platforms that have broken system header dependencies we do not want application writers to care about, and the compat-util header knows about them.