From 5c5481ea57f7a00ce3d3f1bfbc82b289288f809d Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 12 Dec 2022 11:19:08 +0100 Subject: [PATCH] Add --revision parameter to allow to control the commits used to generate the changelog --- gitdch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gitdch b/gitdch index ad30202..176bb0a 100755 --- a/gitdch +++ b/gitdch @@ -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)