{"thread":{"id":"15068","subject":"[PATCH] add definitions for global variables to shell.c","startedAt":"2008-08-18T12:37:27Z","lastAt":"2008-08-20T06:54:14Z","messageCount":13,"participants":["Robert Schiele","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"87534","messageId":"20080818123727.GB11842@schiele.dyndns.org","threadId":"15068","inReplyTo":null,"subject":"[PATCH] add definitions for global variables to shell.c","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-18T12:37:27Z","receivedAt":"2008-08-18T12:37:27Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"Commit 5b8e6f85 introduced stubs for three functions that make no sense\nfor git-shell.  But those stubs defined libgit.a functions a second time\nso that a linker can complain.  While commit 78568448 fixes this problem\nit introduces a new issue on the affected systems: Some versions of the\nSun compiler generate references to global variables when they see\nextern declarations for those, even when they are never used in the\ncode.\n\nThis patch does a similar workaround for this problem as commit 5b8e6f85\ndid for the functions.\n\nSigned-off-by: Robert Schiele <rschiele@gmail.com>\n---\n shell.c |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/shell.c b/shell.c\nindex 6a48de0..8902ea5 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -3,12 +3,17 @@\n #include \"exec_cmd.h\"\n #include \"strbuf.h\"\n \n-/* Stubs for functions that make no sense for git-shell. These stubs\n- * are provided here to avoid linking in external redundant modules.\n+/* Stubs for functions and external variables that make no sense for\n+ * git-shell. These stubs are provided here to avoid linking in\n+ * external redundant modules.\n  */\n void release_pack_memory(size_t need, int fd){}\n void trace_argv_printf(const char **argv, const char *fmt, ...){}\n void trace_printf(const char *fmt, ...){}\n+int trust_executable_bit;\n+const unsigned char null_sha1[20];\n+const signed char hexval_table[256];\n+int has_symlinks;\n \n \n static int do_generic_cmd(const char *me, char *arg)\n-- \n1.5.4.5\n"},{"id":"87625","messageId":"7vy72tkfu0.fsf@gitster.siamese.dyndns.org","threadId":"15068","inReplyTo":"20080818123727.GB11842@schiele.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-19T00:29:11Z","receivedAt":"2008-08-19T00:29:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Schiele <rschiele@gmail.com> writes:\n\n> Commit 5b8e6f85 introduced stubs for three functions that make no sense\n> for git-shell.  But those stubs defined libgit.a functions a second time\n> so that a linker can complain.  While commit 78568448 fixes this problem\n> it introduces a new issue on the affected systems: Some versions of the\n> Sun compiler generate references to global variables when they see\n> extern declarations for those, even when they are never used in the\n> code.\n\nHaven't looked at the real declarations but if the decl are \"extern\" and\nnobody refers to them, why should the resulting object file require them\nto be defined anywhere?  If the decl are not and in (fortran-ish) \"common\"\nsection, on the other hand, you shouldn't have to define them yourself\nlike this either.\n\nThis sounds like a compiler bug to me.\n"},{"id":"87653","messageId":"20080819072650.GE11842@schiele.dyndns.org","threadId":"15068","inReplyTo":"7vy72tkfu0.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-19T07:26:51Z","receivedAt":"2008-08-19T07:26:51Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Mon, Aug 18, 2008 at 05:29:11PM -0700, Junio C Hamano wrote:\n> Haven't looked at the real declarations but if the decl are \"extern\" and\n> nobody refers to them, why should the resulting object file require them\n> to be defined anywhere?  If the decl are not and in (fortran-ish) \"common\"\n> section, on the other hand, you shouldn't have to define them yourself\n> like this either.\n> \n> This sounds like a compiler bug to me.\n\nThis was my first thought as well but after more inspection there are two\nthings to consider:\n\n1. I was not really precise enough in my description since I didn't spot that\n   when I looked into the issue first: Actually there are references to these\n   variables in static inline functions in cache.h.  Thus there actually is a\n   reference though one that will never be used since abspath.c (that includes\n   cache.h) is not calling any of these functions.\n\n2. Since these symbols turn out to be referenced though in dead code only I\n   wouldn't call it a compiler bug.  Obviously a smart compiler would do dead\n   code elimination here but the fact that this compiler is not doing so is\n   bad but not really a bug.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"87659","messageId":"7vpro5fnke.fsf@gitster.siamese.dyndns.org","threadId":"15068","inReplyTo":"20080819072650.GE11842@schiele.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-19T07:53:21Z","receivedAt":"2008-08-19T07:53:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Schiele <rschiele@gmail.com> writes:\n\n> On Mon, Aug 18, 2008 at 05:29:11PM -0700, Junio C Hamano wrote:\n>> Haven't looked at the real declarations but if the decl are \"extern\" and\n>> nobody refers to them, why should the resulting object file require them\n>> to be defined anywhere?  If the decl are not and in (fortran-ish) \"common\"\n>> section, on the other hand, you shouldn't have to define them yourself\n>> like this either.\n>> \n>> This sounds like a compiler bug to me.\n>\n> This was my first thought as well but after more inspection there are two\n> things to consider:\n>\n> 1. I was not really precise enough in my description since I didn't spot that\n>    when I looked into the issue first: Actually there are references to these\n>    variables in static inline functions in cache.h.  Thus there actually is a\n>    reference though one that will never be used since abspath.c (that includes\n>    cache.h) is not calling any of these functions.\n>\n> 2. Since these symbols turn out to be referenced though in dead code only I\n>    wouldn't call it a compiler bug.\n\nOk, as I said, I didn't look.  If they are indeed referenced, that is a\ndifferent story.\n\nEven if that is the case, I do not like the prospect of having to maintain\na set of duplicated variable definitions.  If we really wanted to address\nthis issue, maybe we would want a separate source file that is linked to\nboth git-shell and to the rest of the system that has nothing but\ndefinitions of these variables?  I thought environment.c was meant to be\nsomething like that -- would linking environment.o pull in too many extra\nreferences these days (again, I didn't try)?\n"},{"id":"87662","messageId":"20080819081625.GF11842@schiele.dyndns.org","threadId":"15068","inReplyTo":"7vpro5fnke.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-19T08:16:25Z","receivedAt":"2008-08-19T08:16:25Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Tue, Aug 19, 2008 at 12:53:21AM -0700, Junio C Hamano wrote:\n> Even if that is the case, I do not like the prospect of having to maintain\n> a set of duplicated variable definitions.  If we really wanted to address\n> this issue, maybe we would want a separate source file that is linked to\n> both git-shell and to the rest of the system that has nothing but\n> definitions of these variables?  I thought environment.c was meant to be\n\nOk, so how about globals.c and move just global variables that have at least\ntwo references there?\n\n> something like that -- would linking environment.o pull in too many extra\n> references these days (again, I didn't try)?\n\nThis pulls in almost everything these days.  In our specific case even the\nfunctions that were redefined in shell.c to start the whole mess.  Thus as\nsoon as we add environment.c we end up with duplicate symbols on linking\ngit-shell again.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"87665","messageId":"48AA8931.1030009@viscovery.net","threadId":"15068","inReplyTo":"7vpro5fnke.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-08-19T08:49:53Z","receivedAt":"2008-08-19T08:49:53Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> Even if that is the case, I do not like the prospect of having to maintain\n> a set of duplicated variable definitions.  If we really wanted to address\n> this issue, maybe we would want a separate source file that is linked to\n> both git-shell and to the rest of the system that has nothing but\n> definitions of these variables?  I thought environment.c was meant to be\n> something like that -- would linking environment.o pull in too many extra\n> references these days (again, I didn't try)?\n\nWhy not just revert 5b8e6f85f (shrink git-shell)? It was a nice try. If it\nhad not proved as a maintainance burden, it would have had merits. But who\nthese days cares whether git-shell takes 300K or 30K in the light of that\nit goes out of the way anyway by execing some other process at the first\nopportunity?\n\n-- Hannes\n"},{"id":"87673","messageId":"20080819091830.GG11842@schiele.dyndns.org","threadId":"15068","inReplyTo":"48AA8931.1030009@viscovery.net","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-19T09:18:30Z","receivedAt":"2008-08-19T09:18:30Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Tue, Aug 19, 2008 at 10:49:53AM +0200, Johannes Sixt wrote:\n> Why not just revert 5b8e6f85f (shrink git-shell)? It was a nice try. If it\n> had not proved as a maintainance burden, it would have had merits. But who\n> these days cares whether git-shell takes 300K or 30K in the light of that\n> it goes out of the way anyway by execing some other process at the first\n> opportunity?\n\nSounds reasonable to me.  Doing this in a clean way would require more\nrestructuring in the code.  So far this change started a chain of changes\nwhere each change tried to solve one issue and caused a more severe one.\n\nThough it would not only be 5b8e6f85 to be reverted but also 78568448 that\ntried to fix up problems that 5b8e6f85 caused.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"87765","messageId":"7vbpzoy53d.fsf@gitster.siamese.dyndns.org","threadId":"15068","inReplyTo":"20080819091830.GG11842@schiele.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-19T23:09:42Z","receivedAt":"2008-08-19T23:09:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Schiele <rschiele@gmail.com> writes:\n\n> On Tue, Aug 19, 2008 at 10:49:53AM +0200, Johannes Sixt wrote:\n>\n>> Why not just revert 5b8e6f85f (shrink git-shell)? It was a nice try. If it\n>> had not proved as a maintainance burden, it would have had merits. But who\n>> these days cares whether git-shell takes 300K or 30K in the light of that\n>> it goes out of the way anyway by execing some other process at the first\n>> opportunity?\n>\n> Sounds reasonable to me.  Doing this in a clean way would require more\n> restructuring in the code.  So far this change started a chain of changes\n> where each change tried to solve one issue and caused a more severe one.\n>\n> Though it would not only be 5b8e6f85 to be reverted but also 78568448 that\n> tried to fix up problems that 5b8e6f85 caused.\n\nI have no issue with that.  Some people also mumbled about auditability,\nwhich I did not find particularly convincing.\n"},{"id":"87777","messageId":"7vd4k4v6kh.fsf@gitster.siamese.dyndns.org","threadId":"15068","inReplyTo":"7vbpzoy53d.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 1/2] shell: do not play duplicated definition games to shrink the executable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T01:06:06Z","receivedAt":"2008-08-20T01:06:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Playing with linker games to shrink git-shell did not go well with various\nother platforms and compilers.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile |    9 +--------\n shell.c  |    8 --------\n 2 files changed, 1 insertions(+), 16 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 53ab4b5..71339e1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -333,7 +333,6 @@ endif\n export PERL_PATH\n \n LIB_FILE=libgit.a\n-COMPAT_LIB = compat/lib.a\n XDIFF_LIB=xdiff/lib.a\n \n LIB_H += archive.h\n@@ -1223,12 +1222,6 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)\n \n-$(COMPAT_LIB): $(COMPAT_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(COMPAT_OBJS)\n-\n-git-shell$X: abspath.o ctype.o exec_cmd.o quote.o strbuf.o usage.o wrapper.o shell.o $(COMPAT_LIB)\n-\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(COMPAT_LIB)\n-\n $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)\n $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)\n builtin-revert.o wt-status.o: wt-status.h\n@@ -1441,7 +1434,7 @@ distclean: clean\n \n clean:\n \t$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \\\n-\t\t$(LIB_FILE) $(XDIFF_LIB) $(COMPAT_LIB)\n+\t\t$(LIB_FILE) $(XDIFF_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X\n \t$(RM) $(TEST_PROGRAMS)\n \t$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*\ndiff --git a/shell.c b/shell.c\nindex 6a48de0..0f6a727 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -3,14 +3,6 @@\n #include \"exec_cmd.h\"\n #include \"strbuf.h\"\n \n-/* Stubs for functions that make no sense for git-shell. These stubs\n- * are provided here to avoid linking in external redundant modules.\n- */\n-void release_pack_memory(size_t need, int fd){}\n-void trace_argv_printf(const char **argv, const char *fmt, ...){}\n-void trace_printf(const char *fmt, ...){}\n-\n-\n static int do_generic_cmd(const char *me, char *arg)\n {\n \tconst char *my_argv[4];\n-- \n1.6.0.6.gc6670b\n"},{"id":"87778","messageId":"7v7iacv6kb.fsf@gitster.siamese.dyndns.org","threadId":"15068","inReplyTo":"7vbpzoy53d.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 2/2] Build-in \"git-shell\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T01:06:12Z","receivedAt":"2008-08-20T01:06:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This trivially makes \"git-shell\" a built-in.  It makes the executable even\nfatter, though.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile                   |    1 +\n shell.c => builtin-shell.c |    5 +++--\n builtin.h                  |    1 +\n git.c                      |    1 +\n 4 files changed, 6 insertions(+), 2 deletions(-)\n rename shell.c => builtin-shell.c (94%)\n\ndiff --git a/Makefile b/Makefile\nindex 71339e1..1a52f71 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -546,6 +546,7 @@ BUILTIN_OBJS += builtin-rev-parse.o\n BUILTIN_OBJS += builtin-revert.o\n BUILTIN_OBJS += builtin-rm.o\n BUILTIN_OBJS += builtin-send-pack.o\n+BUILTIN_OBJS += builtin-shell.o\n BUILTIN_OBJS += builtin-shortlog.o\n BUILTIN_OBJS += builtin-show-branch.o\n BUILTIN_OBJS += builtin-show-ref.o\ndiff --git a/shell.c b/builtin-shell.c\nsimilarity index 94%\nrename from shell.c\nrename to builtin-shell.c\nindex 0f6a727..3cf97d4 100644\n--- a/shell.c\n+++ b/builtin-shell.c\n@@ -2,6 +2,7 @@\n #include \"quote.h\"\n #include \"exec_cmd.h\"\n #include \"strbuf.h\"\n+#include \"builtin.h\"\n \n static int do_generic_cmd(const char *me, char *arg)\n {\n@@ -44,7 +45,7 @@ static struct commands {\n \t{ NULL },\n };\n \n-int main(int argc, char **argv)\n+int cmd_shell(int argc, const char **argv, const char *prefix)\n {\n \tchar *prog;\n \tstruct commands *cmd;\n@@ -62,7 +63,7 @@ int main(int argc, char **argv)\n \telse if (argc != 3 || strcmp(argv[1], \"-c\"))\n \t\tdie(\"What do you think I am? A shell?\");\n \n-\tprog = argv[2];\n+\tprog = xstrdup(argv[2]);\n \tif (!strncmp(prog, \"git\", 3) && isspace(prog[3]))\n \t\t/* Accept \"git foo\" as if the caller said \"git-foo\". */\n \t\tprog[3] = '-';\ndiff --git a/builtin.h b/builtin.h\nindex f3502d3..2b57a5e 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -88,6 +88,7 @@ extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);\n extern int cmd_revert(int argc, const char **argv, const char *prefix);\n extern int cmd_rm(int argc, const char **argv, const char *prefix);\n extern int cmd_send_pack(int argc, const char **argv, const char *prefix);\n+extern int cmd_shell(int argc, const char **argv, const char *prefix);\n extern int cmd_shortlog(int argc, const char **argv, const char *prefix);\n extern int cmd_show(int argc, const char **argv, const char *prefix);\n extern int cmd_show_branch(int argc, const char **argv, const char *prefix);\ndiff --git a/git.c b/git.c\nindex 37b1d76..89e4645 100644\n--- a/git.c\n+++ b/git.c\n@@ -338,6 +338,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"revert\", cmd_revert, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"rm\", cmd_rm, RUN_SETUP },\n \t\t{ \"send-pack\", cmd_send_pack, RUN_SETUP },\n+\t\t{ \"shell\", cmd_shell },\n \t\t{ \"shortlog\", cmd_shortlog, USE_PAGER },\n \t\t{ \"show-branch\", cmd_show_branch, RUN_SETUP },\n \t\t{ \"show\", cmd_show, RUN_SETUP | USE_PAGER },\n-- \n1.6.0.6.gc6670b\n"},{"id":"87779","messageId":"7vzln8trzj.fsf@gitster.siamese.dyndns.org","threadId":"15068","inReplyTo":"7vbpzoy53d.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-20T01:06:24Z","receivedAt":"2008-08-20T01:06:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Robert Schiele <rschiele@gmail.com> writes:\n>\n>> On Tue, Aug 19, 2008 at 10:49:53AM +0200, Johannes Sixt wrote:\n>>\n>>> Why not just revert 5b8e6f85f (shrink git-shell)? It was a nice try. If it\n>>> had not proved as a maintainance burden, it would have had merits. But who\n>>> these days cares whether git-shell takes 300K or 30K in the light of that\n>>> it goes out of the way anyway by execing some other process at the first\n>>> opportunity?\n>>\n>> Sounds reasonable to me.  Doing this in a clean way would require more\n>> restructuring in the code.  So far this change started a chain of changes\n>> where each change tried to solve one issue and caused a more severe one.\n>>\n>> Though it would not only be 5b8e6f85 to be reverted but also 78568448 that\n>> tried to fix up problems that 5b8e6f85 caused.\n>\n> I have no issue with that.  Some people also mumbled about auditability,\n> which I did not find particularly convincing.\n\nThe result would look like this two-patch series.\n\n [1/2] shell: do not play duplicated definition games to shrink the executable\n [2/2] Build-in \"git-shell\"\n"},{"id":"87794","messageId":"20080820043646.GH11842@schiele.dyndns.org","threadId":"15068","inReplyTo":"7vzln8trzj.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] add definitions for global variables to shell.c","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-20T04:36:46Z","receivedAt":"2008-08-20T04:36:46Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Tue, Aug 19, 2008 at 06:06:24PM -0700, Junio C Hamano wrote:\n> The result would look like this two-patch series.\n> \n>  [1/2] shell: do not play duplicated definition games to shrink the executable\n>  [2/2] Build-in \"git-shell\"\n\nThanks, this makes the Sun compilers happy again without the need of weired\nhacks.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"87798","messageId":"48ABBF96.2050609@viscovery.net","threadId":"15068","inReplyTo":"7v7iacv6kb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] Build-in \"git-shell\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-08-20T06:54:14Z","receivedAt":"2008-08-20T06:54:14Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> This trivially makes \"git-shell\" a built-in.  It makes the executable even\n> fatter, though.\n...\n> diff --git a/Makefile b/Makefile\n> index 71339e1..1a52f71 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -546,6 +546,7 @@ BUILTIN_OBJS += builtin-rev-parse.o\n>  BUILTIN_OBJS += builtin-revert.o\n>  BUILTIN_OBJS += builtin-rm.o\n>  BUILTIN_OBJS += builtin-send-pack.o\n> +BUILTIN_OBJS += builtin-shell.o\n>  BUILTIN_OBJS += builtin-shortlog.o\n>  BUILTIN_OBJS += builtin-show-branch.o\n>  BUILTIN_OBJS += builtin-show-ref.o\n\nYou must squash this in:\n\ndiff --git a/Makefile b/Makefile\nindex 57d16cb..fae9b22 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -826,7 +826,6 @@ EXTLIBS += -lz\n ifndef NO_POSIX_ONLY_PROGRAMS\n \tPROGRAMS += git-daemon$X\n \tPROGRAMS += git-imap-send$X\n-\tPROGRAMS += git-shell$X\n endif\n ifndef NO_OPENSSL\n \tOPENSSL_LIBSSL = -lssl\n\nWe removed git-shell from the MinGW build only because of the compat\ndependencies. We don't have problems building it as a built-in.\n\n-- Hannes\n"}]}