-
-
Notifications
You must be signed in to change notification settings - Fork 933
commit.diff(branch, create_patch=True) gets "+" and "-" backwards #1291
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
Comments
I guess this is related to #852 (comment) If I add
Then I seem to get the right results. But this still seems like a bug! Will this be fixed someday? I'm worried that if I add |
Apparently this was believed to be fixed here: 14d7034. Maybe in your particular case it still is inverted? Or is the version you are using not the most recent one? Thanks to a particularly occluded API GitPython can be really confusing, making it hard to understand what's diffed against what. Thus I would not be surprised if there are more issues slumbering there or the fix above isn't correct in all cases. If you figure it out a PR would be welcome. |
This is still inverted in my testing -- below reproduces this committing a new file
|
When I do this:
Then I see the same first file as when I do
git diff master
in the terminal. But, it gets the "+" and "-" backwards. In python I see lines such as:But this is a file I've added in the active branch that isn't in the master! In the terminal when I do
git diff master
I see:On the other hand, when I use
pprint(r.git.diff('master').split('\n'))
then I get the right result:The text was updated successfully, but these errors were encountered: