* [PATCH] svnrdump_sim: start the script with /usr/bin/env python
@ 2012-11-28 2:57 Christian Couder
2012-11-28 7:36 ` Junio C Hamano
0 siblings, 1 reply; 8+ messages in thread
From: Christian Couder @ 2012-11-28 2:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
All the python scripts except contrib/svn-fe/svnrdump_sim.py
start with "#!/usr/bin/env python".
This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
contrib/svn-fe/svnrdump_sim.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py
index 1cfac4a..d219180 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.7.11.rc3.17.g55b3f8c
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 2:57 [PATCH] svnrdump_sim: start the script with /usr/bin/env python Christian Couder
@ 2012-11-28 7:36 ` Junio C Hamano
2012-11-28 8:03 ` Felipe Contreras
0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2012-11-28 7:36 UTC (permalink / raw)
To: Christian Couder; +Cc: git
Christian Couder <chriscool@tuxfamily.org> writes:
> All the python scripts except contrib/svn-fe/svnrdump_sim.py
> start with "#!/usr/bin/env python".
>
> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.
I suspect you need a bit more than that.
$ make git-p4
$ diff -u git-p4.py git-p4
shows you how we tell the scripts how to find their interpreters
(that way, there is no need to rely on the existence of
/usr/bin/env).
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> contrib/svn-fe/svnrdump_sim.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py
> index 1cfac4a..d219180 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 7:36 ` Junio C Hamano
@ 2012-11-28 8:03 ` Felipe Contreras
2012-11-28 8:55 ` Christian Couder
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2012-11-28 8:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, git
On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <chriscool@tuxfamily.org> writes:
>
>> All the python scripts except contrib/svn-fe/svnrdump_sim.py
>> start with "#!/usr/bin/env python".
>>
>> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.
>
> I suspect you need a bit more than that.
>
> $ make git-p4
> $ diff -u git-p4.py git-p4
>
> shows you how we tell the scripts how to find their interpreters
> (that way, there is no need to rely on the existence of
> /usr/bin/env).
That works if somebody managed to export PYTHON_PATH, which very very
often is not the case for me.
./git-p4
zsh: ./git-p4: bad interpreter: /usr/bin/python: no such file or directory
In this case git-p4.py is correct, and git-p4 is not.
Either way, this is for contrib, and we don't have a standard
procedure for python scripts there. /usr/bin/env is better than
nothing, and in the vast majority of cases, more than enough.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 8:03 ` Felipe Contreras
@ 2012-11-28 8:55 ` Christian Couder
2012-11-28 16:57 ` Junio C Hamano
0 siblings, 1 reply; 8+ messages in thread
From: Christian Couder @ 2012-11-28 8:55 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Junio C Hamano, Christian Couder, git
On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Christian Couder <chriscool@tuxfamily.org> writes:
>>
>>> All the python scripts except contrib/svn-fe/svnrdump_sim.py
>>> start with "#!/usr/bin/env python".
>>>
>>> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.
>>
>> I suspect you need a bit more than that.
>>
>> $ make git-p4
>> $ diff -u git-p4.py git-p4
>>
>> shows you how we tell the scripts how to find their interpreters
>> (that way, there is no need to rely on the existence of
>> /usr/bin/env).
>
> That works if somebody managed to export PYTHON_PATH, which very very
> often is not the case for me.
Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,
svnrdump.py is used as is.
So if your python is not /usr/bin/python, you cannot just add
something to $PATH to pass the test.
Best regards,
Christian.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 8:55 ` Christian Couder
@ 2012-11-28 16:57 ` Junio C Hamano
2012-11-28 19:19 ` Felipe Contreras
0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2012-11-28 16:57 UTC (permalink / raw)
To: Christian Couder; +Cc: Felipe Contreras, Christian Couder, git
Christian Couder <christian.couder@gmail.com> writes:
> On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
>> On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Christian Couder <chriscool@tuxfamily.org> writes:
>>>
>>>> All the python scripts except contrib/svn-fe/svnrdump_sim.py
>>>> start with "#!/usr/bin/env python".
>>>>
>>>> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.
>>>
>>> I suspect you need a bit more than that.
>>>
>>> $ make git-p4
>>> $ diff -u git-p4.py git-p4
>>>
>>> shows you how we tell the scripts how to find their interpreters
>>> (that way, there is no need to rely on the existence of
>>> /usr/bin/env).
>>
>> That works if somebody managed to export PYTHON_PATH, which very very
>> often is not the case for me.
>
> Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,
> svnrdump.py is used as is.
You need a fix for that; didn't I already say "you need a bit more
than that"?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 16:57 ` Junio C Hamano
@ 2012-11-28 19:19 ` Felipe Contreras
2012-11-28 19:33 ` Junio C Hamano
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2012-11-28 19:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, Christian Couder, git
On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <christian.couder@gmail.com> writes:
>
>> On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras
>> <felipe.contreras@gmail.com> wrote:
>>> That works if somebody managed to export PYTHON_PATH, which very very
>>> often is not the case for me.
>>
>> Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,
>> svnrdump.py is used as is.
>
> You need a fix for that; didn't I already say "you need a bit more
> than that"?
I disagree. Most of the contrib scripts are expected to be used as
they are. There's no step in the Makefile that will convert them, and
it's up to each distribution to decide what to do with them. This is
what Arch Linux does:
# more contrib stuff
cp -a ./contrib/* $pkgdir/usr/share/git/
# scripts are for python 2.x
sed -i 's|#![ ]*/usr/bin/env python|#!/usr/bin/env python2|' \
$(find "$pkgdir" -name '*.py') \
"$pkgdir"/usr/lib/git-core/git-p4 \
"$pkgdir"/usr/share/git/gitview/gitview
At some point we might decide to change this, but at the moment
contrib scripts are pretty much stand-alone.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 19:19 ` Felipe Contreras
@ 2012-11-28 19:33 ` Junio C Hamano
2012-11-28 21:32 ` Felipe Contreras
0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2012-11-28 19:33 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Christian Couder, Christian Couder, git
Felipe Contreras <felipe.contreras@gmail.com> writes:
> On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> You need a fix for that; didn't I already say "you need a bit more
>> than that"?
>
> I disagree. Most of the contrib scripts are expected to be used as
> they are.
You are only looking at one of the uses for this script, when there
are two.
You are correct that distros may install with whatever tweaks of
their own, and to help their tweak process (like the one that
specifically notices "/usr/bin/env python" as you wrote), changing
the "#!/usr/bin/python" to match others would be a good change.
But that change alone is not sufficient for this one, which is used
from t/ script. You cannot treat this one like import-zips and
hg-to-git that we do not use in-tree. Somewhere before t9020 uses
it, it needs the treatment similar to the rewriting that is done for
git-p4.py to git-p4.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python
2012-11-28 19:33 ` Junio C Hamano
@ 2012-11-28 21:32 ` Felipe Contreras
0 siblings, 0 replies; 8+ messages in thread
From: Felipe Contreras @ 2012-11-28 21:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, Christian Couder, git
On Wed, Nov 28, 2012 at 8:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> ...
>>> You need a fix for that; didn't I already say "you need a bit more
>>> than that"?
>>
>> I disagree. Most of the contrib scripts are expected to be used as
>> they are.
>
> You are only looking at one of the uses for this script, when there
> are two.
>
> You are correct that distros may install with whatever tweaks of
> their own, and to help their tweak process (like the one that
> specifically notices "/usr/bin/env python" as you wrote), changing
> the "#!/usr/bin/python" to match others would be a good change.
>
> But that change alone is not sufficient for this one, which is used
> from t/ script. You cannot treat this one like import-zips and
> hg-to-git that we do not use in-tree. Somewhere before t9020 uses
> it, it needs the treatment similar to the rewriting that is done for
> git-p4.py to git-p4.
Unless the tests are moved to contrib, which I think is a good
practice: should anything in contrib break 'make test'? I don't think
so.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-11-28 21:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 2:57 [PATCH] svnrdump_sim: start the script with /usr/bin/env python Christian Couder
2012-11-28 7:36 ` Junio C Hamano
2012-11-28 8:03 ` Felipe Contreras
2012-11-28 8:55 ` Christian Couder
2012-11-28 16:57 ` Junio C Hamano
2012-11-28 19:19 ` Felipe Contreras
2012-11-28 19:33 ` Junio C Hamano
2012-11-28 21:32 ` Felipe Contreras
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).