* [PATCH] Standardize python shebangs
@ 2014-05-07 10:03 Felipe Contreras
2014-05-07 10:27 ` Johan Herland
2014-05-07 18:06 ` Matthieu Moy
0 siblings, 2 replies; 13+ messages in thread
From: Felipe Contreras @ 2014-05-07 10:03 UTC (permalink / raw)
To: git; +Cc: Felipe Contreras
It's better if all our scripts use the same '/usr/bin/env python'.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
contrib/hooks/multimail/README | 6 +++---
contrib/hooks/multimail/git_multimail.py | 2 +-
contrib/hooks/multimail/migrate-mailhook-config | 2 +-
contrib/hooks/multimail/post-receive | 2 +-
contrib/svn-fe/svnrdump_sim.py | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/contrib/hooks/multimail/README b/contrib/hooks/multimail/README
index 477d65f..cf0bcb8 100644
--- a/contrib/hooks/multimail/README
+++ b/contrib/hooks/multimail/README
@@ -76,10 +76,10 @@ Requirements
The example scripts invoke Python using the following shebang line
(following PEP 394 [1]):
- #! /usr/bin/env python2
+ #! /usr/bin/env python
- If your system's Python2 interpreter is not in your PATH or is not
- called "python2", you can change the lines accordingly. Or you can
+ If your system's Python interpreter is not in your PATH or is not
+ called "python", you can change the lines accordingly. Or you can
invoke the Python interpreter explicitly, for example via a tiny
shell script like
diff --git a/contrib/hooks/multimail/git_multimail.py b/contrib/hooks/multimail/git_multimail.py
index 8b58ed6..f6dcdc6 100755
--- a/contrib/hooks/multimail/git_multimail.py
+++ b/contrib/hooks/multimail/git_multimail.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2
+#! /usr/bin/env python
# Copyright (c) 2012-2014 Michael Haggerty and others
# Derived from contrib/hooks/post-receive-email, which is
diff --git a/contrib/hooks/multimail/migrate-mailhook-config b/contrib/hooks/multimail/migrate-mailhook-config
index 04eeaac..fba0b90 100755
--- a/contrib/hooks/multimail/migrate-mailhook-config
+++ b/contrib/hooks/multimail/migrate-mailhook-config
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2
+#! /usr/bin/env python
"""Migrate a post-receive-email configuration to be usable with git_multimail.py.
diff --git a/contrib/hooks/multimail/post-receive b/contrib/hooks/multimail/post-receive
index 4d46828..4f2cf9d 100755
--- a/contrib/hooks/multimail/post-receive
+++ b/contrib/hooks/multimail/post-receive
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2
+#! /usr/bin/env python
"""Example post-receive hook based on git-multimail.
diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py
index 4e78a1c..bf20819 100755
--- a/contrib/svn-fe/svnrdump_sim.py
+++ b/contrib/svn-fe/svnrdump_sim.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""
Simulates svnrdump by replaying an existing dump from a file, taking care
of the specified revision range.
--
1.9.2+fc1.25.g15bd061
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 10:03 [PATCH] Standardize python shebangs Felipe Contreras
@ 2014-05-07 10:27 ` Johan Herland
2014-05-07 11:11 ` Felipe Contreras
2014-05-07 18:06 ` Matthieu Moy
1 sibling, 1 reply; 13+ messages in thread
From: Johan Herland @ 2014-05-07 10:27 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Git mailing list
On Wed, May 7, 2014 at 12:03 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> It's better if all our scripts use the same '/usr/bin/env python'.
Only if they are source compatible with both Python2 and Python3. See
PEP394 <URL: http://legacy.python.org/dev/peps/pep-0394/ >. Otherwise
(for python2-only scripts) '/usr/bin/env python2' is the way to go.
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 10:27 ` Johan Herland
@ 2014-05-07 11:11 ` Felipe Contreras
2014-05-07 12:03 ` James Denholm
2014-05-07 12:28 ` Johan Herland
0 siblings, 2 replies; 13+ messages in thread
From: Felipe Contreras @ 2014-05-07 11:11 UTC (permalink / raw)
To: Johan Herland, Felipe Contreras; +Cc: Git mailing list
Johan Herland wrote:
> On Wed, May 7, 2014 at 12:03 PM, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
> > It's better if all our scripts use the same '/usr/bin/env python'.
>
> Only if they are source compatible with both Python2 and Python3. See
> PEP394 <URL: http://legacy.python.org/dev/peps/pep-0394/ >. Otherwise
> (for python2-only scripts) '/usr/bin/env python2' is the way to go.
It doesn't matter. People and aistributions have to change them anyway.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 11:11 ` Felipe Contreras
@ 2014-05-07 12:03 ` James Denholm
2014-05-07 12:28 ` Johan Herland
1 sibling, 0 replies; 13+ messages in thread
From: James Denholm @ 2014-05-07 12:03 UTC (permalink / raw)
To: Felipe Contreras, Johan Herland; +Cc: Git mailing list
On 7 May 2014 21:11:53 GMT+10:00, Felipe Contreras <felipe.contreras@gmail.com> wrote:
>Johan Herland wrote:
>> On Wed, May 7, 2014 at 12:03 PM, Felipe Contreras
>> <felipe.contreras@gmail.com> wrote:
>> > It's better if all our scripts use the same '/usr/bin/env python'.
>>
>> Only if they are source compatible with both Python2 and Python3. See
>> PEP394 <URL: http://legacy.python.org/dev/peps/pep-0394/ >. Otherwise
>> (for python2-only scripts) '/usr/bin/env python2' is the way to go.
>
>It doesn't matter. People and aistributions have to change them anyway.
Yeah, but they shouldn't have to. The build process is
already non-"sane", let's please not make it more so?
Moving all instances of "env python" to be "env python2",
though, that I think is a reasonable solution (if this is even
felt to be a problem).
Regards,
James Denholm.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 11:11 ` Felipe Contreras
2014-05-07 12:03 ` James Denholm
@ 2014-05-07 12:28 ` Johan Herland
1 sibling, 0 replies; 13+ messages in thread
From: Johan Herland @ 2014-05-07 12:28 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Git mailing list
On Wed, May 7, 2014 at 1:11 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> Johan Herland wrote:
>> On Wed, May 7, 2014 at 12:03 PM, Felipe Contreras
>> <felipe.contreras@gmail.com> wrote:
>> > It's better if all our scripts use the same '/usr/bin/env python'.
>>
>> Only if they are source compatible with both Python2 and Python3. See
>> PEP394 <URL: http://legacy.python.org/dev/peps/pep-0394/ >. Otherwise
>> (for python2-only scripts) '/usr/bin/env python2' is the way to go.
>
> It doesn't matter. People and aistributions have to change them anyway.
No, that's _exactly_ what PEP394 addresses. If we standardize on
'/usr/bin/env python2' (I assume all our .py scripts are Python2) then
they should work on _all_ distros, and Arch Linux would not have to do
their current python -> python2 hack (which you referred in another
thread).
If we instead standardize on '/usr/bin/env python' instead, we only
end up annoying forward-looking distros that (want to) enable python
== python3 (but obviously also provide python2 for as long as
necessary).
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 10:03 [PATCH] Standardize python shebangs Felipe Contreras
2014-05-07 10:27 ` Johan Herland
@ 2014-05-07 18:06 ` Matthieu Moy
2014-05-07 19:06 ` Felipe Contreras
1 sibling, 1 reply; 13+ messages in thread
From: Matthieu Moy @ 2014-05-07 18:06 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git, Michael Haggerty
Felipe Contreras <felipe.contreras@gmail.com> writes:
> It's better if all our scripts use the same '/usr/bin/env python'.
Why?
Using python2 for git_multimail.py is a deliberate decision:
https://github.com/mhagger/git-multimail/pull/2
(also, contrib/hooks/multimail/README says:
"The git-multimail project itself is currently hosted on GitHub:
https://github.com/mhagger/git-multimail
We use the GitHub issue tracker to keep track of bugs and feature
requests, and GitHub pull requests to exchange patches (though, if you
prefer, you can send patches via the Git mailing list with cc to me).
Please sign off your patches as per the Git project practice."
)
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> contrib/hooks/multimail/README | 6 +++---
> contrib/hooks/multimail/git_multimail.py | 2 +-
> contrib/hooks/multimail/migrate-mailhook-config | 2 +-
> contrib/hooks/multimail/post-receive | 2 +-
> contrib/svn-fe/svnrdump_sim.py | 2 +-
> 5 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/contrib/hooks/multimail/README b/contrib/hooks/multimail/README
> index 477d65f..cf0bcb8 100644
> --- a/contrib/hooks/multimail/README
> +++ b/contrib/hooks/multimail/README
> @@ -76,10 +76,10 @@ Requirements
> The example scripts invoke Python using the following shebang line
> (following PEP 394 [1]):
>
> - #! /usr/bin/env python2
> + #! /usr/bin/env python
>
> - If your system's Python2 interpreter is not in your PATH or is not
> - called "python2", you can change the lines accordingly. Or you can
> + If your system's Python interpreter is not in your PATH or is not
> + called "python", you can change the lines accordingly. Or you can
> invoke the Python interpreter explicitly, for example via a tiny
> shell script like
>
> diff --git a/contrib/hooks/multimail/git_multimail.py b/contrib/hooks/multimail/git_multimail.py
> index 8b58ed6..f6dcdc6 100755
> --- a/contrib/hooks/multimail/git_multimail.py
> +++ b/contrib/hooks/multimail/git_multimail.py
> @@ -1,4 +1,4 @@
> -#! /usr/bin/env python2
> +#! /usr/bin/env python
>
> # Copyright (c) 2012-2014 Michael Haggerty and others
> # Derived from contrib/hooks/post-receive-email, which is
> diff --git a/contrib/hooks/multimail/migrate-mailhook-config b/contrib/hooks/multimail/migrate-mailhook-config
> index 04eeaac..fba0b90 100755
> --- a/contrib/hooks/multimail/migrate-mailhook-config
> +++ b/contrib/hooks/multimail/migrate-mailhook-config
> @@ -1,4 +1,4 @@
> -#! /usr/bin/env python2
> +#! /usr/bin/env python
>
> """Migrate a post-receive-email configuration to be usable with git_multimail.py.
>
> diff --git a/contrib/hooks/multimail/post-receive b/contrib/hooks/multimail/post-receive
> index 4d46828..4f2cf9d 100755
> --- a/contrib/hooks/multimail/post-receive
> +++ b/contrib/hooks/multimail/post-receive
> @@ -1,4 +1,4 @@
> -#! /usr/bin/env python2
> +#! /usr/bin/env python
>
> """Example post-receive hook based on git-multimail.
>
> diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py
> index 4e78a1c..bf20819 100755
> --- a/contrib/svn-fe/svnrdump_sim.py
> +++ b/contrib/svn-fe/svnrdump_sim.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/python
> +#!/usr/bin/env python
> """
> Simulates svnrdump by replaying an existing dump from a file, taking care
> of the specified revision range.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 18:06 ` Matthieu Moy
@ 2014-05-07 19:06 ` Felipe Contreras
2014-05-07 20:23 ` Matthieu Moy
0 siblings, 1 reply; 13+ messages in thread
From: Felipe Contreras @ 2014-05-07 19:06 UTC (permalink / raw)
To: Matthieu Moy, Felipe Contreras; +Cc: git, Michael Haggerty
Matthieu Moy wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > It's better if all our scripts use the same '/usr/bin/env python'.
>
> Why?
>
> Using python2 for git_multimail.py is a deliberate decision:
If you want to use python2, then use '/usr/bin/env python2'.
> "The git-multimail project itself is currently hosted on GitHub:
>
> https://github.com/mhagger/git-multimail
>
> We use the GitHub issue tracker to keep track of bugs and feature
> requests, and GitHub pull requests to exchange patches (though, if you
> prefer, you can send patches via the Git mailing list with cc to me).
> Please sign off your patches as per the Git project practice."
> )
If you are going to follow practices different than git.git, then
multimail shouldn't live in 'contrib/'. Junio is already thretening to
remove stuff out of contrib even when development behaves as the Git
core does, so it makes more sense for stuff that doesn't.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 19:06 ` Felipe Contreras
@ 2014-05-07 20:23 ` Matthieu Moy
2014-05-07 20:40 ` Felipe Contreras
0 siblings, 1 reply; 13+ messages in thread
From: Matthieu Moy @ 2014-05-07 20:23 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git, Michael Haggerty
Felipe Contreras <felipe.contreras@gmail.com> writes:
> Matthieu Moy wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>> > It's better if all our scripts use the same '/usr/bin/env python'.
>>
>> Why?
>>
>> Using python2 for git_multimail.py is a deliberate decision:
>
> If you want to use python2, then use '/usr/bin/env python2'.
Err, yes, this is what the code does before your patch.
>> "The git-multimail project itself is currently hosted on GitHub:
>>
>> https://github.com/mhagger/git-multimail
>>
>> We use the GitHub issue tracker to keep track of bugs and feature
>> requests, and GitHub pull requests to exchange patches (though, if you
>> prefer, you can send patches via the Git mailing list with cc to me).
>> Please sign off your patches as per the Git project practice."
>> )
>
> If you are going to follow practices different than git.git, then
> multimail shouldn't live in 'contrib/'.
git-multimail is not the only part of git.git that has a separate
maintainer. Same goes for git-gui and gitk.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 20:23 ` Matthieu Moy
@ 2014-05-07 20:40 ` Felipe Contreras
2014-05-07 20:57 ` Matthieu Moy
0 siblings, 1 reply; 13+ messages in thread
From: Felipe Contreras @ 2014-05-07 20:40 UTC (permalink / raw)
To: Matthieu Moy, Felipe Contreras; +Cc: git, Michael Haggerty
Matthieu Moy wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> > If you want to use python2, then use '/usr/bin/env python2'.
>
> Err, yes, this is what the code does before your patch.
Not for all the instances.
> > If you are going to follow practices different than git.git, then
> > multimail shouldn't live in 'contrib/'.
>
> git-multimail is not the only part of git.git that has a separate
> maintainer. Same goes for git-gui and gitk.
They are not part of contrib.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 20:40 ` Felipe Contreras
@ 2014-05-07 20:57 ` Matthieu Moy
2014-05-07 22:19 ` James Denholm
0 siblings, 1 reply; 13+ messages in thread
From: Matthieu Moy @ 2014-05-07 20:57 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git, Michael Haggerty
Felipe Contreras <felipe.contreras@gmail.com> writes:
> Matthieu Moy wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>> > If you want to use python2, then use '/usr/bin/env python2'.
>>
>> Err, yes, this is what the code does before your patch.
>
> Not for all the instances.
Well, I guess not all scripts require python2, hence not all scripts
declare that they depend on python2.
And anyway, I don't see how changing python2 to python in git-multimail
solves any problem.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 20:57 ` Matthieu Moy
@ 2014-05-07 22:19 ` James Denholm
2014-05-08 11:48 ` Matthieu Moy
0 siblings, 1 reply; 13+ messages in thread
From: James Denholm @ 2014-05-07 22:19 UTC (permalink / raw)
To: Matthieu Moy, Felipe Contreras; +Cc: git, Michael Haggerty
On 8 May 2014 06:57:13 GMT+10:00, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
>Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> Matthieu Moy wrote:
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>> > If you want to use python2, then use '/usr/bin/env python2'.
>>>
>>> Err, yes, this is what the code does before your patch.
>>
>> Not for all the instances.
>
>Well, I guess not all scripts require python2, hence not all scripts
>declare that they depend on python2.
Does it make sense for git to have a strict subset of python scripts as
version agnostic, though? Given that some scripts depend on python2
already, and hence we know that the user has python2, and these scripts
run perfectly well on python2, why not mandate that the agnostic subset
be run on python2?
Regards,
James Denholm.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-07 22:19 ` James Denholm
@ 2014-05-08 11:48 ` Matthieu Moy
2014-05-08 12:20 ` Johan Herland
0 siblings, 1 reply; 13+ messages in thread
From: Matthieu Moy @ 2014-05-08 11:48 UTC (permalink / raw)
To: James Denholm; +Cc: Felipe Contreras, git, Michael Haggerty
James Denholm <nod.helm@gmail.com> writes:
> On 8 May 2014 06:57:13 GMT+10:00, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
>>Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>>> Matthieu Moy wrote:
>>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>> > If you want to use python2, then use '/usr/bin/env python2'.
>>>>
>>>> Err, yes, this is what the code does before your patch.
>>>
>>> Not for all the instances.
>>
>>Well, I guess not all scripts require python2, hence not all scripts
>>declare that they depend on python2.
>
> Does it make sense for git to have a strict subset of python scripts as
> version agnostic, though? Given that some scripts depend on python2
> already, and hence we know that the user has python2,
No, we don't. People do not have to use _all_ Python scripts. The
discussion started about git-multimail.py, which I use on a server which
doesn't have python3, while my desktop (where I use other Git commands)
has Python3.
It is very important that git-multimail keeps running with Python2
(ideally, it could be portable Python 2 or 3, but it's not so easy to
do), but that would be strange to force even non-git-multimail-users to
use Python2 for that.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Standardize python shebangs
2014-05-08 11:48 ` Matthieu Moy
@ 2014-05-08 12:20 ` Johan Herland
0 siblings, 0 replies; 13+ messages in thread
From: Johan Herland @ 2014-05-08 12:20 UTC (permalink / raw)
To: Matthieu Moy
Cc: James Denholm, Felipe Contreras, Git mailing list,
Michael Haggerty
On Thu, May 8, 2014 at 1:48 PM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> It is very important that git-multimail keeps running with Python2
> (ideally, it could be portable Python 2 or 3, but it's not so easy to
> do), but that would be strange to force even non-git-multimail-users to
> use Python2 for that.
FWIW, the rules laid out in PEP394 should be very easy to follow:
- If your script is Python2-only, use "#!/usr/bin/env python2"
- If your script is Python3-only, use "#!/usr/bin/env python3"
- If your script is Python2/3-agnostic, use "#!/usr/bin/env python"
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2014-05-08 12:20 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-07 10:03 [PATCH] Standardize python shebangs Felipe Contreras
2014-05-07 10:27 ` Johan Herland
2014-05-07 11:11 ` Felipe Contreras
2014-05-07 12:03 ` James Denholm
2014-05-07 12:28 ` Johan Herland
2014-05-07 18:06 ` Matthieu Moy
2014-05-07 19:06 ` Felipe Contreras
2014-05-07 20:23 ` Matthieu Moy
2014-05-07 20:40 ` Felipe Contreras
2014-05-07 20:57 ` Matthieu Moy
2014-05-07 22:19 ` James Denholm
2014-05-08 11:48 ` Matthieu Moy
2014-05-08 12:20 ` Johan Herland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).