PBR

pbr 1.9 tag parsing incompatible with older git versions

Bug #1570458 reported by R. Nortman
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
PBR
Fix Released
Undecided
James Polley

Bug Description

pbr 1.9 changed the git log command used for extracting tags (see commit da9ab10). This log command has different output for the two versions of git I've tested. Newer git (I tested 2.1.4) gives the output pbr expects, but older git (I tested 1.7.10.4, the version in Debian Wheezy stable) gives different output that does not include the string "tag" preceding a tag, so the new pbr parser doesn't recognize the tags.

Here's a sample 'git log --format=%h%x00%s%x00%d' output line from git 1.7.10.4 that contains the tag "2.3.1":

7d57ece\x00Merge "Revert "Support `truncated` flag returned by identity service""\x00 (2.3.1)

Here's the same rev as reported by git 2.1.4:

7d57ece\x00Merge "Revert "Support `truncated` flag returned by identity service""\x00 (tag: 2.3.1)

Revision history for this message
Jeremy Stanley (fungi) wrote :

Note also that Ubuntu 12.04 LTS (Precise Pangolin) should also suffer from this issue, as it has an even slightly earlier Git version of 1.7.9.5.

R. Nortman (r-nortman)
Changed in pbr:
assignee: nobody → R. Nortman (r-nortman)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pbr (master)

Fix proposed to branch: master
Review: https://review.openstack.org/306082

Revision history for this message
R. Nortman (r-nortman) wrote :

I've bisected git and it was commit 9d3f002f21f78576f3c31ae94ce78de54e305c95 that changed this behavior. This commit was released in v1.8.3 and is not present in v1.8.2.3. I'll update my patch to switch behavior based on the output of `git --version`; if <1.8.3 I'll trigger the workaround.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/339392

Changed in pbr:
assignee: R. Nortman (r-nortman) → James Polley (tchaypo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/339392
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=626ecb6275d1402ac0f4d127990c62672878ed32
Submitter: Jenkins
Branch: master

commit 626ecb6275d1402ac0f4d127990c62672878ed32
Author: Randall Nortman <email address hidden>
Date: Thu Apr 14 17:07:43 2016 -0400

    Fix handling of old git log output

    Older versions of git produce log output (using --format specifiers)
    that doesn't prefix tags with a "tag:" prefix, though they do using
    the --decorate log format. This was a bug in git that was fixed, but
    the older git is still in the wild. This change combines both the new
    --format specifier method with the --decorate method to find tags even
    if used with the old, buggy git, while (hopefully) avoiding
    identifying non-tags as tags.

    This is based on I6b557687f2428a528a8aa7f76e84797162488887 but tries to
    use a single format string that works across all versions of git.

    Because the format string has changed, some of the test data has had to
    change to reflect the new format.

    Change-Id: I58a1b12e0f4054fd25bddc77fabb6c89239561ff
    Closes-Bug: #1570458
    Co-Authored-By: James Polley <email address hidden>

Changed in pbr:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack-dev/pbr 2.0.0

This issue was fixed in the openstack-dev/pbr 2.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on pbr (master)

Change abandoned by ChangBo Guo(gcb) (<email address hidden>) on branch: master
Review: https://review.openstack.org/306082
Reason: Please restore it if you want to continue working on this.

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.