Comments (8)
python2 is there because git-imerge requires Python version 2.x as opposed to Python 3.x (or, God forbid, Python 1.x). According to PEP 394, it is recommended that some Python 2.x interpreter be installed in PATH under the name "python2". I understand that this is not yet universal practice, but on the other hand there are already systems where "python" is a Python version 3.x interpreter, so that option is also not universally portable.
By the way, I think that any Python interpreter version 2.5 <= version < 3.0 should be fine for git-imerge.
from git-imerge.
I resolved this by supporting both Python 2 and 3. @mhagger, if you are interested, I can either send a pull requests or you can just merge my fork. The continuous integration server shows the test results.
from git-imerge.
@myint, that's really cool! I hadn't yet had the energy to get any of my projects running under Python3. It's a lot less nasty than I would have feared.
I just pushed some commits to master that incorporate some of the changes from your first commit. The remainder of your changes (i.e., after the already-merged changes have been removed) are in my repo under branch myint/python3
. But before I merge the rest, I would like to understand the ramifications a little bit better.
What is the situation on the Mac OSX? (Is that is what you are using?) Is Python 2.x unavailable, or is it available, but just not under the name python2
? In other words, are these changes needed to make the script usable under Mac OSX at all, or just to avoid having to edit the shebang line?
(If the latter, then there are other ways to make sure that a Python 2.x interpreter is used to run the script. Either the script can be given a Shell preamble that chooses the correct Python interpreter, or we could add an install script that overwrites the shebang line with the one correct for the system that it is running on. Not that python3 compatibility is something bad, but reducing the python2 compatibility might still be inconvenient for some users.)
Before these changes, I think that git-imerge
would have worked under Python versions 2.5 <= version < 3.0 (though I haven't actually tested it against the older versions). The changes I just pushed now prevent it from running under 2.5 (because it doesn't have the next()
built-in function). With the rest of your changes, what versions of Python should it run under? Only 2.7 and 3.3? Assuming that is the case, we should probably verify that the important recent OSs make one of these Python versions available.
Thanks again for your contribution!
from git-imerge.
Python 2.x comes installed on OS X, as python
. OS X 10.9 comes with python 2.7.5. There's no python2
by default
from git-imerge.
Like @jdelStrother mentioned, python2
doesn't exist on OS X. An OS X user could just create a symlink called python2
and point it to /usr/bin/python
. I happen to use Python 3 by default so my use case only tangentially relates to this issue (#18).
I've enabled the Python 2.6 test on Travis CI (450e728). It works. See test results here.
I could enable Python 2.5 support, but the code will get a bit uglier. (The as
exception syntax, which Python 3 requires, isn't supported in Python 2.5 and there are a few other things like what you mentioned.) And I think the trend in Python now is to support Python 2.6, 2.7, and 3.3.
from git-imerge.
@myint: Thanks for the additional info. I was confused; I thought that "except E as T" syntax wasn't added until Python 2.7. Now I see that it was backported to Python 2.6.1.
So if we merge your changes, I think our Python version requirement would become
(2.6.1 <= version < 3.0) or (3.3 <= version)
(that is, unless something else that you are using was introduced even later than 2.6.1). I think we can live with that. I just merged your change (though the commit identities have changed, so you might want to pull from me again).
Thanks!
from git-imerge.
Great! By the way, as far as I know the as
exception syntax was introduced in Python 2.6 proper. The 2.6.1 change log mentions it too, but only because the change log is cumulative. (I don't think Python developers introduce syntax changes in patch releases.)
from git-imerge.
@myint: I was going by the language reference for 2.6 vs 2.6.1. The as
syntax wasn't mentioned until 2.6.1. But given that it is mentioned in the changelog for 2.6, I assume that it was implemented then and they just didn't get around to updating the language reference in time for the release.
I'll fix the README.
from git-imerge.
Related Issues (20)
- Interactive Rebase With History Preserving Past Merges HOT 1
- Skip incompatible merges HOT 1
- Identifying list of conflicting commits HOT 1
- Exact equivalent of `git rebase --onto ancient origin/ancient modern` ? HOT 2
- Error: untracked working tree files aborts imerge HOT 6
- Why autofills if automerge succeeds? HOT 2
- Merging a branch that has merge commits HOT 1
- non-zero exit status 128 HOT 2
- Is it possible to redo parts of an iterative merge? HOT 4
- add a stop, abort, or similar command HOT 5
- Cannot proceed dead lock ( maybe related to `git lfs` in history? ) HOT 2
- [Question] why is such a feature not integrated in git main? HOT 1
- How to manually cleanup in case of a crash? HOT 4
- [Request] Keep diff3 conflictstyle as clear as without imerge HOT 3
- Automate ability to extend merge when source branches are updated HOT 3
- Stuck in a merge, imerge crashes when attempting to continue HOT 2
- backtracking repeats unrelated autofills
- possibility of merging unrelated histories
- add support for new Python `pyproject.toml` standard: `setup.py install` is deprecated
- Question: can git-imerge product a list of all conflicts in advance and their associated commits? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-imerge.