Skip to content

Commit 85b964d

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 95e2131 + c62014d commit 85b964d

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
@@ -1687,11 +1687,17 @@ version.sp version.s version.o: EXTRA_CPPFLAGS = \
16871687
'-DGIT_VERSION="$(GIT_VERSION)"' \
16881688
'-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
16891689

1690+
ifeq (,$(BUILT_IN_WRAPPER))
16901691
$(BUILT_INS): git$X
16911692
$(QUIET_BUILT_IN)$(RM) $@ && \
16921693
ln $< $@ 2>/dev/null || \
16931694
ln -s $< $@ 2>/dev/null || \
16941695
cp $< $@
1696+
else
1697+
$(BUILT_INS): $(BUILT_IN_WRAPPER)
1698+
$(QUIET_BUILT_IN)$(RM) $@ && \
1699+
cp $< $@
1700+
endif
16951701

16961702
common-cmds.h: generate-cmdlist.perl command-list.txt
16971703

@@ -2256,6 +2262,24 @@ profile-install: profile
22562262
profile-fast-install: profile-fast
22572263
$(MAKE) install
22582264

2265+
ifeq (,$(BUILT_IN_WRAPPER))
2266+
LN_OR_CP_BUILT_IN_BINDIR = \
2267+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2268+
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2269+
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2270+
cp "$$bindir/git$X" "$$bindir/$$p" || exit;
2271+
LN_OR_CP_BUILT_IN_EXECDIR = \
2272+
test -z "$(NO_INSTALL_HARDLINKS)" && \
2273+
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2274+
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2275+
cp "$$execdir/git$X" "$$execdir/$$p" || exit;
2276+
else
2277+
LN_OR_CP_BUILT_IN_BINDIR = \
2278+
cp "$(BUILT_IN_WRAPPER)" "$$bindir/$$p" || exit;
2279+
LN_OR_CP_BUILT_IN_EXECDIR = \
2280+
cp "$(BUILT_IN_WRAPPER)" "$$execdir/$$p" || exit;
2281+
endif
2282+
22592283
install: all
22602284
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
22612285
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -2294,17 +2318,11 @@ endif
22942318
} && \
22952319
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
22962320
$(RM) "$$bindir/$$p" && \
2297-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2298-
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2299-
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2300-
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
2321+
$(LN_OR_CP_BUILT_IN_BINDIR) \
23012322
done && \
23022323
for p in $(BUILT_INS); do \
23032324
$(RM) "$$execdir/$$p" && \
2304-
test -z "$(NO_INSTALL_HARDLINKS)" && \
2305-
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2306-
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2307-
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
2325+
$(LN_OR_CP_BUILT_IN_EXECDIR) \
23082326
done && \
23092327
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
23102328
for p in $$remote_curl_aliases; do \

0 commit comments

Comments
 (0)