Skip to content

Commit 08ff145

Browse files
committed
Report errors during changelog generation.
1 parent d540f21 commit 08ff145

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

releasetools/changelog.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
command = ['git', 'log', '--format=%s' % GIT_LOG_FORMAT, '--name-only']
1919
if not all:
2020
# Determine the last release tag and limit history to then.
21-
release = ['git', 'describe', '--tags', '--match', 'release/*', '--abbrev=0']
22-
out = subprocess.check_output(release)
21+
release = ['git', 'describe', '--tags', '--match', 'release/*', '--abbrev=0', '--always']
22+
try:
23+
out = subprocess.check_output(release, stderr=subprocess.STDOUT)
24+
except subprocess.CalledProcessError as e:
25+
print >> sys.stderr, 'Error executing "{}": {}'.format(' '.join(e.cmd), e.output)
26+
sys.exit(-1)
2327
out = out.strip()
2428
command.append('%s..HEAD'%out.decode(encoding='UTF-8'))
2529
out = subprocess.check_output(command)

0 commit comments

Comments
 (0)