← Winnitude! Search  ·  Reader Mode (1263 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 13 LINKS

How can I get a diff object of a triple dot diff? · gitpython-developers/GitPython · Discussion #1851

Repository navigation

How can I get a diff object of a triple dot diff? #1851

Unanswered itamarsch asked this question in Q&A How can I get a diff object of a triple dot diff? #1851 itamarsch Feb 29, 2024 · 1 comment Return to top Discussion options

itamarsch Feb 29, 2024

I'm trying to compare the diffs between two branches for a git forge project and I tried using:

diff = repo.git.diff(f"{branch1}...{branch2}")

But the diff result is a string and I need a diff object.
Is there a way to create a diff object from this string?

1 You must be logged in to vote

Replies: 1 comment

Comment options

Byron Feb 29, 2024
Maintainer

This just invokes the git command, without further processing.

In order to get diffs, the higher-level API is needed, but I am not sure if diffs can be specified using the a...b syntax. It's certainly worth to just try it in place where the documentation speaks about refs or revs.

1 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 Q&A Labels None yet 2 participants