From 2d7514f61126e1eb8aef2e232a7a7b60a7697412 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Fri, 15 Nov 2013 01:52:06 -0800 Subject: [PATCH] Ensure that we can get a commit number from git Currently, git describe fails with "fatal: No names found, cannot describe anything." --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6ab478bfc2541..44229fa64d4cd 100755 --- a/setup.py +++ b/setup.py @@ -201,12 +201,12 @@ def build_extensions(self): try: import subprocess try: - pipe = subprocess.Popen(["git", "describe", "HEAD"], + pipe = subprocess.Popen(["git", "describe", "--always"], stdout=subprocess.PIPE).stdout except OSError: # msysgit compatibility pipe = subprocess.Popen( - ["git.cmd", "describe", "HEAD"], + ["git.cmd", "describe", "--always"], stdout=subprocess.PIPE).stdout rev = pipe.read().strip() # makes distutils blow up on Python 2.7