{"thread":{"id":"4608","subject":"[PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","startedAt":"2006-06-22T01:47:00Z","lastAt":"2006-06-22T18:58:31Z","messageCount":8,"participants":["Yakov Lerner","Junio C Hamano","Timo Hirvonen","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22231","messageId":"0J1800MC1NKJD2C0@mxout2.netvision.net.il","threadId":"4608","inReplyTo":null,"subject":"[PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2006-06-22T01:47:00Z","receivedAt":"2006-06-22T01:47:00Z","isPatch":true,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"Before this patch, -DDEFAULT_GIT_TEMPLATE_DIR was passed on compilation\ncommand line to all and every %c compiled. In fact the macro\nis used by only one .c file, and unused by all other .c files.\nRemove -DDEFAULT_GIT_TEMPLATE_DIR where unused. Follow the examlpe of \nexec_cmd.o. Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used. \n\nSigned-off-by: Yakov Lerner <iler.ml@gmail.com>\n---\n Makefile |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c602099..7af0937 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -472,7 +472,6 @@ PYTHON_PATH_SQ = $(subst ','\\'',$(PYTHON\n GIT_PYTHON_DIR_SQ = $(subst ','\\'',$(GIT_PYTHON_DIR))\n \n ALL_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS)\n-ALL_CFLAGS += -DDEFAULT_GIT_TEMPLATE_DIR='\"$(template_dir_SQ)\"'\n LIB_OBJS += $(COMPAT_OBJS)\n export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir\n ### Build rules\n@@ -548,6 +547,8 @@ git$X git.spec \\\n \n exec_cmd.o: exec_cmd.c GIT-CFLAGS\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH=\"$(gitexecdir_SQ)\"' $<\n+builtin-init-db.o: builtin-init-db.c GIT-CFLAGS\n+\t$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='\"$(template_dir_SQ)\"' $<\n \n http.o: http.c GIT-CFLAGS\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='\"git/$(GIT_VERSION)\"' $<\n-- \n1.4.0.ga40a\n"},{"id":"22241","messageId":"7vwtb9veqv.fsf@assigned-by-dhcp.cox.net","threadId":"4608","inReplyTo":"0J1800MC1NKJD2C0@mxout2.netvision.net.il","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T07:19:52Z","receivedAt":"2006-06-22T07:19:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yakov Lerner <iler.ml@gmail.com> writes:\n\n> Before this patch, -DDEFAULT_GIT_TEMPLATE_DIR was passed on compilation\n> command line to all and every %c compiled. In fact the macro\n> is used by only one .c file, and unused by all other .c files.\n> Remove -DDEFAULT_GIT_TEMPLATE_DIR where unused. Follow the examlpe of \n> exec_cmd.o. Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used. \n\nThanks.\n\nBy the way, I really started hating that we have $(GIT_VERSION)\nin $(TRACK_CFLAGS).  Since the version string is tied to the\nHEAD commit object name, having it in $(TRACK_CFLAGS) means that\nevery time I switch branches, make a new commit on top of the\ncurrent branch, or checkout-compile-and-then-make-local-change\nsequence would force pretty much everything to be rebuilt.\n\nDo you think of any downside if I remove it from the list of\nsymbols in TRACK_CFLAGS?\n\nFor that matter, I do not think tracking prefix_SQ makes much\nsense since what matters are bindir, gitexecdir and template_dir\nwhich are already covered, and prefix is merely a convenience to\nset these three (four, counting GIT_PYTHON_DIR; we probably\nshould add it to TRACK_CFLAGS).\n\nThoughts?\n"},{"id":"22243","messageId":"20060622104901.f3543f07.tihirvon@gmail.com","threadId":"4608","inReplyTo":"7vwtb9veqv.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-06-22T07:49:01Z","receivedAt":"2006-06-22T07:49:01Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n\n> Yakov Lerner <iler.ml@gmail.com> writes:\n> \n> > Before this patch, -DDEFAULT_GIT_TEMPLATE_DIR was passed on compilation\n> > command line to all and every %c compiled. In fact the macro\n> > is used by only one .c file, and unused by all other .c files.\n> > Remove -DDEFAULT_GIT_TEMPLATE_DIR where unused. Follow the examlpe of \n> > exec_cmd.o. Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used. \n> \n> Thanks.\n> \n> By the way, I really started hating that we have $(GIT_VERSION)\n> in $(TRACK_CFLAGS).  Since the version string is tied to the\n> HEAD commit object name, having it in $(TRACK_CFLAGS) means that\n> every time I switch branches, make a new commit on top of the\n> current branch, or checkout-compile-and-then-make-local-change\n> sequence would force pretty much everything to be rebuilt.\n\nI think this already makes sure git is compiled if version changes:\n\n# These can record GIT_VERSION\ngit$X git.spec \\\n        $(patsubst %.sh,%,$(SCRIPT_SH)) \\\n        $(patsubst %.perl,%,$(SCRIPT_PERL)) \\\n        $(patsubst %.py,%,$(SCRIPT_PYTHON)) \\\n        : GIT-VERSION-FILE\n\n$ git grep GIT_VERSION *.sh *.perl\ngit-send-email.perl:\tmy $gitversion = '@@GIT_VERSION@@';\ngit-send-email.perl:\tif ($gitversion =~ m/..GIT_VERSION../) {\n\nOnly git-send-email and git needs to depend on GIT_VERSION.\n\n> For that matter, I do not think tracking prefix_SQ makes much\n> sense since what matters are bindir, gitexecdir and template_dir\n> which are already covered, and prefix is merely a convenience to\n> set these three (four, counting GIT_PYTHON_DIR; we probably\n> should add it to TRACK_CFLAGS).\n\nYes, only ALL_CFLAGS, bindir, gitexecdir, template_dir and\nGIT_PYTHON_DIR should be in TRACK_CFLAGS.\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"22251","messageId":"7v7j39tvcr.fsf@assigned-by-dhcp.cox.net","threadId":"4608","inReplyTo":"20060622104901.f3543f07.tihirvon@gmail.com","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T09:04:04Z","receivedAt":"2006-06-22T09:04:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Timo Hirvonen <tihirvon@gmail.com> writes:\n\n> Junio C Hamano <junkio@cox.net> wrote:\n>\n>> By the way, I really started hating that we have $(GIT_VERSION)\n>> in $(TRACK_CFLAGS).  Since the version string is tied to the\n>> HEAD commit object name, having it in $(TRACK_CFLAGS) means that\n>> every time I switch branches, make a new commit on top of the\n>> current branch, or checkout-compile-and-then-make-local-change\n>> sequence would force pretty much everything to be rebuilt.\n>...\n>> For that matter, I do not think tracking prefix_SQ makes much\n>> sense since what matters are bindir, gitexecdir and template_dir\n>> which are already covered, and prefix is merely a convenience to\n>> set these three (four, counting GIT_PYTHON_DIR; we probably\n>> should add it to TRACK_CFLAGS).\n>\n> Yes, only ALL_CFLAGS, bindir, gitexecdir, template_dir and\n> GIT_PYTHON_DIR should be in TRACK_CFLAGS.\n\nExactly my thinking.  Let's do it like this, then.\n\n-- >8 --\nMakefile: do not force unneeded recompilation upon GIT_VERSION changes\n\n---\ndiff --git a/Makefile b/Makefile\nindex 55a84d4..d45f3dc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -612,7 +612,7 @@ tags:\n \tfind . -name '*.[hcS]' -print | xargs ctags -a\n \n ### Detect prefix changes\n-TRACK_CFLAGS = $(subst ','\\'',$(ALL_CFLAGS)):$(GIT_VERSION):\\\n+TRACK_CFLAGS = $(subst ','\\'',$(ALL_CFLAGS)):$(GIT_PYTHON_DIR_SQ):\\\n              $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)\n \n GIT-CFLAGS: .FORCE-GIT-CFLAGS\n"},{"id":"22266","messageId":"20060622131235.GA21864@pasky.or.cz","threadId":"4608","inReplyTo":"7vwtb9veqv.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-22T13:12:35Z","receivedAt":"2006-06-22T13:12:35Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Jun 22, 2006 at 09:19:52AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> For that matter, I do not think tracking prefix_SQ makes much\n> sense since what matters are bindir, gitexecdir and template_dir\n> which are already covered, and prefix is merely a convenience to\n> set these three (four, counting GIT_PYTHON_DIR; we probably\n> should add it to TRACK_CFLAGS).\n\n$(prefix) will be passed to perl/Makefile.PL.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22284","messageId":"7vodwlp12i.fsf@assigned-by-dhcp.cox.net","threadId":"4608","inReplyTo":"20060622131235.GA21864@pasky.or.cz","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T17:11:49Z","receivedAt":"2006-06-22T17:11:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> Dear diary, on Thu, Jun 22, 2006 at 09:19:52AM CEST, I got a letter\n> where Junio C Hamano <junkio@cox.net> said that...\n>> For that matter, I do not think tracking prefix_SQ makes much\n>> sense since what matters are bindir, gitexecdir and template_dir\n>> which are already covered, and prefix is merely a convenience to\n>> set these three (four, counting GIT_PYTHON_DIR; we probably\n>> should add it to TRACK_CFLAGS).\n>\n> $(prefix) will be passed to perl/Makefile.PL.\n\nThen probably it shouldn't; instead we woulld probably want to\npass the moral equivalent of GIT_PYTHON_DIR.\n"},{"id":"22287","messageId":"20060622175815.GC21864@pasky.or.cz","threadId":"4608","inReplyTo":"7vodwlp12i.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-06-22T17:58:15Z","receivedAt":"2006-06-22T17:58:15Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Jun 22, 2006 at 07:11:49PM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > Dear diary, on Thu, Jun 22, 2006 at 09:19:52AM CEST, I got a letter\n> > where Junio C Hamano <junkio@cox.net> said that...\n> >> For that matter, I do not think tracking prefix_SQ makes much\n> >> sense since what matters are bindir, gitexecdir and template_dir\n> >> which are already covered, and prefix is merely a convenience to\n> >> set these three (four, counting GIT_PYTHON_DIR; we probably\n> >> should add it to TRACK_CFLAGS).\n> >\n> > $(prefix) will be passed to perl/Makefile.PL.\n> \n> Then probably it shouldn't; instead we woulld probably want to\n> pass the moral equivalent of GIT_PYTHON_DIR.\n\nI'm not sure about what the rationale behind GIT_PYTHON_DIR was, but it\nseems to be used only by a library supposedly internal to some Git\ncommands, while the Git.pm module should be available systemwide even\nfor non-Git applications, so it's really best to leave it to Perl where\nto put it.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"},{"id":"22293","messageId":"7vlkrpkofc.fsf@assigned-by-dhcp.cox.net","threadId":"4608","inReplyTo":"20060622175815.GC21864@pasky.or.cz","subject":"Re: [PATCH] Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T18:58:31Z","receivedAt":"2006-06-22T18:58:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> ... while the Git.pm module should be available systemwide even\n> for non-Git applications, so it's really best to leave it to Perl where\n> to put it.\n\nOK, if that is the intention passing prefix might be sensible.\n"}]}