Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

versioneer lookup: add support for detached checkouts #1041

Merged
merged 1 commit into from Sep 1, 2015

Conversation

Projects
None yet
2 participants
@koenkooi
Copy link
Contributor

commented Sep 1, 2015

When doing 'git checkout ' or 'git checkout ' there will be no
branch info:

$ git branch
* (detached from 96fc70b)

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

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 from 96fc70b)

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>

foosel added a commit that referenced this pull request Sep 1, 2015

Merge pull request #1041 from koenkooi/detached-checkouts
versioneer lookup: add support for detached checkouts

@foosel foosel merged commit 65ee0cc into foosel:devel Sep 1, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@foosel

This comment has been minimized.

Copy link
Owner

commented Sep 1, 2015

I'm not too happy with the fact that this will then report the branch as "HEAD" in the UI, but that is something that has to be solved within versioneer first.

foosel added a commit that referenced this pull request Sep 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.