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

[PATCH] Link git-shell only to a subset of libgit.a

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jul 18, 2008, 01:04 UTC
Message-ID
<1216343070-20237-1-git-send-email-s-beyer@gmx.net>
In-Reply-To
<20080718005814.GA4155@spearce.org>

Commit 5b8e6f85 introduced stubs for three functions that make no sense for git-shell. But those stubs defined libgit.a functions a second time so that a linker can complain.

Now git-shell is only linked to a subset of libgit.a.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
Hi Shawn,
does this compile on Solaris?
For Dmitry: this is even smaller, but not significant ;-)
Before:
  text    data     bss     dec     hex filename
 24798    1304    8232   34334    861e git-shell
After:
   text    data     bss     dec     hex filename
  24504    1264    8248   34016    84e0 git-shell

*hide&run* Stephan.

 Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 4bec4b3..a5626dc 100644
--- a/Makefile
+++ b/Makefile
@@ -1204,6 +1204,9 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 
+git-shell$X: compat/strlcpy.o abspath.o ctype.o exec_cmd.o quote.o strbuf.o usage.o wrapper.o shell.o
+	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^)
+
 $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
 $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
 builtin-revert.o wt-status.o: wt-status.h
-- 
1.5.6.3.390.g7b30
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 7 of 16 in “shrink git-shell by avoiding redundant dependencies”
  1. shrink git-shell by avoiding redundant dependenciesDmitry Potapov, Jun 27, 2008
  2. Junio C HamanoJun 27, 2008
  3. Dmitry PotapovJun 27, 2008
  4. Junio C HamanoJun 27, 2008
  5. Stephan BeyerJul 18, 2008
  6. Shawn O. PearceJul 18, 2008
  7. Link git-shell only to a subset of libgit.aStephan Beyer, Jul 18, 2008
  8. Shawn O. PearceJul 18, 2008
  9. Dmitry PotapovJul 18, 2008
  10. Johannes SchindelinJul 18, 2008
  11. Remove function stubs in shell.cStephan Beyer, Jul 18, 2008
  12. Dmitry PotapovJul 18, 2008
  13. Dmitry PotapovJul 18, 2008
  14. Johannes SchindelinJun 28, 2008
  15. Dmitry PotapovJun 28, 2008
  16. Johannes SchindelinJun 28, 2008

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.