Skip to content

Commit f0571f8

Browse files
committed
Merge 'git-wrapper' into HEAD
Use msysGit's `git-wrapper` instead of the builtins. This works around two issues: - when the file system does not allow hard links, we would waste over 800 megabyte by having 109 copies of a multi-megabyte executable - even when the file system allows hard links, the Windows Explorer counts the disk usage as if it did not. Many users complained about Git for Windows using too much space (when it actually did not). We can easily avoid those user complaints by merging this branch. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 0125021 + 17a17d8 commit f0571f8

File tree

3 files changed

+538
-8
lines changed

3 files changed

+538
-8
lines changed

Makefile

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,11 +1691,17 @@ version.sp version.s version.o: EXTRA_CPPFLAGS = \
16911691
'-DGIT_VERSION="$(GIT_VERSION)"' \
16921692
'-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
16931693

1694+
ifeq (,$(BUILT_IN_WRAPPER))
16941695
$(BUILT_INS): git$X
16951696
$(QUIET_BUILT_IN)$(RM) $@ && \
16961697
ln $< $@ 2>/dev/null || \
16971698
ln -s $< $@ 2>/dev/null || \
16981699
cp $< $@
1700+
else
1701+
$(BUILT_INS): $(BUILT_IN_WRAPPER)
1702+
$(QUIET_BUILT_IN)$(RM) $@ && \
1703+
cp $< $@
1704+
endif
16991705

17001706
common-cmds.h: generate-cmdlist.sh command-list.txt
17011707

@@ -2260,6 +2266,24 @@ profile-install: profile
22602266
profile-fast-install: profile-fast
22612267
$(MAKE) install
22622268

2269+
ifeq (,$(BUILT_IN_WRAPPER))
2270+
LN_OR_CP_BUILT_IN_BINDIR = \
2271+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2272+
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2273+
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2274+
cp "$$bindir/git$X" "$$bindir/$$p" || exit;
2275+
LN_OR_CP_BUILT_IN_EXECDIR = \
2276+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2277+
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2278+
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2279+
cp "$$execdir/git$X" "$$execdir/$$p" || exit;
2280+
else
2281+
LN_OR_CP_BUILT_IN_BINDIR = \
2282+
cp "$(BUILT_IN_WRAPPER)" "$$bindir/$$p" || exit;
2283+
LN_OR_CP_BUILT_IN_EXECDIR = \
2284+
cp "$(BUILT_IN_WRAPPER)" "$$execdir/$$p" || exit;
2285+
endif
2286+
22632287
install: all
22642288
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
22652289
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -2298,17 +2322,11 @@ endif
22982322
} && \
22992323
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
23002324
$(RM) "$$bindir/$$p" && \
2301-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2302-
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2303-
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2304-
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
2325+
$(LN_OR_CP_BUILT_IN_BINDIR) \
23052326
done && \
23062327
for p in $(BUILT_INS); do \
23072328
$(RM) "$$execdir/$$p" && \
2308-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2309-
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2310-
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2311-
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
2329+
$(LN_OR_CP_BUILT_IN_EXECDIR) \
23122330
done && \
23132331
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
23142332
for p in $$remote_curl_aliases; do \

0 commit comments

Comments
 (0)