Browse Source

"shut changelog" command now adds the fixes to the Git commit message if the -c,--commit option is used

shut
Niklas Rosenstein 10 months ago
parent
commit
3f49fdb7a4
No known key found for this signature in database GPG Key ID: 6D269B33D25F6C6
1 changed files with 4 additions and 1 deletions
  1. + 4
    - 1
      src/shut/commands/changelog/__init__.py

+ 4
- 1
src/shut/commands/changelog/__init__.py

@ -81,11 +81,12 @@ def changelog(**args):
logger.error('invalid changelog type: %r', args['add'])
sys.exit(1)
fixes = ['#' + f if f.isdigit() else f for f in _split(args['fixes'])]
entry = v3.Changelog.Entry(
type_,
args['for'],
args['message'] or '',
_split(args['fixes']))
fixes)
# Allow the user to edit the entry if no description is provided or the
# -e,--edit option was set.
@ -112,6 +113,8 @@ def changelog(**args):
commit_message = '{}({}): '.format(entry.type_.name, subject.name) + commit_message
else:
commit_message = '{}: '.format(entry.type_.name) + commit_message
if fixes:
commit_message += '\n\nfixes ' + ', '.join(fixes)
_git.commit(commit_message)
sys.exit(0)

Loading…
Cancel
Save