summaryrefslogtreecommitdiff
path: root/advice.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2023-02-24 00:09:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-02-24 01:25:28 (GMT)
commitf332121e75d3aa2b0ce7efd120ac3ede19e9a733 (patch)
treea574878798d23c1832a022d09234727649ccaa5d /advice.h
parent8bff5ca030d314d613e1ab58f07b27914d6dfd33 (diff)
downloadgit-f332121e75d3aa2b0ce7efd120ac3ede19e9a733.zip
git-f332121e75d3aa2b0ce7efd120ac3ede19e9a733.tar.gz
git-f332121e75d3aa2b0ce7efd120ac3ede19e9a733.tar.bz2
treewide: remove unnecessary git-compat-util.h includes in headers
For sanity, we should probably do one of the following: (a) make C and header files both depend upon everything they need (b) consistently exclude git-compat-util.h from headers and require it be the first include in C files Currently, we have some of the headers following (a) and others following (b), which makes things messy. In the past I was pushed towards (b), as per [1] and [2]. Further, during this series I discovered that this mixture empirically will mean that we end up with C files that do not directly include git-compat-util.h, and do include headers that don't include git-compat-util.h, with the result that we likely have headers included before an indirect inclusion of git-compat-util.h. Since git-compat-util.h has tricky platform-specific stuff that is meant to be included before everything else, this state of affairs is risky and may lead to things breaking in subtle ways (and only on some platforms) as per [1] and [2]. Since including git-compat-util.h in existing header files makes it harder for us to catch C files that are missing that include, let's switch to (b) to make the enforcement of this rule easier. Remove the inclusion of git-compat-util.h from header files other than the ones that have been approved as alternate first includes. [1] https://lore.kernel.org/git/20180811173406.GA9119@sigill.intra.peff.net/ [2] https://lore.kernel.org/git/20180811174301.GA9287@sigill.intra.peff.net/ Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.h')
-rw-r--r--advice.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/advice.h b/advice.h
index 07e0f76..3e1b48b 100644
--- a/advice.h
+++ b/advice.h
@@ -1,8 +1,6 @@
#ifndef ADVICE_H
#define ADVICE_H
-#include "git-compat-util.h"
-
struct string_list;
/*