Skip to content

Commit c84560a

Browse files
committed
add hide_merge_commit for less content
add hide_merge_commit in git_changelog for less content
1 parent 70105d9 commit c84560a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sphinx_git/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class GitChangelog(GitDirectiveBase):
118118
'hide_author': bool,
119119
'hide_date': bool,
120120
'hide_details': bool,
121+
'hide_merge_commit': bool,
121122
'repo-dir': six.text_type,
122123
}
123124

@@ -168,6 +169,10 @@ def _filter_commits_on_filenames(self, commits):
168169
def _build_markup(self, commits):
169170
list_node = nodes.bullet_list()
170171
for commit in commits:
172+
if self.options.get('hide_merge_commit'):
173+
if len(commit.parents) > 1:
174+
continue
175+
171176
date_str = datetime.fromtimestamp(commit.authored_date)
172177
if '\n' in commit.message:
173178
message, detailed_message = commit.message.split('\n', 1)

0 commit comments

Comments
 (0)