Add --revision parameter to allow to control the commits used to generate the changelog

This commit is contained in:
Benjamin Renard 2022-12-12 11:19:08 +01:00
parent e71611f17a
commit 5c5481ea57

13
gitdch
View file

@ -148,6 +148,17 @@ parser.add_argument(
help='Specify an optional Markdown release notes output path'
)
parser.add_argument(
'--revision',
type=str,
dest='revision',
help=(
'Specify the revision to use to generate the changelog (see '
'git-rev-parse for viable options, optional, default: generate the '
'changelog with all commits of the current branch) '
),
default=None
)
options = parser.parse_args()
@ -225,7 +236,7 @@ version = (
)
)
messages = []
for commit in repo.iter_commits():
for commit in repo.iter_commits(rev=options.revision):
if version_commit is None:
version_commit = commit
log.debug('Commit %s', commit)