{"thread":{"id":"35700","subject":"[PATCH/RFC] Makefile: Fix compilation of windows resource file","startedAt":"2014-01-20T20:22:20Z","lastAt":"2014-01-23T18:02:46Z","messageCount":15,"participants":["Ramsay Jones","Junio C Hamano","Johannes Sixt","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"233412","messageId":"52DD857C.6060005@ramsay1.demon.co.uk","threadId":"35700","inReplyTo":null,"subject":"[PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-01-20T20:22:20Z","receivedAt":"2014-01-20T20:22:20Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIf the git version number consists of less than three period\nseparated numbers, then the windows resource file compilation\nissues a syntax error:\n\n  $ touch git.rc\n  $ make V=1 git.res\n  GIT_VERSION = 1.9.rc0\n  windres -O coff \\\n            -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \\\n            -DGIT_VERSION=\"\\\\\\\"1.9.rc0\\\\\\\"\" git.rc -o git.res\n  C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n  make: *** [git.res] Error 1\n  $\n\n[Note that -DPATCH=rc0]\n\nIn order to fix the syntax error, we replace any rcX with zero and\ninclude some additional 'zero' padding to the version number list.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nThis patch is marked RFC because, as I was just about to send this\nemail, I realized it wouldn't always work:\n\n    $ touch git.rc\n    $ make V=1 GIT_VERSION=1.9.dirty git.res\n    windres -O coff \\\n              -DMAJOR=1 -DMINOR=9 -DPATCH=dirty \\\n              -DGIT_VERSION=\"\\\\\\\"1.9.dirty\\\\\\\"\" git.rc -o git.res\n    C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n    make: *** [git.res] Error 1\n    $\n\n:-D\n\nI suspect it would be easier to change GIT-VERSION-GEN to also set, say,\nGIT_VERSION_MAJOR, GIT_VERSION_MINOR and GIT_VERSION_PATCH ...\n\nATB,\nRamsay Jones\n\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex b4af1e2..308baaa 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n \n git.res: git.rc GIT-VERSION-FILE\n \t$(QUIET_RC)$(RC) \\\n-\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n+\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(patsubst rc%,0,$(subst -, ,$(subst ., ,$(GIT_VERSION))) 0 0))) \\\n \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n \n ifndef NO_PERL\n-- \n1.8.5\n"},{"id":"233460","messageId":"xmqqy529t5bb.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"52DD857C.6060005@ramsay1.demon.co.uk","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-21T21:04:24Z","receivedAt":"2014-01-21T21:04:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> If the git version number consists of less than three period\n> separated numbers, then the windows resource file compilation\n> issues a syntax error:\n>\n>   $ touch git.rc\n>   $ make V=1 git.res\n>   GIT_VERSION = 1.9.rc0\n>   windres -O coff \\\n>             -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \\\n>             -DGIT_VERSION=\"\\\\\\\"1.9.rc0\\\\\\\"\" git.rc -o git.res\n>   C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n>   make: *** [git.res] Error 1\n>   $\n>\n> [Note that -DPATCH=rc0]\n\nThanks for a report.  I've been wondering how many distros and\npackagers would have an issue like this when we go to 2-digit\nrelease naming.  Of course we knew everybody can grok 3-or-4 ;-)\n\n> In order to fix the syntax error, we replace any rcX with zero and\n> include some additional 'zero' padding to the version number list.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>\n> Hi Junio,\n>\n> This patch is marked RFC because, as I was just about to send this\n> email, I realized it wouldn't always work:\n\nYeah, and I suspect that with the use of $(wordlist 1,3,...) it is\nnot even working for maintenance releases.  Does it differenciate\nbetween 1.8.5.1 and 1.8.5.2, for example?.  Or does \"windres\" always\nassume that a package version is always 3-dewey-decimal (not 2, not\n4)?\n"},{"id":"233463","messageId":"xmqqppnlt3u3.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"xmqqy529t5bb.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-21T21:36:20Z","receivedAt":"2014-01-21T21:36:20Z","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> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>\n>> If the git version number consists of less than three period\n>> separated numbers, then the windows resource file compilation\n>> issues a syntax error:\n>>\n>>   $ touch git.rc\n>>   $ make V=1 git.res\n>>   GIT_VERSION = 1.9.rc0\n>>   windres -O coff \\\n>>             -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \\\n>>             -DGIT_VERSION=\"\\\\\\\"1.9.rc0\\\\\\\"\" git.rc -o git.res\n>>   C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n>>   make: *** [git.res] Error 1\n>>   $\n>>\n>> [Note that -DPATCH=rc0]\n>\n> Thanks for a report.  I've been wondering how many distros and\n> packagers would have an issue like this when we go to 2-digit\n> release naming.  Of course we knew everybody can grok 3-or-4 ;-)\n>\n>> In order to fix the syntax error, we replace any rcX with zero and\n>> include some additional 'zero' padding to the version number list.\n>>\n>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>> ---\n>>\n>> Hi Junio,\n>>\n>> This patch is marked RFC because, as I was just about to send this\n>> email, I realized it wouldn't always work:\n>\n> Yeah, and I suspect that with the use of $(wordlist 1,3,...) it is\n> not even working for maintenance releases.  Does it differenciate\n> between 1.8.5.1 and 1.8.5.2, for example?.  Or does \"windres\" always\n> assume that a package version is always 3-dewey-decimal (not 2, not\n> 4)?\n\nPerhaps like this?  Just grab digit-only segments that are separated\nwith either dot or dash (and stop when we see a non-digit like\n'dirty' or 'rcX'), and make them separated with comma.\n\nNote that I am merely guessing that \"short-digit\" version numbers\nare acceptable by now after seeing\n\n    https://sourceware.org/ml/binutils/2012-07/msg00199.html\n\nwithout knowing the current state of affairs.  If that is not the\ncase you may have to count the iteration of the loop and append or\nchop the resulting string as necessary.\n\n Makefile              |  2 +-\n gen-version-string.sh | 13 +++++++++++++\n git.rc                |  4 ++--\n 3 files changed, 16 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b4af1e2..329f942 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n \n git.res: git.rc GIT-VERSION-FILE\n \t$(QUIET_RC)$(RC) \\\n-\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n+\t\t-DVERSIONSTRING=$$(./gen-version-string.sh $(GIT_VERSION)) \\\n \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n \n ifndef NO_PERL\ndiff --git a/gen-version-string.sh b/gen-version-string.sh\nnew file mode 100755\nindex 0000000..00af718\n--- /dev/null\n+++ b/gen-version-string.sh\n@@ -0,0 +1,13 @@\n+#!/bin/sh\n+\n+IFS=.- result=\n+for v in $1\n+do\n+\tif expr \"$v\" : '[0-9][0-9]*$' >/dev/null\n+\tthen\n+\t\tresult=$result${result:+,}$v\n+\telse\n+\t\tbreak\n+\tfi\n+done\n+echo \"$result\"\ndiff --git a/git.rc b/git.rc\nindex bce6db9..6f2a8d2 100644\n--- a/git.rc\n+++ b/git.rc\n@@ -1,6 +1,6 @@\n 1 VERSIONINFO\n-FILEVERSION     MAJOR,MINOR,PATCH,0\n-PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n+FILEVERSION     VERSIONSTRING,0\n+PRODUCTVERSION  VERSIONSTRING,0\n BEGIN\n   BLOCK \"StringFileInfo\"\n   BEGIN\n"},{"id":"233472","messageId":"52DEF9F2.1000905@ramsay1.demon.co.uk","threadId":"35700","inReplyTo":"xmqqppnlt3u3.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-01-21T22:51:30Z","receivedAt":"2014-01-21T22:51:30Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 21/01/14 21:36, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>\n>>> If the git version number consists of less than three period\n>>> separated numbers, then the windows resource file compilation\n>>> issues a syntax error:\n>>>\n>>>   $ touch git.rc\n>>>   $ make V=1 git.res\n>>>   GIT_VERSION = 1.9.rc0\n>>>   windres -O coff \\\n>>>             -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \\\n>>>             -DGIT_VERSION=\"\\\\\\\"1.9.rc0\\\\\\\"\" git.rc -o git.res\n>>>   C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n>>>   make: *** [git.res] Error 1\n>>>   $\n>>>\n>>> [Note that -DPATCH=rc0]\n>>\n>> Thanks for a report.  I've been wondering how many distros and\n>> packagers would have an issue like this when we go to 2-digit\n>> release naming.  Of course we knew everybody can grok 3-or-4 ;-)\n>>\n>>> In order to fix the syntax error, we replace any rcX with zero and\n>>> include some additional 'zero' padding to the version number list.\n>>>\n>>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>>> ---\n>>>\n>>> Hi Junio,\n>>>\n>>> This patch is marked RFC because, as I was just about to send this\n>>> email, I realized it wouldn't always work:\n>>\n>> Yeah, and I suspect that with the use of $(wordlist 1,3,...) it is\n>> not even working for maintenance releases.  Does it differenciate\n>> between 1.8.5.1 and 1.8.5.2, for example?.  Or does \"windres\" always\n>> assume that a package version is always 3-dewey-decimal (not 2, not\n>> 4)?\n\nI'm no expert on '.rc' file syntax, but the code certainly does not\n(currently) support four digit versions.\n\n> Perhaps like this?  Just grab digit-only segments that are separated\n> with either dot or dash (and stop when we see a non-digit like\n> 'dirty' or 'rcX'), and make them separated with comma.\n\nOh, this is *much* better than my new (unsent) attempt to fix this! ;-)\n\n> \n> Note that I am merely guessing that \"short-digit\" version numbers\n> are acceptable by now after seeing\n> \n>     https://sourceware.org/ml/binutils/2012-07/msg00199.html\n\nAh, nice find!\n\nI will test your patch (below) and let you know soon, but it looks\ngood to me. (I can't test it tonight, unfortunately.)\n\nATB,\nRamsay Jones\n\n> \n> without knowing the current state of affairs.  If that is not the\n> case you may have to count the iteration of the loop and append or\n> chop the resulting string as necessary.\n> \n>  Makefile              |  2 +-\n>  gen-version-string.sh | 13 +++++++++++++\n>  git.rc                |  4 ++--\n>  3 files changed, 16 insertions(+), 3 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index b4af1e2..329f942 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>  \n>  git.res: git.rc GIT-VERSION-FILE\n>  \t$(QUIET_RC)$(RC) \\\n> -\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n> +\t\t-DVERSIONSTRING=$$(./gen-version-string.sh $(GIT_VERSION)) \\\n>  \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>  \n>  ifndef NO_PERL\n> diff --git a/gen-version-string.sh b/gen-version-string.sh\n> new file mode 100755\n> index 0000000..00af718\n> --- /dev/null\n> +++ b/gen-version-string.sh\n> @@ -0,0 +1,13 @@\n> +#!/bin/sh\n> +\n> +IFS=.- result=\n> +for v in $1\n> +do\n> +\tif expr \"$v\" : '[0-9][0-9]*$' >/dev/null\n> +\tthen\n> +\t\tresult=$result${result:+,}$v\n> +\telse\n> +\t\tbreak\n> +\tfi\n> +done\n> +echo \"$result\"\n> diff --git a/git.rc b/git.rc\n> index bce6db9..6f2a8d2 100644\n> --- a/git.rc\n> +++ b/git.rc\n> @@ -1,6 +1,6 @@\n>  1 VERSIONINFO\n> -FILEVERSION     MAJOR,MINOR,PATCH,0\n> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n> +FILEVERSION     VERSIONSTRING,0\n> +PRODUCTVERSION  VERSIONSTRING,0\n>  BEGIN\n>    BLOCK \"StringFileInfo\"\n>    BEGIN\n> .\n> \n"},{"id":"233490","messageId":"xmqqk3dssxpb.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"52DEF9F2.1000905@ramsay1.demon.co.uk","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-21T23:48:48Z","receivedAt":"2014-01-21T23:48:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n>> Note that I am merely guessing that \"short-digit\" version numbers\n>> are acceptable by now after seeing\n>> \n>>     https://sourceware.org/ml/binutils/2012-07/msg00199.html\n>\n> Ah, nice find!\n>\n> I will test your patch (below) and let you know soon, but it looks\n> good to me. (I can't test it tonight, unfortunately.)\n\nOne thing to note is that I don't know why the existing code dropped\nthe fourth digit from the maintenance series.  The updated one will\ngive you \"1,8,5,3,0\" (because I just have a hardcoded \",0\" at the\nend for no good reason there), and if the missing fourth digit in\nthe original was a deliberate workaround for this file having an\nupper limit of the number of digits (like \"four\"), this change will\nbreak it, so if that is the case, you may have to count and stop the\nloop early, perhaps like...\n\n>> diff --git a/gen-version-string.sh b/gen-version-string.sh\n>> new file mode 100755\n>> index 0000000..00af718\n>> --- /dev/null\n>> +++ b/gen-version-string.sh\n>> @@ -0,0 +1,13 @@\n>> +#!/bin/sh\n>> +\n>> +IFS=.- result=\n\nAdd\n\n\tnum_digits=0\n\nhere, and...\n\n>> +for v in $1\n>> +do\n>> +\tif expr \"$v\" : '[0-9][0-9]*$' >/dev/null\n>> +\tthen\n>> +\t\tresult=$result${result:+,}$v\n\n... insert these here.\n\n                num_digits=$(( $num_digits + 1 ))\n                if test $num_digits = 4\n                then\n                        break\n                fi\n\n>> +\telse\n>> +\t\tbreak\n>> +\tfi\n>> +done\n>> +echo \"$result\"\n>> diff --git a/git.rc b/git.rc\n>> index bce6db9..6f2a8d2 100644\n>> --- a/git.rc\n>> +++ b/git.rc\n>> @@ -1,6 +1,6 @@\n>>  1 VERSIONINFO\n>> -FILEVERSION     MAJOR,MINOR,PATCH,0\n>> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n>> +FILEVERSION     VERSIONSTRING,0\n>> +PRODUCTVERSION  VERSIONSTRING,0\n>>  BEGIN\n>>    BLOCK \"StringFileInfo\"\n>>    BEGIN\n>> .\n>> \n"},{"id":"233500","messageId":"52DF6B6C.4020708@viscovery.net","threadId":"35700","inReplyTo":"xmqqk3dssxpb.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-01-22T06:55:40Z","receivedAt":"2014-01-22T06:55:40Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"[Cc Pat, who added git.rc]\n\nAm 1/22/2014 0:48, schrieb Junio C Hamano:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>>> Note that I am merely guessing that \"short-digit\" version numbers\n>>> are acceptable by now after seeing\n>>>\n>>>     https://sourceware.org/ml/binutils/2012-07/msg00199.html\n>>\n>> Ah, nice find!\n>>\n>> I will test your patch (below) and let you know soon, but it looks\n>> good to me. (I can't test it tonight, unfortunately.)\n> \n> One thing to note is that I don't know why the existing code dropped\n> the fourth digit from the maintenance series.\n\nI don't know either. But it does not really matter. When there are 4\ndigits in the FILEVERSION and PRODUCTVERSION statements, then the user\ndoes not see them as-are, but, for example, 1.8.1283 for\nFILEVERSION 1,8,5,3 (1283 = 5*256+3). Therefore, I think that there is\nno point in providing 4 numbers, and the patch below should be\nsufficient.\n\ndiff --git a/Makefile b/Makefile\nindex b4af1e2..99b2b89 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n \n git.res: git.rc GIT-VERSION-FILE\n \t$(QUIET_RC)$(RC) \\\n-\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n+\t  $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n \n ifndef NO_PERL\ndiff --git a/git.rc b/git.rc\nindex bce6db9..33aafb7 100644\n--- a/git.rc\n+++ b/git.rc\n@@ -1,6 +1,6 @@\n 1 VERSIONINFO\n-FILEVERSION     MAJOR,MINOR,PATCH,0\n-PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n+FILEVERSION     MAJOR,MINOR,0,0\n+PRODUCTVERSION  MAJOR,MINOR,0,0\n BEGIN\n   BLOCK \"StringFileInfo\"\n   BEGIN\n"},{"id":"233522","messageId":"xmqq38kgyozt.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"52DF6B6C.4020708@viscovery.net","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-22T16:12:38Z","receivedAt":"2014-01-22T16:12:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> [Cc Pat, who added git.rc]\n>\n> Am 1/22/2014 0:48, schrieb Junio C Hamano:\n>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>> \n>>>> Note that I am merely guessing that \"short-digit\" version numbers\n>>>> are acceptable by now after seeing\n>>>>\n>>>>     https://sourceware.org/ml/binutils/2012-07/msg00199.html\n>>>\n>>> Ah, nice find!\n>>>\n>>> I will test your patch (below) and let you know soon, but it looks\n>>> good to me. (I can't test it tonight, unfortunately.)\n>> \n>> One thing to note is that I don't know why the existing code dropped\n>> the fourth digit from the maintenance series.\n>\n> I don't know either. But it does not really matter. When there are 4\n> digits in the FILEVERSION and PRODUCTVERSION statements, then the user\n> does not see them as-are, but, for example, 1.8.1283 for\n> FILEVERSION 1,8,5,3 (1283 = 5*256+3). Therefore, I think that there is\n> no point in providing 4 numbers, and the patch below should be\n> sufficient.\n\nWould that work well when we do 1.9.1, the first maintenance/bugfix\nrelease for 1.9?\n\n> diff --git a/Makefile b/Makefile\n> index b4af1e2..99b2b89 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>  \n>  git.res: git.rc GIT-VERSION-FILE\n>  \t$(QUIET_RC)$(RC) \\\n> -\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n> +\t  $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>  \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>  \n>  ifndef NO_PERL\n> diff --git a/git.rc b/git.rc\n> index bce6db9..33aafb7 100644\n> --- a/git.rc\n> +++ b/git.rc\n> @@ -1,6 +1,6 @@\n>  1 VERSIONINFO\n> -FILEVERSION     MAJOR,MINOR,PATCH,0\n> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n> +FILEVERSION     MAJOR,MINOR,0,0\n> +PRODUCTVERSION  MAJOR,MINOR,0,0\n>  BEGIN\n>    BLOCK \"StringFileInfo\"\n>    BEGIN\n"},{"id":"233524","messageId":"52DFF4E8.8060605@viscovery.net","threadId":"35700","inReplyTo":"xmqq38kgyozt.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-01-22T16:42:16Z","receivedAt":"2014-01-22T16:42:16Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 1/22/2014 17:12, schrieb Junio C Hamano:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n> \n>> [Cc Pat, who added git.rc]\n>>\n>> Am 1/22/2014 0:48, schrieb Junio C Hamano:\n>>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>>\n>>>>> Note that I am merely guessing that \"short-digit\" version numbers\n>>>>> are acceptable by now after seeing\n>>>>>\n>>>>>     https://sourceware.org/ml/binutils/2012-07/msg00199.html\n>>>>\n>>>> Ah, nice find!\n>>>>\n>>>> I will test your patch (below) and let you know soon, but it looks\n>>>> good to me. (I can't test it tonight, unfortunately.)\n>>>\n>>> One thing to note is that I don't know why the existing code dropped\n>>> the fourth digit from the maintenance series.\n>>\n>> I don't know either. But it does not really matter. When there are 4\n>> digits in the FILEVERSION and PRODUCTVERSION statements, then the user\n>> does not see them as-are, but, for example, 1.8.1283 for\n>> FILEVERSION 1,8,5,3 (1283 = 5*256+3). Therefore, I think that there is\n\nI just noticed that I'm wrong here: The user will see \"1.8.5.3\". But I\nthink it makes no difference. Read on.\n\n>> no point in providing 4 numbers, and the patch below should be\n>> sufficient.\n> \n> Would that work well when we do 1.9.1, the first maintenance/bugfix\n> release for 1.9?\n\nDefine \"work well\".\n\nThe numbers defined in {FILE,PRODUCT}VERSION statements are intended for\nmachine consumption and are always 4 positions (if the source contains\nfewer, they are padded with zeros). They can be used by installers to\ndecide whether a file that already exists in the system should be\noverwritten by a newer version.\n\nUnfortunately, these numbers are visible when the user invokes Properties\nfrom the context menu of git.exe in the file manager and then switches to\nthe \"Version\" tab. All 4 positions are always listed. Therefore, the user\nwill see \"1.9.0.0\" for the first release of the 1.9 series, which is\n\"wrong\", because you will call \"1.9\", not \"1.9.0.0\", I assume.\n\nWith sufficient effort, we could achieve that version 1.9.1 is listed as\n\"1.9.1.0\". That is still \"wrong\".\n\nSince we can't get this display right, I suggest that we just punt (as per\nmy patch). That should work out nicely because we can fairly safely assume\nthat there are no installers around that look at these particular version\nnumbers.\n\nBTW, that same \"Version\" tab will have another entry, called \"Product\nVersion\" later in the list. This one lists the string that we pass in\n-DGIT_VERSION (see quoted context below). It is the truely correct version\nthat *users* should be interested in.\n\n> \n>> diff --git a/Makefile b/Makefile\n>> index b4af1e2..99b2b89 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>>  \n>>  git.res: git.rc GIT-VERSION-FILE\n>>  \t$(QUIET_RC)$(RC) \\\n>> -\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>> +\t  $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>>  \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>>  \n>>  ifndef NO_PERL\n>> diff --git a/git.rc b/git.rc\n>> index bce6db9..33aafb7 100644\n>> --- a/git.rc\n>> +++ b/git.rc\n>> @@ -1,6 +1,6 @@\n>>  1 VERSIONINFO\n>> -FILEVERSION     MAJOR,MINOR,PATCH,0\n>> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n>> +FILEVERSION     MAJOR,MINOR,0,0\n>> +PRODUCTVERSION  MAJOR,MINOR,0,0\n>>  BEGIN\n>>    BLOCK \"StringFileInfo\"\n>>    BEGIN\n"},{"id":"233526","messageId":"xmqqppnjyl10.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"52DFF4E8.8060605@viscovery.net","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-22T17:38:18Z","receivedAt":"2014-01-22T17:38:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> The numbers defined in {FILE,PRODUCT}VERSION statements are intended for\n> machine consumption and are always 4 positions (if the source contains\n> fewer, they are padded with zeros). They can be used by installers to\n> decide whether a file that already exists in the system should be\n> overwritten by a newer version.\n\nOK, that makes sense.  If you package 1.9 (padded as 1.9.0.0) and\nthen 1.9.1 (padded as 1.9.1.0), you can update from 1.9 to 1.9.1\njust fine.\n\n> Unfortunately, these numbers are visible when the user invokes Properties\n> from the context menu of git.exe in the file manager and then switches to\n> the \"Version\" tab. All 4 positions are always listed. Therefore, the user\n> will see \"1.9.0.0\" for the first release of the 1.9 series, which is\n> \"wrong\", because you will call \"1.9\", not \"1.9.0.0\", I assume.\n>\n> With sufficient effort, we could achieve that version 1.9.1 is listed as\n> \"1.9.1.0\". That is still \"wrong\".\n\nI would not be worried about showing 1.9.1.0 for 1.9.1 and/or\n1.9.0.0 for 1.9 at all.\n\nBut if the (receiving) system expects these to be monotonically\nincreasing, I suspect the script I posted would not \"work well\"\nunder that expectation.  When you package 1.9.2.g43218765.dirty,\nthat would become \"1.9.2.0\", and become indistinguishable from the\npackage taken from v1.9.2 tag, which is not good at all.  So the\nscript should strip [0-9]*\\.g[0-9a-f]*\\(\\.dirty\\)? from the end\nfirst.\n\nBut even without complications from the \"N-commit after the tag\" it\nwon't \"work well\" if you cut packages from anything that is not\ntagged anyway.  The only thing we know about any package taken from\nthe tip of 'master' past v1.9 is that it is newer than the package\ntaken from v1.9 tag. Sometimes it should be considered newer than a\npackage taken from v1.9.x tag (i.e. the contents of the maintenance\nrelase is fully included in 'master'), but not always (i.e. the tip\nof 'master' when the package was made may contain up to v1.9.3 but\nv1.9.4 may be newer than that).\n\nIf you truncate down to only two, like your patch does, anything\npast v1.9 and before v1.10 (or v2.0) would have 1.9.0.0 and that is\nno worse than giving 1.9.3.0 for v1.9.3 and giving 1.9.0.0 for\nanything based on 'master'.  Your user may have installed a package\nmade from v1.9.1 and would want to update to the one taken from\n'master' when it contained everything up to v1.9.3---under my\nearlier \"take numbers\" approach, we would be \"updating\" from 1.9.1.0\nto 1.9.0.0, which does not look like updating at all to the system.\nThe installers can use this to decide \"a file that already exists in\nthe system\" is newer, which is wrong, if I am reading your earlier\nexplanation corretly.\n\nWith your \"we just take the first two numbers always\", you would be\nsidegrading between two 1.9.0.0, which may fare better.\n\n> Since we can't get this display right, I suggest that we just punt (as per\n> my patch). That should work out nicely because we can fairly safely assume\n> that there are no installers around that look at these particular version\n> numbers.\n>\n> BTW, that same \"Version\" tab will have another entry, called \"Product\n> Version\" later in the list. This one lists the string that we pass in\n> -DGIT_VERSION (see quoted context below). It is the truely correct version\n> that *users* should be interested in.\n>\n>> \n>>> diff --git a/Makefile b/Makefile\n>>> index b4af1e2..99b2b89 100644\n>>> --- a/Makefile\n>>> +++ b/Makefile\n>>> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>>>  \n>>>  git.res: git.rc GIT-VERSION-FILE\n>>>  \t$(QUIET_RC)$(RC) \\\n>>> -\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>>> +\t  $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>>>  \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>>>  \n>>>  ifndef NO_PERL\n>>> diff --git a/git.rc b/git.rc\n>>> index bce6db9..33aafb7 100644\n>>> --- a/git.rc\n>>> +++ b/git.rc\n>>> @@ -1,6 +1,6 @@\n>>>  1 VERSIONINFO\n>>> -FILEVERSION     MAJOR,MINOR,PATCH,0\n>>> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n>>> +FILEVERSION     MAJOR,MINOR,0,0\n>>> +PRODUCTVERSION  MAJOR,MINOR,0,0\n>>>  BEGIN\n>>>    BLOCK \"StringFileInfo\"\n>>>    BEGIN\n"},{"id":"233536","messageId":"xmqqeh3zydrz.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"xmqqppnjyl10.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-22T20:14:56Z","receivedAt":"2014-01-22T20:14:56Z","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> Johannes Sixt <j.sixt@viscovery.net> writes:\n> ...\n>> ..., I suggest that we just punt (as per\n>> my patch). That should work out nicely because we can fairly safely assume\n>> that there are no installers around that look at these particular version\n>> numbers.\n\nOK.  I do not think we care too deeply about how a \"forced to be\nfour dewey-decimal numbers\" looks compared to 2 or 3 numbers in the\n$(GIT_VERSION), as I think we always had that (non-)issue, but not\nbeing able to compile is not very nice.\n\nSo can you, Pat or Ramsay send a tested patch with a proposed log\nmessage?   Preferrably by -rc1 but I think the change is low impact\nthat it can be in -rc2, leaving -rc1 broken.\n\nThanks.\n"},{"id":"233587","messageId":"52E0C4BA.4080405@viscovery.net","threadId":"35700","inReplyTo":"xmqqeh3zydrz.fsf@gitster.dls.corp.google.com","subject":"[PATCH v2] Makefile: Fix compilation of Windows resource file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-01-23T07:28:58Z","receivedAt":"2014-01-23T07:28:58Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nIf the git version number consists of less than three period\nseparated numbers, then the Windows resource file compilation\nissues a syntax error:\n\n  $ touch git.rc\n  $ make V=1 git.res\n  GIT_VERSION = 1.9.rc0\n  windres -O coff \\\n            -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \\\n            -DGIT_VERSION=\"\\\\\\\"1.9.rc0\\\\\\\"\" git.rc -o git.res\n  C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n  make: *** [git.res] Error 1\n  $\n\nNote that -DPATCH=rc0.\n\nThe values passed via -DMAJOR=, -DMINOR=, and -DPATCH= are used in\nFILEVERSION and PRODUCTVERSION statements, which expect up to four numeric\nvalues. These version numbers are intended for machine consumption. They\nare typically inspected by installers to decide whether a file to be\ninstalled is newer than one that exists on the system, but are not used\nfor much else.\n\nWe can be pretty certain that there are no tools that look at these\nversion numbers, not even the installer of Git for Windows does.\nTherefore, to fix the syntax error, fill in only the first two numbers,\nwhich we are guaranteed to find in Git version numbers.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n That \"not even the installer of Git for Windows uses\" the FILEVERSION\n numbers is a bold statement of mine (I did not check). If I am wrong,\n this approach for a fix is not viable, and a better fix would be\n needed. Otherwise, an Acked-By would be appreciated so that we can\n have this fix in upstream ASAP.\n\n Makefile | 2 +-\n git.rc   | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b4af1e2..99b2b89 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n \n git.res: git.rc GIT-VERSION-FILE\n \t$(QUIET_RC)$(RC) \\\n-\t  $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n+\t  $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n \t  -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n \n ifndef NO_PERL\ndiff --git a/git.rc b/git.rc\nindex bce6db9..33aafb7 100644\n--- a/git.rc\n+++ b/git.rc\n@@ -1,6 +1,6 @@\n 1 VERSIONINFO\n-FILEVERSION     MAJOR,MINOR,PATCH,0\n-PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n+FILEVERSION     MAJOR,MINOR,0,0\n+PRODUCTVERSION  MAJOR,MINOR,0,0\n BEGIN\n   BLOCK \"StringFileInfo\"\n   BEGIN\n-- \n1.9.rc0.1179.g5088b55\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"233593","messageId":"CABNJ2GJRsqsr5+ga3-oKVU_H-HtsH+R14fBaVwV8jJcExkxr4g@mail.gmail.com","threadId":"35700","inReplyTo":"52E0C4BA.4080405@viscovery.net","subject":"Re: [PATCH v2] Makefile: Fix compilation of Windows resource file","fromName":"Pat Thoyts","fromEmail":"patthoyts@gmail.com","sentAt":"2014-01-23T12:02:37Z","receivedAt":"2014-01-23T12:02:37Z","isPatch":true,"sender":{"key":"patthoyts@gmail.com","avatar":"https://gravatar.com/avatar/bee887a777c790bd241f398217723fbe4b854428671db83db32216a28654cb25?d=mp&s=160"},"body":"On 23 January 2014 07:28, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> From: Johannes Sixt <j6t@kdbg.org>\n>\n> If the git version number consists of less than three period\n> separated numbers, then the Windows resource file compilation\n> issues a syntax error:\n>\n>   $ touch git.rc\n>   $ make V=1 git.res\n>   GIT_VERSION = 1.9.rc0\n>   windres -O coff \\\n>             -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \\\n>             -DGIT_VERSION=\"\\\\\\\"1.9.rc0\\\\\\\"\" git.rc -o git.res\n>   C:\\msysgit\\msysgit\\mingw\\bin\\windres.exe: git.rc:2: syntax error\n>   make: *** [git.res] Error 1\n>   $\n>\n> Note that -DPATCH=rc0.\n>\n> The values passed via -DMAJOR=, -DMINOR=, and -DPATCH= are used in\n> FILEVERSION and PRODUCTVERSION statements, which expect up to four numeric\n> values. These version numbers are intended for machine consumption. They\n> are typically inspected by installers to decide whether a file to be\n> installed is newer than one that exists on the system, but are not used\n> for much else.\n>\n> We can be pretty certain that there are no tools that look at these\n> version numbers, not even the installer of Git for Windows does.\n> Therefore, to fix the syntax error, fill in only the first two numbers,\n> which we are guaranteed to find in Git version numbers.\n>\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  That \"not even the installer of Git for Windows uses\" the FILEVERSION\n>  numbers is a bold statement of mine (I did not check). If I am wrong,\n>  this approach for a fix is not viable, and a better fix would be\n>  needed. Otherwise, an Acked-By would be appreciated so that we can\n>  have this fix in upstream ASAP.\n>\n>  Makefile | 2 +-\n>  git.rc   | 4 ++--\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index b4af1e2..99b2b89 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>\n>  git.res: git.rc GIT-VERSION-FILE\n>         $(QUIET_RC)$(RC) \\\n> -         $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n> +         $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>           -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>\n>  ifndef NO_PERL\n> diff --git a/git.rc b/git.rc\n> index bce6db9..33aafb7 100644\n> --- a/git.rc\n> +++ b/git.rc\n> @@ -1,6 +1,6 @@\n>  1 VERSIONINFO\n> -FILEVERSION     MAJOR,MINOR,PATCH,0\n> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0\n> +FILEVERSION     MAJOR,MINOR,0,0\n> +PRODUCTVERSION  MAJOR,MINOR,0,0\n>  BEGIN\n>    BLOCK \"StringFileInfo\"\n>    BEGIN\n> --\n> 1.9.rc0.1179.g5088b55\n>\nThis was put in as a response to\nhttps://github.com/msysgit/git/issues/5 where a request was made to be\nable to check the version without actually executing the file. Given\nthat the majority of versions has the same first two digits this\nbecomes fairly useless without the patchlevel digit. So it would be\npreferable to try to maintain all three digits. The following should\ndo this:\n\nGIT_VERSION=1.9.rc0\nall:\n    echo $(join -DMAJOR= -DMINOR= -DPATCH=, \\\n        $(wordlist 1,3,$(filter-out rc%,$(subst -, ,$(subst .,\n,$(GIT_VERSION)))) 0 0))\n\nThis removes any rc* parts and appends a couple of zeros so that all\nmissing elements should appear as 0 in the final list.\n\nPat Thoyts\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"233597","messageId":"52E1244E.4010503@viscovery.net","threadId":"35700","inReplyTo":"CABNJ2GJRsqsr5+ga3-oKVU_H-HtsH+R14fBaVwV8jJcExkxr4g@mail.gmail.com","subject":"Re: [PATCH v2] Makefile: Fix compilation of Windows resource file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-01-23T14:16:46Z","receivedAt":"2014-01-23T14:16:46Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 1/23/2014 13:02, schrieb Pat Thoyts:\n> On 23 January 2014 07:28, Johannes Sixt <j.sixt@viscovery.net> wrote:\n>> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>>\n>>  git.res: git.rc GIT-VERSION-FILE\n>>         $(QUIET_RC)$(RC) \\\n>> -         $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>> +         $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>>           -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>>\n>>  ifndef NO_PERL\n>\n> This was put in as a response to\n> https://github.com/msysgit/git/issues/5 where a request was made to be\n> able to check the version without actually executing the file.\n\nIf I understand the request correctly, it is about manual inspection. The\ncorrect version string for this purpose is recorded via -DGIT_VERSION.\n\n> Given\n> that the majority of versions has the same first two digits this\n> becomes fairly useless without the patchlevel digit. So it would be\n> preferable to try to maintain all three digits. The following should\n> do this:\n> \n> GIT_VERSION=1.9.rc0\n> all:\n>     echo $(join -DMAJOR= -DMINOR= -DPATCH=, \\\n>         $(wordlist 1,3,$(filter-out rc%,$(subst -, ,$(subst .,\n> ,$(GIT_VERSION)))) 0 0))\n> \n> This removes any rc* parts and appends a couple of zeros so that all\n> missing elements should appear as 0 in the final list.\n\nAs Junio already pointed out, this records the wrong number in the 1.9\ntrack before 1.9.1 is out because the third position is the commit count,\nnot the patch level.\n\n-- Hannes\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"233599","messageId":"CABNJ2GKA5PhzTfrhSCOTWtWAKMdT8+Sn6_Q54z=Dc0UVWgdmZQ@mail.gmail.com","threadId":"35700","inReplyTo":"52E1244E.4010503@viscovery.net","subject":"Re: [PATCH v2] Makefile: Fix compilation of Windows resource file","fromName":"Pat Thoyts","fromEmail":"patthoyts@gmail.com","sentAt":"2014-01-23T15:19:18Z","receivedAt":"2014-01-23T15:19:18Z","isPatch":true,"sender":{"key":"patthoyts@gmail.com","avatar":"https://gravatar.com/avatar/bee887a777c790bd241f398217723fbe4b854428671db83db32216a28654cb25?d=mp&s=160"},"body":"On 23 January 2014 14:16, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Am 1/23/2014 13:02, schrieb Pat Thoyts:\n>> On 23 January 2014 07:28, Johannes Sixt <j.sixt@viscovery.net> wrote:\n>>> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES\n>>>\n>>>  git.res: git.rc GIT-VERSION-FILE\n>>>         $(QUIET_RC)$(RC) \\\n>>> -         $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>>> +         $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \\\n>>>           -DGIT_VERSION=\"\\\\\\\"$(GIT_VERSION)\\\\\\\"\" $< -o $@\n>>>\n>>>  ifndef NO_PERL\n>>\n>> This was put in as a response to\n>> https://github.com/msysgit/git/issues/5 where a request was made to be\n>> able to check the version without actually executing the file.\n>\n> If I understand the request correctly, it is about manual inspection. The\n> correct version string for this purpose is recorded via -DGIT_VERSION.\n>\n>> Given\n>> that the majority of versions has the same first two digits this\n>> becomes fairly useless without the patchlevel digit. So it would be\n>> preferable to try to maintain all three digits. The following should\n>> do this:\n>>\n>> GIT_VERSION=1.9.rc0\n>> all:\n>>     echo $(join -DMAJOR= -DMINOR= -DPATCH=, \\\n>>         $(wordlist 1,3,$(filter-out rc%,$(subst -, ,$(subst .,\n>> ,$(GIT_VERSION)))) 0 0))\n>>\n>> This removes any rc* parts and appends a couple of zeros so that all\n>> missing elements should appear as 0 in the final list.\n>\n> As Junio already pointed out, this records the wrong number in the 1.9\n> track before 1.9.1 is out because the third position is the commit count,\n> not the patch level.\n>\n> -- Hannes\n\nOK - I cehcked and you are right in that the GIT_VERSION value is the\none showing up the properties dialog at least under Windows 7. As this\nis the most likely to be examined I agree that just taking the first\ntwo digits is the simplest fix here. So, fine by me then.\n\nAcked-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nCheers,\nPat.\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"},{"id":"233605","messageId":"xmqqlhy6vant.fsf@gitster.dls.corp.google.com","threadId":"35700","inReplyTo":"CABNJ2GKA5PhzTfrhSCOTWtWAKMdT8+Sn6_Q54z=Dc0UVWgdmZQ@mail.gmail.com","subject":"Re: [PATCH v2] Makefile: Fix compilation of Windows resource file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-23T18:02:46Z","receivedAt":"2014-01-23T18:02:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pat Thoyts <patthoyts@gmail.com> writes:\n\n>>> GIT_VERSION=1.9.rc0\n>>> all:\n>>>     echo $(join -DMAJOR= -DMINOR= -DPATCH=, \\\n>>>         $(wordlist 1,3,$(filter-out rc%,$(subst -, ,$(subst .,\n>>> ,$(GIT_VERSION)))) 0 0))\n>>>\n>>> This removes any rc* parts and appends a couple of zeros so that all\n>>> missing elements should appear as 0 in the final list.\n>>\n>> As Junio already pointed out, this records the wrong number in the 1.9\n>> track before 1.9.1 is out because the third position is the commit count,\n>> not the patch level.\n>>\n>> -- Hannes\n>\n> OK - I cehcked and you are right in that the GIT_VERSION value is the\n> one showing up the properties dialog at least under Windows 7. As this\n> is the most likely to be examined I agree that just taking the first\n> two digits is the simplest fix here. So, fine by me then.\n>\n> Acked-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nThanks.\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/groups/opt_out.\n"}]}