Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify lines of context while doing diff (-U flag) #1883

Closed
bentotten opened this issue Mar 21, 2024 · 1 comment
Closed

Unable to specify lines of context while doing diff (-U flag) #1883

bentotten opened this issue Mar 21, 2024 · 1 comment

Comments

@bentotten
Copy link

bentotten commented Mar 21, 2024

Currently there does not appear to be a way to specify the lines of context desired while using the git function

For example:
git diff -U0 efefe435

It would be useful to add this to the api so that this command could be executed:
diff = commit.diff(parent, create_patch=True, lines_of_context=0)

In this function, lines_of_context could be added to the function:

**kwargs: Any,

and treated the same as the create_patch variable:

if create_patch:

args.append(f"-U{lines_of_context}")

Is this something that could be added?

@bentotten
Copy link
Author

Able to be passed in with kwargs unified=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant