From: Andreas Färber Date: Sun, 17 Aug 2008 12:14:42 GMT Subject: Re: [PATCH 6/6] Always provide a fallback when hardlinks fail Message-ID: <06F58415-2F22-44BE-8F19-70460DDF7F35@web.de> In-Reply-To: <7vljyv6gyo.fsf@gitster.siamese.dyndns.org> Am 17.08.2008 um 13:03 schrieb Junio C Hamano: > Andreas Färber writes: > >> BFS does not support hardlinks, so suppress the resulting error >> messages. > > Hmm, this is not specific to BFS. I would have preferred if you > brought > up much earlier. Right, it isn't. Do you mean earlier in time, or would you like me to reorder it in my v2 series? > diff --git a/Makefile b/Makefile > index 53ab4b5..53112bb 100644 > --- a/Makefile > +++ b/Makefile > @@ -1098,7 +1098,10 @@ 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 || \ > + ln -s git$X $@ 2>/dev/null || \ > + cp git$X $@ > > common-cmds.h: ./generate-cmdlist.sh command-list.txt > > @@ -1365,10 +1368,12 @@ endif > execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ > if test "z$$bindir" != "z$$execdir"; \ > then \ > - ln -f "$$bindir/git$X" "$$execdir/git$X" || \ > - cp "$$bindir/git$X" "$$execdir/git$X"; \ > + $(RM) "$$execdir/git$X" && \ > + ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \ > + ln -s "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \ > + cp "$$bindir/git$X" "$$execdir/git$X" || exit; \ > 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" || exit;) } && \ > if test "z$$bindir" != "z$$execdir"; \ > then \ > $(RM) "$$execdir/git$X"; \ Looks fine, I'll test it together with the other changes. Andreas