versioneer lookup: add support for detached checkouts
When doing 'git checkout <rev>' or 'git checkout <tag>' there will be no branch info: $ git branch * (detached from96fc70b) After whitelisting '\(detached.*' we get: $ python setup.py version running version got version from git {'version': '1.2.5-1-gfd73e02', 'branch': 'HEAD', 'full': 'fd73e02f4fa9f286407ad688feeeee3ebaffea60'} Version is currently: 1.2.5-1-gfd73e02 The '-1-gfd73e02' is this commit on top of the 1.2.5 tag. While detached checkouts should be discouraged some buildsystems (e.g. OpenEmbedded) have no real way to avoid it, which is what this patch fixes. Actual people doing a checkout should use a branch. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> (cherry picked from commit987e637)
This commit is contained in:
parent
754ef428a0
commit
ab8b0230bd
1 changed files with 3 additions and 0 deletions
|
|
@ -15,5 +15,8 @@ master
|
|||
maintenance 1.2.6-dev 96fc70bdb2dd74ba04c3071f70da385b0408904a
|
||||
fix/.* 1.2.6-dev 96fc70bdb2dd74ba04c3071f70da385b0408904a
|
||||
|
||||
# Special case disconnected checkouts, e.g. 'git checkout <tag>'
|
||||
(detached.*
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.3.0-dev for now
|
||||
.* 1.3.0-dev 198d3450d94be1a2
|
||||
|
|
|
|||
Loading…
Reference in a new issue