git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/6] Always provide a fallback when hardlinks fail

From
Andreas Färber <andreas.faerber@web.de>
Date
Aug 17, 2008, 09:00 UTC
Message-ID
<0EFF470D-341A-4619-910A-0F9C663D0B51@web.de>

BFS does not support hardlinks, so suppress the resulting error messages.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Acked-by: Ingo Weinhold <ingo_weinhold@gmx.de>
Acked-by: Scott McCreary <scottmc2@gmail.com>
---
In one place cp was already used as fallback, so I went that route.
Personally I would also be okay with symlinks as alternative.
  Makefile |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 3daf9ac..7dc4bbd 100644
--- a/Makefile
+++ b/Makefile
@@ -1106,7 +1106,7 @@ help.o: help.c common-cmds.h GIT-CFLAGS
  		'-DGIT_INFO_PATH="$(infodir_SQ)"' $<

  $(BUILT_INS): git$X
-	$(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@
+	$(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@ 2>/dev/null || cp git$X $@

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

@@ -1373,10 +1373,10 @@ endif
  	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
  	if test "z$$bindir" != "z$$execdir"; \
  	then \
-		ln -f "$$bindir/git$X" "$$execdir/git$X" || \
+		ln -f "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
  		cp "$$bindir/git$X" "$$execdir/git$X"; \
  	fi && \
-	{ $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git 
$X" "$$execdir/$p" ;) } && \
+	{ $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git 
$X" "$$execdir/$p" 2>/dev/null || cp "$$execdir/git$X" "$$execdir/ 
$p" ;) } && \
  	if test "z$$bindir" != "z$$execdir"; \
  	then \
  		$(RM) "$$execdir/git$X"; \
-- 
1.6.0.rc3.32.g8aaa
Next: Junio C Hamano
Message 1 of 6 in “Always provide a fallback when hardlinks fail”
  1. 6/6 Always provide a fallback when hardlinks failAndreas Färber, Aug 17, 2008
  2. Junio C HamanoAug 17, 2008
  3. Andreas FärberAug 17, 2008
  4. Junio C HamanoAug 17, 2008
  5. Makefile: always provide a fallback when hardlinks failAndreas Färber, Aug 25, 2008
  6. Junio C HamanoAug 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.