Skip to content

Commit 6ea0e67

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 adfa6cf + 5e404f5 commit 6ea0e67

File tree

3 files changed

+540
-8
lines changed

3 files changed

+540
-8
lines changed

Makefile

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

1727+
ifeq (,$(BUILT_IN_WRAPPER))
17271728
$(BUILT_INS): git$X
17281729
$(QUIET_BUILT_IN)$(RM) $@ && \
17291730
ln $< $@ 2>/dev/null || \
17301731
ln -s $< $@ 2>/dev/null || \
17311732
cp $< $@
1733+
else
1734+
$(BUILT_INS): $(BUILT_IN_WRAPPER)
1735+
$(QUIET_BUILT_IN)$(RM) $@ && \
1736+
cp $< $@
1737+
endif
17321738

17331739
common-cmds.h: generate-cmdlist.sh command-list.txt
17341740

@@ -2297,6 +2303,24 @@ profile-install: profile
22972303
profile-fast-install: profile-fast
22982304
$(MAKE) install
22992305

2306+
ifeq (,$(BUILT_IN_WRAPPER))
2307+
LN_OR_CP_BUILT_IN_BINDIR = \
2308+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2309+
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2310+
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2311+
cp "$$bindir/git$X" "$$bindir/$$p" || exit;
2312+
LN_OR_CP_BUILT_IN_EXECDIR = \
2313+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2314+
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2315+
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2316+
cp "$$execdir/git$X" "$$execdir/$$p" || exit;
2317+
else
2318+
LN_OR_CP_BUILT_IN_BINDIR = \
2319+
cp "$(BUILT_IN_WRAPPER)" "$$bindir/$$p" || exit;
2320+
LN_OR_CP_BUILT_IN_EXECDIR = \
2321+
cp "$(BUILT_IN_WRAPPER)" "$$execdir/$$p" || exit;
2322+
endif
2323+
23002324
install: all
23012325
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
23022326
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -2335,17 +2359,11 @@ endif
23352359
} && \
23362360
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
23372361
$(RM) "$$bindir/$$p" && \
2338-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2339-
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2340-
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2341-
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
2362+
$(LN_OR_CP_BUILT_IN_BINDIR) \
23422363
done && \
23432364
for p in $(BUILT_INS); do \
23442365
$(RM) "$$execdir/$$p" && \
2345-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2346-
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2347-
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2348-
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
2366+
$(LN_OR_CP_BUILT_IN_EXECDIR) \
23492367
done && \
23502368
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
23512369
for p in $$remote_curl_aliases; do \

0 commit comments

Comments
 (0)