git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [filter-repo PATCH] filter-repo: help with local install
@ 2021-07-09 15:25 Michael J Gruber
  2021-07-09 15:41 ` Elijah Newren
  2021-07-09 17:24 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Michael J Gruber @ 2021-07-09 15:25 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren

The Makefile suggests a local install and works almost as is, except for
the python path. Make it work automatically for this typical use case,
and give a corresponding hint in INSTALL.md.

Signed-off-by: Michael J Gruber <git@grubix.eu>
---
 INSTALL.md | 5 +++--
 Makefile   | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/INSTALL.md b/INSTALL.md
index 00aabb7..d479681 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:
     You can create this symlink to (or copy of) git-filter-repo named
     git_filter-repo.py and place it in your python site packages; `python
     -c "import site; print(site.getsitepackages())"` may help you find the
-    appropriate location for your system.  Alternatively, you can place
-    this file anywhere within $PYTHONPATH.
+    appropriate location for your system, `python -c "import site;
+    print(site.getusersitepackages())"` for a local install. Alternatively,
+    you can place this file anywhere within $PYTHONPATH.
 
   * git-filter-repo.1
 
diff --git a/Makefile b/Makefile
index 31f5e3a..c97d1f6 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core
 localedir = $(prefix)/share/locale
 mandir = $(prefix)/share/man
 htmldir = $(prefix)/share/doc/git-doc
-pythondir = $(prefix)/lib64/python3.6/site-packages
+pythondir = $(shell python -c "import site; print(site.getusersitepackages())")
 
 default: build
 
-- 
2.32.0.375.gf4d99f6c19


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [filter-repo PATCH] filter-repo: help with local install
  2021-07-09 15:25 [filter-repo PATCH] filter-repo: help with local install Michael J Gruber
@ 2021-07-09 15:41 ` Elijah Newren
  2021-07-09 17:24 ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Elijah Newren @ 2021-07-09 15:41 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Git Mailing List

On Fri, Jul 9, 2021 at 8:25 AM Michael J Gruber <git@grubix.eu> wrote:
>
> The Makefile suggests a local install and works almost as is, except for
> the python path. Make it work automatically for this typical use case,
> and give a corresponding hint in INSTALL.md.

Make sense.

>
> Signed-off-by: Michael J Gruber <git@grubix.eu>
> ---
>  INSTALL.md | 5 +++--
>  Makefile   | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/INSTALL.md b/INSTALL.md
> index 00aabb7..d479681 100644
> --- a/INSTALL.md
> +++ b/INSTALL.md
> @@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:
>      You can create this symlink to (or copy of) git-filter-repo named
>      git_filter-repo.py and place it in your python site packages; `python
>      -c "import site; print(site.getsitepackages())"` may help you find the
> -    appropriate location for your system.  Alternatively, you can place
> -    this file anywhere within $PYTHONPATH.
> +    appropriate location for your system, `python -c "import site;
> +    print(site.getusersitepackages())"` for a local install. Alternatively,

Why repeat the exact same python invocation twice in the same
sentence?  What's the difference between "may help you find the
appropriate location for your system" and "for a local install"?

> +    you can place this file anywhere within $PYTHONPATH.
>
>    * git-filter-repo.1
>
> diff --git a/Makefile b/Makefile
> index 31f5e3a..c97d1f6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core
>  localedir = $(prefix)/share/locale
>  mandir = $(prefix)/share/man
>  htmldir = $(prefix)/share/doc/git-doc
> -pythondir = $(prefix)/lib64/python3.6/site-packages
> +pythondir = $(shell python -c "import site; print(site.getusersitepackages())")

Yeah, this seems like a good idea.


Thanks for sending this in.  If we can get INSTALL.md straightened
out, I'll be happy to apply it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [filter-repo PATCH] filter-repo: help with local install
  2021-07-09 15:25 [filter-repo PATCH] filter-repo: help with local install Michael J Gruber
  2021-07-09 15:41 ` Elijah Newren
@ 2021-07-09 17:24 ` Junio C Hamano
  2021-07-09 17:51   ` Elijah Newren
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2021-07-09 17:24 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Elijah Newren

Michael J Gruber <git@grubix.eu> writes:

> The Makefile suggests a local install and works almost as is, except for
> the python path. Make it work automatically for this typical use case,
> and give a corresponding hint in INSTALL.md.
>
> Signed-off-by: Michael J Gruber <git@grubix.eu>
> ---
>  INSTALL.md | 5 +++--
>  Makefile   | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/INSTALL.md b/INSTALL.md
> index 00aabb7..d479681 100644
> --- a/INSTALL.md
> +++ b/INSTALL.md
> @@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:
>      You can create this symlink to (or copy of) git-filter-repo named
>      git_filter-repo.py and place it in your python site packages; `python
>      -c "import site; print(site.getsitepackages())"` may help you find the
> -    appropriate location for your system.  Alternatively, you can place
> -    this file anywhere within $PYTHONPATH.
> +    appropriate location for your system, `python -c "import site;
> +    print(site.getusersitepackages())"` for a local install. Alternatively,
> +    you can place this file anywhere within $PYTHONPATH.
>  
>    * git-filter-repo.1
>  
> diff --git a/Makefile b/Makefile
> index 31f5e3a..c97d1f6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core
>  localedir = $(prefix)/share/locale
>  mandir = $(prefix)/share/man
>  htmldir = $(prefix)/share/doc/git-doc
> -pythondir = $(prefix)/lib64/python3.6/site-packages
> +pythondir = $(shell python -c "import site; print(site.getusersitepackages())")

There may be no "python" on $PATH, yet the user may have told the
make via PYTHON_PATH that /usr/bin/python3 is to be used.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [filter-repo PATCH] filter-repo: help with local install
  2021-07-09 17:24 ` Junio C Hamano
@ 2021-07-09 17:51   ` Elijah Newren
  0 siblings, 0 replies; 4+ messages in thread
From: Elijah Newren @ 2021-07-09 17:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Michael J Gruber, Git Mailing List

On Fri, Jul 9, 2021 at 10:24 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Michael J Gruber <git@grubix.eu> writes:
>
> > The Makefile suggests a local install and works almost as is, except for
> > the python path. Make it work automatically for this typical use case,
> > and give a corresponding hint in INSTALL.md.
> >
> > Signed-off-by: Michael J Gruber <git@grubix.eu>
> > ---
> >  INSTALL.md | 5 +++--
> >  Makefile   | 2 +-
> >  2 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/INSTALL.md b/INSTALL.md
> > index 00aabb7..d479681 100644
> > --- a/INSTALL.md
> > +++ b/INSTALL.md
> > @@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:
> >      You can create this symlink to (or copy of) git-filter-repo named
> >      git_filter-repo.py and place it in your python site packages; `python
> >      -c "import site; print(site.getsitepackages())"` may help you find the
> > -    appropriate location for your system.  Alternatively, you can place
> > -    this file anywhere within $PYTHONPATH.
> > +    appropriate location for your system, `python -c "import site;
> > +    print(site.getusersitepackages())"` for a local install. Alternatively,
> > +    you can place this file anywhere within $PYTHONPATH.
> >
> >    * git-filter-repo.1
> >
> > diff --git a/Makefile b/Makefile
> > index 31f5e3a..c97d1f6 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core
> >  localedir = $(prefix)/share/locale
> >  mandir = $(prefix)/share/man
> >  htmldir = $(prefix)/share/doc/git-doc
> > -pythondir = $(prefix)/lib64/python3.6/site-packages
> > +pythondir = $(shell python -c "import site; print(site.getusersitepackages())")
>
> There may be no "python" on $PATH, yet the user may have told the
> make via PYTHON_PATH that /usr/bin/python3 is to be used.

This was a patch for git-filter-repo.git rather than git.git; there is
no PYTHON_PATH variable in the Makefile.

That said, thanks for calling out python3.  As the git-filter-repo
script uses that, all these references to 'python' should be replaced
with 'python3' (including the two in INSTALL.md from before this
patch).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-09 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 15:25 [filter-repo PATCH] filter-repo: help with local install Michael J Gruber
2021-07-09 15:41 ` Elijah Newren
2021-07-09 17:24 ` Junio C Hamano
2021-07-09 17:51   ` Elijah Newren

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).