@@ -341,6 +341,7 @@ PROGRAMS =
341341SCRIPT_PERL =
342342SCRIPT_PYTHON =
343343SCRIPT_SH =
344+ SCRIPT_LIB =
344345TEST_PROGRAMS =
345346
346347SCRIPT_SH += git-am.sh
@@ -352,20 +353,21 @@ SCRIPT_SH += git-merge-octopus.sh
352353SCRIPT_SH += git-merge-one-file.sh
353354SCRIPT_SH += git-merge-resolve.sh
354355SCRIPT_SH += git-mergetool.sh
355- SCRIPT_SH += git-mergetool--lib.sh
356356SCRIPT_SH += git-notes.sh
357- SCRIPT_SH += git-parse-remote.sh
358357SCRIPT_SH += git-pull.sh
359358SCRIPT_SH += git-quiltimport.sh
360359SCRIPT_SH += git-rebase--interactive.sh
361360SCRIPT_SH += git-rebase.sh
362361SCRIPT_SH += git-repack.sh
363362SCRIPT_SH += git-request-pull.sh
364- SCRIPT_SH += git-sh-setup.sh
365363SCRIPT_SH += git-stash.sh
366364SCRIPT_SH += git-submodule.sh
367365SCRIPT_SH += git-web--browse.sh
368366
367+ SCRIPT_LIB += git-mergetool--lib
368+ SCRIPT_LIB += git-parse-remote
369+ SCRIPT_LIB += git-sh-setup
370+
369371SCRIPT_PERL += git-add--interactive.perl
370372SCRIPT_PERL += git-difftool.perl
371373SCRIPT_PERL += git-archimport.perl
@@ -1454,7 +1456,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
14541456
14551457SHELL = $(SHELL_PATH )
14561458
1457- all :: shell_compatibility_test $(ALL_PROGRAMS ) $(BUILT_INS ) $(OTHER_PROGRAMS ) GIT-BUILD-OPTIONS
1459+ all :: shell_compatibility_test $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS ) $(OTHER_PROGRAMS ) GIT-BUILD-OPTIONS
14581460ifneq (,$X)
14591461 $(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';)
14601462endif
@@ -1505,17 +1507,25 @@ common-cmds.h: ./generate-cmdlist.sh command-list.txt
15051507common-cmds.h : $(wildcard Documentation/git-* .txt)
15061508 $(QUIET_GEN ) ./generate-cmdlist.sh > $@ + && mv $@ + $@
15071509
1510+ define cmd_munge_script
1511+ $(RM ) $@ $@ + && \
1512+ sed -e '1s|# !.*/sh|#!$(SHELL_PATH_SQ)|' \
1513+ -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1514+ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1515+ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1516+ -e $(BROKEN_PATH_FIX) \
1517+ $@.sh >$@+
1518+ endef
1519+
15081520$(patsubst % .sh,% ,$(SCRIPT_SH ) ) : % : % .sh
1509- $(QUIET_GEN )$(RM ) $@ $@ + && \
1510- sed -e ' 1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1511- -e ' s|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1512- -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1513- -e ' s/@@NO_CURL@@/$(NO_CURL)/g' \
1514- -e $(BROKEN_PATH_FIX ) \
1515- $@ .sh > $@ + && \
1521+ $(QUIET_GEN )$(cmd_munge_script ) && \
15161522 chmod +x $@ + && \
15171523 mv $@ + $@
15181524
1525+ $(SCRIPT_LIB ) : % : % .sh
1526+ $(QUIET_GEN )$(cmd_munge_script ) && \
1527+ mv $@ + $@
1528+
15191529ifndef NO_PERL
15201530$(patsubst % .perl,% ,$(SCRIPT_PERL ) ) : perl/perl.mak
15211531
@@ -1866,6 +1876,7 @@ install: all
18661876 $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(bindir_SQ)'
18671877 $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(gitexec_instdir_SQ)'
18681878 $(INSTALL ) $(ALL_PROGRAMS ) ' $(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1879+ $(INSTALL ) -m 644 $(SCRIPT_LIB ) ' $(DESTDIR_SQ)$(gitexec_instdir_SQ)'
18691880 $(INSTALL ) $(install_bindir_programs ) ' $(DESTDIR_SQ)$(bindir_SQ)'
18701881 $(MAKE ) -C templates DESTDIR=' $(DESTDIR_SQ)' install
18711882ifndef NO_PERL
@@ -1985,7 +1996,7 @@ distclean: clean
19851996clean :
19861997 $(RM ) * .o block-sha1/* .o ppc/* .o compat/* .o compat/* /* .o xdiff/* .o \
19871998 $(LIB_FILE ) $(XDIFF_LIB )
1988- $(RM ) $(ALL_PROGRAMS ) $(BUILT_INS ) git$X
1999+ $(RM ) $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS ) git$X
19892000 $(RM ) $(TEST_PROGRAMS )
19902001 $(RM ) -r bin-wrappers
19912002 $(RM ) * .spec * .pyc * .pyo * /* .pyc * /* .pyo common-cmds.h TAGS tags cscope*
@@ -2017,7 +2028,7 @@ endif
20172028# ## Check documentation
20182029#
20192030check-docs ::
2020- @ (for v in $( ALL_PROGRAMS) $( BUILT_INS) git gitk; \
2031+ @ (for v in $( ALL_PROGRAMS) $( SCRIPT_LIB ) $( BUILT_INS) git gitk; \
20212032 do \
20222033 case " $$ v" in \
20232034 git-merge-octopus | git-merge-ours | git-merge-recursive | \
@@ -2060,9 +2071,12 @@ check-docs::
20602071 documented,gitrepository-layout | \
20612072 documented,gittutorial | \
20622073 documented,gittutorial-2 | \
2074+ documented,git-bisect-lk2009 | \
2075+ documented.git-remote-helpers | \
2076+ documented,gitworkflows | \
20632077 sentinel,not,matching,is,ok ) continue ;; \
20642078 esac ; \
2065- case " $( ALL_PROGRAMS) $( BUILT_INS) git gitk " in \
2079+ case " $( ALL_PROGRAMS) $( SCRIPT_LIB ) $( BUILT_INS) git gitk " in \
20662080 * " $$ cmd " * ) ;; \
20672081 * ) echo " removed but $$ how: $$ cmd" ;; \
20682082 esac ; \
0 commit comments