Skip to content

Commit d5da08a

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 d052e28 + c8715a7 commit d5da08a

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
@@ -1732,11 +1732,17 @@ version.sp version.s version.o: EXTRA_CPPFLAGS = \
17321732
'-DGIT_VERSION="$(GIT_VERSION)"' \
17331733
'-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
17341734

1735+
ifeq (,$(BUILT_IN_WRAPPER))
17351736
$(BUILT_INS): git$X
17361737
$(QUIET_BUILT_IN)$(RM) $@ && \
17371738
ln $< $@ 2>/dev/null || \
17381739
ln -s $< $@ 2>/dev/null || \
17391740
cp $< $@
1741+
else
1742+
$(BUILT_INS): $(BUILT_IN_WRAPPER)
1743+
$(QUIET_BUILT_IN)$(RM) $@ && \
1744+
cp $< $@
1745+
endif
17401746

17411747
common-cmds.h: generate-cmdlist.sh command-list.txt
17421748

@@ -2303,6 +2309,24 @@ profile-install: profile
23032309
profile-fast-install: profile-fast
23042310
$(MAKE) install
23052311

2312+
ifeq (,$(BUILT_IN_WRAPPER))
2313+
LN_OR_CP_BUILT_IN_BINDIR = \
2314+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2315+
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2316+
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2317+
cp "$$bindir/git$X" "$$bindir/$$p" || exit;
2318+
LN_OR_CP_BUILT_IN_EXECDIR = \
2319+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2320+
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2321+
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2322+
cp "$$execdir/git$X" "$$execdir/$$p" || exit;
2323+
else
2324+
LN_OR_CP_BUILT_IN_BINDIR = \
2325+
cp "$(BUILT_IN_WRAPPER)" "$$bindir/$$p" || exit;
2326+
LN_OR_CP_BUILT_IN_EXECDIR = \
2327+
cp "$(BUILT_IN_WRAPPER)" "$$execdir/$$p" || exit;
2328+
endif
2329+
23062330
install: all
23072331
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
23082332
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -2341,17 +2365,11 @@ endif
23412365
} && \
23422366
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
23432367
$(RM) "$$bindir/$$p" && \
2344-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2345-
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2346-
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2347-
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
2368+
$(LN_OR_CP_BUILT_IN_BINDIR) \
23482369
done && \
23492370
for p in $(BUILT_INS); do \
23502371
$(RM) "$$execdir/$$p" && \
2351-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2352-
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2353-
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2354-
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
2372+
$(LN_OR_CP_BUILT_IN_EXECDIR) \
23552373
done && \
23562374
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
23572375
for p in $$remote_curl_aliases; do \

0 commit comments

Comments
 (0)