Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 70de5e6

Browse files
committed
Makefile: NO_INSTALL_HARDLINKS
Your filesystem may support hardlinks, but you may choose not to use them when installing git-foo builtins and favor symblic links or copies for whatever reason. The installation procedure of git-gui/ directory is not touched with this patch and git-citool still ends up being a hardlink to git-gui, but it needs to be addressed separately. Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0f1ea6 commit 70de5e6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ all::
244244
# Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
245245
# programs as a tar, where bin/ and libexec/ might be on different file systems.
246246
#
247+
# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
248+
# copies to install built-in git commands e.g. git-cat-file.
249+
#
247250
# Define USE_NED_ALLOCATOR if you want to replace the platforms default
248251
# memory allocators with the nedmalloc allocator written by Niall Douglas.
249252
#
@@ -1777,6 +1780,10 @@ ifdef ASCIIDOC7
17771780
export ASCIIDOC7
17781781
endif
17791782

1783+
ifdef NO_INSTALL_HARDLINKS
1784+
export NO_INSTALL_HARDLINKS
1785+
endif
1786+
17801787
### profile feedback build
17811788
#
17821789

@@ -2482,26 +2489,29 @@ endif
24822489
{ test "$$bindir/" = "$$execdir/" || \
24832490
for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
24842491
$(RM) "$$execdir/$$p" && \
2485-
test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
2492+
test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
24862493
ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
24872494
cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
24882495
done; \
24892496
} && \
24902497
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
24912498
$(RM) "$$bindir/$$p" && \
2499+
test -z "$(NO_INSTALL_HARDLINKS)" && \
24922500
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
24932501
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
24942502
cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
24952503
done && \
24962504
for p in $(BUILT_INS); do \
24972505
$(RM) "$$execdir/$$p" && \
2506+
test -z "$(NO_INSTALL_HARDLINKS)" && \
24982507
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
24992508
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
25002509
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
25012510
done && \
25022511
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
25032512
for p in $$remote_curl_aliases; do \
25042513
$(RM) "$$execdir/$$p" && \
2514+
test -z "$(NO_INSTALL_HARDLINKS)" && \
25052515
ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
25062516
ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
25072517
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \

0 commit comments

Comments
 (0)