threads / patch / 45269

patchDo not require Python for the git-remote-{bzr,hg} placeholder scripts

Subject: [PATCH] Do not require Python for the git-remote-{bzr,hg} placeholder scripts

## tl;dr

6 messages between Mar 3, 2017 and Mar 3, 2017. Diffs are folded; open one to read it.

replies: 5people: 4as markdown or json

Sebastian Schuberth· Mar 3, 2017, 10:57 UTC · lore

It does not make sense for these placeholder scripts to depend on Python just because the real scripts do. At the example of Git for Windows, we would not even be able to see those warnings as it does not ship with Python. So just use plain shell scripts instead.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 contrib/remote-helpers/git-remote-bzr | 16 +++++++---------
 contrib/remote-helpers/git-remote-hg  | 16 +++++++---------
 2 files changed, 14 insertions(+), 18 deletions(-)
Show changes to 2 files +14 −19

contrib/remote-helpers/git-remote-bzr, contrib/remote-helpers/git-remote-hg

diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 712a137..ccc4aea 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -1,13 +1,11 @@
-#!/usr/bin/env python
+#!/bin/sh
 
-import sys
-
-sys.stderr.write('WARNING: git-remote-bzr is now maintained independently.\n')
-sys.stderr.write('WARNING: For more information visit https://github.com/felipec/git-remote-bzr\n')
-
-sys.stderr.write('''WARNING:
+cat <<'EOT'
+WARNING: git-remote-bzr is now maintained independently.
+WARNING: For more information visit https://github.com/felipec/git-remote-bzr
+WARNING:
 WARNING: You can pick a directory on your $PATH and download it, e.g.:
-WARNING:   $ wget -O $HOME/bin/git-remote-bzr \\
+WARNING:   $ wget -O $HOME/bin/git-remote-bzr \
 WARNING:     https://raw.github.com/felipec/git-remote-bzr/master/git-remote-bzr
 WARNING:   $ chmod +x $HOME/bin/git-remote-bzr
-''')
+EOT
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 4255ad6..dfda44f 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -1,13 +1,11 @@
-#!/usr/bin/env python
+#!/bin/sh
 
-import sys
-
-sys.stderr.write('WARNING: git-remote-hg is now maintained independently.\n')
-sys.stderr.write('WARNING: For more information visit https://github.com/felipec/git-remote-hg\n')
-
-sys.stderr.write('''WARNING:
+cat <<'EOT'
+WARNING: git-remote-hg is now maintained independently.
+WARNING: For more information visit https://github.com/felipec/git-remote-hg
+WARNING:
 WARNING: You can pick a directory on your $PATH and download it, e.g.:
-WARNING:   $ wget -O $HOME/bin/git-remote-hg \\
+WARNING:   $ wget -O $HOME/bin/git-remote-hg \
 WARNING:     https://raw.github.com/felipec/git-remote-hg/master/git-remote-hg
 WARNING:   $ chmod +x $HOME/bin/git-remote-hg
-''')
+EOT

--
https://github.com/git/git/pull/333
Jeff King· Mar 3, 2017, 11:21 UTC · re: Sebastian Schuberth · lore

Re: [PATCH] Do not require Python for the git-remote-{bzr,hg} placeholder scripts

On Fri, Mar 03, 2017 at 10:57:46AM +0000, Sebastian Schuberth wrote:
> It does not make sense for these placeholder scripts to depend on Python
> just because the real scripts do. At the example of Git for Windows, we
> would not even be able to see those warnings as it does not ship with
> Python. So just use plain shell scripts instead.

Yeah, this seems like an obvious improvement. I think we got here because the originals issued a warning but kept working, and then it was slowly whittled down to remove the "working" part.

At some point these can probably go away. It's been 3 years since they turned into nothing but warnings, so presumably most people have upgraded by now (I know people often go a long time on old distro-packaged versions, but the distro packagers would presumably figure this out in the meantime).

OTOH, it is not really hurting much, so I do not mind keeping them around for another 3 years (or more) just to catch any stragglers.

-Peff
Junio C Hamano· Mar 3, 2017, 19:06 UTC · re: Jeff King · lore

Re: [PATCH] Do not require Python for the git-remote-{bzr,hg} placeholder scripts

Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> On Fri, Mar 03, 2017 at 10:57:46AM +0000, Sebastian Schuberth wrote:
>
>> It does not make sense for these placeholder scripts to depend on Python
>> just because the real scripts do. At the example of Git for Windows, we
>> would not even be able to see those warnings as it does not ship with
>> Python. So just use plain shell scripts instead.
>
> Yeah, this seems like an obvious improvement. I think we got here
> because the originals issued a warning but kept working, and then it was
> slowly whittled down to remove the "working" part.
> ...
> OTOH, it is not really hurting much, so I do not mind keeping them
> around for another 3 years (or more) just to catch any stragglers.
Yup, let's queue it and remove it in a few years.
Thanks.
Marc Branchaud· Mar 3, 2017, 15:32 UTC · re: Sebastian Schuberth · lore

Re: [PATCH] Do not require Python for the git-remote-{bzr,hg} placeholder scripts

On 2017-03-03 05:57 AM, Sebastian Schuberth wrote:
> It does not make sense for these placeholder scripts to depend on Python
> just because the real scripts do. At the example of Git for Windows, we
> would not even be able to see those warnings as it does not ship with
> Python. So just use plain shell scripts instead.
Just a niggle:  This change moves the warning message from stderr to stdout.
		M.
Show 60 quoted lines
> Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
> ---
>  contrib/remote-helpers/git-remote-bzr | 16 +++++++---------
>  contrib/remote-helpers/git-remote-hg  | 16 +++++++---------
>  2 files changed, 14 insertions(+), 18 deletions(-)
>
> diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
> index 712a137..ccc4aea 100755
> --- a/contrib/remote-helpers/git-remote-bzr
> +++ b/contrib/remote-helpers/git-remote-bzr
> @@ -1,13 +1,11 @@
> -#!/usr/bin/env python
> +#!/bin/sh
>
> -import sys
> -
> -sys.stderr.write('WARNING: git-remote-bzr is now maintained independently.\n')
> -sys.stderr.write('WARNING: For more information visit https://github.com/felipec/git-remote-bzr\n')
> -
> -sys.stderr.write('''WARNING:
> +cat <<'EOT'
> +WARNING: git-remote-bzr is now maintained independently.
> +WARNING: For more information visit https://github.com/felipec/git-remote-bzr
> +WARNING:
>  WARNING: You can pick a directory on your $PATH and download it, e.g.:
> -WARNING:   $ wget -O $HOME/bin/git-remote-bzr \\
> +WARNING:   $ wget -O $HOME/bin/git-remote-bzr \
>  WARNING:     https://raw.github.com/felipec/git-remote-bzr/master/git-remote-bzr
>  WARNING:   $ chmod +x $HOME/bin/git-remote-bzr
> -''')
> +EOT
> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
> index 4255ad6..dfda44f 100755
> --- a/contrib/remote-helpers/git-remote-hg
> +++ b/contrib/remote-helpers/git-remote-hg
> @@ -1,13 +1,11 @@
> -#!/usr/bin/env python
> +#!/bin/sh
>
> -import sys
> -
> -sys.stderr.write('WARNING: git-remote-hg is now maintained independently.\n')
> -sys.stderr.write('WARNING: For more information visit https://github.com/felipec/git-remote-hg\n')
> -
> -sys.stderr.write('''WARNING:
> +cat <<'EOT'
> +WARNING: git-remote-hg is now maintained independently.
> +WARNING: For more information visit https://github.com/felipec/git-remote-hg
> +WARNING:
>  WARNING: You can pick a directory on your $PATH and download it, e.g.:
> -WARNING:   $ wget -O $HOME/bin/git-remote-hg \\
> +WARNING:   $ wget -O $HOME/bin/git-remote-hg \
>  WARNING:     https://raw.github.com/felipec/git-remote-hg/master/git-remote-hg
>  WARNING:   $ chmod +x $HOME/bin/git-remote-hg
> -''')
> +EOT
>
> --
> https://github.com/git/git/pull/333
>
Junio C Hamano· Mar 3, 2017, 19:10 UTC · re: Marc Branchaud · lore

Re: [PATCH] Do not require Python for the git-remote-{bzr,hg} placeholder scripts

Marc Branchaud <marcnarc@xiplink.com> writes:
Show 7 quoted lines
> On 2017-03-03 05:57 AM, Sebastian Schuberth wrote:
>> It does not make sense for these placeholder scripts to depend on Python
>> just because the real scripts do. At the example of Git for Windows, we
>> would not even be able to see those warnings as it does not ship with
>> Python. So just use plain shell scripts instead.
>
> Just a niggle:  This change moves the warning message from stderr to stdout.
Right.  Here is what I'll queue.
-- >8 --
From: Sebastian Schuberth <sschuberth@gmail.com>
Date: Fri, 3 Mar 2017 10:57:46 +0000
Subject: [PATCH] contrib: git-remote-{bzr,hg} placeholders don't need Python

It does not make sense for these placeholder scripts to depend on Python just because the real scripts do. At the example of Git for Windows, we would not even be able to see those warnings as it does not ship with Python. So just use plain shell scripts instead.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/remote-helpers/git-remote-bzr | 16 +++++++---------
 contrib/remote-helpers/git-remote-hg  | 16 +++++++---------
 2 files changed, 14 insertions(+), 18 deletions(-)
Show changes to 2 files +14 −18

contrib/remote-helpers/git-remote-bzr, contrib/remote-helpers/git-remote-hg

diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 712a1377e2..ccc4aea362 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -1,13 +1,11 @@
-#!/usr/bin/env python
+#!/bin/sh
 
-import sys
-
-sys.stderr.write('WARNING: git-remote-bzr is now maintained independently.\n')
-sys.stderr.write('WARNING: For more information visit https://github.com/felipec/git-remote-bzr\n')
-
-sys.stderr.write('''WARNING:
+cat >&2 <<'EOT'
+WARNING: git-remote-bzr is now maintained independently.
+WARNING: For more information visit https://github.com/felipec/git-remote-bzr
+WARNING:
 WARNING: You can pick a directory on your $PATH and download it, e.g.:
-WARNING:   $ wget -O $HOME/bin/git-remote-bzr \\
+WARNING:   $ wget -O $HOME/bin/git-remote-bzr \
 WARNING:     https://raw.github.com/felipec/git-remote-bzr/master/git-remote-bzr
 WARNING:   $ chmod +x $HOME/bin/git-remote-bzr
-''')
+EOT
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 4255ad6312..dfda44f311 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -1,13 +1,11 @@
-#!/usr/bin/env python
+#!/bin/sh
 
-import sys
-
-sys.stderr.write('WARNING: git-remote-hg is now maintained independently.\n')
-sys.stderr.write('WARNING: For more information visit https://github.com/felipec/git-remote-hg\n')
-
-sys.stderr.write('''WARNING:
+cat >&2 <<'EOT'
+WARNING: git-remote-hg is now maintained independently.
+WARNING: For more information visit https://github.com/felipec/git-remote-hg
+WARNING:
 WARNING: You can pick a directory on your $PATH and download it, e.g.:
-WARNING:   $ wget -O $HOME/bin/git-remote-hg \\
+WARNING:   $ wget -O $HOME/bin/git-remote-hg \
 WARNING:     https://raw.github.com/felipec/git-remote-hg/master/git-remote-hg
 WARNING:   $ chmod +x $HOME/bin/git-remote-hg
-''')
+EOT
-- 
2.12.0-368-g85767a6c71
Sebastian Schuberth· Mar 3, 2017, 20:13 UTC · re: Junio C Hamano · lore

Re: [PATCH] Do not require Python for the git-remote-{bzr,hg} placeholder scripts

On Fri, Mar 3, 2017 at 8:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Just a niggle:  This change moves the warning message from stderr to stdout.
>
> Right.  Here is what I'll queue.
Indeed, thanks for the note, and also Junio for fixing while queuing.
-- 
Sebastian Schuberth

← back to recent threads