Skip to content

Commit

Permalink
Merge "Better Sem-Ver header handling"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Apr 3, 2018
2 parents 7b0374d + 183b445 commit 7767c44
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pbr/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,14 @@ def _get_increment_kwargs(git_dir, tag):
version_spec = tag + "..HEAD"
else:
version_spec = "HEAD"
changelog = git._run_git_command(['log', version_spec], git_dir)
header_len = len(' sem-ver:')
# Get the raw body of the commit messages so that we don't have to
# parse out any formatting whitespace and to avoid user settings on
# git log output affecting out ability to have working sem ver headers.
changelog = git._run_git_command(['log', '--pretty=%B', version_spec],
git_dir)
header_len = len('sem-ver:')
commands = [line[header_len:].strip() for line in changelog.split('\n')
if line.lower().startswith(' sem-ver:')]
if line.lower().startswith('sem-ver:')]
symbols = set()
for command in commands:
symbols.update([symbol.strip() for symbol in command.split(',')])
Expand Down

0 comments on commit 7767c44

Please sign in to comment.