Skip to contentSkip to conversation

Remove. duplicate include directives

PATCH In review Elia Pinto 2 participants 7 messages Mar 13, 2022

lore
Share & tools
lore

Elia Pinto

author
#0 lore raw

cover Remove. duplicate include directives

This series of patches does not solve any particular problems but only eliminates unnecessary duplicate include directives from git sources

Elia Pinto (5):
attr.c: delete duplicate include builtin/gc.c: delete duplicate include builtin/sparse-checkout.c: delete duplicate include builtin/stash.c: delete duplicate include t/helper/test-run-command.c: delete duplicate include

 attr.c                      | 1 -
 builtin/gc.c                | 1 -
 builtin/sparse-checkout.c   | 1 -
 builtin/stash.c             | 1 -
 t/helper/test-run-command.c | 1 -
 5 files changed, 5 deletions(-)
Signature · 1 line
2.35.1
author
#1 lore raw

PATCH 1/5 attr.c: delete duplicate include

dir.h is included more than once

---
 attr.c | 1 -
 1 file changed, 1 deletion(-)
attr.c +0 -1
index 79adaa50ea..1626cade8b 100644
@@ -14,7 +14,6 @@
 #include "utf8.h"
 #include "quote.h"
 #include "thread-utils.h"
-#include "dir.h"
 
 const char git_attr__true[] = "(builtin)true";
 const char git_attr__false[] = "\0(builtin)false";
Signature · 1 line
2.35.1
author
#2 lore raw

PATCH 2/5 builtin/gc.c: delete duplicate include

In reply to Elia Pinto

object-store.h is included more than once.

---
 builtin/gc.c | 1 -
 1 file changed, 1 deletion(-)
builtin/gc.c +0 -1
index ffaf0daf5d..b335cffa33 100644
@@ -30,7 +30,6 @@
 #include "promisor-remote.h"
 #include "refs.h"
 #include "remote.h"
-#include "object-store.h"
 #include "exec-cmd.h"
 #include "hook.h"
 
Signature · 1 line
2.35.1
author
#3 lore raw

PATCH 3/5 builtin/sparse-checkout.c: delete duplicate include

In reply to Elia Pinto

cache.h is included more than once.

---
 builtin/sparse-checkout.c | 1 -
 1 file changed, 1 deletion(-)
builtin/sparse-checkout.c +0 -1
index 5518ed47f6..d88d141076 100644
@@ -8,7 +8,6 @@
 #include "run-command.h"
 #include "strbuf.h"
 #include "string-list.h"
-#include "cache.h"
 #include "cache-tree.h"
 #include "lockfile.h"
 #include "resolve-undo.h"
Signature · 1 line
2.35.1
author
#4 lore raw

PATCH 4/5 builtin/stash.c: delete duplicate include

In reply to Elia Pinto

entry.h is included more than once.

---
 builtin/stash.c | 1 -
 1 file changed, 1 deletion(-)
builtin/stash.c +0 -1
index 3e8af210fd..548048f444 100644
@@ -16,7 +16,6 @@
 #include "log-tree.h"
 #include "diffcore.h"
 #include "exec-cmd.h"
-#include "entry.h"
 
 #define INCLUDE_ALL_FILES 2
 
Signature · 1 line
2.35.1
author
#5 lore raw

PATCH 5/5 t/helper/test-run-command.c: delete duplicate include

In reply to Elia Pinto

parse-options.h is included more than once.

---
 t/helper/test-run-command.c | 1 -
 1 file changed, 1 deletion(-)
t/helper/test-run-command.c +0 -1
index 8f370cd89f..1b35a143c1 100644
@@ -19,7 +19,6 @@
 #include "thread-utils.h"
 #include "wildmatch.h"
 #include "gettext.h"
-#include "parse-options.h"
 
 static int number_callbacks;
 static int parallel_next(struct child_process *cp,
Signature · 1 line
2.35.1
#6 lore raw
In reply to Elia Pinto
Quoted 10 lines · Elia Pinto

This series of patches does not solve any particular problems but only eliminates unnecessary duplicate include directives from git sources

Elia Pinto (5):
attr.c: delete duplicate include builtin/gc.c: delete duplicate include builtin/sparse-checkout.c: delete duplicate include builtin/stash.c: delete duplicate include t/helper/test-run-command.c: delete duplicate include

Thanks.

It matches the output from the pipeline:

$ git grep '^#include' \*.c |
  sort | uniq -c | sort -n | sed -e '/^ *1 /d'