-
-
Notifications
You must be signed in to change notification settings - Fork 933
Diff broken in 1.0.2 #382
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
gitpython-developers/GitPython#382 Change-Id: I6d9bdaadb82b6702ffb75245f84637f9795d4e02
Thanks for getting down to the root of the problem. This change was introduced to solve a particular (and to me unknown) problem, and I am wondering how to solve this issue without introducing breakage for someone else. When looking at the code, I couldn't find any usage of the Can you help me to reproduce the problem ? |
I believe the U option is being passed as part of the kwargs. Actually experiencing this with a tool called gertty. Here is the line with the diff() call where the crash occurs: https://github.com/openstack/gertty/blob/master/gertty/gitrepo.py#L390-L391 Also, see new comments in: 332521a |
What about using the respective long option instead, i.e. extra_contexts, oldc.diff(
newc, color='never',create_patch=True, unified=context)) |
Yes, the long option works. Buts that's nothing more than a workaround. |
Great to hear it works ! Where else are you having problems with that particular behaviour of the git executable when used with gitpython ? |
It might be helpful to know what commit 332521a was attempting to fix. It seems like we have traded something unknown to us being broken for the breakage described in this issue. A quick check of some random diff options suggests that this behavior change will affect not only "-U" in git diff, but also "-C", "-M', and "-B". These are likely to cause GitPython users to run into difficult-to-diagnose problems when they attempt to use these options in their customary form. With an understanding of what 332521a was fixing, we could evaluate a way forward -- perhaps there is another way to accomplish what was intended there, or perhaps we need to support different behaviors for different git subcommands, or perhaps we need to say that single-char options with arguments are not supported and return a useful error to gitpython users. |
Agree with jeblair here. I find it odd to consider it "fixed" by putting the responsibility on users of the library to modify their once-working code. |
Thanks for your feedback ! Just to unclutter this issue a bit, I would like to move attention to the linked issue, and close this one. In the meanwhile, one could go with the proposed workaround of using long options instead of short ones. |
GitPython had a very incompatible change that breaks any call that uses a single character option (e.g., -U) that requires no space between the option and the value. So far, this breaks the diff API where we used the -U option instead of the long option equivalent. For history: gitpython-developers/GitPython#382 So far, I've only seen one place where this bites gertty. Since the GitPython author has stated this will not be reverted or fixed, having a permanent cap on that library seems harsh as we won't get any other bug fixes. This fixes the known/found areas where we are affected. Change-Id: Iadb279234af2ea01fbff35dc629c01dae5a3195c
GitPython had a very incompatible change that breaks any call that uses a single character option (e.g., -U) that requires no space between the option and the value. So far, this breaks the diff API where we used the -U option instead of the long option equivalent. For history: gitpython-developers/GitPython#382 So far, I've only seen one place where this bites gertty. Since the GitPython author has stated this will not be reverted or fixed, having a permanent cap on that library seems harsh as we won't get any other bug fixes. This fixes the known/found areas where we are affected. Change-Id: Iadb279234af2ea01fbff35dc629c01dae5a3195c
I believe this change breaks diff functionality in 1.0.2:
332521a
Using OS X and git 2.5.4, the generated command puts a space between the diff -U option and its value. This causes an exception as git insists on there being no space between them.
The text was updated successfully, but these errors were encountered: