diff --git a/sphinx_git/__init__.py b/sphinx_git/__init__.py index 958e189..8ae092a 100644 --- a/sphinx_git/__init__.py +++ b/sphinx_git/__init__.py @@ -118,6 +118,7 @@ class GitChangelog(GitDirectiveBase): 'hide_author': bool, 'hide_date': bool, 'hide_details': bool, + 'hide_merge_commit': bool, 'repo-dir': six.text_type, } @@ -168,6 +169,9 @@ def _filter_commits_on_filenames(self, commits): def _build_markup(self, commits): list_node = nodes.bullet_list() for commit in commits: + if self.options.get('hide_merge_commit') and len(commit.parents) > 1: + continue + date_str = datetime.fromtimestamp(commit.authored_date) if '\n' in commit.message: message, detailed_message = commit.message.split('\n', 1)