{"thread":{"id":"64946","subject":"[PATCH] remove duplicate includes","startedAt":"2026-02-08T12:32:24Z","lastAt":"2026-02-08T12:32:24Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"535474","messageId":"280325e3-401c-47c7-98cf-c5cc7f719ee4@web.de","threadId":"64946","inReplyTo":null,"subject":"[PATCH] remove duplicate includes","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-02-08T12:32:22Z","receivedAt":"2026-02-08T12:32:24Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"The following command reports that some header files are included twice:\n\n   $ git grep '#include' '*.c' | sort | uniq -cd\n\nRemove the second #include line in each case, as it has no effect.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\nPatch formatted with --function-context for easier review.\n\n builtin/blame.c        | 1 -\n builtin/log.c          | 1 -\n builtin/pack-objects.c | 1 -\n commit.c               | 1 -\n object-file-convert.c  | 1 -\n protocol-caps.c        | 1 -\n setup.c                | 1 -\n 7 files changed, 7 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 6044973462..6588161382 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -1,37 +1,36 @@\n /*\n  * Blame\n  *\n  * Copyright (c) 2006, 2014 by its authors\n  * See COPYING for licensing conditions\n  */\n \n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n #include \"config.h\"\n #include \"color.h\"\n-#include \"builtin.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"quote.h\"\n #include \"string-list.h\"\n #include \"mailmap.h\"\n #include \"parse-options.h\"\n #include \"prio-queue.h\"\n #include \"utf8.h\"\n #include \"userdiff.h\"\n #include \"line-range.h\"\n #include \"line-log.h\"\n #include \"progress.h\"\n #include \"object-name.h\"\n #include \"odb.h\"\n #include \"pager.h\"\n #include \"blame.h\"\n #include \"refs.h\"\n #include \"setup.h\"\n #include \"tag.h\"\n #include \"write-or-die.h\"\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 5c9a8ef363..43af5047e3 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1,52 +1,51 @@\n /*\n  * Builtin \"git log\" and related commands (show, whatchanged)\n  *\n  * (C) Copyright 2006 Linus Torvalds\n  *\t\t 2006 Junio Hamano\n  */\n \n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs.h\"\n #include \"object-name.h\"\n #include \"odb.h\"\n #include \"odb/streaming.h\"\n #include \"pager.h\"\n #include \"color.h\"\n #include \"commit.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n #include \"revision.h\"\n #include \"log-tree.h\"\n-#include \"builtin.h\"\n #include \"oid-array.h\"\n #include \"tag.h\"\n #include \"reflog-walk.h\"\n #include \"patch-ids.h\"\n #include \"path.h\"\n #include \"shortlog.h\"\n #include \"remote.h\"\n #include \"string-list.h\"\n #include \"parse-options.h\"\n #include \"line-log.h\"\n #include \"branch.h\"\n #include \"version.h\"\n #include \"mailmap.h\"\n #include \"progress.h\"\n #include \"commit-slab.h\"\n \n #include \"commit-reach.h\"\n #include \"range-diff.h\"\n #include \"tmp-objdir.h\"\n #include \"tree.h\"\n #include \"write-or-die.h\"\n \n #define MAIL_DEFAULT_WRAP 72\n #define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100\n #define FORMAT_PATCH_NAME_MAX_DEFAULT 64\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 5846b6a293..9768c7bf0b 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -1,53 +1,52 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"config.h\"\n #include \"attr.h\"\n #include \"object.h\"\n #include \"commit.h\"\n #include \"tag.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n #include \"pack-revindex.h\"\n #include \"csum-file.h\"\n #include \"tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter-options.h\"\n #include \"pack-objects.h\"\n #include \"progress.h\"\n #include \"refs.h\"\n #include \"thread-utils.h\"\n #include \"pack-bitmap.h\"\n #include \"delta-islands.h\"\n #include \"reachable.h\"\n #include \"oid-array.h\"\n #include \"strvec.h\"\n #include \"list.h\"\n #include \"packfile.h\"\n #include \"object-file.h\"\n #include \"odb.h\"\n #include \"odb/streaming.h\"\n #include \"replace-object.h\"\n #include \"dir.h\"\n #include \"midx.h\"\n #include \"trace2.h\"\n #include \"shallow.h\"\n #include \"promisor-remote.h\"\n #include \"pack-mtimes.h\"\n #include \"parse-options.h\"\n #include \"blob.h\"\n #include \"tree.h\"\n #include \"path-walk.h\"\n-#include \"trace2.h\"\n \n /*\n  * Objects we are going to pack are collected in the `to_pack` structure.\n  * It contains an array (dynamically expanded) of the object data, and a map\n  * that can resolve SHA1s to their position in the array.\n  */\ndiff --git a/commit.c b/commit.c\nindex 28bb5ce029..515d77e7d3 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1,37 +1,36 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n #include \"tag.h\"\n #include \"commit.h\"\n #include \"commit-graph.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n #include \"object-name.h\"\n #include \"odb.h\"\n #include \"utf8.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"notes.h\"\n #include \"alloc.h\"\n #include \"gpg-interface.h\"\n #include \"mergesort.h\"\n #include \"commit-slab.h\"\n #include \"prio-queue.h\"\n #include \"hash-lookup.h\"\n #include \"wt-status.h\"\n #include \"advice.h\"\n #include \"refs.h\"\n #include \"commit-reach.h\"\n #include \"setup.h\"\n #include \"shallow.h\"\n #include \"tree.h\"\n #include \"hook.h\"\n #include \"parse.h\"\n #include \"object-file.h\"\n #include \"object-file-convert.h\"\n-#include \"prio-queue.h\"\n \n static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);\n \ndiff --git a/object-file-convert.c b/object-file-convert.c\nindex 7ab875afe6..7813286596 100644\n--- a/object-file-convert.c\n+++ b/object-file-convert.c\n@@ -1,14 +1,13 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n #include \"hash.h\"\n-#include \"hash.h\"\n #include \"object.h\"\n #include \"loose.h\"\n #include \"commit.h\"\n #include \"gpg-interface.h\"\n #include \"object-file-convert.h\"\ndiff --git a/protocol-caps.c b/protocol-caps.c\nindex ecdd0dc58d..35072ed60b 100644\n--- a/protocol-caps.c\n+++ b/protocol-caps.c\n@@ -1,12 +1,11 @@\n #include \"git-compat-util.h\"\n #include \"protocol-caps.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"pkt-line.h\"\n #include \"hash.h\"\n-#include \"hex.h\"\n #include \"object.h\"\n #include \"odb.h\"\n #include \"repository.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\ndiff --git a/setup.c b/setup.c\nindex 11fe7f8841..c8336eb20e 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -1,31 +1,30 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"copy.h\"\n #include \"environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"object-file.h\"\n #include \"object-name.h\"\n #include \"refs.h\"\n #include \"replace-object.h\"\n #include \"repository.h\"\n #include \"config.h\"\n #include \"dir.h\"\n #include \"setup.h\"\n #include \"shallow.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"chdir-notify.h\"\n #include \"path.h\"\n #include \"quote.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n #include \"worktree.h\"\n-#include \"exec-cmd.h\"\n \n static int inside_git_dir = -1;\n static int inside_work_tree = -1;\n-- \n2.52.0\n"}]}