Re: [GIT GUI PATCH] git-gui: use vcompare when comparing the git version
- From
Pat Thoyts <patthoyts@users.sourceforge.net>
- Date
- May 17, 2014, 12:23 UTC
- Message-ID
- <87k39kbnmg.fsf@fox.patthoyts.tk>
- In-Reply-To
- <xmqqk39ohvyp.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
>Junio C Hamano <gitster@pobox.com> writes: > >> Jens Lehmann <Jens.Lehmann@web.de> writes: >> >>> Junio, I believe this issue needs to be fixed before 2.0 final. Otherwise >>> git gui will not work inside submodules anymore due to the major version >>> number change from 1 to 2. I'd like to hear Pat's opinion on this; even >>> though I think my patch is less risky (as it doesn't change behavior for >>> pre-2 versions), he might like Chris' proposal better. >> >> Thanks; I share the same feeling. > >So after checking git://repo.or.cz/git-gui.git/ and seeing that I am >not missing any commit from there, I tentatively created a fork of >it, applied your patch and merged it somewhere on 'pu' that is close >to 'next'. We may want to fast-track it to 2.0 without waiting for >an Ack from Pat but let's give him one more day to respond. >
The analysis about the major version number being significant is correct. By default vsatisfies assumes that a major version number change means all lesser versions are incompatible. However, you can prevent that assumption using an unlimited check by appending a - (minus sign) to the version to yield an open ended range. Or by giving another range. So the only change required is to append a minus.
package vsatisfies $::_git_version 1.7.0-
will suffice.
package vsatisfies $::_git_version 1.7.0 2.0.0
would work but would cause failures when we arrive at git 3.0
-- Pat Thoyts http://www.patthoyts.tk/ PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD