{"thread":{"id":"24492","subject":"[PATCH] Makefile: don't include git version file on 'make clean'","startedAt":"2010-07-24T03:53:47Z","lastAt":"2010-07-25T18:49:51Z","messageCount":19,"participants":["lynn.lin@emc.com","Ævar Arnfjörð Bjarmason","Kevin P. Fleming","Andreas Schwab","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"146139","messageId":"1279943627-11053-1-git-send-email-Lynn.Lin@emc.com","threadId":"24492","inReplyTo":null,"subject":"[PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-24T03:53:47Z","receivedAt":"2010-07-24T03:53:47Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"From: Lynn Lin <Lynn.Lin@emc.com>\n\n---\n Makefile         |    4 +++-\n git-gui/Makefile |    4 +++-\n 2 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex bc3c570..eb28b98 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -238,7 +238,9 @@ all::\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n--include GIT-VERSION-FILE\n+ifneq \"$(MAKECMDGOALS)\" \"clean\"\n+  -include GIT-VERSION-FILE\n+endif\n \n uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\ndiff --git a/git-gui/Makefile b/git-gui/Makefile\nindex 197b55e..91e1ea5 100644\n--- a/git-gui/Makefile\n+++ b/git-gui/Makefile\n@@ -9,7 +9,9 @@ all::\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n--include GIT-VERSION-FILE\n+ifneq \"$(MAKECMDGOALS)\" \"clean\"\n+  -include GIT-VERSION-FILE\n+endif\n \n uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n-- \n1.7.1\n"},{"id":"146164","messageId":"AANLkTilYXdVI_fqG5ZvPEABTXt7fTps3ZbPiiWgVnDxS@mail.gmail.com","threadId":"24492","inReplyTo":"1279943627-11053-1-git-send-email-Lynn.Lin@emc.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-24T12:36:01Z","receivedAt":"2010-07-24T12:36:01Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n> From: Lynn Lin <Lynn.Lin@emc.com>\n>\n> ---\n>  Makefile         |    4 +++-\n>  git-gui/Makefile |    4 +++-\n>  2 files changed, 6 insertions(+), 2 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index bc3c570..eb28b98 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -238,7 +238,9 @@ all::\n>\n>  GIT-VERSION-FILE: FORCE\n>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n> --include GIT-VERSION-FILE\n> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n> +  -include GIT-VERSION-FILE\n> +endif\n>\n>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n> diff --git a/git-gui/Makefile b/git-gui/Makefile\n> index 197b55e..91e1ea5 100644\n> --- a/git-gui/Makefile\n> +++ b/git-gui/Makefile\n> @@ -9,7 +9,9 @@ all::\n>\n>  GIT-VERSION-FILE: FORCE\n>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n> --include GIT-VERSION-FILE\n> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n> +  -include GIT-VERSION-FILE\n> +endif\n>\n>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n> --\n> 1.7.1\n\nThis patch needs a rationale, why was it needed? The \"-include\"\ndirective will simply ignore files that don't exist (as opposed to\n\"include\"), so including GIT-VERSION-FILE during \"make clean'\nshouldn't be an issue.\n\nWas it for you? And if so what version of make, what OS etc.\n"},{"id":"146251","messageId":"4C4BFAA3.3050700@digium.com","threadId":"24492","inReplyTo":"AANLkTilYXdVI_fqG5ZvPEABTXt7fTps3ZbPiiWgVnDxS@mail.gmail.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Kevin P. Fleming","fromEmail":"kpfleming@digium.com","sentAt":"2010-07-25T08:49:39Z","receivedAt":"2010-07-25T08:49:39Z","isPatch":true,"sender":{"key":"kpfleming@digium.com","avatar":null},"body":"On 07/24/2010 02:36 PM, Ævar Arnfjörð Bjarmason wrote:\n> On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n>> From: Lynn Lin <Lynn.Lin@emc.com>\n>>\n>> ---\n>>  Makefile         |    4 +++-\n>>  git-gui/Makefile |    4 +++-\n>>  2 files changed, 6 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/Makefile b/Makefile\n>> index bc3c570..eb28b98 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -238,7 +238,9 @@ all::\n>>\n>>  GIT-VERSION-FILE: FORCE\n>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>> --include GIT-VERSION-FILE\n>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>> +  -include GIT-VERSION-FILE\n>> +endif\n>>\n>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n>> diff --git a/git-gui/Makefile b/git-gui/Makefile\n>> index 197b55e..91e1ea5 100644\n>> --- a/git-gui/Makefile\n>> +++ b/git-gui/Makefile\n>> @@ -9,7 +9,9 @@ all::\n>>\n>>  GIT-VERSION-FILE: FORCE\n>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>> --include GIT-VERSION-FILE\n>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>> +  -include GIT-VERSION-FILE\n>> +endif\n>>\n>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n>> --\n>> 1.7.1\n> \n> This patch needs a rationale, why was it needed? The \"-include\"\n> directive will simply ignore files that don't exist (as opposed to\n> \"include\"), so including GIT-VERSION-FILE during \"make clean'\n> shouldn't be an issue.\n\nJust guessing here, but since GIT-VERSION-FILE has a 'FORCE'\nprerequisite, that means that the operations to generate it will be run\neven for 'make clean', which is not useful for the cleaning operation.\nIt's probably not harmful either... but maybe the OP has some more\nsignificant reason for this patch.\n\n-- \nKevin P. Fleming\nDigium, Inc. | Director of Software Technologies\n445 Jan Davis Drive NW - Huntsville, AL 35806 - USA\nskype: kpfleming | jabber: kfleming@digium.com\nCheck us out at www.digium.com & www.asterisk.org\n"},{"id":"146261","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F998@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"4C4BFAA3.3050700@digium.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T11:28:34Z","receivedAt":"2010-07-25T11:28:34Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: Kevin P. Fleming [mailto:kpfleming@digium.com] \nSent: 2010年7月25日 16:50\nTo: Ævar Arnfjörð Bjarmason\nCc: Lin, Lynn; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn 07/24/2010 02:36 PM, Ævar Arnfjörð Bjarmason wrote:\n> On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n>> From: Lynn Lin <Lynn.Lin@emc.com>\n>>\n>> ---\n>>  Makefile         |    4 +++-\n>>  git-gui/Makefile |    4 +++-\n>>  2 files changed, 6 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/Makefile b/Makefile\n>> index bc3c570..eb28b98 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -238,7 +238,9 @@ all::\n>>\n>>  GIT-VERSION-FILE: FORCE\n>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>> --include GIT-VERSION-FILE\n>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>> +  -include GIT-VERSION-FILE\n>> +endif\n>>\n>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n>> diff --git a/git-gui/Makefile b/git-gui/Makefile\n>> index 197b55e..91e1ea5 100644\n>> --- a/git-gui/Makefile\n>> +++ b/git-gui/Makefile\n>> @@ -9,7 +9,9 @@ all::\n>>\n>>  GIT-VERSION-FILE: FORCE\n>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>> --include GIT-VERSION-FILE\n>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>> +  -include GIT-VERSION-FILE\n>> +endif\n>>\n>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n>> --\n>> 1.7.1\n> \n> This patch needs a rationale, why was it needed? The \"-include\"\n> directive will simply ignore files that don't exist (as opposed to\n> \"include\"), so including GIT-VERSION-FILE during \"make clean'\n> shouldn't be an issue.\n\nJust guessing here, but since GIT-VERSION-FILE has a 'FORCE'\nprerequisite, that means that the operations to generate it will be run\neven for 'make clean', which is not useful for the cleaning operation.\nIt's probably not harmful either... but maybe the OP has some more\nsignificant reason for this patch.\n\n\n\nYes, when we run 'make clean' ,it also generate the git version file,then remove it .It's not necessary to trigger the operation when run 'make clean' command\n\nLynn\n\n\n-- \nKevin P. Fleming\nDigium, Inc. | Director of Software Technologies\n445 Jan Davis Drive NW - Huntsville, AL 35806 - USA\nskype: kpfleming | jabber: kfleming@digium.com\nCheck us out at www.digium.com & www.asterisk.org\n\n"},{"id":"146262","messageId":"AANLkTilHrEImfhl0YTqj0MgXFTzYmJMJrUTKkflGFwpp@mail.gmail.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F998@CORPUSMX100A.corp.emc.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-25T11:41:30Z","receivedAt":"2010-07-25T11:41:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Jul 25, 2010 at 11:28,  <lynn.lin@emc.com> wrote:\n>\n>\n> -----Original Message-----\n> From: Kevin P. Fleming [mailto:kpfleming@digium.com]\n> Sent: 2010年7月25日 16:50\n> To: Ævar Arnfjörð Bjarmason\n> Cc: Lin, Lynn; git@vger.kernel.org\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>\n> On 07/24/2010 02:36 PM, Ævar Arnfjörð Bjarmason wrote:\n>> On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n>>> From: Lynn Lin <Lynn.Lin@emc.com>\n>>>\n>>> ---\n>>>  Makefile         |    4 +++-\n>>>  git-gui/Makefile |    4 +++-\n>>>  2 files changed, 6 insertions(+), 2 deletions(-)\n>>>\n>>> diff --git a/Makefile b/Makefile\n>>> index bc3c570..eb28b98 100644\n>>> --- a/Makefile\n>>> +++ b/Makefile\n>>> @@ -238,7 +238,9 @@ all::\n>>>\n>>>  GIT-VERSION-FILE: FORCE\n>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>> --include GIT-VERSION-FILE\n>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>> +  -include GIT-VERSION-FILE\n>>> +endif\n>>>\n>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n>>> diff --git a/git-gui/Makefile b/git-gui/Makefile\n>>> index 197b55e..91e1ea5 100644\n>>> --- a/git-gui/Makefile\n>>> +++ b/git-gui/Makefile\n>>> @@ -9,7 +9,9 @@ all::\n>>>\n>>>  GIT-VERSION-FILE: FORCE\n>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>> --include GIT-VERSION-FILE\n>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>> +  -include GIT-VERSION-FILE\n>>> +endif\n>>>\n>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n>>> --\n>>> 1.7.1\n>>\n>> This patch needs a rationale, why was it needed? The \"-include\"\n>> directive will simply ignore files that don't exist (as opposed to\n>> \"include\"), so including GIT-VERSION-FILE during \"make clean'\n>> shouldn't be an issue.\n>\n> Just guessing here, but since GIT-VERSION-FILE has a 'FORCE'\n> prerequisite, that means that the operations to generate it will be run\n> even for 'make clean', which is not useful for the cleaning operation.\n> It's probably not harmful either... but maybe the OP has some more\n> significant reason for this patch.\n>\n>\n\n> Yes, when we run 'make clean' ,it also generate the git version\n> file,then remove it .It's not necessary to trigger the operation\n> when run 'make clean' command\n\nSure, it's not needed. But it's OK to have a bit of redundancy for\nsimplicity, unless that redundancy is breaking something. Which is why\nI asked whether it was actually causing a problem in any case.\n\nWith this patch we still call ./GIT-VERSION-GEN to make the\n./GIT-VERSION-FILE, we just aren't including it anymore, and it would\nstill be included on \"make distclean\" since you're just looking at\n$(MAKECMDGOALS).\n"},{"id":"146263","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F99A@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"AANLkTilHrEImfhl0YTqj0MgXFTzYmJMJrUTKkflGFwpp@mail.gmail.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T11:46:09Z","receivedAt":"2010-07-25T11:46:09Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of ?var Arnfj?re Bjarmason\nSent: 2010年7月25日 19:42\nTo: Lin, Lynn\nCc: kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 11:28,  <lynn.lin@emc.com> wrote:\n>\n>\n> -----Original Message-----\n> From: Kevin P. Fleming [mailto:kpfleming@digium.com]\n> Sent: 2010年7月25日 16:50\n> To: Ævar Arnfjörð Bjarmason\n> Cc: Lin, Lynn; git@vger.kernel.org\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>\n> On 07/24/2010 02:36 PM, Ævar Arnfjörð Bjarmason wrote:\n>> On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n>>> From: Lynn Lin <Lynn.Lin@emc.com>\n>>>\n>>> ---\n>>>  Makefile         |    4 +++-\n>>>  git-gui/Makefile |    4 +++-\n>>>  2 files changed, 6 insertions(+), 2 deletions(-)\n>>>\n>>> diff --git a/Makefile b/Makefile\n>>> index bc3c570..eb28b98 100644\n>>> --- a/Makefile\n>>> +++ b/Makefile\n>>> @@ -238,7 +238,9 @@ all::\n>>>\n>>>  GIT-VERSION-FILE: FORCE\n>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>> --include GIT-VERSION-FILE\n>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>> +  -include GIT-VERSION-FILE\n>>> +endif\n>>>\n>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n>>> diff --git a/git-gui/Makefile b/git-gui/Makefile\n>>> index 197b55e..91e1ea5 100644\n>>> --- a/git-gui/Makefile\n>>> +++ b/git-gui/Makefile\n>>> @@ -9,7 +9,9 @@ all::\n>>>\n>>>  GIT-VERSION-FILE: FORCE\n>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>> --include GIT-VERSION-FILE\n>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>> +  -include GIT-VERSION-FILE\n>>> +endif\n>>>\n>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n>>> --\n>>> 1.7.1\n>>\n>> This patch needs a rationale, why was it needed? The \"-include\"\n>> directive will simply ignore files that don't exist (as opposed to\n>> \"include\"), so including GIT-VERSION-FILE during \"make clean'\n>> shouldn't be an issue.\n>\n> Just guessing here, but since GIT-VERSION-FILE has a 'FORCE'\n> prerequisite, that means that the operations to generate it will be run\n> even for 'make clean', which is not useful for the cleaning operation.\n> It's probably not harmful either... but maybe the OP has some more\n> significant reason for this patch.\n>\n>\n\n> Yes, when we run 'make clean' ,it also generate the git version\n> file,then remove it .It's not necessary to trigger the operation\n> when run 'make clean' command\n\nSure, it's not needed. But it's OK to have a bit of redundancy for\nsimplicity, unless that redundancy is breaking something. Which is why\nI asked whether it was actually causing a problem in any case.\n\nWith this patch we still call ./GIT-VERSION-GEN to make the\n./GIT-VERSION-FILE, we just aren't including it anymore, and it would\nstill be included on \"make distclean\" since you're just looking at\n$(MAKECMDGOALS).\n\nNo,it won't call ./GIT-VERSION-GEN as it doesn't include GET-VERSION-FILE any more.so It won't trigger the  GIT-VERSION-FILE target\n\n\nWe can also handle distclean target\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe git\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n"},{"id":"146265","messageId":"AANLkTilhoF670uZ1WbosZP9TNbXect2A3gELRJL0ZZIn@mail.gmail.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F99A@CORPUSMX100A.corp.emc.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-25T11:55:39Z","receivedAt":"2010-07-25T11:55:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Jul 25, 2010 at 11:46,  <lynn.lin@emc.com> wrote:\n>\n>\n> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of ?var Arnfj?re Bjarmason\n> Sent: 2010年7月25日 19:42\n> To: Lin, Lynn\n> Cc: kpfleming@digium.com; git@vger.kernel.org\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>\n> On Sun, Jul 25, 2010 at 11:28,  <lynn.lin@emc.com> wrote:\n>>\n>>\n>> -----Original Message-----\n>> From: Kevin P. Fleming [mailto:kpfleming@digium.com]\n>> Sent: 2010年7月25日 16:50\n>> To: Ævar Arnfjörð Bjarmason\n>> Cc: Lin, Lynn; git@vger.kernel.org\n>> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>>\n>> On 07/24/2010 02:36 PM, Ævar Arnfjörð Bjarmason wrote:\n>>> On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n>>>> From: Lynn Lin <Lynn.Lin@emc.com>\n>>>>\n>>>> ---\n>>>>  Makefile         |    4 +++-\n>>>>  git-gui/Makefile |    4 +++-\n>>>>  2 files changed, 6 insertions(+), 2 deletions(-)\n>>>>\n>>>> diff --git a/Makefile b/Makefile\n>>>> index bc3c570..eb28b98 100644\n>>>> --- a/Makefile\n>>>> +++ b/Makefile\n>>>> @@ -238,7 +238,9 @@ all::\n>>>>\n>>>>  GIT-VERSION-FILE: FORCE\n>>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>>> --include GIT-VERSION-FILE\n>>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>>> +  -include GIT-VERSION-FILE\n>>>> +endif\n>>>>\n>>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n>>>> diff --git a/git-gui/Makefile b/git-gui/Makefile\n>>>> index 197b55e..91e1ea5 100644\n>>>> --- a/git-gui/Makefile\n>>>> +++ b/git-gui/Makefile\n>>>> @@ -9,7 +9,9 @@ all::\n>>>>\n>>>>  GIT-VERSION-FILE: FORCE\n>>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>>> --include GIT-VERSION-FILE\n>>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>>> +  -include GIT-VERSION-FILE\n>>>> +endif\n>>>>\n>>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n>>>> --\n>>>> 1.7.1\n>>>\n>>> This patch needs a rationale, why was it needed? The \"-include\"\n>>> directive will simply ignore files that don't exist (as opposed to\n>>> \"include\"), so including GIT-VERSION-FILE during \"make clean'\n>>> shouldn't be an issue.\n>>\n>> Just guessing here, but since GIT-VERSION-FILE has a 'FORCE'\n>> prerequisite, that means that the operations to generate it will be run\n>> even for 'make clean', which is not useful for the cleaning operation.\n>> It's probably not harmful either... but maybe the OP has some more\n>> significant reason for this patch.\n>>\n>>\n>\n>> Yes, when we run 'make clean' ,it also generate the git version\n>> file,then remove it .It's not necessary to trigger the operation\n>> when run 'make clean' command\n>\n> Sure, it's not needed. But it's OK to have a bit of redundancy for\n> simplicity, unless that redundancy is breaking something. Which is why\n> I asked whether it was actually causing a problem in any case.\n>\n> With this patch we still call ./GIT-VERSION-GEN to make the\n> ./GIT-VERSION-FILE, we just aren't including it anymore, and it would\n> still be included on \"make distclean\" since you're just looking at\n> $(MAKECMDGOALS).\n\n> No,it won't call ./GIT-VERSION-GEN as it doesn't include\n> GET-VERSION-FILE any more.so It won't trigger the  GIT-VERSION-FILE\n> target\n\nYes it will. The version file is generated by this part:\n\n    GIT-VERSION-FILE: FORCE\n        @$(SHELL_PATH) ./GIT-VERSION-GEN\n\nBut you've only wrapped the inclusion *after* the file is generated in\nan ifneq:\n\n    +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n    +  -include GIT-VERSION-FILE\n    +endif\n\nMakefile targets aren't triggered by the include directive.\n\n> We can also handle distclean target\n\nSure, it can be made to work. But can you tell my *why* this is needed\n(asking for the third time now). I'm more interested in the motivation\nthan getting this particular patch working. If generating files like\nthis during clean is breaking something it would be good to know, as\nwe're probably doing it somewhere else too.\n\nIf it's just OCD about not doing redundant work that's fine too. But\nit would be good to *know*.\n\nThanks.\n"},{"id":"146266","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F99B@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"AANLkTilhoF670uZ1WbosZP9TNbXect2A3gELRJL0ZZIn@mail.gmail.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T12:02:04Z","receivedAt":"2010-07-25T12:02:04Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] \nSent: 2010年7月25日 19:56\nTo: Lin, Lynn\nCc: kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 11:46,  <lynn.lin@emc.com> wrote:\n>\n>\n> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of ?var Arnfj?re Bjarmason\n> Sent: 2010年7月25日 19:42\n> To: Lin, Lynn\n> Cc: kpfleming@digium.com; git@vger.kernel.org\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>\n> On Sun, Jul 25, 2010 at 11:28,  <lynn.lin@emc.com> wrote:\n>>\n>>\n>> -----Original Message-----\n>> From: Kevin P. Fleming [mailto:kpfleming@digium.com]\n>> Sent: 2010年7月25日 16:50\n>> To: Ævar Arnfjörð Bjarmason\n>> Cc: Lin, Lynn; git@vger.kernel.org\n>> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>>\n>> On 07/24/2010 02:36 PM, Ævar Arnfjörð Bjarmason wrote:\n>>> On Sat, Jul 24, 2010 at 03:53,  <Lynn.Lin@emc.com> wrote:\n>>>> From: Lynn Lin <Lynn.Lin@emc.com>\n>>>>\n>>>> ---\n>>>>  Makefile         |    4 +++-\n>>>>  git-gui/Makefile |    4 +++-\n>>>>  2 files changed, 6 insertions(+), 2 deletions(-)\n>>>>\n>>>> diff --git a/Makefile b/Makefile\n>>>> index bc3c570..eb28b98 100644\n>>>> --- a/Makefile\n>>>> +++ b/Makefile\n>>>> @@ -238,7 +238,9 @@ all::\n>>>>\n>>>>  GIT-VERSION-FILE: FORCE\n>>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>>> --include GIT-VERSION-FILE\n>>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>>> +  -include GIT-VERSION-FILE\n>>>> +endif\n>>>>\n>>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>>  uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n>>>> diff --git a/git-gui/Makefile b/git-gui/Makefile\n>>>> index 197b55e..91e1ea5 100644\n>>>> --- a/git-gui/Makefile\n>>>> +++ b/git-gui/Makefile\n>>>> @@ -9,7 +9,9 @@ all::\n>>>>\n>>>>  GIT-VERSION-FILE: FORCE\n>>>>        @$(SHELL_PATH) ./GIT-VERSION-GEN\n>>>> --include GIT-VERSION-FILE\n>>>> +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n>>>> +  -include GIT-VERSION-FILE\n>>>> +endif\n>>>>\n>>>>  uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n>>>>  uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n>>>> --\n>>>> 1.7.1\n>>>\n>>> This patch needs a rationale, why was it needed? The \"-include\"\n>>> directive will simply ignore files that don't exist (as opposed to\n>>> \"include\"), so including GIT-VERSION-FILE during \"make clean'\n>>> shouldn't be an issue.\n>>\n>> Just guessing here, but since GIT-VERSION-FILE has a 'FORCE'\n>> prerequisite, that means that the operations to generate it will be run\n>> even for 'make clean', which is not useful for the cleaning operation.\n>> It's probably not harmful either... but maybe the OP has some more\n>> significant reason for this patch.\n>>\n>>\n>\n>> Yes, when we run 'make clean' ,it also generate the git version\n>> file,then remove it .It's not necessary to trigger the operation\n>> when run 'make clean' command\n>\n> Sure, it's not needed. But it's OK to have a bit of redundancy for\n> simplicity, unless that redundancy is breaking something. Which is why\n> I asked whether it was actually causing a problem in any case.\n>\n> With this patch we still call ./GIT-VERSION-GEN to make the\n> ./GIT-VERSION-FILE, we just aren't including it anymore, and it would\n> still be included on \"make distclean\" since you're just looking at\n> $(MAKECMDGOALS).\n\n> No,it won't call ./GIT-VERSION-GEN as it doesn't include\n> GET-VERSION-FILE any more.so It won't trigger the  GIT-VERSION-FILE\n> target\n\nYes it will. The version file is generated by this part:\n\n    GIT-VERSION-FILE: FORCE\n        @$(SHELL_PATH) ./GIT-VERSION-GEN\n\n\nIf we don't trigger include ,it won't call GIT-VERSION-FILE target\n\n\n\nBut you've only wrapped the inclusion *after* the file is generated in\nan ifneq:\n\n    +ifneq \"$(MAKECMDGOALS)\" \"clean\"\n    +  -include GIT-VERSION-FILE\n    +endif\n\n\n\n\n\nMakefile targets aren't triggered by the include directive.\n\n> We can also handle distclean target\n\nSure, it can be made to work. But can you tell my *why* this is needed\n(asking for the third time now).I'm more interested in the motivation\nthan getting this particular patch working. If generating files like\nthis during clean is breaking something it would be good to know, as\nwe're probably doing it somewhere else too.\n\n\nSorry. It doesn't break something. The motivation is that it's redundant code\n\n\nIf it's just OCD about not doing redundant work that's fine too. But\nit would be good to *know*.\n\nThanks.\n\n"},{"id":"146267","messageId":"m2d3ubojfr.fsf@igel.home","threadId":"24492","inReplyTo":"AANLkTilhoF670uZ1WbosZP9TNbXect2A3gELRJL0ZZIn@mail.gmail.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-07-25T12:05:44Z","receivedAt":"2010-07-25T12:05:44Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> Makefile targets aren't triggered by the include directive.\n\nUmm, yes they are, see (make) Remaking Makefiles.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"146268","messageId":"AANLkTin-TAZXzTCisSQqxOQrJ0MqJ6XN75LJXiEDqegs@mail.gmail.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F99B@CORPUSMX100A.corp.emc.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-25T12:10:41Z","receivedAt":"2010-07-25T12:10:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Jul 25, 2010 at 12:02,  <lynn.lin@emc.com> wrote:\n\n> Sorry. It doesn't break something. The motivation is that it's redundant code\n\nAh, good to know. That was what I mainly wanted to know. Thanks.\n"},{"id":"146269","messageId":"AANLkTilK_8wVQG6s8pUrscwd7ZnvgGyjOjJP41uXYfEl@mail.gmail.com","threadId":"24492","inReplyTo":"m2d3ubojfr.fsf@igel.home","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-25T12:15:38Z","receivedAt":"2010-07-25T12:15:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Jul 25, 2010 at 12:05, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> Makefile targets aren't triggered by the include directive.\n>\n> Umm, yes they are, see (make) Remaking Makefiles.\n\nAh, yes. But it was being included in more places than just that\n-include directive, so I didn't spot the difference:\n\nWithout that directive, still generated on make clean:\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..5edfeca 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -241 +240,0 @@ GIT-VERSION-FILE: FORCE\n    --include GIT-VERSION-FILE\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    GIT_VERSION = 1.7.2.6.g65a0d3.dirty\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    MOO\n\nDeleted the rule, not generated, but other things are still calling\nthe rule:\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..1a189da 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -239,4 +238,0 @@ all::\n    -GIT-VERSION-FILE: FORCE\n    -       @$(SHELL_PATH) ./GIT-VERSION-GEN\n    --include GIT-VERSION-FILE\n    -\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    cat: /tmp/moo: No such file or directory\n"},{"id":"146270","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F99D@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"AANLkTilK_8wVQG6s8pUrscwd7ZnvgGyjOjJP41uXYfEl@mail.gmail.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T12:19:10Z","receivedAt":"2010-07-25T12:19:10Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] \nSent: 2010年7月25日 20:16\nTo: Andreas Schwab\nCc: Lin, Lynn; kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 12:05, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> Makefile targets aren't triggered by the include directive.\n>\n> Umm, yes they are, see (make) Remaking Makefiles.\n\nAh, yes. But it was being included in more places than just that\n-include directive, so I didn't spot the difference:\n\nWithout that directive, still generated on make clean:\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..5edfeca 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -241 +240,0 @@ GIT-VERSION-FILE: FORCE\n    --include GIT-VERSION-FILE\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    GIT_VERSION = 1.7.2.6.g65a0d3.dirty\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    MOO\n\nDeleted the rule, not generated, but other things are still calling\nthe rule:\n\n\nWhy not delete the rule? We only handle this on 'make clean' command ('make distclean') target\n\n\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..1a189da 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -239,4 +238,0 @@ all::\n    -GIT-VERSION-FILE: FORCE\n    -       @$(SHELL_PATH) ./GIT-VERSION-GEN\n    --include GIT-VERSION-FILE\n    -\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    cat: /tmp/moo: No such file or directory\n\n"},{"id":"146271","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F99F@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F99D@CORPUSMX100A.corp.emc.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T12:21:55Z","receivedAt":"2010-07-25T12:21:55Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of lynn.lin@emc.com\nSent: 2010年7月25日 20:19\nTo: avarab@gmail.com; schwab@linux-m68k.org\nCc: kpfleming@digium.com; git@vger.kernel.org\nSubject: RE: [PATCH] Makefile: don't include git version file on 'make clean'\n\n\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] \nSent: 2010年7月25日 20:16\nTo: Andreas Schwab\nCc: Lin, Lynn; kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 12:05, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> Makefile targets aren't triggered by the include directive.\n>\n> Umm, yes they are, see (make) Remaking Makefiles.\n\nAh, yes. But it was being included in more places than just that\n-include directive, so I didn't spot the difference:\n\nWithout that directive, still generated on make clean:\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..5edfeca 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -241 +240,0 @@ GIT-VERSION-FILE: FORCE\n    --include GIT-VERSION-FILE\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    GIT_VERSION = 1.7.2.6.g65a0d3.dirty\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    MOO\n\nDeleted the rule, not generated, but other things are still calling\nthe rule:\n\n\nWhy not delete the rule? We only handle this on 'make clean' command ('make distclean') target\n\n\nSorry.it's typo .Why delete the rule\n\n\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..1a189da 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -239,4 +238,0 @@ all::\n    -GIT-VERSION-FILE: FORCE\n    -       @$(SHELL_PATH) ./GIT-VERSION-GEN\n    --include GIT-VERSION-FILE\n    -\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    cat: /tmp/moo: No such file or directory\n\nNryزXvؖ){nǉض\u0017}zj:v\nzZzf~zwڢ)\u001b\n"},{"id":"146273","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F9A0@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F99F@CORPUSMX100A.corp.emc.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T12:29:23Z","receivedAt":"2010-07-25T12:29:23Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: Lin, Lynn \nSent: 2010年7月25日 20:22\nTo: Lin, Lynn; avarab@gmail.com; schwab@linux-m68k.org\nCc: kpfleming@digium.com; git@vger.kernel.org\nSubject: RE: [PATCH] Makefile: don't include git version file on 'make clean'\n\n\n\n-----Original Message-----\nFrom: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of lynn.lin@emc.com\nSent: 2010年7月25日 20:19\nTo: avarab@gmail.com; schwab@linux-m68k.org\nCc: kpfleming@digium.com; git@vger.kernel.org\nSubject: RE: [PATCH] Makefile: don't include git version file on 'make clean'\n\n\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] \nSent: 2010年7月25日 20:16\nTo: Andreas Schwab\nCc: Lin, Lynn; kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 12:05, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> Makefile targets aren't triggered by the include directive.\n>\n> Umm, yes they are, see (make) Remaking Makefiles.\n\nAh, yes. But it was being included in more places than just that\n-include directive, so I didn't spot the difference:\n\nWithout that directive, still generated on make clean:\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..5edfeca 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -241 +240,0 @@ GIT-VERSION-FILE: FORCE\n    --include GIT-VERSION-FILE\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    GIT_VERSION = 1.7.2.6.g65a0d3.dirty\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    MOO\n\nDeleted the rule, not generated, but other things are still calling\nthe rule:\n\n\nWhy not delete the rule? We only handle this on 'make clean' command ('make distclean') target\n\n\nSorry.it's typo .Why delete the rule\n\n\n\n    $ git diff -U0 | cat\n    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n    index e88f50c..f29406b 100755\n    --- a/GIT-VERSION-GEN\n    +++ b/GIT-VERSION-GEN\n    @@ -2,0 +3,2 @@\n    +echo MOO > /tmp/moo\n    +\n    diff --git a/Makefile b/Makefile\n    index b6975aa..1a189da 100644\n    --- a/Makefile\n    +++ b/Makefile\n    @@ -239,4 +238,0 @@ all::\n    -GIT-VERSION-FILE: FORCE\n    -       @$(SHELL_PATH) ./GIT-VERSION-GEN\n    --include GIT-VERSION-FILE\n    -\n    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo\n    removed `/tmp/moo'\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.\n    GITGUI_VERSION = 0.12.0.64.g89d61-dirty\n    cat: /tmp/moo: No such file or directory\n\nNryزXvؖ){nǉض\u0017}zj:v\nzZzf~zwڢ)\u001b\n\n\n\n\n\n\nWe have two place to call GIT-VERSION-FILE target in top Makefile\n \ngit.o git.spec \\\n        $(patsubst %.sh,%,$(SCRIPT_SH)) \\\n        $(patsubst %.perl,%,$(SCRIPT_PERL)) \\\n        : GIT-VERSION-FILE\n\nclean:\n$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS\n\n\nMy patch is to don't call GIT-VERSION-FILE target when you run 'make clean'\n\n\n\nThanks\nLynn\n\n\n"},{"id":"146274","messageId":"AANLkTinjmUEHxnGI2kRBwN17689MEwRRX_1uOQx-ZaHY@mail.gmail.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F9A0@CORPUSMX100A.corp.emc.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-25T12:34:29Z","receivedAt":"2010-07-25T12:34:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Jul 25, 2010 at 12:29,  <lynn.lin@emc.com> wrote:\n\n> My patch is to don't call GIT-VERSION-FILE target when you run 'make clean'\n\nYes, but as I demonstrated it gets called anyway. Presumably because\nof the $(MAKE) -C ... clean rules. But I haven't looked into it.\n"},{"id":"146275","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F9A1@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"AANLkTinjmUEHxnGI2kRBwN17689MEwRRX_1uOQx-ZaHY@mail.gmail.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T12:37:35Z","receivedAt":"2010-07-25T12:37:35Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] \nSent: 2010年7月25日 20:34\nTo: Lin, Lynn\nCc: schwab@linux-m68k.org; kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 12:29,  <lynn.lin@emc.com> wrote:\n\n> My patch is to don't call GIT-VERSION-FILE target when you run 'make clean'\n\nYes, but as I demonstrated it gets called anyway. Presumably because\nof the $(MAKE) -C ... clean rules. But I haven't looked into it.\n\n\nIf we don't specify special goals, when we run any target ,it will call GIT-VERSIONF-FILE target as it include this target \n\nExample from GNU make manual:\nhttp://www.gnu.org/software/autoconf/manual/make/Goals.html\n\n\nAn example of appropriate use is to avoid including .d files during clean rules (see Automatic Prerequisites), so make won't create them only to immediately remove them again:\n\n          sources = foo.c bar.c\n     \n     ifneq ($(MAKECMDGOALS),clean)\n     include $(sources:.c=.d)\n     endif\n\n\n\nThanks\nLynn\n"},{"id":"146277","messageId":"AANLkTillxO38RTicjCw8ujzliFIhY3oHYHOCHAvUe7mB@mail.gmail.com","threadId":"24492","inReplyTo":"7F48A44C0E1FBF48B00D4DA49C85432E54F9A1@CORPUSMX100A.corp.emc.com","subject":"Re: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-25T13:08:14Z","receivedAt":"2010-07-25T13:08:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Jul 25, 2010 at 12:37,  <lynn.lin@emc.com> wrote:\n>\n>\n> -----Original Message-----\n> From: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com]\n> Sent: 2010年7月25日 20:34\n> To: Lin, Lynn\n> Cc: schwab@linux-m68k.org; kpfleming@digium.com; git@vger.kernel.org\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>\n> On Sun, Jul 25, 2010 at 12:29,  <lynn.lin@emc.com> wrote:\n>\n>> My patch is to don't call GIT-VERSION-FILE target when you run 'make clean'\n>\n> Yes, but as I demonstrated it gets called anyway. Presumably because\n> of the $(MAKE) -C ... clean rules. But I haven't looked into it.\n>\n>\n> If we don't specify special goals, when we run any target ,it will call GIT-VERSIONF-FILE target as it include this target\n>\n> Example from GNU make manual:\n> http://www.gnu.org/software/autoconf/manual/make/Goals.html\n>\n>\n> An example of appropriate use is to avoid including .d files during clean rules (see Automatic Prerequisites), so make won't create them only to immediately remove them again:\n>\n>          sources = foo.c bar.c\n>\n>     ifneq ($(MAKECMDGOALS),clean)\n>     include $(sources:.c=.d)\n>     endif\n\nYes, I know (now) how include directives work. What I'm saying is that\nyour patch doesn't work because the main Makefile clean directive\ncalls *other* makefiles, which in turn include the version file:\n\n    $ rm GIT-VERSION-FILE ; make -C gitweb clean; cat GIT-VERSION-FILE\n    make: Entering directory `/home/avar/g/git/gitweb'\n    make[1]: Entering directory `/home/avar/g/git'\n    GIT_VERSION = 1.7.2.6.g65a0d3\n    make[1]: Leaving directory `/home/avar/g/git'\n    make[1]: Entering directory `/home/avar/g/git'\n    make[1]: `GIT-VERSION-FILE' is up to date.\n    make[1]: Leaving directory `/home/avar/g/git'\n    make: Leaving directory `/home/avar/g/git/gitweb'\n    make: Entering directory `/home/avar/g/git/gitweb'\n    make[1]: Entering directory `/home/avar/g/git'\n    make[1]: `GIT-VERSION-FILE' is up to date.\n    make[1]: Leaving directory `/home/avar/g/git'\n    rm -f gitweb.cgi static/gitweb.min.js static/gitweb.min.css\nGITWEB-BUILD-OPTIONS\n    make: Leaving directory `/home/avar/g/git/gitweb'\n    GIT_VERSION = 1.7.2.6.g65a0d3\n\nSo just removing the inclusion in the main Makefile doesn't do\nanything at all.\n\nTo get it to work you need to patch the */Makefile files too, and\npatch other clean targets like distclean.\n\nBut personally I think this whole thing is a bit silly, but others may\ndisagree. I've said my bit.\n\nThanks for contributing to Git anyway, your help is appreciated.\n"},{"id":"146280","messageId":"7F48A44C0E1FBF48B00D4DA49C85432E54F9A3@CORPUSMX100A.corp.emc.com","threadId":"24492","inReplyTo":"AANLkTillxO38RTicjCw8ujzliFIhY3oHYHOCHAvUe7mB@mail.gmail.com","subject":"RE: [PATCH] Makefile: don't include git version file on 'make clean'","fromName":"","fromEmail":"lynn.lin@emc.com","sentAt":"2010-07-25T13:21:59Z","receivedAt":"2010-07-25T13:21:59Z","isPatch":true,"sender":{"key":"lynn.lin@emc.com","avatar":null},"body":"\n\n-----Original Message-----\nFrom: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of ?var Arnfj?re Bjarmason\nSent: 2010年7月25日 21:08\nTo: Lin, Lynn\nCc: schwab@linux-m68k.org; kpfleming@digium.com; git@vger.kernel.org\nSubject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n\nOn Sun, Jul 25, 2010 at 12:37,  <lynn.lin@emc.com> wrote:\n>\n>\n> -----Original Message-----\n> From: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com]\n> Sent: 2010年7月25日 20:34\n> To: Lin, Lynn\n> Cc: schwab@linux-m68k.org; kpfleming@digium.com; git@vger.kernel.org\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n>\n> On Sun, Jul 25, 2010 at 12:29,  <lynn.lin@emc.com> wrote:\n>\n>> My patch is to don't call GIT-VERSION-FILE target when you run 'make clean'\n>\n> Yes, but as I demonstrated it gets called anyway. Presumably because\n> of the $(MAKE) -C ... clean rules. But I haven't looked into it.\n>\n>\n> If we don't specify special goals, when we run any target ,it will call GIT-VERSIONF-FILE target as it include this target\n>\n> Example from GNU make manual:\n> http://www.gnu.org/software/autoconf/manual/make/Goals.html\n>\n>\n> An example of appropriate use is to avoid including .d files during clean rules (see Automatic Prerequisites), so make won't create them only to immediately remove them again:\n>\n>          sources = foo.c bar.c\n>\n>     ifneq ($(MAKECMDGOALS),clean)\n>     include $(sources:.c=.d)\n>     endif\n\nYes, I know (now) how include directives work. What I'm saying is that\nyour patch doesn't work because the main Makefile clean directive\ncalls *other* makefiles, which in turn include the version file:\n\n    $ rm GIT-VERSION-FILE ; make -C gitweb clean; cat GIT-VERSION-FILE\n    make: Entering directory `/home/avar/g/git/gitweb'\n    make[1]: Entering directory `/home/avar/g/git'\n    GIT_VERSION = 1.7.2.6.g65a0d3\n    make[1]: Leaving directory `/home/avar/g/git'\n    make[1]: Entering directory `/home/avar/g/git'\n    make[1]: `GIT-VERSION-FILE' is up to date.\n    make[1]: Leaving directory `/home/avar/g/git'\n    make: Leaving directory `/home/avar/g/git/gitweb'\n    make: Entering directory `/home/avar/g/git/gitweb'\n    make[1]: Entering directory `/home/avar/g/git'\n    make[1]: `GIT-VERSION-FILE' is up to date.\n    make[1]: Leaving directory `/home/avar/g/git'\n    rm -f gitweb.cgi static/gitweb.min.js static/gitweb.min.css\nGITWEB-BUILD-OPTIONS\n    make: Leaving directory `/home/avar/g/git/gitweb'\n    GIT_VERSION = 1.7.2.6.g65a0d3\n\nSo just removing the inclusion in the main Makefile doesn't do\nanything at all.\n\nTo get it to work you need to patch the */Makefile files too, and\npatch other clean targets like distclean.\n\nThere are Document,gitweb and git-gui module have the same \"issues\"\n\n\nBut personally I think this whole thing is a bit silly, but others may\ndisagree. I've said my bit.\n\n\nI think we can do better when we find redundant code, correct?\n\n\nThanks for contributing to Git anyway, your help is appreciated.\n--\nTo unsubscribe from this list: send the line \"unsubscribe git\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n"},{"id":"146314","messageId":"20100725184951.GA9636@burratino","threadId":"24492","inReplyTo":"1279943627-11053-1-git-send-email-Lynn.Lin@emc.com","subject":"Patch follow-up conventions (Re: [PATCH] Makefile: don't include git version file on 'make clean')","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-25T18:49:51Z","receivedAt":"2010-07-25T18:49:51Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Lynn,\n\nLynn Lin wrote:\n> -----Original Message-----\n> From: Jonathan Nieder [mailto:jrnieder@gmail.com] \n> Sent: 2010年7月24日 19:52\n> To: Lin, Lynn\n> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'\n[...]\n> Thanks much ,Jonathan.\n> It's my first time to try submit patch to git project:)\n> \n> Do I need to re-submit patch to add more message in commit message ?\n\nNo problem; it is always good to see people noticing things that can\nbe improved and fixing them. :)\n\nIn general the best thing to do (though hard) is to imagine what\nwould be most convenient at the receiving end and support that.\nThis means:\n\n - do not resend a whole patch when a small fixup would be easier;\n\n - if there has been a long discussion, once a patch is ready\n   send a copy with [PATCH v2] in the subject, with a summary\n   of the discussion after the \"---\" line and cc-ing Junio to let\n   him know it is ready for application.\n\nAnother piece of advice: please convince your mailer setup to present\nreplies in a more useful form.  That means snipping out any irrelevant\ntext and somehow visually distinguishing the text you are quoting from\nyour reply, like I have done with \"> \" above.\n\nHope that helps,\nJonathan\n"}]}