-
-
Notifications
You must be signed in to change notification settings - Fork 934
issue with diff method #501
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I've updated gitpython to the last version (2.0.8), however the problem is still there. As you said, it may depend on Windows-related stuff. from git import *
REPO_PATH = "./org.eclipse.papyrus"
BRANCH = "2.0.0"
def main():
diffs = []
repo = Repo(REPO_PATH, odbt=GitCmdObjectDB)
reference = [r for r in repo.references if r.name == BRANCH][0]
for c in repo.iter_commits(rev=reference):
if c.hexsha == 'f5f817279baa2008450aa32b18e576c2fcda02bb':
files = repo.git.execute(["git", "diff", "--name-only", c.parents[0].hexsha, c.hexsha]).split('\n')
for f in files:
diff = c.parents[0].diff(c, paths=f, create_patch=True)
diffs = diffs + diff
if __name__ == "__main__":
main() |
Thanks for the feedback, and for posting the workaround ! |
I can definitely reproduce this. |
I'm using gitpython to collect diff information between a commit and his parent.
Generally, the following code works fine when the number of diffs to retrieve is small:
diffs = c.parents[0].diff(c, create_patch=True)
Conversely, when the number of diffs is huge (https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=f5f817279baa2008450aa32b18e576c2fcda02bb), that code is not able to produce an output after 24h (at least).
Is there another way I could use to retrieve the diff information between two commits?
Below you can find the code to replicate this behaviour:
The text was updated successfully, but these errors were encountered: