diff --git a/releasetools/changelog.py b/releasetools/changelog.py index 845d825f0..6dfabc3b1 100644 --- a/releasetools/changelog.py +++ b/releasetools/changelog.py @@ -18,8 +18,12 @@ command = ['git', 'log', '--format=%s' % GIT_LOG_FORMAT, '--name-only'] if not all: # Determine the last release tag and limit history to then. - release = ['git', 'describe', '--tags', '--match', 'release/*', '--abbrev=0'] - out = subprocess.check_output(release) + release = ['git', 'describe', '--tags', '--match', 'release/*', '--abbrev=0', '--always'] + try: + out = subprocess.check_output(release, stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + print >> sys.stderr, 'Error executing "{}": {}'.format(' '.join(e.cmd), e.output) + sys.exit(-1) out = out.strip() command.append('%s..HEAD'%out.decode(encoding='UTF-8')) out = subprocess.check_output(command)