{"thread":{"id":"30399","subject":"[PATCH] Makefile: NO_INSTALL_HARDLINKS","startedAt":"2012-05-02T22:12:10Z","lastAt":"2012-05-02T22:12:10Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"190600","messageId":"7vmx5qgrlx.fsf@alter.siamese.dyndns.org","threadId":"30399","inReplyTo":null,"subject":"[PATCH] Makefile: NO_INSTALL_HARDLINKS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-02T22:12:10Z","receivedAt":"2012-05-02T22:12:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Your filesystem may support hardlinks, but you may choose not to use them\nwhen installing git-foo builtins and favor symblic links or copies for\nwhatever reason.\n\nThe installation procedure of git-gui/ directory is not touched with this\npatch and git-citool still ends up being a hardlink to git-gui, but it\nneeds to be addressed separately.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\ndiff --git a/Makefile b/Makefile\nindex e4f8e0e..05d34b3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -244,6 +244,9 @@ all::\n # Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed\n # programs as a tar, where bin/ and libexec/ might be on different file systems.\n #\n+# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or\n+# copies to install built-in git commands e.g. git-cat-file.\n+#\n # Define USE_NED_ALLOCATOR if you want to replace the platforms default\n # memory allocators with the nedmalloc allocator written by Niall Douglas.\n #\n@@ -2482,19 +2485,21 @@ endif\n \t{ test \"$$bindir/\" = \"$$execdir/\" || \\\n \t  for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n-\t\ttest -z \"$(NO_CROSS_DIRECTORY_HARDLINKS)\" && \\\n+\t\ttest -z \"$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)\" && \\\n \t\tln \"$$bindir/$$p\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$bindir/$$p\" \"$$execdir/$$p\" || exit; \\\n \t  done; \\\n \t} && \\\n \tfor p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \\\n \t\t$(RM) \"$$bindir/$$p\" && \\\n+\t\ttest -z \"$(NO_INSTALL_HARDLINKS)\" && \\\n \t\tln \"$$bindir/git$X\" \"$$bindir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git$X\" \"$$bindir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$bindir/git$X\" \"$$bindir/$$p\" || exit; \\\n \tdone && \\\n \tfor p in $(BUILT_INS); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n+\t\ttest -z \"$(NO_INSTALL_HARDLINKS)\" && \\\n \t\tln \"$$execdir/git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git$X\" \"$$execdir/$$p\" || exit; \\\n@@ -2502,6 +2507,7 @@ endif\n \tremote_curl_aliases=\"$(REMOTE_CURL_ALIASES)\" && \\\n \tfor p in $$remote_curl_aliases; do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n+\t\ttest -z \"$(NO_INSTALL_HARDLINKS)\" && \\\n \t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" || exit; \\\n"}]}