[PATCH] Makefile: dedup git-ls-files output to prevent duplicate targets
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- May 26, 2022, 02:15 UTC
- Message-ID
- <20220526021540.2812-1-worldhello.net@gmail.com>
- In-Reply-To
- <xmqqtu9d45f7.fsf@gitster.g>
From: Jiang Xin <zhiyou.jx@alibaba-inc.com>
If there are unresolved conflicts left in the working tree, "make" may report warnings as follows:
Makefile:xxxx: target '.build/pot/po/FOO.c.po' given more than once
in the same ruleThe duplicate targets are introduced by the following pattern rule we added in the preceding commit for incremental build of "po/git.pot",
$(LOCALIZED_C_GEN_PO): .build/pot/po/%.po: %
and the duplicate entries in $(LOCALIZED_C_GEN_PO) come from the "git ls-files" command in SOURCES_CMD.
We can pass the option "--deduplicate" to git-ls-files to suppress duplicate entries for unresolved conflicts.
Reported-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index a3f8446de9..a8880ed482 100644 --- a/Makefile +++ b/Makefile @@ -846,7 +846,7 @@ generated-hdrs: $(GENERATED_H) ## Exhaustive lists of our source files, either dynamically generated, ## or hardcoded. SOURCES_CMD = ( \ - git ls-files \ + git ls-files --deduplicate \ '*.[hcS]' \ '*.sh' \ ':!*[tp][0-9][0-9][0-9][0-9]*' \
-- 2.36.0.1.g15c4090757