{"thread":{"id":"8951","subject":"[PATCH] Makefile: rebuild git.o on version change, clean up git$X flags","startedAt":"2007-07-10T01:30:39Z","lastAt":"2007-07-10T01:55:51Z","messageCount":2,"participants":["Matt McCutchen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46902","messageId":"1184031039.14364.11.camel@mattlaptop2","threadId":"8951","inReplyTo":null,"subject":"[PATCH] Makefile: rebuild git.o on version change, clean up git$X flags","fromName":"Matt McCutchen","fromEmail":"hashproduct@gmail.com","sentAt":"2007-07-10T01:30:39Z","receivedAt":"2007-07-10T01:30:39Z","isPatch":true,"sender":{"key":"matt@mattmccutchen.net","avatar":"https://avatars.githubusercontent.com/u/8885753?v=4"},"body":"Commit 334d28ae factored out git.o as an intermediate stage between\ngit.c and git$X.  However:\n\n- It left some no-longer-relevant flags in the rule for git$X.\n\n- It failed to replace git$X with git.o in the list of files that\n  record GIT_VERSION.  This broke incorporation of a changed\n  GIT_VERSION into git$X because, when GIT_VERSION changes, git.o isn't\n  remade and git$X is relinked from the git.o that still contains the\n  old GIT_VERSION.\n\nThis patch removes the irrelevant flags and fixes incorporation of a\nchanged GIT_VERSION into git$X.\n\nSigned-off-by: Matt McCutchen <hashproduct@gmail.com>\n---\nAmusingly, I found this because, when I formatted my previous patch for\nsubmission, I noticed that the \"-dirty\" in the version at the bottom\nwouldn't go away even though I had committed my changes to my\ngit-development repository.  (I was actually using the git tools from\nthat repository.)\n\n Makefile |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 5b30e5c..d7541b4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -753,8 +753,7 @@ git.o: git.c common-cmds.h GIT-CFLAGS\n \t\t$(ALL_CFLAGS) -c $(filter %.c,$^)\n \n git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)\n-\t$(QUIET_LINK)$(CC) -DGIT_VERSION='\"$(GIT_VERSION)\"' \\\n-\t\t$(ALL_CFLAGS) -o $@ $(filter %.c,$^) git.o \\\n+\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \\\n \t\t$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)\n \n help.o: common-cmds.h\n@@ -857,7 +856,7 @@ configure: configure.ac\n \trm -f $<+\n \n # These can record GIT_VERSION\n-git$X git.spec \\\n+git.o git.spec \\\n \t$(patsubst %.sh,%,$(SCRIPT_SH)) \\\n \t$(patsubst %.perl,%,$(SCRIPT_PERL)) \\\n \t: GIT-VERSION-FILE\n-- \n1.5.3.rc0.83.gb18a6\n"},{"id":"46903","messageId":"7vbqelt42g.fsf@assigned-by-dhcp.cox.net","threadId":"8951","inReplyTo":"1184031039.14364.11.camel@mattlaptop2","subject":"Re: [PATCH] Makefile: rebuild git.o on version change, clean up git$X flags","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-10T01:55:51Z","receivedAt":"2007-07-10T01:55:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}