Johannes Sixt <> writes:

> The numbers defined in {FILE,PRODUCT}VERSION statements are intended for
> machine consumption and are always 4 positions (if the source contains
> fewer, they are padded with zeros). They can be used by installers to
> decide whether a file that already exists in the system should be
> overwritten by a newer version.

OK, that makes sense.  If you package 1.9 (padded as and
then 1.9.1 (padded as, you can update from 1.9 to 1.9.1
just fine.

> Unfortunately, these numbers are visible when the user invokes Properties
> from the context menu of git.exe in the file manager and then switches to
> the "Version" tab. All 4 positions are always listed. Therefore, the user
> will see "" for the first release of the 1.9 series, which is
> "wrong", because you will call "1.9", not "", I assume.
> With sufficient effort, we could achieve that version 1.9.1 is listed as
> "". That is still "wrong".

I would not be worried about showing for 1.9.1 and/or for 1.9 at all.

But if the (receiving) system expects these to be monotonically
increasing, I suspect the script I posted would not "work well"
under that expectation.  When you package 1.9.2.g43218765.dirty,
that would become "", and become indistinguishable from the
package taken from v1.9.2 tag, which is not good at all.  So the
script should strip [0-9]*\.g[0-9a-f]*\(\.dirty\)? from the end

But even without complications from the "N-commit after the tag" it
won't "work well" if you cut packages from anything that is not
tagged anyway.  The only thing we know about any package taken from
the tip of 'master' past v1.9 is that it is newer than the package
taken from v1.9 tag. Sometimes it should be considered newer than a
package taken from v1.9.x tag (i.e. the contents of the maintenance
relase is fully included in 'master'), but not always (i.e. the tip
of 'master' when the package was made may contain up to v1.9.3 but
v1.9.4 may be newer than that).

If you truncate down to only two, like your patch does, anything
past v1.9 and before v1.10 (or v2.0) would have and that is
no worse than giving for v1.9.3 and giving for
anything based on 'master'.  Your user may have installed a package
made from v1.9.1 and would want to update to the one taken from
'master' when it contained everything up to v1.9.3---under my
earlier "take numbers" approach, we would be "updating" from
to, which does not look like updating at all to the system.
The installers can use this to decide "a file that already exists in
the system" is newer, which is wrong, if I am reading your earlier
explanation corretly.

With your "we just take the first two numbers always", you would be
sidegrading between two, which may fare better.

> Since we can't get this display right, I suggest that we just punt (as per
> my patch). That should work out nicely because we can fairly safely assume
> that there are no installers around that look at these particular version
> numbers.
> BTW, that same "Version" tab will have another entry, called "Product
> Version" later in the list. This one lists the string that we pass in
> -DGIT_VERSION (see quoted context below). It is the truely correct version
> that *users* should be interested in.
>>> diff --git a/Makefile b/Makefile
>>> index b4af1e2..99b2b89 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : GIT-SCRIPT-DEFINES
>>>  git.res: git.rc GIT-VERSION-FILE
>>>     $(QUIET_RC)$(RC) \
>>> -     $(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst 
>>> ., ,$(GIT_VERSION))))) \
>>> +     $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., 
>>> ,$(GIT_VERSION))))) \
>>>       -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
>>>  ifndef NO_PERL
>>> diff --git a/git.rc b/git.rc
>>> index bce6db9..33aafb7 100644
>>> --- a/git.rc
>>> +++ b/git.rc
>>> @@ -1,6 +1,6 @@
>>>  BEGIN
>>>    BLOCK "StringFileInfo"
>>>    BEGIN
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to