Skip to content

Commit

Permalink
Fix scm contributors not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Knittl-Frank committed Dec 18, 2023
1 parent 304d744 commit 5c2936a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/sphinxcontrib/scm/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,27 @@ def get_contributors(self) -> list[str]:
self.option_over_conf("email", "scm_contribs_email"),
("true", "false"),
)
flags += ["-e"] if contribs_email == "true" else []
flags += ["--email"] if contribs_email == "true" else ["--no-email"]

contribs_sort = directives.choice(
self.option_over_conf("sort", "scm_contribs_sort"),
("name", "num"),
)
flags += ["-n"] if contribs_sort == "num" else []
flags += ["--numbered"] if contribs_sort == "num" else ["--no-numbered"]

contribs_type = directives.choice(
self.option_over_conf("type", "scm_contribs_type"),
("author", "committer"),
)
flags += ["-c"] if contribs_type == "committer" else []

git_shortlog_options = ["-s", *flags, "--", docfile_name]
flags += ["--committer"] if contribs_type == "committer" else ["--no-committer"]

git_shortlog_options = [
"--summary",
*flags,
"HEAD",
"--",
docfile_name,
]

contributors = []
git_shortlog = Git(docdir_path).shortlog(*git_shortlog_options)
Expand Down

0 comments on commit 5c2936a

Please sign in to comment.