Skip to content

Commit ebfdd2c

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 8720831 + adf4eda commit ebfdd2c

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

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

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

@@ -2283,6 +2289,24 @@ profile-install: profile
22832289
profile-fast-install: profile-fast
22842290
$(MAKE) install
22852291

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

0 commit comments

Comments
 (0)