git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] fetch-pack.h: remove unnecessary #include

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Sep 17, 2012, 15:15 UTC
Message-ID
<1347894910-27624-1-git-send-email-mhagger@alum.mit.edu>

Given the git project policy that *.c files that include header files are responsible for including everything the headers they include need, there is no need for fetch-pack.h to include string-list.h itself. As for the files that include fetch-pack.h:

* builtin/clone.c and builtin/fetch-pack.c
  include builtin.h
  which includes notes.h
  which includes string-list.h
* transport.c
  includes string-list.h
so no other adjustments are needed.
Suggested by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 fetch-pack.h | 2 --
 1 file changed, 2 deletions(-)
diff --git a/fetch-pack.h b/fetch-pack.h
index cb14871..018f35f 100644
--- a/fetch-pack.h
+++ b/fetch-pack.h
@@ -1,8 +1,6 @@
 #ifndef FETCH_PACK_H
 #define FETCH_PACK_H
 
-#include "string-list.h"
-
 struct fetch_pack_args {
 	const char *uploadpack;
 	int unpacklimit;
-- 
1.7.11.3
Message 1 of 1 in “fetch-pack.h: remove unnecessary #include”
  1. fetch-pack.h: remove unnecessary #includeMichael Haggerty, Sep 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.