Skip to content

Commit c583a73

Browse files
committed
Merge branch 'js/no-builtins-on-disk-option' into seen
The installation procedure learned to optionally omit "git-foo" executable files for each 'foo' built-in subcommand, which are only required by old timers that still rely on the age old promise that prepending "git --exec-path" output to PATH early in their script will keep the "git-foo" calls they wrote working. The old attempt to remove these executables from the disk failed in the 1.6 era; it may be worth attempting again, but I think it is worth to keep this topic separate from such a policy change to help it graduate early. * js/no-builtins-on-disk-option: ci: stop linking built-ins to the dashed versions install: optionally skip linking/copying the built-ins msvc: copy the correct `.pdb` files in the Makefile target `install`
2 parents cea157b + e89800c commit c583a73

File tree

2 files changed

+40
-28
lines changed

2 files changed

+40
-28
lines changed

Makefile

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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
777780
ALL_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
780793
OTHER_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
20932106
ifneq (,$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';)
20952108
endif
20962109

20972110
all::
@@ -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)'
29342940
ifndef 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
29592965
endif
29602966
ifneq (,$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';)
29622968
endif
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),)
30843096
OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll)
30853097
endif
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)
31833195
ALL_COMMANDS += git
31843196
ALL_COMMANDS += git-citool
31853197
ALL_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; \

ci/run-build-and-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";;
1010
*) ln -s "$cache_dir/.prove" t/.prove;;
1111
esac
1212

13-
make
13+
make SKIP_DASHED_BUILT_INS=YesPlease
1414
case "$jobname" in
1515
linux-gcc)
1616
make test

0 commit comments

Comments
 (0)