Better Sem-Ver header handling
This makes Sem-Ver header handling more reliable by ignoring any
potential user configured git log output format. Instead PBR supplies
its own format string that will output the commit message bodies in
their entirety without wrapping and other whitespace formatting done for
humans.
Related-Bug:
Fixes-Bug:
@@ -622,7 +622,11 @@ 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)
+ # 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:')]
