Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
Fix order of operators before executing the git command#431
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -13,6 +13,8 @@ | ||
import errno | ||
import mmap | ||
from collections import OrderedDict | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This change causes Is that the intention, or should this be replaced with:
as is done here:https://github.com/gitpython-developers/GitPython/blob/master/git/config.py#L20 ? I'm happy to issue a pull request for this, as I would really like GitPython to remain compatible with Python 2.6 for now... Should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Hi@boegel, Indeed, with release 2.0 we officially dropped support for py2.6, assuming that this move is fine as py2.6 is not maintained anymore. Nonetheless, I see no harm in using the alternate odict implementation, and would very much welcome a PR. Thank you! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Python 2.6 is still the default Python in several operating systems, for example anything Red Hat 6.x based (CentOS 6, RHEL 6, Scientific Linux 6, etc.). But, I understand the move, the only way is forward, I guess we should just stick to the latest GitPython 1.x then on these systems. Would you mind sharing a pointer to the official announcement that mentions dropping Py2.6 support? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Of course: You will find these announcements in thechangelog. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @Byron I agree it's worth fixing, especially since Should I also look into adding (back) testing for Py2.6 in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I very much like the idea - a commit is on the way to see what happens. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Here is the result:https://travis-ci.org/gitpython-developers/GitPython/jobs/133041770 . Seems to be just one part of the compat code, which may be fixable in some way in case the blame functionality is important to someone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. for future reference: this issue got fixed in#431, but other incompatibilities with Py2.6 remain, e.g.https://travis-ci.org/gitpython-developers/GitPython/jobs/133041770 I won't be spending time on those (for now), I'll just stick with the latest GitPython 1.x on Py2.6 (cfr.easybuilders/easybuild-framework#1781) | ||
from contextlib import contextmanager | ||
import signal | ||
from subprocess import ( | ||
@@ -783,6 +785,7 @@ def transform_kwarg(self, name, value, split_single_char_options): | ||
def transform_kwargs(self, split_single_char_options=True, **kwargs): | ||
"""Transforms Python style kwargs into git command line options.""" | ||
args = list() | ||
kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. nitpick: you could use operator.itemgetter() for more readability | ||
for k, v in kwargs.items(): | ||
if isinstance(v, (list, tuple)): | ||
for value in v: | ||