Wrong git version split under OSX

Bug #1348240 reported by David Lefever @ Taktik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP buildout recipe
Fix Committed
Undecided
Unassigned

Bug Description

Hello,

there is a bug introduced recently in git.py.
Under OSX, git version can give something like "git version 1.8.5.2 (Apple Git-48)".
In git.py, method init_git_version, you remove "git version " from the string, then split
on the dots and try to cast as int.
The cast raises an exception as it tries to cast "2 (Apple Git-48)".

Regards,
David

Revision history for this message
Georges Racinet (gracinet) wrote :

Man, that was fast !

Thanks for the report and the proposed branch (you got the merge request in the wrong way, I think)

Revision history for this message
Georges Racinet (gracinet) wrote :

The recipe does not currently support windows, but someone just showed me one that would'nt pass your way of doing either:

$ git --version
git version 1.8.4.msysgit.0

(through TortoiseGit)

Revision history for this message
Georges Racinet (gracinet) wrote :

And here's the one I get after compiling Git from its git source:

$ ./git --version
git version 2.0.3.2.g996b0fd

sorry for the inconvenience, I was hoping it could be simple, for once
(I'll keep the first three digits)

Revision history for this message
David Lefever @ Taktik (dl-taktik) wrote :

Sorry for the merge request, I'll never be used to launchpad I guess ;)

We didn't bulletproof the solution indeed, it's never as simple as it sounds.
Thanks for the prompt answer!

Revision history for this message
Georges Racinet (gracinet) wrote :

fix merged, and generalized for Tortoise and compiled versions (see doctest)

Changed in anybox.recipe.openerp:
milestone: none → 1.9.0
status: New → Fix Committed
Revision history for this message
Georges Racinet (gracinet) wrote :

About launchpad, we plan to move to Github like everybody else in the community.

But I'd like to do it after Odoo support has been stabilized.
Thanks again,

Revision history for this message
Georges Racinet (gracinet) wrote :

People using hub (https://hub.github.com/), a wrapper around Git for GitHub may have a version string on two lines:

$ git version
git version 1.7.9
hub version 1.11.0

just added a new doctest case for it

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.