{"thread":{"id":"58951","subject":"[PATCH] git: remove duplicate includes","startedAt":"2022-12-14T16:52:40Z","lastAt":"2022-12-14T20:53:55Z","messageCount":2,"participants":["Rose via GitGitGadget","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"469023","messageId":"pull.1394.git.git.1671036743272.gitgitgadget@gmail.com","threadId":"58951","inReplyTo":null,"subject":"[PATCH] git: remove duplicate includes","fromName":"Rose via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-12-14T16:52:23Z","receivedAt":"2022-12-14T16:52:40Z","isPatch":true,"sender":{"key":"ckelsch@jgrcpa.com","avatar":null},"body":"From: Seija Kijin <doremylover123@gmail.com>\n\nThese files are already included; we do not need to include them again\n\nSigned-off-by: Seija Kijin <doremylover123@gmail.com>\n---\n    git: remove duplicate includes\n    \n    These files are already included; we do not need to include them again\n    \n    Signed-off-by: Seija Kijin doremylover123@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1394%2FAtariDreams%2Finclude-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1394/AtariDreams/include-v1\nPull-Request: https://github.com/git/git/pull/1394\n\n pack-write.c   | 1 -\n sequencer.c    | 1 -\n unpack-trees.c | 1 -\n 3 files changed, 3 deletions(-)\n\ndiff --git a/pack-write.c b/pack-write.c\nindex 00787e306db..33637297487 100644\n--- a/pack-write.c\n+++ b/pack-write.c\n@@ -5,7 +5,6 @@\n #include \"chunk-format.h\"\n #include \"pack-mtimes.h\"\n #include \"oidmap.h\"\n-#include \"chunk-format.h\"\n #include \"pack-objects.h\"\n \n void reset_pack_idx_option(struct pack_idx_option *opts)\ndiff --git a/sequencer.c b/sequencer.c\nindex dbd56121e24..bcb662e23be 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -36,7 +36,6 @@\n #include \"rebase-interactive.h\"\n #include \"reset.h\"\n #include \"branch.h\"\n-#include \"log-tree.h\"\n \n #define GIT_REFLOG_ACTION \"GIT_REFLOG_ACTION\"\n \ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 8a762aa0772..d11bef96bf3 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -19,7 +19,6 @@\n #include \"promisor-remote.h\"\n #include \"entry.h\"\n #include \"parallel-checkout.h\"\n-#include \"sparse-index.h\"\n \n /*\n  * Error messages expected by scripts out of plumbing commands such as\n\nbase-commit: 57e2c6ebbe7108b35ba30184dcbcb6c34c929ad8\n-- \ngitgitgadget\n"},{"id":"469043","messageId":"Y5o33g7sEljanQjv@coredump.intra.peff.net","threadId":"58951","inReplyTo":"pull.1394.git.git.1671036743272.gitgitgadget@gmail.com","subject":"Re: [PATCH] git: remove duplicate includes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2022-12-14T20:53:50Z","receivedAt":"2022-12-14T20:53:55Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 14, 2022 at 04:52:23PM +0000, Rose via GitGitGadget wrote:\n\n> These files are already included; we do not need to include them again\n\nThese all look good to me. I'm guessing you found them with something\nlike:\n\n  git grep '^#include' '*.h' '*.c' | sort | uniq -d\n\nand then looking over the output (it has many false positives because\nsometimes includes are found in multiple conditionals).\n\nThere's one more in compat/regex/regex.h, where we include stddef.h\nunconditionally, but also if HAVE_STDDEF_H is defined (which I think\nwe'd never set ourselves). The conditional bit comes from upstream, I\nthink, via d18f76dccf (compat/regex: use the regex engine from gawk for\ncompat, 2010-08-17). The unconditional one is from just after that, in\na997bf423d (compat/regex: get the gawk regex engine to compile within\ngit, 2010-08-17).\n\nIt's probably best to leave it as-is, since the \"clean\" fix would be to\nremove the unused conditional, but that takes us further from upstream,\nwhich would be a pain if we ever want to re-import a new version.\n\nSo I think your patch covers all of the cases we'd want to fix.\n\n-Peff\n"}]}