Skip to content

Commit 34f7617

Browse files
committed
INSTALL.md: simplify manual installation instructions
Make use of `git --man-path` and `git --html-path` to simplify the manual installation instructions a bit. Also, there appears to be a site.getsitepackages() call in python to give similar information about where git_filter_repo.py can be installed. Signed-off-by: Elijah Newren <[email protected]>
1 parent a238e3b commit 34f7617

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

INSTALL.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ filter-repo only consists of a few files that need to be installed:
2222

2323
* git-filter-repo
2424

25+
This is the only thing needed for basic use.
26+
2527
This can be installed in the directory pointed to by `git --exec-path`,
26-
or placed anywhere in $PATH. This is the only thing needed for basic use.
28+
or placed anywhere in $PATH.
2729

2830
If your python3 executable is named "python" instead of "python3"
2931
(this particularly appears to affect a number of Windows users),
@@ -32,24 +34,49 @@ filter-repo only consists of a few files that need to be installed:
3234

3335
* git_filter_repo.py
3436

35-
If you want to make use of one of the scripts in contrib/filter-repo-demos/,
36-
or want to write your own script making use of filter-repo as a python
37-
library, then you need to have a symlink to (or copy of) git-filter-repo
38-
named git_filter_repo.py in $PYTHONPATH.
37+
This is needed if you want to make use of one of the scripts in
38+
contrib/filter-repo-demos/, or want to write your own script making use
39+
of filter-repo as a python library.
40+
41+
You can create this symlink to (or copy of) git-filter-repo named
42+
git_filter-repo.py and place it in your python site packages; `python
43+
-c "import site; print(site.getsitepackages())" may help you find the
44+
appropriate location for your system. Alternatively, you can place
45+
this file anywhere within $PYTHONPATH.
3946

4047
* git-filter-repo.1
4148

42-
If you want `git filter-repo --help` to display the manpage, this needs
43-
to be copied into $MANDIR/man1/ where $MANDIR is some entry from $MANPATH.
44-
(Note that `git filter-repo -h` will show a more limited built-in set of
45-
instructions regardless of whether the manpage is installed.)
49+
This is needed if you want `git filter-repo --help` to succeed in
50+
displaying the manpage, when help.format is "man" (the default on Linux
51+
and Mac).
52+
53+
This can be installed in the directory pointed to by `$(git
54+
--man-path)/man1/`, or placed anywhere in $MANDIR/man1/ where $MANDIR
55+
is some entry from $MANPATH.
56+
57+
Note that `git filter-repo -h` will show a more limited built-in set of
58+
instructions regardless of whether the manpage is installed.
4659

4760
* git-filter-repo.html
4861

49-
The manpage is good enough for me and my systems, but an html-formatted
50-
version of the same page is provided for those who prefer it. Place it
51-
where ever you like; I have no idea where such a thing should go.
62+
This is needed if you want `git filter-repo --help` to succeed in
63+
displaying the html version of the help, when help.format is set to
64+
"html" (the default on Windows).
65+
66+
This can be installed in the directory pointed to by `git --html-path`.
67+
68+
Note that `git filter-repo -h` will show a more limited built-in set of
69+
instructions regardless of whether the html version of help is
70+
installed.
5271

72+
So, installation might look something like
73+
```
74+
cp -a git-filter-repo $(git --exec-path)
75+
cp -a git-filter-repo.1 $(git --man-path)/man1
76+
cp -a git-filter-repo.html $(git --html-path)
77+
ln -s $(git --exec-path)/git-filter-repo \
78+
$(python -c "import site; print(site.getsitepackages()[-1])")/git_filter_repo.py
79+
```
5380

5481
# Installation via [pip](https://pip.pypa.io/)
5582

0 commit comments

Comments
 (0)