# git-permalink [pt][pt1] | [fr][fr1] | [eo][eo1] [pt1]: https://euandreh.xyz/git-permalink/pt/ [fr1]: https://euandreh.xyz/git-permalink/fr/ [eo1]: https://euandreh.xyz/git-permalink/eo/ Git extension to generate web permalinks of files in a repository. It knows about many of the existing code forges, but allows for URL template overrides to be used on custom domains or deployments via git config. ## Usage ```shell # setup example "remembering" repository $ git clone https://euandreh.xyz/remembering.git $ cd remembering/ ``` Now inside the repository folder, running `git permalink` will try building the web URL of the given file and use `xdg-open` to launch the browser (or whatever is configured): ```shell $ git permalink tests/ranking.sh Opening https://euandreh.xyz/remembering.git/tree/tests/ranking.sh?id=44533e2df144e7749a382e298aea53ca11a2239e $ git permalink tests/ranking.sh 23 Opening https://euandreh.xyz/remembering.git/tree/tests/ranking.sh?id=44533e2df144e7749a382e298aea53ca11a2239e#n23 ``` Or if you just want to output the link without invoking `xdg-open`, you can use the `-p` flag: ```shell $ git permalink -p tests/ranking.sh 23 https://euandreh.xyz/remembering.git/tree/tests/ranking.sh?id=44533e2df144e7749a382e298aea53ca11a2239e#n23 ``` ## Installation ```shell $ make $ make check # make install ``` You can pass `PREFIX` or `DESTDIR` to `make` if you'd like: ```shell $ make PREFIX=$HOME/.local $ make check $ make install PREFIX=$HOME/.local ``` There are no dependencies or requirements, only standard tools such as POSIX sed, POSIX make, etc. ## Documentation ### Manuals The documentation is available via installed manpages or online: - [`git-permalink.1`] ([pt][pt2], [fr][fr2], [eo][eo2]). [`git-permalink.1`]: https://euandreh.xyz/git-permalink/en/git-permalink.1.html [pt2]: https://euandreh.xyz/git-permalink/pt/git-permalink.1.html [fr2]: https://euandreh.xyz/git-permalink/fr/git-permalink.1.html [eo2]: https://euandreh.xyz/git-permalink/eo/git-permalink.1.html ### Directory structure The directory structure of the repository is: - `aux/`: personal scripts and helpers I've vendored in to ensure the repository is self contained, feel free to ignore it; - `doc/`: manpages, with their translated versions; - `po/`: gettext `.po` files for the translated languages and hunspell dictionaries for spell checking; - `src/`: main source code for the project; - `tests/`: integration tests for the project. ## Contributing Extra tools used for development are: - [ShellCheck] for validating scripts; - [po4a], [mdpo] and [gettext] for i18n and l10n support; - [pandoc] for generating the documentation HTML and website. [ShellCheck]: https://www.shellcheck.net/ [po4a]: https://po4a.org/index.php.en [gettext]: https://www.gnu.org/software/gettext/ [pandoc]: https://pandoc.org/ [mdpo]: https://mdpo.readthedocs.io/en/master/ For running the extra development-only checks, run: ```shell $ make dev-check ``` and for generating the documentation HTML and website, run: ```shell $ make public ``` Send contributions to the [mailing list] via [`git send-email`](https://git-send-email.io/). ## Links - [homepage](https://euandreh.xyz/git-permalink/en/) - [source code](https://euandreh.xyz/git-permalink.git/) - [bug tracking](https://euandreh.xyz/git-permalink/TODOs.html) - [mailing list] - [CI logs](https://euandreh.xyz/git-permalink/ci.html) - [CHANGELOG](https://euandreh.xyz/git-permalink/en/CHANGELOG.html) [mailing list]: https://lists.sr.ht/~euandreh/public-inbox?search=%5Bgit-permalink%5D ## Releases - [v0.3.1](https://euandreh.xyz/git-permalink.git/commit/?id=v0.3.1) [git-permalink-v0.3.1.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.3.1.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.3.1.tar.gz.asc)) - 2022-01-16 - [v0.3.0](https://euandreh.xyz/git-permalink.git/commit/?id=v0.3.0) [git-permalink-v0.3.0.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.3.0.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.3.0.tar.gz.asc)) - 2022-01-16 - [v0.2.3](https://euandreh.xyz/git-permalink.git/commit/?id=v0.2.3) [git-permalink-v0.2.3.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.3.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.3.tar.gz.asc)) - 2021-07-16 - [v0.2.2](https://euandreh.xyz/git-permalink.git/commit/?id=v0.2.2) [git-permalink-v0.2.2.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.2.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.2.tar.gz.asc)) - 2021-06-25 - [v0.2.1](https://euandreh.xyz/git-permalink.git/commit/?id=v0.2.1) [git-permalink-v0.2.1.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.1.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.1.tar.gz.asc)) - 2021-06-25 - [v0.2.0](https://euandreh.xyz/git-permalink.git/commit/?id=v0.2.0) [git-permalink-v0.2.0.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.0.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.2.0.tar.gz.asc)) - 2021-06-19 - [v0.1.0](https://euandreh.xyz/git-permalink.git/commit/?id=v0.1.0) [git-permalink-v0.1.0.tar.gz](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.1.0.tar.gz) ([sig](https://euandreh.xyz/git-permalink.git/snapshot/git-permalink-v0.1.0.tar.gz.asc)) - 2021-06-13 ## License The code is licensed under [GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] (AGPL-3.0-or-later). [AGPL-3.0-or-later]: https://euandreh.xyz/git-permalink.git/tree/COPYING