Skip to content

Commit

Permalink
add hide_merge_commit for less content
Browse files Browse the repository at this point in the history
add hide_merge_commit in git_changelog for less content
  • Loading branch information
lethee committed Jan 25, 2021
1 parent 70105d9 commit 4503a4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sphinx_git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4503a4b

Please sign in to comment.