{"thread":{"id":"32223","subject":"[PATCH] svnrdump_sim: start the script with /usr/bin/env python","startedAt":"2012-11-28T02:57:33Z","lastAt":"2012-11-28T21:32:47Z","messageCount":8,"participants":["Christian Couder","Junio C Hamano","Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"204118","messageId":"20121128025734.21231.47468.chriscool@tuxfamily.org","threadId":"32223","inReplyTo":null,"subject":"[PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2012-11-28T02:57:33Z","receivedAt":"2012-11-28T02:57:33Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"All the python scripts except contrib/svn-fe/svnrdump_sim.py\nstart with \"#!/usr/bin/env python\".\n\nThis patch fix contrib/svn-fe/svnrdump_sim.py to do the same.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n contrib/svn-fe/svnrdump_sim.py | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py\nindex 1cfac4a..d219180 100755\n--- a/contrib/svn-fe/svnrdump_sim.py\n+++ b/contrib/svn-fe/svnrdump_sim.py\n@@ -1,4 +1,4 @@\n-#!/usr/bin/python\n+#!/usr/bin/env python\n \"\"\"\n Simulates svnrdump by replaying an existing dump from a file, taking care\n of the specified revision range.\n-- \n1.7.11.rc3.17.g55b3f8c\n"},{"id":"204141","messageId":"7vy5hmgovt.fsf@alter.siamese.dyndns.org","threadId":"32223","inReplyTo":"20121128025734.21231.47468.chriscool@tuxfamily.org","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-28T07:36:38Z","receivedAt":"2012-11-28T07:36:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> All the python scripts except contrib/svn-fe/svnrdump_sim.py\n> start with \"#!/usr/bin/env python\".\n>\n> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.\n\nI suspect you need a bit more than that.\n\n    $ make git-p4\n    $ diff -u git-p4.py git-p4\n\nshows you how we tell the scripts how to find their interpreters\n(that way, there is no need to rely on the existence of\n/usr/bin/env).\n\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  contrib/svn-fe/svnrdump_sim.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py\n> index 1cfac4a..d219180 100755\n> --- a/contrib/svn-fe/svnrdump_sim.py\n> +++ b/contrib/svn-fe/svnrdump_sim.py\n> @@ -1,4 +1,4 @@\n> -#!/usr/bin/python\n> +#!/usr/bin/env python\n>  \"\"\"\n>  Simulates svnrdump by replaying an existing dump from a file, taking care\n>  of the specified revision range.\n"},{"id":"204144","messageId":"CAMP44s17Gycr2tWOLYAxMG7-CGP3SpFf7XTWf94qGg3WfVpT-A@mail.gmail.com","threadId":"32223","inReplyTo":"7vy5hmgovt.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-28T08:03:10Z","receivedAt":"2012-11-28T08:03:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Christian Couder <chriscool@tuxfamily.org> writes:\n>\n>> All the python scripts except contrib/svn-fe/svnrdump_sim.py\n>> start with \"#!/usr/bin/env python\".\n>>\n>> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.\n>\n> I suspect you need a bit more than that.\n>\n>     $ make git-p4\n>     $ diff -u git-p4.py git-p4\n>\n> shows you how we tell the scripts how to find their interpreters\n> (that way, there is no need to rely on the existence of\n> /usr/bin/env).\n\nThat works if somebody managed to export PYTHON_PATH, which very very\noften is not the case for me.\n\n./git-p4\nzsh: ./git-p4: bad interpreter: /usr/bin/python: no such file or directory\n\nIn this case git-p4.py is correct, and git-p4 is not.\n\nEither way, this is for contrib, and we don't have a standard\nprocedure for python scripts there. /usr/bin/env is better than\nnothing, and in the vast majority of cases, more than enough.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"204148","messageId":"CAP8UFD08LhywQ9KaNoeG1nORZwtK8MNWqwjfRJPyT2vLkNgs9A@mail.gmail.com","threadId":"32223","inReplyTo":"CAMP44s17Gycr2tWOLYAxMG7-CGP3SpFf7XTWf94qGg3WfVpT-A@mail.gmail.com","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2012-11-28T08:55:40Z","receivedAt":"2012-11-28T08:55:40Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Christian Couder <chriscool@tuxfamily.org> writes:\n>>\n>>> All the python scripts except contrib/svn-fe/svnrdump_sim.py\n>>> start with \"#!/usr/bin/env python\".\n>>>\n>>> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.\n>>\n>> I suspect you need a bit more than that.\n>>\n>>     $ make git-p4\n>>     $ diff -u git-p4.py git-p4\n>>\n>> shows you how we tell the scripts how to find their interpreters\n>> (that way, there is no need to rely on the existence of\n>> /usr/bin/env).\n>\n> That works if somebody managed to export PYTHON_PATH, which very very\n> often is not the case for me.\n\nYeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,\nsvnrdump.py is used as is.\nSo if your python is not /usr/bin/python, you cannot just add\nsomething to $PATH to pass the test.\n\nBest regards,\nChristian.\n"},{"id":"204167","messageId":"7vmwy1hdgx.fsf@alter.siamese.dyndns.org","threadId":"32223","inReplyTo":"CAP8UFD08LhywQ9KaNoeG1nORZwtK8MNWqwjfRJPyT2vLkNgs9A@mail.gmail.com","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-28T16:57:50Z","receivedAt":"2012-11-28T16:57:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>> On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Christian Couder <chriscool@tuxfamily.org> writes:\n>>>\n>>>> All the python scripts except contrib/svn-fe/svnrdump_sim.py\n>>>> start with \"#!/usr/bin/env python\".\n>>>>\n>>>> This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.\n>>>\n>>> I suspect you need a bit more than that.\n>>>\n>>>     $ make git-p4\n>>>     $ diff -u git-p4.py git-p4\n>>>\n>>> shows you how we tell the scripts how to find their interpreters\n>>> (that way, there is no need to rely on the existence of\n>>> /usr/bin/env).\n>>\n>> That works if somebody managed to export PYTHON_PATH, which very very\n>> often is not the case for me.\n>\n> Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,\n> svnrdump.py is used as is.\n\nYou need a fix for that; didn't I already say \"you need a bit more\nthan that\"?\n"},{"id":"204187","messageId":"CAMP44s3YfLrL+74j5DOVVATK8GWEo1qHnmJDW5dLWJRxK_CVLQ@mail.gmail.com","threadId":"32223","inReplyTo":"7vmwy1hdgx.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-28T19:19:32Z","receivedAt":"2012-11-28T19:19:32Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Christian Couder <christian.couder@gmail.com> writes:\n>\n>> On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n\n>>> That works if somebody managed to export PYTHON_PATH, which very very\n>>> often is not the case for me.\n>>\n>> Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,\n>> svnrdump.py is used as is.\n>\n> You need a fix for that; didn't I already say \"you need a bit more\n> than that\"?\n\nI disagree. Most of the contrib scripts are expected to be used as\nthey are. There's no step in the Makefile that will convert them, and\nit's up to each distribution to decide what to do with them. This is\nwhat Arch Linux does:\n\n  # more contrib stuff\n  cp -a ./contrib/* $pkgdir/usr/share/git/\n  # scripts are for python 2.x\n  sed -i 's|#![ ]*/usr/bin/env python|#!/usr/bin/env python2|' \\\n    $(find \"$pkgdir\" -name '*.py') \\\n    \"$pkgdir\"/usr/lib/git-core/git-p4 \\\n    \"$pkgdir\"/usr/share/git/gitview/gitview\n\nAt some point we might decide to change this, but at the moment\ncontrib scripts are pretty much stand-alone.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"204192","messageId":"7v7gp5v7y1.fsf@alter.siamese.dyndns.org","threadId":"32223","inReplyTo":"CAMP44s3YfLrL+74j5DOVVATK8GWEo1qHnmJDW5dLWJRxK_CVLQ@mail.gmail.com","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-28T19:33:26Z","receivedAt":"2012-11-28T19:33:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> ...\n>> You need a fix for that; didn't I already say \"you need a bit more\n>> than that\"?\n>\n> I disagree. Most of the contrib scripts are expected to be used as\n> they are.\n\nYou are only looking at one of the uses for this script, when there\nare two.\n\nYou are correct that distros may install with whatever tweaks of\ntheir own, and to help their tweak process (like the one that\nspecifically notices \"/usr/bin/env python\" as you wrote), changing\nthe \"#!/usr/bin/python\" to match others would be a good change.\n\nBut that change alone is not sufficient for this one, which is used\nfrom t/ script.  You cannot treat this one like import-zips and\nhg-to-git that we do not use in-tree.  Somewhere before t9020 uses\nit, it needs the treatment similar to the rewriting that is done for\ngit-p4.py to git-p4.\n"},{"id":"204207","messageId":"CAMP44s3dfY=UODdH+Q+YQiP5pwaoHpuDNwbOYh5GUF7AmoJigw@mail.gmail.com","threadId":"32223","inReplyTo":"7v7gp5v7y1.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-28T21:32:47Z","receivedAt":"2012-11-28T21:32:47Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Nov 28, 2012 at 8:33 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> ...\n>>> You need a fix for that; didn't I already say \"you need a bit more\n>>> than that\"?\n>>\n>> I disagree. Most of the contrib scripts are expected to be used as\n>> they are.\n>\n> You are only looking at one of the uses for this script, when there\n> are two.\n>\n> You are correct that distros may install with whatever tweaks of\n> their own, and to help their tweak process (like the one that\n> specifically notices \"/usr/bin/env python\" as you wrote), changing\n> the \"#!/usr/bin/python\" to match others would be a good change.\n>\n> But that change alone is not sufficient for this one, which is used\n> from t/ script.  You cannot treat this one like import-zips and\n> hg-to-git that we do not use in-tree.  Somewhere before t9020 uses\n> it, it needs the treatment similar to the rewriting that is done for\n> git-p4.py to git-p4.\n\nUnless the tests are moved to contrib, which I think is a good\npractice: should anything in contrib break 'make test'? I don't think\nso.\n\nCheers.\n\n-- \nFelipe Contreras\n"}]}