@@ -348,6 +348,9 @@ all::
348348# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
349349# copies to install built-in git commands e.g. git-cat-file.
350350#
351+ # Define SKIP_DASHED_BUILT_INS if you do not need the dashed versions of the
352+ # built-ins to be linked/copied at all.
353+ #
351354# Define USE_NED_ALLOCATOR if you want to replace the platforms default
352355# memory allocators with the nedmalloc allocator written by Niall Douglas.
353356#
@@ -775,6 +778,16 @@ BUILT_INS += git-whatchanged$X
775778# what 'all' will build and 'install' will install in gitexecdir,
776779# excluding programs for built-in commands
777780ALL_PROGRAMS = $(PROGRAMS ) $(SCRIPTS )
781+ ALL_COMMANDS_TO_INSTALL = $(ALL_PROGRAMS )
782+ ifeq (,$(SKIP_DASHED_BUILT_INS ) )
783+ ALL_COMMANDS_TO_INSTALL += $(BUILT_INS )
784+ else
785+ # git-upload-pack, git-receive-pack and git-upload-archive are special: they
786+ # are _expected_ to be present in the `bin/` directory in their dashed form.
787+ ALL_COMMANDS_TO_INSTALL += git-receive-pack$(X )
788+ ALL_COMMANDS_TO_INSTALL += git-upload-archive$(X )
789+ ALL_COMMANDS_TO_INSTALL += git-upload-pack$(X )
790+ endif
778791
779792# what 'all' will build but not install in gitexecdir
780793OTHER_PROGRAMS = git$X
@@ -2089,9 +2102,9 @@ profile-fast: profile-clean
20892102 $(MAKE ) PROFILE=USE all
20902103
20912104
2092- all :: $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS ) $(OTHER_PROGRAMS ) GIT-BUILD-OPTIONS
2105+ all :: $(ALL_COMMANDS_TO_INSTALL ) $(SCRIPT_LIB ) $(OTHER_PROGRAMS ) GIT-BUILD-OPTIONS
20932106ifneq (,$X)
2094- $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS ) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
2107+ $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL ) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
20952108endif
20962109
20972110all ::
@@ -2922,15 +2935,8 @@ ifdef MSVC
29222935 # have already been rolled up into the exe's pdb file.
29232936 # We DO NOT have pdb files for the builtin commands (like git-status.exe)
29242937 # because it is just a copy/hardlink of git.exe, rather than a unique binary.
2925- $(INSTALL) git.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
2926- $(INSTALL) git-shell.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
2927- $(INSTALL) git-daemon.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2928- $(INSTALL) git-http-backend.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2929- $(INSTALL) git-http-fetch.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2930- $(INSTALL) git-http-push.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2931- $(INSTALL) git-imap-send.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2932- $(INSTALL) git-remote-http.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2933- $(INSTALL) git-sh-i18n--envsubst.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2938+ $(INSTALL) $(patsubst %.exe,%.pdb,$(filter-out $(BUILT_INS),$(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)))) '$(DESTDIR_SQ)$(bindir_SQ)'
2939+ $(INSTALL) $(patsubst %.exe,%.pdb,$(filter-out $(BUILT_INS) $(REMOTE_CURL_ALIASES),$(PROGRAMS))) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
29342940ifndef DEBUG
29352941 $(INSTALL) $(vcpkg_rel_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
29362942 $(INSTALL) $(vcpkg_rel_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
@@ -2958,7 +2964,7 @@ ifndef NO_TCLTK
29582964 $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
29592965endif
29602966ifneq (,$X)
2961- $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS ) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
2967+ $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL ) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
29622968endif
29632969
29642970 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
@@ -2976,21 +2982,27 @@ endif
29762982 } && \
29772983 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
29782984 $(RM) "$$bindir/$$p" && \
2979- test -n "$(INSTALL_SYMLINKS)" && \
2980- ln -s "git$X" "$$bindir/$$p" || \
2981- { test -z "$(NO_INSTALL_HARDLINKS)" && \
2982- ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2983- ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2984- cp "$$bindir/git$X" "$$bindir/$$p" || exit; } \
2985+ if test -z "$(SKIP_DASHED_BUILT_INS)"; \
2986+ then \
2987+ test -n "$(INSTALL_SYMLINKS)" && \
2988+ ln -s "git$X" "$$bindir/$$p" || \
2989+ { test -z "$(NO_INSTALL_HARDLINKS)" && \
2990+ ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2991+ ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2992+ cp "$$bindir/git$X" "$$bindir/$$p" || exit; }; \
2993+ fi \
29852994 done && \
29862995 for p in $(BUILT_INS); do \
29872996 $(RM) "$$execdir/$$p" && \
2988- test -n "$(INSTALL_SYMLINKS)" && \
2989- ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \
2990- { test -z "$(NO_INSTALL_HARDLINKS)" && \
2991- ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2992- ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2993- cp "$$execdir/git$X" "$$execdir/$$p" || exit; } \
2997+ if test -z "$(SKIP_DASHED_BUILT_INS)"; \
2998+ then \
2999+ test -n "$(INSTALL_SYMLINKS)" && \
3000+ ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \
3001+ { test -z "$(NO_INSTALL_HARDLINKS)" && \
3002+ ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
3003+ ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
3004+ cp "$$execdir/git$X" "$$execdir/$$p" || exit; }; \
3005+ fi \
29943006 done && \
29953007 remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
29963008 for p in $$remote_curl_aliases; do \
@@ -3084,7 +3096,7 @@ ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),)
30843096OTHER_PROGRAMS += $(shell echo * .dll t/helper/* .dll)
30853097endif
30863098
3087- artifacts-tar :: $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS ) $(OTHER_PROGRAMS ) \
3099+ artifacts-tar :: $(ALL_COMMANDS_TO_INSTALL ) $(SCRIPT_LIB ) $(OTHER_PROGRAMS ) \
30883100 GIT-BUILD-OPTIONS $(TEST_PROGRAMS ) $(test_bindir_programs ) \
30893101 $(MOFILES )
30903102 $(QUIET_SUBDIR0 ) templates $(QUIET_SUBDIR1 ) \
@@ -3179,7 +3191,7 @@ endif
31793191
31803192# ## Check documentation
31813193#
3182- ALL_COMMANDS = $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS )
3194+ ALL_COMMANDS = $(ALL_COMMANDS_TO_INSTALL ) $(SCRIPT_LIB )
31833195ALL_COMMANDS += git
31843196ALL_COMMANDS += git-citool
31853197ALL_COMMANDS += git-gui
@@ -3219,7 +3231,7 @@ check-docs::
32193231 -e ' s/\.txt//' ; \
32203232 ) | while read how cmd; \
32213233 do \
3222- case " $( patsubst %$X ,%,$( ALL_COMMANDS) $( EXCLUDED_PROGRAMS) ) " in \
3234+ case " $( patsubst %$X ,%,$( ALL_COMMANDS) $( BUILT_INS ) $( EXCLUDED_PROGRAMS) ) " in \
32233235 * " $$ cmd " * ) ;; \
32243236 * ) echo " removed but $$ how: $$ cmd" ;; \
32253237 esac ; \
0 commit comments