)]}'
{"marconi/version.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"6da079508dc666df80f565f13aa24e0a47094226","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import pbr.version"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"version_info \u003d pbr.version.VersionInfo(\u0027marconi\u0027)"},{"line_number":20,"context_line":"commit \u003d pbr.packaging._get_version_from_git(None)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAS3%2F%2FdmM%3D","line":20,"updated":"2013-09-26 10:23:49.000000000","message":"I guess you want to use:\n\n  `packaging.get_version(\u0027marconi\u0027)` # or None\n\nReading here[0] the release_string should return the package version which is either the final version or the version + commit hash.\n\n    \u00272013.2.a381.g60b8dbf\u0027 \n\nThis means that we could basically use:\n\n    version_info.release_string\n\nAnd check the commit hash is present there:\n\n    cur_hash in version_info.release_string\n\n[0] https://github.com/openstack-dev/pbr/blob/master/pbr/version.py#L59","commit_id":"60b8dbf4e87f85dbaa8f2a712628dfddb516f953"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"ffee87ed2819fee1789592a211f1f26238aedd8f","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# NOTE(kgriffs): We could get this from version_info, but it isn\u0027t always"},{"line_number":22,"context_line":"# guaranteed to be there, so in the interest of following the Principle of"},{"line_number":23,"context_line":"# Least Suprise..."},{"line_number":24,"context_line":"commit_hash \u003d pbr.packaging._get_version_from_git(None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FaYY%3D","line":24,"updated":"2013-09-27 07:59:23.000000000","message":"The hash will be present *just* when Marconi is being executed from his git repository since it depends on the .git directory[0]. This function doesn\u0027t guarantees the commit hash presence, it behaves just as version_info does wrt the commit hash.\n\nIs there a case I\u0027m missing here where version_info does not return the hash and we need to call `_get_version_from_git`?\n\nhttps://github.com/openstack-dev/pbr/blob/master/pbr/packaging.py#L762","commit_id":"f9d1f83601ce2e2eac7bd23b2895bceb0a195759"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"2603977e61be79b07ad70d129e19620bb4228a70","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# NOTE(kgriffs): We could get this from version_info, but it isn\u0027t always"},{"line_number":22,"context_line":"# guaranteed to be there, so in the interest of following the Principle of"},{"line_number":23,"context_line":"# Least Suprise..."},{"line_number":24,"context_line":"commit_hash \u003d pbr.packaging._get_version_from_git(None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FZsw%3D","line":24,"in_reply_to":"AAAAS3%2F%2FaYY%3D","updated":"2013-09-27 15:18:52.000000000","message":"Indeed; this would depend on git, and doesn\u0027t account for other was that the code may be obtained.\n\nI went spelunking through pbr to understand in detail how the version string is calculated, and replaced this line with a helper function. Let me know what you think.","commit_id":"f9d1f83601ce2e2eac7bd23b2895bceb0a195759"}]}
