All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Jeff King" <peff@peff.net>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"René Scharfe" <l.s.r@web.de>,
	"Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>
Subject: [PATCH 2/2] cleanups: ensure that git-compat-util.h is included first
Date: Sun, 14 Sep 2014 00:40:45 -0700	[thread overview]
Message-ID: <1410680445-84593-2-git-send-email-davvid@gmail.com> (raw)
In-Reply-To: <1410680445-84593-1-git-send-email-davvid@gmail.com>

CodingGuidelines states that the first #include in C files should be
git-compat-util.h or another header file that includes it, such as
cache.h or builtin.h.

Tweak the tiny minority of files that do not follow this advice.
This makes "make check-headers SKIP_HEADER_CHECK=1" happy.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 bulk-checkin.c    | 1 +
 bulk-checkin.h    | 2 --
 http.c            | 1 +
 merge-recursive.c | 2 +-
 sigchain.c        | 2 +-
 test-regex.c      | 2 +-
 test-sigchain.c   | 2 +-
 varint.c          | 1 +
 varint.h          | 2 --
 9 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/bulk-checkin.c b/bulk-checkin.c
index 98e651c..0c4b8a7 100644
--- a/bulk-checkin.c
+++ b/bulk-checkin.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2011, Google Inc.
  */
+#include "cache.h"
 #include "bulk-checkin.h"
 #include "csum-file.h"
 #include "pack.h"
diff --git a/bulk-checkin.h b/bulk-checkin.h
index 4f599f8..fbd40fc 100644
--- a/bulk-checkin.h
+++ b/bulk-checkin.h
@@ -4,8 +4,6 @@
 #ifndef BULK_CHECKIN_H
 #define BULK_CHECKIN_H
 
-#include "cache.h"
-
 extern int index_bulk_checkin(unsigned char sha1[],
 			      int fd, size_t size, enum object_type type,
 			      const char *path, unsigned flags);
diff --git a/http.c b/http.c
index 0adcec4..040f362 100644
--- a/http.c
+++ b/http.c
@@ -1,3 +1,4 @@
+#include "git-compat-util.h"
 #include "http.h"
 #include "pack.h"
 #include "sideband.h"
diff --git a/merge-recursive.c b/merge-recursive.c
index 8ab944c..df8157b 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -3,8 +3,8 @@
  * Fredrik Kuivinen.
  * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
  */
-#include "advice.h"
 #include "cache.h"
+#include "advice.h"
 #include "cache-tree.h"
 #include "commit.h"
 #include "blob.h"
diff --git a/sigchain.c b/sigchain.c
index 1118b99..faa375d 100644
--- a/sigchain.c
+++ b/sigchain.c
@@ -1,5 +1,5 @@
-#include "sigchain.h"
 #include "cache.h"
+#include "sigchain.h"
 
 #define SIGCHAIN_MAX_SIGNALS 32
 
diff --git a/test-regex.c b/test-regex.c
index b5bfd54..0dc598e 100644
--- a/test-regex.c
+++ b/test-regex.c
@@ -1,4 +1,4 @@
-#include <git-compat-util.h>
+#include "git-compat-util.h"
 
 int main(int argc, char **argv)
 {
diff --git a/test-sigchain.c b/test-sigchain.c
index 42db234..e499fce 100644
--- a/test-sigchain.c
+++ b/test-sigchain.c
@@ -1,5 +1,5 @@
-#include "sigchain.h"
 #include "cache.h"
+#include "sigchain.h"
 
 #define X(f) \
 static void f(int sig) { \
diff --git a/varint.c b/varint.c
index 4ed7729..409c497 100644
--- a/varint.c
+++ b/varint.c
@@ -1,3 +1,4 @@
+#include "git-compat-util.h"
 #include "varint.h"
 
 uintmax_t decode_varint(const unsigned char **bufp)
diff --git a/varint.h b/varint.h
index 0321195..c1c44d9 100644
--- a/varint.h
+++ b/varint.h
@@ -1,8 +1,6 @@
 #ifndef VARINT_H
 #define VARINT_H
 
-#include "git-compat-util.h"
-
 extern int encode_varint(uintmax_t, unsigned char *);
 extern uintmax_t decode_varint(const unsigned char **);
 
-- 
2.1.0.241.ga16d620

  reply	other threads:[~2014-09-14  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14  7:40 [PATCH 1/2] check-headers: add header usage checks for .c files David Aguilar
2014-09-14  7:40 ` David Aguilar [this message]
2014-09-15 19:14 ` Junio C Hamano
2014-09-15 19:16 ` Junio C Hamano
2014-09-15 19:19   ` Junio C Hamano
2014-09-15 19:49     ` David Aguilar

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=1410680445-84593-2-git-send-email-davvid@gmail.com \
    --to=davvid@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=l.s.r@web.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.