diff options
authorÆvar Arnfjörð Bjarmason <>2021-09-23 10:29:58 (GMT)
committerJunio C Hamano <>2021-09-23 22:06:47 (GMT)
commit7c812953826549bd21c119a0b533d03973c52443 (patch)
parent7c3c0a99cc22279f7060ff2e73befbcd7d449896 (diff)
Makefile: don't perform "mv $@+ $@" dance for $(GENERATED_H)
Change the " > $@+ && mv $@+ $@" pattern used for generating the config-list.h and command-list.h to just " >$@". This was needed as a guard to ensure that we don't have an empty file if the script failed, but since 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR" flag, 2021-06-29) GNU make ensures that doesn't happen. There's still a lot of other places in the Makefile where we needlessly use this pattern, but I'm just changing these because I'm about to add a new $(GENERATED_H) target, let's have them all look and act the same way. Even with ".DELETE_ON_ERROR" there is still a point to using the "mv $@+ $@" pattern in some cases, e.g. to ensure that you have a working binary during recompilation (see [1] for the start of a long discussion about that), but that doesn't apply here. Nothing external uses $(GENERATED_H) directly, it's only ever used in the context of the Makefile's own dependency (re-)generation. 1. Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
1 files changed, 2 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 47e79a6..e6b8d00 100644
--- a/Makefile
+++ b/Makefile
@@ -2231,15 +2231,14 @@ $(BUILT_INS): git$X
config-list.h: Documentation/*config.txt Documentation/config/*.txt
- >$@+ && mv $@+ $@
+ $(QUIET_GEN)$(SHELL_PATH) ./ >$@
command-list.h: command-list.txt
command-list.h: $(wildcard Documentation/git*.txt)
$(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
- command-list.txt >$@+ && mv $@+ $@
+ command-list.txt >$@