{"thread":{"id":"56084","subject":"[filter-repo PATCH] filter-repo: help with local install","startedAt":"2021-07-09T15:35:30Z","lastAt":"2021-07-09T17:52:12Z","messageCount":4,"participants":["Michael J Gruber","Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"429554","messageId":"e3d6c6d670b46d4f0dc133e83c6feede4d55c412.1625844149.git.git@grubix.eu","threadId":"56084","inReplyTo":null,"subject":"[filter-repo PATCH] filter-repo: help with local install","fromName":"Michael J Gruber","fromEmail":"git@grubix.eu","sentAt":"2021-07-09T15:25:30Z","receivedAt":"2021-07-09T15:35:30Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"The Makefile suggests a local install and works almost as is, except for\nthe python path. Make it work automatically for this typical use case,\nand give a corresponding hint in INSTALL.md.\n\nSigned-off-by: Michael J Gruber <git@grubix.eu>\n---\n INSTALL.md | 5 +++--\n Makefile   | 2 +-\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/INSTALL.md b/INSTALL.md\nindex 00aabb7..d479681 100644\n--- a/INSTALL.md\n+++ b/INSTALL.md\n@@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:\n     You can create this symlink to (or copy of) git-filter-repo named\n     git_filter-repo.py and place it in your python site packages; `python\n     -c \"import site; print(site.getsitepackages())\"` may help you find the\n-    appropriate location for your system.  Alternatively, you can place\n-    this file anywhere within $PYTHONPATH.\n+    appropriate location for your system, `python -c \"import site;\n+    print(site.getusersitepackages())\"` for a local install. Alternatively,\n+    you can place this file anywhere within $PYTHONPATH.\n \n   * git-filter-repo.1\n \ndiff --git a/Makefile b/Makefile\nindex 31f5e3a..c97d1f6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core\n localedir = $(prefix)/share/locale\n mandir = $(prefix)/share/man\n htmldir = $(prefix)/share/doc/git-doc\n-pythondir = $(prefix)/lib64/python3.6/site-packages\n+pythondir = $(shell python -c \"import site; print(site.getusersitepackages())\")\n \n default: build\n \n-- \n2.32.0.375.gf4d99f6c19\n\n"},{"id":"429556","messageId":"CABPp-BEXz2r+VjaWnuCopZXi-WjaCymT3WJe0KU8OGj8Lqi-Mg@mail.gmail.com","threadId":"56084","inReplyTo":"e3d6c6d670b46d4f0dc133e83c6feede4d55c412.1625844149.git.git@grubix.eu","subject":"Re: [filter-repo PATCH] filter-repo: help with local install","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-07-09T15:41:33Z","receivedAt":"2021-07-09T15:41:47Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Jul 9, 2021 at 8:25 AM Michael J Gruber <git@grubix.eu> wrote:\n>\n> The Makefile suggests a local install and works almost as is, except for\n> the python path. Make it work automatically for this typical use case,\n> and give a corresponding hint in INSTALL.md.\n\nMake sense.\n\n>\n> Signed-off-by: Michael J Gruber <git@grubix.eu>\n> ---\n>  INSTALL.md | 5 +++--\n>  Makefile   | 2 +-\n>  2 files changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/INSTALL.md b/INSTALL.md\n> index 00aabb7..d479681 100644\n> --- a/INSTALL.md\n> +++ b/INSTALL.md\n> @@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:\n>      You can create this symlink to (or copy of) git-filter-repo named\n>      git_filter-repo.py and place it in your python site packages; `python\n>      -c \"import site; print(site.getsitepackages())\"` may help you find the\n> -    appropriate location for your system.  Alternatively, you can place\n> -    this file anywhere within $PYTHONPATH.\n> +    appropriate location for your system, `python -c \"import site;\n> +    print(site.getusersitepackages())\"` for a local install. Alternatively,\n\nWhy repeat the exact same python invocation twice in the same\nsentence?  What's the difference between \"may help you find the\nappropriate location for your system\" and \"for a local install\"?\n\n> +    you can place this file anywhere within $PYTHONPATH.\n>\n>    * git-filter-repo.1\n>\n> diff --git a/Makefile b/Makefile\n> index 31f5e3a..c97d1f6 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core\n>  localedir = $(prefix)/share/locale\n>  mandir = $(prefix)/share/man\n>  htmldir = $(prefix)/share/doc/git-doc\n> -pythondir = $(prefix)/lib64/python3.6/site-packages\n> +pythondir = $(shell python -c \"import site; print(site.getusersitepackages())\")\n\nYeah, this seems like a good idea.\n\n\nThanks for sending this in.  If we can get INSTALL.md straightened\nout, I'll be happy to apply it.\n"},{"id":"429568","messageId":"xmqqk0lz764u.fsf@gitster.g","threadId":"56084","inReplyTo":"e3d6c6d670b46d4f0dc133e83c6feede4d55c412.1625844149.git.git@grubix.eu","subject":"Re: [filter-repo PATCH] filter-repo: help with local install","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-07-09T17:24:01Z","receivedAt":"2021-07-09T17:24:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@grubix.eu> writes:\n\n> The Makefile suggests a local install and works almost as is, except for\n> the python path. Make it work automatically for this typical use case,\n> and give a corresponding hint in INSTALL.md.\n>\n> Signed-off-by: Michael J Gruber <git@grubix.eu>\n> ---\n>  INSTALL.md | 5 +++--\n>  Makefile   | 2 +-\n>  2 files changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/INSTALL.md b/INSTALL.md\n> index 00aabb7..d479681 100644\n> --- a/INSTALL.md\n> +++ b/INSTALL.md\n> @@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:\n>      You can create this symlink to (or copy of) git-filter-repo named\n>      git_filter-repo.py and place it in your python site packages; `python\n>      -c \"import site; print(site.getsitepackages())\"` may help you find the\n> -    appropriate location for your system.  Alternatively, you can place\n> -    this file anywhere within $PYTHONPATH.\n> +    appropriate location for your system, `python -c \"import site;\n> +    print(site.getusersitepackages())\"` for a local install. Alternatively,\n> +    you can place this file anywhere within $PYTHONPATH.\n>  \n>    * git-filter-repo.1\n>  \n> diff --git a/Makefile b/Makefile\n> index 31f5e3a..c97d1f6 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core\n>  localedir = $(prefix)/share/locale\n>  mandir = $(prefix)/share/man\n>  htmldir = $(prefix)/share/doc/git-doc\n> -pythondir = $(prefix)/lib64/python3.6/site-packages\n> +pythondir = $(shell python -c \"import site; print(site.getusersitepackages())\")\n\nThere may be no \"python\" on $PATH, yet the user may have told the\nmake via PYTHON_PATH that /usr/bin/python3 is to be used.\n\n"},{"id":"429572","messageId":"CABPp-BH3-0oE8_VsXgwOky8vAv=gZvP96ym=mc4hjHDKanRmQQ@mail.gmail.com","threadId":"56084","inReplyTo":"xmqqk0lz764u.fsf@gitster.g","subject":"Re: [filter-repo PATCH] filter-repo: help with local install","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-07-09T17:51:59Z","receivedAt":"2021-07-09T17:52:12Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Jul 9, 2021 at 10:24 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Michael J Gruber <git@grubix.eu> writes:\n>\n> > The Makefile suggests a local install and works almost as is, except for\n> > the python path. Make it work automatically for this typical use case,\n> > and give a corresponding hint in INSTALL.md.\n> >\n> > Signed-off-by: Michael J Gruber <git@grubix.eu>\n> > ---\n> >  INSTALL.md | 5 +++--\n> >  Makefile   | 2 +-\n> >  2 files changed, 4 insertions(+), 3 deletions(-)\n> >\n> > diff --git a/INSTALL.md b/INSTALL.md\n> > index 00aabb7..d479681 100644\n> > --- a/INSTALL.md\n> > +++ b/INSTALL.md\n> > @@ -75,8 +75,9 @@ filter-repo only consists of a few files that need to be installed:\n> >      You can create this symlink to (or copy of) git-filter-repo named\n> >      git_filter-repo.py and place it in your python site packages; `python\n> >      -c \"import site; print(site.getsitepackages())\"` may help you find the\n> > -    appropriate location for your system.  Alternatively, you can place\n> > -    this file anywhere within $PYTHONPATH.\n> > +    appropriate location for your system, `python -c \"import site;\n> > +    print(site.getusersitepackages())\"` for a local install. Alternatively,\n> > +    you can place this file anywhere within $PYTHONPATH.\n> >\n> >    * git-filter-repo.1\n> >\n> > diff --git a/Makefile b/Makefile\n> > index 31f5e3a..c97d1f6 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -4,7 +4,7 @@ bindir = $(prefix)/libexec/git-core\n> >  localedir = $(prefix)/share/locale\n> >  mandir = $(prefix)/share/man\n> >  htmldir = $(prefix)/share/doc/git-doc\n> > -pythondir = $(prefix)/lib64/python3.6/site-packages\n> > +pythondir = $(shell python -c \"import site; print(site.getusersitepackages())\")\n>\n> There may be no \"python\" on $PATH, yet the user may have told the\n> make via PYTHON_PATH that /usr/bin/python3 is to be used.\n\nThis was a patch for git-filter-repo.git rather than git.git; there is\nno PYTHON_PATH variable in the Makefile.\n\nThat said, thanks for calling out python3.  As the git-filter-repo\nscript uses that, all these references to 'python' should be replaced\nwith 'python3' (including the two in INSTALL.md from before this\npatch).\n"}]}