gitpython-developers / GitPython

GitPython is a python library used to interact with Git repositories.

Home Page:http://gitpython.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bentotten opened this issue · comments

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?

Able to be passed in with kwargs unified=0