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)