Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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

The command git rev-list has a lot of options including a very useful one --first-parent: https://git-scm.com/docs/git-rev-list

Is there a way to pass '--first-parent' as an option to Repo.iter_commits() ?

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

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.

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.

AltStyle によって変換されたページ (->オリジナル) /