ref: c2036016cf3c2e3f21376ef39f4fd586b6e91a77
parent: f5bb097efa323f274022c11f1944a91f53282f74
author: Paul Brossier <piem@piem.org>
date: Thu Mar 23 15:45:41 EDT 2017
this_version.py: show status if tree is not clean
--- a/this_version.py
+++ b/this_version.py
@@ -87,8 +87,15 @@
gitcmd = ['git', '-C', aubio_dir, 'diff-index', '--quiet']
gitcmd.append('HEAD')
try:
- subprocess.check_output(gitcmd).strip().decode('utf8')
- except Exception as e:
+ output = subprocess.check_output(gitcmd)
+ except subprocess.CalledProcessError:
+ try:
+ import sys
+ sys.stdout.write('Info: current git tree is not clean\n')
+ gitstatus = subprocess.check_output(['git', 'status'])
+ sys.stdout.write(gitstatus.decode('utf8'))
+ except Exception:
+ pass
gitsha += '+mods'
return gitsha