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

[PATCH 1/2] Makefile: link builtins residing in bin directory to main git binary too

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jul 23, 2010, 17:50 UTC
Message-ID
<taBDPvzBKDsn4R3mVCPIS8b7DATXdlBe-WqMByA8COCjNJVZsuTq4cKE-C0wPs_pTG1B23aAVpU@cipher.nrlssc.navy.mil>
In-Reply-To
<taBDPvzBKDtgdmYKlcbFJ_fQRnY4jBMR74BF1vetbRU3OZRMPpwtU0wTG1SSa0hFgNsCN5k9Qx8@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>

To conserve space/improve file caching we try to make hard or symbolic links from each builtin program to the main git executable rather than having each be a complete duplicate copy of it. We weren't doing this for the builtin programs residing in the bin directory though. So, let's do so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 Makefile |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index bc3c570..d725c15 100644
--- a/Makefile
+++ b/Makefile
@@ -2079,6 +2079,12 @@ endif
 		test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
 		ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
 		cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
+	for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
+		$(RM) "$$bindir/$$p" && \
+		ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
+		ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
+		cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
+	done && \
 	for p in $(BUILT_INS); do \
 		$(RM) "$$execdir/$$p" && \
 		ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
-- 
1.7.2
Previous: Brandon CaseyNext: Brandon Casey
Message 2 of 6 in “make git installation footprint smaller”
  1. 0/2 make git installation footprint smallerBrandon Casey, Jul 23, 2010
  2. 1/2 Makefile: link builtins residing in bin directory to main git binary tooBrandon Casey, Jul 23, 2010
  3. 2/2 Makefile: make hard/symbolic links for non-builtins tooBrandon Casey, Jul 23, 2010
  4. A Large Angry SCMJul 23, 2010
  5. Brandon CaseyJul 23, 2010
  6. Jonathan NiederJul 24, 2010

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.