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

Is there a way to get tripple dot diff? #1406

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

I am getting the diff between two commits using gitpython in below way:

def get_inbetween_commit_diff(repo_path, commit_a, commit_b):
 repo = Repo(repo_path)
 uni_diff_text = repo.git.diff(
 "{}".format(commit_a), "{}".format(commit_b), ignore_blank_lines=True, ignore_space_at_eol=True
 )
 return uni_diff_text

However, the default repo.git.diff shows the diff with double dot. Is there a way to achieve triple dot diff using gitpython?
Reference on double dot and triple dot diff: https://matthew-brett.github.io/pydagogue/git_diff_dots.html

You must be logged in to vote

Maybe this works?

repo.git.diff("{}...{}".format(commit_a, commit_b), ignore_blank_lines=True, ignore_space_at_eol=True)

Replies: 1 comment 1 reply

Comment options

Maybe this works?

repo.git.diff("{}...{}".format(commit_a, commit_b), ignore_blank_lines=True, ignore_space_at_eol=True)
You must be logged in to vote
1 reply
Comment options

yes thanks.

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

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