{"thread":{"id":"8784","subject":"[PATCH] Makefile: USE_SYMLINK option","startedAt":"2007-06-30T18:14:56Z","lastAt":"2007-06-30T18:46:52Z","messageCount":2,"participants":["Matthias Lederhofer","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46110","messageId":"20070630181456.GA15035@moooo.ath.cx","threadId":"8784","inReplyTo":null,"subject":"[PATCH] Makefile: USE_SYMLINK option","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-06-30T18:14:56Z","receivedAt":"2007-06-30T18:14:56Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"When USE_SYMLINK is defined symlinks will be used instead of hardlinks.\n\nSigned-off-by: Matthias Lederhofer <matled@gmx.net>\n---\nI found no real drawback using symlinks and symlinks are sometimes\nmore practical, for example when copying/creating a tarball of the\ninstallation.\n---\n Makefile |   17 +++++++++++++----\n 1 files changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 4ea5e45..db0b818 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -181,6 +181,11 @@ INSTALL = install\n RPMBUILD = rpmbuild\n TCL_PATH = tclsh\n TCLTK_PATH = wish\n+ifdef USE_SYMLINK\n+LN = ln -s\n+else\n+LN = ln\n+endif\n \n export TCL_PATH TCLTK_PATH\n \n@@ -759,10 +764,10 @@ git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)\n help.o: common-cmds.h\n \n git-merge-subtree$X: git-merge-recursive$X\n-\t$(QUIET_BUILT_IN)rm -f $@ && ln git-merge-recursive$X $@\n+\t$(QUIET_BUILT_IN)rm -f $@ && $(LN) git-merge-recursive$X $@\n \n $(BUILT_INS): git$X\n-\t$(QUIET_BUILT_IN)rm -f $@ && ln git$X $@\n+\t$(QUIET_BUILT_IN)rm -f $@ && $(LN) git$X $@\n \n common-cmds.h: ./generate-cmdlist.sh\n \n@@ -1004,12 +1009,16 @@ ifndef NO_TCLTK\n endif\n \tif test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \\\n \tthen \\\n-\t\tln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \\\n+\t\t$(LN) -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \\\n \t\t\t'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \\\n \t\tcp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \\\n \t\t\t'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \\\n \tfi\n-\t$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)\n+ifdef USE_SYMLINK\n+\t$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && $(LN) 'git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)\n+else\n+\t$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && $(LN) '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)\n+endif\n ifneq (,$X)\n \t$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)\n endif\n-- \n1.5.0.3\n"},{"id":"46116","messageId":"7v7iplcmar.fsf@assigned-by-dhcp.cox.net","threadId":"8784","inReplyTo":"20070630181456.GA15035@moooo.ath.cx","subject":"Re: [PATCH] Makefile: USE_SYMLINK option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-30T18:46:52Z","receivedAt":"2007-06-30T18:46:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Lederhofer <matled@gmx.net> writes:\n\n> I found no real drawback using symlinks and symlinks are sometimes\n> more practical, for example when copying/creating a tarball of the\n> installation.\n\nWell, tar handles hard links just fine, thanks.  The real\ndrawbacks of doing symlinks people often cite (and I agree to)\nare that they can become dangling, and they consume i-nodes.\n"}]}