All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file
Date: Tue, 21 Jan 2014 15:48:48 -0800	[thread overview]
Message-ID: <xmqqk3dssxpb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <52DEF9F2.1000905@ramsay1.demon.co.uk> (Ramsay Jones's message of "Tue, 21 Jan 2014 22:51:30 +0000")

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

>> Note that I am merely guessing that "short-digit" version numbers
>> are acceptable by now after seeing
>> 
>>     https://sourceware.org/ml/binutils/2012-07/msg00199.html
>
> Ah, nice find!
>
> I will test your patch (below) and let you know soon, but it looks
> good to me. (I can't test it tonight, unfortunately.)

One thing to note is that I don't know why the existing code dropped
the fourth digit from the maintenance series.  The updated one will
give you "1,8,5,3,0" (because I just have a hardcoded ",0" at the
end for no good reason there), and if the missing fourth digit in
the original was a deliberate workaround for this file having an
upper limit of the number of digits (like "four"), this change will
break it, so if that is the case, you may have to count and stop the
loop early, perhaps like...

>> diff --git a/gen-version-string.sh b/gen-version-string.sh
>> new file mode 100755
>> index 0000000..00af718
>> --- /dev/null
>> +++ b/gen-version-string.sh
>> @@ -0,0 +1,13 @@
>> +#!/bin/sh
>> +
>> +IFS=.- result=

Add

	num_digits=0

here, and...

>> +for v in $1
>> +do
>> +	if expr "$v" : '[0-9][0-9]*$' >/dev/null
>> +	then
>> +		result=$result${result:+,}$v

... insert these here.

                num_digits=$(( $num_digits + 1 ))
                if test $num_digits = 4
                then
                        break
                fi

>> +	else
>> +		break
>> +	fi
>> +done
>> +echo "$result"
>> diff --git a/git.rc b/git.rc
>> index bce6db9..6f2a8d2 100644
>> --- a/git.rc
>> +++ b/git.rc
>> @@ -1,6 +1,6 @@
>>  1 VERSIONINFO
>> -FILEVERSION     MAJOR,MINOR,PATCH,0
>> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0
>> +FILEVERSION     VERSIONSTRING,0
>> +PRODUCTVERSION  VERSIONSTRING,0
>>  BEGIN
>>    BLOCK "StringFileInfo"
>>    BEGIN
>> .
>> 

  reply	other threads:[~2014-01-21 23:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 20:22 [PATCH/RFC] Makefile: Fix compilation of windows resource file Ramsay Jones
2014-01-21 21:04 ` Junio C Hamano
2014-01-21 21:36   ` Junio C Hamano
2014-01-21 22:51     ` Ramsay Jones
2014-01-21 23:48       ` Junio C Hamano [this message]
2014-01-22  6:55         ` Johannes Sixt
2014-01-22 16:12           ` Junio C Hamano
2014-01-22 16:42             ` Johannes Sixt
2014-01-22 17:38               ` Junio C Hamano
2014-01-22 20:14                 ` Junio C Hamano
2014-01-23  7:28                   ` [PATCH v2] Makefile: Fix compilation of Windows " Johannes Sixt
2014-01-23 12:02                     ` Pat Thoyts
2014-01-23 14:16                       ` Johannes Sixt
2014-01-23 15:19                         ` Pat Thoyts
2014-01-23 18:02                           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk3dssxpb.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ramsay@ramsay1.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.