Skip to content

Commit b329f2e

Browse files
pks-tgitster
authored andcommitted
Makefile: drop unneeded indirection for GIT-VERSION-GEN outputs
Some of the callsites of GIT-VERSION-GEN generate the target file with a "+" suffix first and then move the file into place when the new contents are different compared to the old contents. This allows us to avoid a needless rebuild by not updating timestamps of the target file when its contents will remain unchanged anyway. In fact though, this exact logic is already handled in GIT-VERSION-GEN, so doing this manually is pointless. This is a leftover from an earlier version of 4838dea (Makefile: refactor GIT-VERSION-GEN to be reusable, 2024-12-06), where the script didn't handle that logic for us. Drop the needless indirection. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1b0882c commit b329f2e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Documentation/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,10 @@ XMLTO_EXTRA += --skip-validation
211211
XMLTO_EXTRA += -x manpage.xsl
212212

213213
asciidoctor-extensions.rb: asciidoctor-extensions.rb.in FORCE
214-
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@+
215-
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
214+
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@
216215
else
217216
asciidoc.conf: asciidoc.conf.in FORCE
218-
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@+
219-
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
217+
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@
220218
endif
221219

222220
ASCIIDOC_DEPS += docinfo.html

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,8 +2509,7 @@ pager.sp pager.s pager.o: EXTRA_CPPFLAGS = \
25092509
-DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
25102510

25112511
version-def.h: version-def.h.in GIT-VERSION-GEN GIT-VERSION-FILE GIT-USER-AGENT
2512-
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" $< $@+
2513-
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
2512+
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" $< $@
25142513

25152514
version.sp version.s version.o: version-def.h
25162515

@@ -2551,8 +2550,7 @@ $(SCRIPT_SH_GEN) $(SCRIPT_LIB) : % : %.sh generate-script.sh GIT-BUILD-OPTIONS G
25512550
mv $@+ $@
25522551

25532552
git.rc: git.rc.in GIT-VERSION-GEN GIT-VERSION-FILE
2554-
$(QUIET_GEN)$(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" $< $@+
2555-
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
2553+
$(QUIET_GEN)$(SHELL_PATH) ./GIT-VERSION-GEN "$(shell pwd)" $< $@
25562554

25572555
git.res: git.rc GIT-PREFIX
25582556
$(QUIET_RC)$(RC) -i $< -o $@

0 commit comments

Comments
 (0)