versioneer lookup: add support for detached checkouts
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 <42e3d96910f922bdd7dd1805fe3f8aff634f391d@dominion.thruhere.net>
(cherry picked from commit 987e637)

nickverschoor/OctoPrint,Javierma/OctoPrint-TFG,JackGavin13/octoprint-test-not-finished,leductan-nguyen/RaionPi,senttech/OctoPrint,leductan-nguyen/RaionPi,JackGavin13/octoprint-test-not-finished,shohei/Octoprint,masterhou/OctoPrint,foosel/OctoPrint,MoonshineSG/OctoPrint,senttech/OctoPrint,shohei/Octoprint,ryanneufeld/OctoPrint,leductan-nguyen/RaionPi,Salandora/OctoPrint,masterhou/OctoPrint,CapnBry/OctoPrint,masterhou/OctoPrint,Jaesin/OctoPrint,eliasbakken/OctoPrint,ryanneufeld/OctoPrint,Jaesin/OctoPrint,CapnBry/OctoPrint,nickverschoor/OctoPrint,Salandora/OctoPrint,MoonshineSG/OctoPrint,CapnBry/OctoPrint,bicephale/OctoPrint,CapnBry/OctoPrint,MoonshineSG/OctoPrint,bicephale/OctoPrint,MoonshineSG/OctoPrint,ryanneufeld/OctoPrint,eliasbakken/OctoPrint,Jaesin/OctoPrint,shohei/Octoprint,Jaesin/OctoPrint,Javierma/OctoPrint-TFG,Javierma/OctoPrint-TFG,beeverycreative/BEEweb,leductan-nguyen/RaionPi,shohei/Octoprint,Salandora/OctoPrint,Javierma/OctoPrint-TFG,Salandora/OctoPrint,beeverycreative/BEEweb,senttech/OctoPrint,foosel/OctoPrint,senttech/OctoPrint,eliasbakken/OctoPrint,ryanneufeld/OctoPrint,foosel/OctoPrint,beeverycreative/BEEweb,shohei/Octoprint,bicephale/OctoPrint,bicephale/OctoPrint,JackGavin13/octoprint-test-not-finished,JackGavin13/octoprint-test-not-finished,nickverschoor/OctoPrint,nickverschoor/OctoPrint,beeverycreative/BEEweb,foosel/OctoPrint