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

[PATCH] cat-file: remove unnecessary #include

From
Alexander Kuleshov <kuleshovmail@gmail.com>
Date
Jan 10, 2015, 18:29 UTC
Message-ID
<1420914558-5324-1-git-send-email-kuleshovmail@gmail.com>
"cache.h" is already included in "builtin.h"

It appeared at e83c51 (Initial revision of "git", the information manager from hell., 8 Apr 2005) and used cache.c API (get_sha1_hex and read_sha1_file). After this in the commit f81dae (Builtin git-cat-file., ) was included "builtin.h", which already includes "cache.h", so we no need to include it in the cat-file.c

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 builtin/cat-file.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 750b5a2..2e6aaa1 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -3,7 +3,6 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
 #include "builtin.h"
 #include "parse-options.h"
 #include "userdiff.h"
-- 
2.2.1.532.g168b885.dirty
Message 1 of 1 in “cat-file: remove unnecessary #include”
  1. cat-file: remove unnecessary #includeAlexander Kuleshov, Jan 10, 2015

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.