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

[PATCH] Install built-ins as symlinks

From
Alp Toker <alp@atoker.com>
Date
Jul 11, 2006, 10:19 UTC
Message-ID
<11526131792377-git-send-email-alp@atoker.com>
In-Reply-To
<11526131792773-git-send-email-alp@atoker.com>

Doing this now will save headache in the long run, avoiding mismatched versions of installed utilities and dangling copies of removed or renamed git commands that still appear to work. It also makes screwups when packaging git or making system backups less likely.

BusyBox has been doing it this way for years.
Signed-off-by: Alp Toker <alp@atoker.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 5b7bac8..cb5a5cc 100644
--- a/Makefile
+++ b/Makefile
@@ -538,7 +538,7 @@ git$X: git.c common-cmds.h $(BUILTIN_OBJ
 builtin-help.o: common-cmds.h
 
 $(BUILT_INS): git$X
-	rm -f $@ && ln git$X $@
+	ln -sf git$X $@
 
 common-cmds.h: Documentation/git-*.txt
 	./generate-cmdlist.sh > $@+
@@ -748,7 +748,7 @@ install: all
 		cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
 	fi
-	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+	$(foreach p,$(BUILT_INS), ln -sf 'git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
 
 install-doc:
 	$(MAKE) -C Documentation install
-- 
1.4.1.g97c7-dirty
Previous: Alp TokerNext: Andreas Ericsson
Message 6 of 17 in “Typo fix”
  1. Typo fixAlp Toker, Jul 11, 2006
  2. gitweb: Send XHTML as 'application/xhtml+xml' where possibleAlp Toker, Jul 11, 2006
  3. gitweb: Include a site name in page titlesAlp Toker, Jul 11, 2006
  4. gitweb: Use the git binary in the search path by defaultAlp Toker, Jul 11, 2006
  5. git-send-email: Remove redundant Reply-To headerAlp Toker, Jul 11, 2006
  6. Install built-ins as symlinksAlp Toker, Jul 11, 2006
  7. Andreas EricssonJul 11, 2006
  8. Johannes SchindelinJul 11, 2006
  9. Alp TokerJul 11, 2006
  10. Johannes SchindelinJul 11, 2006
  11. Petr BaudisJul 11, 2006
  12. Alex RiesenJul 12, 2006
  13. Petr BaudisJul 11, 2006
  14. Junio C HamanoJul 11, 2006
  15. Martin LanghoffJul 11, 2006
  16. Junio C HamanoJul 11, 2006
  17. Pavel RoskinJul 11, 2006

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.