Skip to content

How to pass '--first-parent' to Repo.iter_commits() ? #1357

Answered by Byron
mbanders asked this question in Q&A
Discussion options

You must be logged in to vote

As the documentation of iter_commts() suggests keyword arguments can be used to pass additional arguments to the underlying git command. Specifically, repo.iter_commits(first_parent=true) should do the job.

Passing arguments works in most of the GitPython API, here is more on how parameters are converted to CLI flags.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1356 on October 08, 2021 01:57.