Skip to content

Commit 1776aa9

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 773aa4a + d637186 commit 1776aa9

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
@@ -1715,11 +1715,17 @@ version.sp version.s version.o: EXTRA_CPPFLAGS = \
17151715
'-DGIT_VERSION="$(GIT_VERSION)"' \
17161716
'-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
17171717

1718+
ifeq (,$(BUILT_IN_WRAPPER))
17181719
$(BUILT_INS): git$X
17191720
$(QUIET_BUILT_IN)$(RM) $@ && \
17201721
ln $< $@ 2>/dev/null || \
17211722
ln -s $< $@ 2>/dev/null || \
17221723
cp $< $@
1724+
else
1725+
$(BUILT_INS): $(BUILT_IN_WRAPPER)
1726+
$(QUIET_BUILT_IN)$(RM) $@ && \
1727+
cp $< $@
1728+
endif
17231729

17241730
common-cmds.h: generate-cmdlist.sh command-list.txt
17251731

@@ -2284,6 +2290,24 @@ profile-install: profile
22842290
profile-fast-install: profile-fast
22852291
$(MAKE) install
22862292

2293+
ifeq (,$(BUILT_IN_WRAPPER))
2294+
LN_OR_CP_BUILT_IN_BINDIR = \
2295+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2296+
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2297+
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2298+
cp "$$bindir/git$X" "$$bindir/$$p" || exit;
2299+
LN_OR_CP_BUILT_IN_EXECDIR = \
2300+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2301+
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2302+
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2303+
cp "$$execdir/git$X" "$$execdir/$$p" || exit;
2304+
else
2305+
LN_OR_CP_BUILT_IN_BINDIR = \
2306+
cp "$(BUILT_IN_WRAPPER)" "$$bindir/$$p" || exit;
2307+
LN_OR_CP_BUILT_IN_EXECDIR = \
2308+
cp "$(BUILT_IN_WRAPPER)" "$$execdir/$$p" || exit;
2309+
endif
2310+
22872311
install: all
22882312
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
22892313
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -2322,17 +2346,11 @@ endif
23222346
} && \
23232347
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
23242348
$(RM) "$$bindir/$$p" && \
2325-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2326-
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2327-
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2328-
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
2349+
$(LN_OR_CP_BUILT_IN_BINDIR) \
23292350
done && \
23302351
for p in $(BUILT_INS); do \
23312352
$(RM) "$$execdir/$$p" && \
2332-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2333-
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2334-
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2335-
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
2353+
$(LN_OR_CP_BUILT_IN_EXECDIR) \
23362354
done && \
23372355
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
23382356
for p in $$remote_curl_aliases; do \

0 commit comments

Comments
 (0)