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

koenkooi
Copy link
Contributor

@koenkooi koenkooi 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

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
versioneer lookup: add support for detached checkouts
@foosel foosel merged commit 65ee0cc into OctoPrint:devel Sep 1, 2015
@foosel
Copy link
Member

foosel 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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants