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

Appearance settings

formally supported method to iterate through all commits #1425

fche started this conversation in Ideas
Discussion options

Repo.iter_items / iter_commits normally limits itself to parents of HEAD.
However, if a GitPython program wants to iterate through all commits in a git repo, it can use a hack like this:

   r = git.Repo('/path')
   for commit in r.iter_commits('--all'):
        pass

expecting the "--all" flag to be passed down to "git rev-list", and thence back to the python code. It would be nice if there were a more natural interface to expose this search, one that could also work with GitDB.

You must be logged in to vote

Replies: 1 comment

Comment options

Thanks for sharing your thoughts!

I turned this into a discussion in case there should be some brainstorming about how such API should look like with potential contributors.

Please note that GitDB, to me, is end of life, so the GitCmdDB would be the only implementation left to support.

This also means that passing --all is valid and working, even though it certainly isn't the most desirable/idiomatic way to achieve this.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1424 on April 08, 2022 01:10.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.