From 412a3f36cb40dba18f4f0f70a6804882ac6c68eb Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 23 Jun 2021 20:44:40 -0300 Subject: aux/workflow/manpages.sh: Refactor how manpages and translations are made I didn't like the previous version of aux/workflow/manpages.sh mainly for 2 reasons: 1. its CLI was terrible, ugly and fragile; 2. it mixed handling manpages and handling *translations*. The first step was to split the translations part to a different file: aux/workflow/l10n.sh. Now it has the base logic for running po4a, and can apply it to manpages. It is useful for updating translated files in other scenarios, such as catgets() message catalogs, markdown files, etc. After I used the venerable getopts to handle the command line arguments, and give aux/workflow/manpages.sh a saner interface. I disliked the fact that aux/workflow/manpages.sh still is being used for the "install" and "uninstall" targets. Before this file, the canonical workflow of "make && make install/uninstall" was 100% embedded within the Makefile itself. But now the Makefile calls to an external script for that. This isn't a real cost, other than how obvious the behaviour is for someone looking at the Makefile for the first time. I still chose to do it anyway, because there was already too many things in the Makefile itself, and it was getting worse with time. I made sure to never cross the line of relying on an external tool for the canonical "make && make install/uninstall", and even for "make check". Those all work without requiring any extra tool outside what POSIX defines, such as "sed", "awk", etc. Despite the cost of adding this detour from the liner Makefile flow, I found it to be worth it to call to the external script, as this script can now also be shared across projects, and the customized Makefile be made simpler. In other to remove the "-- $(do_subst)" horrendous hack, I chose to use an inference rule for ".in" files, and remove the "$(do_subst)" variable altogether. Now all the files that need to go through sed should end in ".in", and the Makefile will take care of producing it. The upside is that this model is much better integrater into make itself. Addresses #task-9ee2bbc8-295f-52b7-4104-483869bad017. --- .gitignore | 3 +- Makefile | 39 ++++--- aux/workflow/assert-changelog.sh | 3 +- aux/workflow/assert-readme.sh | 3 +- aux/workflow/l10n.sh | 44 ++++++++ aux/workflow/manpages.sh | 114 +++++++++++---------- doc/git-permalink.en.1 | 190 ---------------------------------- doc/git-permalink.en.1.in | 190 ++++++++++++++++++++++++++++++++++ doc/git-permalink.eo.1 | 206 ------------------------------------- doc/git-permalink.eo.1.in | 206 +++++++++++++++++++++++++++++++++++++ doc/git-permalink.fr.1 | 213 --------------------------------------- doc/git-permalink.fr.1.in | 213 +++++++++++++++++++++++++++++++++++++++ doc/git-permalink.pt.1 | 210 -------------------------------------- doc/git-permalink.pt.1.in | 210 ++++++++++++++++++++++++++++++++++++++ 14 files changed, 954 insertions(+), 890 deletions(-) create mode 100755 aux/workflow/l10n.sh delete mode 100644 doc/git-permalink.en.1 create mode 100644 doc/git-permalink.en.1.in delete mode 100644 doc/git-permalink.eo.1 create mode 100644 doc/git-permalink.eo.1.in delete mode 100644 doc/git-permalink.fr.1 create mode 100644 doc/git-permalink.fr.1.in delete mode 100644 doc/git-permalink.pt.1 create mode 100644 doc/git-permalink.pt.1.in diff --git a/.gitignore b/.gitignore index 4a61da9..b75107f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /public/ -/git-permalink +/src/git-permalink.sh /po/*.mo /po/*.po~ /tests/remotes/ /tests/prefix/ +/doc/*.1 diff --git a/Makefile b/Makefile index c485659..c98364b 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,23 @@ NAME = git-permalink MAILING_LIST = public-inbox TRANSLATIONS = pt fr eo -all: git-permalink +.SUFFIXES: +.SUFFIXES: .in -git-permalink: src/git-permalink.sh.in - $(do_subst) < $? > $@ - chmod +x $@ +.in: + sed -e 's/@VERSION@/$(VERSION)/g' -e 's/@DATE@/$(DATE)/g' < $< > $@ + +manpages.en.in = \ + doc/git-permalink.en.1.in \ + +manpages.in = $(manpages.en.in) \ + doc/git-permalink.pt.1.in \ + doc/git-permalink.fr.1.in \ + doc/git-permalink.eo.1.in + +manpages = $(manpages.in:.in=) + +all: src/git-permalink.sh $(manpages) check: all sh tests/cli-opts.sh @@ -23,28 +35,25 @@ dev-check: check sh aux/workflow/assert-todos.sh sh aux/workflow/assert-changelog.sh $(NAME) $(NAME) sh aux/workflow/assert-readme.sh $(NAME) $(MAILING_LIST) - sh aux/workflow/manpages.sh '$(TRANSLATIONS)' --update + sh aux/workflow/l10n.sh -l '$(TRANSLATIONS)' $(manpages.en.in) sh aux/workflow/assert-manpages.sh $(NAME) $(MAILING_LIST) -do_subst = sed \ - -e 's:[@]VERSION[@]:$(VERSION):g' \ - -e 's:[@]DATE[@]:$(DATE):g' - install: all mkdir -p $(DESTDIR)$(PREFIX)/bin - cp git-permalink $(DESTDIR)$(PREFIX)/bin/$(NAME) - sh aux/workflow/manpages.sh '$(TRANSLATIONS)' --install '$(DESTDIR)$(MANPREFIX)' -- $(do_subst) + cp src/git-permalink.sh $(DESTDIR)$(PREFIX)/bin/$(NAME) + chmod +x $(DESTDIR)$(PREFIX)/bin/$(NAME) + sh aux/workflow/manpages.sh -ip $(DESTDIR)$(PREFIX) $(manpages) uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/$(NAME) - sh aux/workflow/manpages.sh '$(TRANSLATIONS)' --uninstall '$(DESTDIR)$(MANPREFIX)' + sh aux/workflow/manpages.sh -up $(DESTDIR)$(PREFIX) $(manpages) clean: - rm -rf public/ git-permalink + rm -rf public/ src/git-permalink.sh $(manpages) dist: sh aux/workflow/dist.sh $(DATE) $(VERSION) $(NAME) $(NAME) $(MAILING_LIST) -public: README.md TODOs.md CHANGELOG.md +public: README.md TODOs.md CHANGELOG.md $(manpages) sh aux/workflow/public.sh $(NAME) $(NAME) $(MAILING_LIST) public - sh aux/workflow/manpages.sh '$(TRANSLATIONS)' --html '' -- $(do_subst) + sh aux/workflow/manpages.sh -Ho public $(manpages) diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh index 61cd916..e2cd926 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -33,8 +33,7 @@ for VVERSION in $(git tag); do done # "$@" represents a list of tags to be also included in the verification. -# shellcheck disable=2068 -for VVERSION in $@; do +for VVERSION in "$@"; do DATE="$(date '+%Y-%m-%d')" assert "$DATE" "$VVERSION" done diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index e256fcf..8fcf188 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -50,8 +50,7 @@ for VVERSION in $(git tag); do done # "$@" represents a list of tags to be also included in the verification. -# shellcheck disable=2068 -for VVERSION in $@; do +for VVERSION in "$@"; do if ! git tag | grep -qF "$VVERSION"; then DATE="$(date '+%Y-%m-%d')" add_release "$DATE" "$VVERSION" diff --git a/aux/workflow/l10n.sh b/aux/workflow/l10n.sh new file mode 100755 index 0000000..81a7d02 --- /dev/null +++ b/aux/workflow/l10n.sh @@ -0,0 +1,44 @@ +#!/bin/sh +set -eu + +LANGS= +while getopts 'l:' flag; do + case "$flag" in + l) + LANGS="$OPTARG" + ;; + *) + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) +if [ -z "$LANGS" ]; then + echo "Missing LANG" >&2 + exit 2 +fi + +for f in $(find $@ -not -name '*.en.*'); do + case "$f" in + *.en.[1-9].in) + manpage "$f" + ;; + *) + echo "Unsupported file format: $f" >&2 + exit 2 + ;; + esac +done + +manpage() { + from_f="$1" + for l in $LANGS; do + to_f="$(echo "$from_f" | sed "s/\.en\./.$l./")" + po4a-updatepo -f man -m "$from_f" -p "po/$l.po" + OUT="$(po4a-translate -f man -m "$from_f" -p "po/$l.po" -l "$to_f" -k 0 -v 2>&1)" + echo "$OUT" >&2 + if ! echo "$OUT" | grep -qF ' is 100% translated ('; then + printf '\n\tWARNING!\n Missing translations for %s\n\n' "$to_f" >&2 + fi + done +} diff --git a/aux/workflow/manpages.sh b/aux/workflow/manpages.sh index fd88d95..7332d8f 100755 --- a/aux/workflow/manpages.sh +++ b/aux/workflow/manpages.sh @@ -1,55 +1,67 @@ #!/bin/sh set -eu -LANGS="$1" -OP="$2" -PREFIX="${3:-}" +while getopts 'iuHo:p:' flag; do + case "$flag" in + i) + ACTION=install + ;; + u) + ACTION=uninstall + ;; + H) + ACTION=html + ;; + o) + OUTDIR="$OPTARG" + ;; + p) + MANPREFIX="$OPTARG" + ;; + *) + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) -if [ "$OP" = '--update' ]; then - for f in doc/*.en.[1-9]; do - for lang in $LANGS; do - to="$(echo "$f" | sed "s|\.en\.|.$lang.|")" - po4a-updatepo -f man -m "$f" -p "po/$lang.po" - printf 'Translating %s...\n' "$to" >&2 - OUT="$(po4a-translate -f man -m "$f" -p "po/$lang.po" -l "$to" -k 0 -v 2>&1)" - echo "$OUT" >&2 - if ! echo "$OUT" | grep -qF ' is 100% translated ('; then - printf "\n WARNING!\n Missing translations for %s\n\n" "$to" >&2 - fi - done - done -else - shift 4 ||: # remove up to '--' - for f in doc/*.en.[1-9]; do - n="${f##*.}" - fileto_name="$(basename "${f%.en.$n}").$n" - for lang in $LANGS en; do - filefrom_name="${f%.en.$n}.$lang.$n" - mandir_name="$PREFIX/$lang/man$n" - htmldir_name="public/$lang/" - case "$OP" in - --install) - mkdir -p "$mandir_name" - # shellcheck disable=2068 - $@ < "$filefrom_name" > "$mandir_name/$fileto_name" - mkdir -p "$PREFIX/man$n" - ln -fs "../en/man$n/$fileto_name" "$PREFIX/man$n/$fileto_name" - ;; - --uninstall) - rm -f \ - "$PREFIX/$lang/man$n/$fileto_name" \ - "$PREFIX/man$n/$fileto_name" - ;; - --html) - mkdir -p "$htmldir_name" - # shellcheck disable=2068 - $@ < "$filefrom_name" | pandoc -s -r man -w html > "public/$lang/$fileto_name.html" - ;; - *) - echo "Unsupported operation: $OP" - exit 2 - ;; - esac - done - done -fi +assert() { + if [ -z "$1" ]; then + echo "Missing $2 argument" >&2 + exit 2 + fi +} + +assert "${ACTION:-}" ACTION + +for f in "$@"; do + l="$(echo "$f" | awk -F. '{print $(NF-1)}')" + n="$(echo "$f" | awk -F. '{print $NF}')" + en="$(echo "$f" | sed "s/\.$l\./.en./")" + case "$ACTION" in + html) + assert "${OUTDIR:-}" OUTDIR + to_name="$(basename "${f%.$l.$n}.html")" + mkdir -p "$OUTDIR/$l" + pandoc -s -r man -w html --metadata "lang=$l" < "$f" > "$OUTDIR/$l/$to_name" + ;; + install) + assert "${MANPREFIX:-}" MANPREFIX + to_name="$(basename "${f%.$l.$n}.$n")" + mkdir -p "$MANPREFIX/$l/man$n" "$MANPREFIX/man$n" + cp "$f" "$MANPREFIX/$l/man$n/$to_name" + ln -fs "../en/man$n/$to_name" "$MANPREFIX/man$n/$to_name" + ;; + uninstall) + assert "${MANPREFIX:-}" MANPREFIX + to_name="$(basename "${f%.$l.$n}.$n")" + rm -f \ + "$MANPREFIX/$l/man$n/$to_name" \ + "$MANPREFIX/man$n/$to_name" + ;; + *) + echo "Bad ACTION: $ACTION" + exit 1 + ;; + esac +done diff --git a/doc/git-permalink.en.1 b/doc/git-permalink.en.1 deleted file mode 100644 index 63d8f0e..0000000 --- a/doc/git-permalink.en.1 +++ /dev/null @@ -1,190 +0,0 @@ -.TH GIT-PERMALINK 1 @DATE@ "git-permalink @VERSION@" "git-permalink user manual" - - -.SH NAME - -git-permalink - Git extension to generate web permalinks of files in a repository. - - -.SH SYNOPSIS - -\fBgit-permalink\fR [\fIOPTIONS\fR] \fIFILE\fR [\fILINENO\fR] - - -.SH DESCRIPTION - -\fBgit-permalink\fR will use Git itself to get a) the commit at \fIHEAD\fR and b) the \fIremote.origin.url\fR via \fBgit-config\fR(1), and optionally c) an URL template override. -It then uses those values to build a permalink URL, with the commit included on it to ensure it is \fIpermanent\fR, and optionally the line number of the selected file. - -\fBgit-permalink\fR then uses \fBxdg-open\fR(1) to open the URL. - -.SH OPTIONS - -.TP -\fB-p\fR -Only print the web URL link to STDOUT, don't try to open it with \fBxdg-open\fR(1) or do anything else. -By default this is turned off. - -.TP -\fB--help\fR, \fB-h\fR -Show show help text. - -.TP -\fB--version\fR, \fB-V\fR -Show version number. - - -.SH CONFIGURATION - -.SS SUPPORTED REMOTES - -The current supported remotes are: - -.RS -.IP \(bu -git.euandreh.xyz (where git-permalink itself is hosted =p) -.IP \(bu -sourcehut -.IP \(bu -git.kernel.org -.IP \(bu -savannah -.IP \(bu -notabug -.IP \(bu -codeberg -.IP \(bu -bitbucket -.IP \(bu -pagure -.IP \(bu -gitlab -.IP \(bu -github -.RE - -Patches to add support for more source code forges are welcome! - -See -.UR https://euandreh.xyz/git-permalink/TODOs.html#task-cebc5298-17ad-5c60-dfa5-a25b66433a3a -#task-cebc5298-17ad-5c60-dfa5-a25b66433a3a -.UE -for discussion and more information. - -.SS OVERRIDES - -If you want to configure the permalink URL template for a project with an unsupported origin you can do so via \fBgit-config\fR(1). - -There are two configuration options available: - -.TP -\fBgit-permalink.template-file-commit\fR -An URL template where the name of the \fIfile\fR comes first, and the \fIcommit\fR comes second. -cgit uses this style of URL, with something like in: - -.nf - https://git.euandreh.xyz/fallible/tree/%s?id=%s -.fi - -On this example, the name of the \fIfile\fR comes first and \fIcommit\fR comes at the very end after "id=". - -.TP -\fBgit-permalink.template-commit-file\fR -An URL template where the \fIcommit\fR comes first, and the name of the \fIfile\fR comes second. -sourcehut uses this style of URL, with something like: - -.nf - https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s -.fi - -On this example, the \fIcommit\fR comes first on the URL path, and the \fIfile\fR name comes at the end. - -.P -If none of those values are found by \fBgit-config\fR(1) and \fBgit-permalink\fR can't guess the URL, it exits with an error. - - -.SH EXAMPLES - -Open \fIsrc/fold.c\fR of a project with its origin pointing to \fIsourcehut\fR: - -.nf - $ git permalink src/fold.c 125 - Opening https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 -.fi - -Generate link for lines 59 through 94 of \fInongnu/packages/clojure.scm\fR on a project hosted on \fIgitlab\fR, but only print it \fIwithout\fR opening with \fBxdg-open\fR(1): - -.nf - $ git permalink -p nongnu/packages/clojure.scm 59-94 - https://gitlab.com/nonguix/nonguix/-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59-94 -.fi - -.P -Configure an URL override, and open the file \fIsrc/app_add.c\fR without selecting an specific line: - -.nf - $ git config git-permalink.template-file-commit 'https://git.alpinelinux.org/apk-tools/tree/%s?id=%s' - $ git permalink src/app_add.c - Opening https://git.alpinelinux.org/apk-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 -.fi - -.P -Open file called \fI--help\fR: - -.nf - $ git permalink -- --help - Opening https://git.euandreh.xyz/non-existent-repository/tree/--help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e -.fi - -.SH EXIT STATUS - -.TP -.B 0 -Successful execution. - -.TP -.B 1 -Unsupported remote. -See the supported list in SUPPORTED REMOTES, and how to add custom ones in OVERRIDES. - -.TP -.B 2 -Invalid arguments. - - -.SH SEE ALSO - -\fBgit-config\fR(1) -\fBxdg-open\fR(1) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[git\-permalink] BUG or TASK: -\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/git\-permalink/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/git\-permalink/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D -Comments and discussions -.UE . diff --git a/doc/git-permalink.en.1.in b/doc/git-permalink.en.1.in new file mode 100644 index 0000000..63d8f0e --- /dev/null +++ b/doc/git-permalink.en.1.in @@ -0,0 +1,190 @@ +.TH GIT-PERMALINK 1 @DATE@ "git-permalink @VERSION@" "git-permalink user manual" + + +.SH NAME + +git-permalink - Git extension to generate web permalinks of files in a repository. + + +.SH SYNOPSIS + +\fBgit-permalink\fR [\fIOPTIONS\fR] \fIFILE\fR [\fILINENO\fR] + + +.SH DESCRIPTION + +\fBgit-permalink\fR will use Git itself to get a) the commit at \fIHEAD\fR and b) the \fIremote.origin.url\fR via \fBgit-config\fR(1), and optionally c) an URL template override. +It then uses those values to build a permalink URL, with the commit included on it to ensure it is \fIpermanent\fR, and optionally the line number of the selected file. + +\fBgit-permalink\fR then uses \fBxdg-open\fR(1) to open the URL. + +.SH OPTIONS + +.TP +\fB-p\fR +Only print the web URL link to STDOUT, don't try to open it with \fBxdg-open\fR(1) or do anything else. +By default this is turned off. + +.TP +\fB--help\fR, \fB-h\fR +Show show help text. + +.TP +\fB--version\fR, \fB-V\fR +Show version number. + + +.SH CONFIGURATION + +.SS SUPPORTED REMOTES + +The current supported remotes are: + +.RS +.IP \(bu +git.euandreh.xyz (where git-permalink itself is hosted =p) +.IP \(bu +sourcehut +.IP \(bu +git.kernel.org +.IP \(bu +savannah +.IP \(bu +notabug +.IP \(bu +codeberg +.IP \(bu +bitbucket +.IP \(bu +pagure +.IP \(bu +gitlab +.IP \(bu +github +.RE + +Patches to add support for more source code forges are welcome! + +See +.UR https://euandreh.xyz/git-permalink/TODOs.html#task-cebc5298-17ad-5c60-dfa5-a25b66433a3a +#task-cebc5298-17ad-5c60-dfa5-a25b66433a3a +.UE +for discussion and more information. + +.SS OVERRIDES + +If you want to configure the permalink URL template for a project with an unsupported origin you can do so via \fBgit-config\fR(1). + +There are two configuration options available: + +.TP +\fBgit-permalink.template-file-commit\fR +An URL template where the name of the \fIfile\fR comes first, and the \fIcommit\fR comes second. +cgit uses this style of URL, with something like in: + +.nf + https://git.euandreh.xyz/fallible/tree/%s?id=%s +.fi + +On this example, the name of the \fIfile\fR comes first and \fIcommit\fR comes at the very end after "id=". + +.TP +\fBgit-permalink.template-commit-file\fR +An URL template where the \fIcommit\fR comes first, and the name of the \fIfile\fR comes second. +sourcehut uses this style of URL, with something like: + +.nf + https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s +.fi + +On this example, the \fIcommit\fR comes first on the URL path, and the \fIfile\fR name comes at the end. + +.P +If none of those values are found by \fBgit-config\fR(1) and \fBgit-permalink\fR can't guess the URL, it exits with an error. + + +.SH EXAMPLES + +Open \fIsrc/fold.c\fR of a project with its origin pointing to \fIsourcehut\fR: + +.nf + $ git permalink src/fold.c 125 + Opening https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 +.fi + +Generate link for lines 59 through 94 of \fInongnu/packages/clojure.scm\fR on a project hosted on \fIgitlab\fR, but only print it \fIwithout\fR opening with \fBxdg-open\fR(1): + +.nf + $ git permalink -p nongnu/packages/clojure.scm 59-94 + https://gitlab.com/nonguix/nonguix/-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59-94 +.fi + +.P +Configure an URL override, and open the file \fIsrc/app_add.c\fR without selecting an specific line: + +.nf + $ git config git-permalink.template-file-commit 'https://git.alpinelinux.org/apk-tools/tree/%s?id=%s' + $ git permalink src/app_add.c + Opening https://git.alpinelinux.org/apk-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 +.fi + +.P +Open file called \fI--help\fR: + +.nf + $ git permalink -- --help + Opening https://git.euandreh.xyz/non-existent-repository/tree/--help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e +.fi + +.SH EXIT STATUS + +.TP +.B 0 +Successful execution. + +.TP +.B 1 +Unsupported remote. +See the supported list in SUPPORTED REMOTES, and how to add custom ones in OVERRIDES. + +.TP +.B 2 +Invalid arguments. + + +.SH SEE ALSO + +\fBgit-config\fR(1) +\fBxdg-open\fR(1) + + +.SH AUTHORS + +.MT eu@euandre.org +EuAndreh +.ME +and contributors. + + +.SH BUGS + +.IP \(bu +Report bugs to the +.MT ~euandreh/public\-inbox@lists.sr.ht +mailing list +.ME . +Use the subject "\f(CR[git\-permalink] BUG or TASK: +\fR". +.IP \(bu +Browse bugs +.UR https://euandreh.xyz/git\-permalink/TODOs.html +online +.UE . +.IP \(bu +.UR https://euandreh.xyz/git\-permalink/ +Homepage +.UE . +.IP \(bu +.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D +Comments and discussions +.UE . diff --git a/doc/git-permalink.eo.1 b/doc/git-permalink.eo.1 deleted file mode 100644 index 0d799c0..0000000 --- a/doc/git-permalink.eo.1 +++ /dev/null @@ -1,206 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH GIT\-PERMALINK 1 @DATE@ "git\-permalink @VERSION@" "git\-permalink uzmanlibro" - - -.SH NOMO - -git\-permalink \- Git\-etendo por generi interretajn konstantajn ligojn -(permalink) de dosieroj en deponejo. - - -.SH RESUMO - -\fBgit\-permalink\fP [\fIEBLOJ\fP] \fIDOSIERO\fP [\fILINIONO\fP] - - -.SH PRISKRIBO - -\fBgit\-permalink\fP uzas Git por akiri a) la commit ĉe \fIHEAD\fP kaj b) la -\fIremote.origin.url\fP per \fBgit\-config\fP(1), kaj laŭvole c) URL ŝablono. Ĝi -tiam uzas tiujn por krei \fIkonstantan\fP URL ligon (permalink), kun la commit -ene por certigi ke ĝi estas konstantan, kaj laŭvole la linia numero -elektita. - -\fBgit\-permalink\fP tiam uzas \fBxdg\-open\fP(1) por malfermi la URL. - -.SH EBLOJ - -.TP -\fB\-p\fP -Nur presas la ligon per norma eligo (STDOUT), ne provas malfermi ĝin kun -\fBxdg\-open\fP(1) aŭ fari ion alian. Defaŭlte ĉi tio estas malŝaltita. - -.TP -\fB\-\-help\fP, \fB\-h\fP -Montras helpmesaĝon. - -.TP -\fB\-\-version\fP, \fB\-V\fP -Montras versian numeron. - - -.SH AGORDO - -.SS "SUBTENITAJ REMOTOJ" - -La nunaj subtenitaj remotoj estas: - -.RS -.IP \(bu -git.euandreh.xyz (kie git\-permalink estas gastiga =p) -.IP \(bu -sourcehut -.IP \(bu -git.kernel.org -.IP \(bu -savannah -.IP \(bu -notabug -.IP \(bu -codeberg -.IP \(bu -bitbucket -.IP \(bu -pagure -.IP \(bu -gitlab -.IP \(bu -github -.RE - -Ŝanĝoj por subteni pli da fontkodaj forĝejoj estas bonvenaj! - -Foliumu -.UR https://euandreh.xyz/git\-permalink/TODOs.html#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a -#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a -.UE -por diskuto kaj pli da -informoj. - -.SS SUPERREGOJ - -Se vi volas agordi la URL ŝablonon por projekto kun nesubtenita remoton, vi -povas uzi \fBgit\-config\fP(1). - -Estas du agordaj elektoj disponeblaj: - -.TP -\fBgit\-permalink.template\-file\-commit\fP -URL ŝablono, kie la nomo de la \fIdosiero\fP estas unue, kaj la \fIcommit\fP estas -due. cgit uzas ĉi tiun specon de URL, kiel en: - -.nf - https://git.euandreh.xyz/fallible/tree/%s?id=%s -.fi - -Laŭ ĉi tiu ekzemplo, la nomo de la \fIdosiero\fP estas unue kaj la \fIcommit\fP -estas fine post "id=". - -.TP -\fBgit\-permalink.template\-commit\-file\fP -URL ŝablono, kie la \fIcommit\fP estas unue, kaj la nomo de la \fIdosiero\fP estas -due. sourcehut uzas ĉi tiun specon de URL, kiel en: - -.nf - https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s -.fi - -Laŭ ĉi tiu ekzemplo, la \fIcommit\fP estas unue en la URL, kaj la nome de la -\fIdosiero\fP estas poste. - -.P -Se neniu el tiuj estas estas trovita por \fBgit\-config\fP(1) aŭ -\fBgit\-permalink\fP ne povas diveni la URL, ĝi eliras erare. - - -.SH EKZEMPLOJ - -Malfermas \fIsrc/fold.c\fP de projekto kiu origino direktiĝas al \fIsourcehut\fP: - -.nf - $ git permalink src/fold.c 125 - Malfermado de https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 -.fi - -Kreas ligon por linioj 59 ĝis 94 de \fInongnu/packages/clojure.scm\fP en -projekto gastigita ĉe \fIgitlab\fP, sed nur presu ĝin \fIsen\fP malfermi kun -\fBxdg\-open\fP(1): - -.nf - $ git permalink \-p nongnu/packages/clojure.scm 59\-94 - https://gitlab.com/nonguix/nonguix/\-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59\-94 -.fi - -.P -Agordas URL superrego, kaj malfermas la dosieron \fIsrc/app_add.c\fP sen elekti -specifan linion: - -.nf - $ git config git\-permalink.template\-file\-commit 'https://git.alpinelinux.org/apk\-tools/tree/%s?id=%s' - $ git permalink src/app_add.c - Malfermado de https://git.alpinelinux.org/apk\-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 -.fi - -.P -Malfermas \fI\-\-help\fP: - -.nf - $ git permalink \-\- \-\-help - Malfermado de https://git.euandreh.xyz/non\-existent\-repository/tree/\-\-help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e -.fi - -.SH ELIRKODOJ - -.TP -\fB0\fP -Bona ekzekuto. - -.TP -\fB1\fP -Nesubtenita remoto. Vidu la subtenitoj en SUBTENITAJ REMOTOJ, kaŭ kiel -aldoni ion en SUPERREGOJ. - -.TP -\fB2\fP -Malvalidaj argumentoj. - - -.SH "VIDU ANKAŬ" - -\fBgit\-config\fP(1) \fBxdg\-open\fP(1) - - -.SH AŬTOROJ - -.MT eu@euandre.org -EuAndreh -.ME -kaj la kontribuuloj. - - -.SH MISFUNKCIOJ - -.IP \(bu -Raportu misfunkcioj al la -.MT ~euandreh/public\-inbox@lists.sr.ht -dissendolisto -.ME . -Uzu la subjekton "\f(CR[git\-permalink] BUG aŭ TASK: -\fR". -.IP \(bu -Foliumu misfunkcioj -.UR https://euandreh.xyz/git\-permalink/TODOs.html -rete -.UE . -.IP \(bu -.UR https://euandreh.xyz/git\-permalink/ -Ĉefpaĝo -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D -Komentoj kaj diskutoj -.UE . diff --git a/doc/git-permalink.eo.1.in b/doc/git-permalink.eo.1.in new file mode 100644 index 0000000..0d799c0 --- /dev/null +++ b/doc/git-permalink.eo.1.in @@ -0,0 +1,206 @@ +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GIT\-PERMALINK 1 @DATE@ "git\-permalink @VERSION@" "git\-permalink uzmanlibro" + + +.SH NOMO + +git\-permalink \- Git\-etendo por generi interretajn konstantajn ligojn +(permalink) de dosieroj en deponejo. + + +.SH RESUMO + +\fBgit\-permalink\fP [\fIEBLOJ\fP] \fIDOSIERO\fP [\fILINIONO\fP] + + +.SH PRISKRIBO + +\fBgit\-permalink\fP uzas Git por akiri a) la commit ĉe \fIHEAD\fP kaj b) la +\fIremote.origin.url\fP per \fBgit\-config\fP(1), kaj laŭvole c) URL ŝablono. Ĝi +tiam uzas tiujn por krei \fIkonstantan\fP URL ligon (permalink), kun la commit +ene por certigi ke ĝi estas konstantan, kaj laŭvole la linia numero +elektita. + +\fBgit\-permalink\fP tiam uzas \fBxdg\-open\fP(1) por malfermi la URL. + +.SH EBLOJ + +.TP +\fB\-p\fP +Nur presas la ligon per norma eligo (STDOUT), ne provas malfermi ĝin kun +\fBxdg\-open\fP(1) aŭ fari ion alian. Defaŭlte ĉi tio estas malŝaltita. + +.TP +\fB\-\-help\fP, \fB\-h\fP +Montras helpmesaĝon. + +.TP +\fB\-\-version\fP, \fB\-V\fP +Montras versian numeron. + + +.SH AGORDO + +.SS "SUBTENITAJ REMOTOJ" + +La nunaj subtenitaj remotoj estas: + +.RS +.IP \(bu +git.euandreh.xyz (kie git\-permalink estas gastiga =p) +.IP \(bu +sourcehut +.IP \(bu +git.kernel.org +.IP \(bu +savannah +.IP \(bu +notabug +.IP \(bu +codeberg +.IP \(bu +bitbucket +.IP \(bu +pagure +.IP \(bu +gitlab +.IP \(bu +github +.RE + +Ŝanĝoj por subteni pli da fontkodaj forĝejoj estas bonvenaj! + +Foliumu +.UR https://euandreh.xyz/git\-permalink/TODOs.html#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a +#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a +.UE +por diskuto kaj pli da +informoj. + +.SS SUPERREGOJ + +Se vi volas agordi la URL ŝablonon por projekto kun nesubtenita remoton, vi +povas uzi \fBgit\-config\fP(1). + +Estas du agordaj elektoj disponeblaj: + +.TP +\fBgit\-permalink.template\-file\-commit\fP +URL ŝablono, kie la nomo de la \fIdosiero\fP estas unue, kaj la \fIcommit\fP estas +due. cgit uzas ĉi tiun specon de URL, kiel en: + +.nf + https://git.euandreh.xyz/fallible/tree/%s?id=%s +.fi + +Laŭ ĉi tiu ekzemplo, la nomo de la \fIdosiero\fP estas unue kaj la \fIcommit\fP +estas fine post "id=". + +.TP +\fBgit\-permalink.template\-commit\-file\fP +URL ŝablono, kie la \fIcommit\fP estas unue, kaj la nomo de la \fIdosiero\fP estas +due. sourcehut uzas ĉi tiun specon de URL, kiel en: + +.nf + https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s +.fi + +Laŭ ĉi tiu ekzemplo, la \fIcommit\fP estas unue en la URL, kaj la nome de la +\fIdosiero\fP estas poste. + +.P +Se neniu el tiuj estas estas trovita por \fBgit\-config\fP(1) aŭ +\fBgit\-permalink\fP ne povas diveni la URL, ĝi eliras erare. + + +.SH EKZEMPLOJ + +Malfermas \fIsrc/fold.c\fP de projekto kiu origino direktiĝas al \fIsourcehut\fP: + +.nf + $ git permalink src/fold.c 125 + Malfermado de https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 +.fi + +Kreas ligon por linioj 59 ĝis 94 de \fInongnu/packages/clojure.scm\fP en +projekto gastigita ĉe \fIgitlab\fP, sed nur presu ĝin \fIsen\fP malfermi kun +\fBxdg\-open\fP(1): + +.nf + $ git permalink \-p nongnu/packages/clojure.scm 59\-94 + https://gitlab.com/nonguix/nonguix/\-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59\-94 +.fi + +.P +Agordas URL superrego, kaj malfermas la dosieron \fIsrc/app_add.c\fP sen elekti +specifan linion: + +.nf + $ git config git\-permalink.template\-file\-commit 'https://git.alpinelinux.org/apk\-tools/tree/%s?id=%s' + $ git permalink src/app_add.c + Malfermado de https://git.alpinelinux.org/apk\-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 +.fi + +.P +Malfermas \fI\-\-help\fP: + +.nf + $ git permalink \-\- \-\-help + Malfermado de https://git.euandreh.xyz/non\-existent\-repository/tree/\-\-help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e +.fi + +.SH ELIRKODOJ + +.TP +\fB0\fP +Bona ekzekuto. + +.TP +\fB1\fP +Nesubtenita remoto. Vidu la subtenitoj en SUBTENITAJ REMOTOJ, kaŭ kiel +aldoni ion en SUPERREGOJ. + +.TP +\fB2\fP +Malvalidaj argumentoj. + + +.SH "VIDU ANKAŬ" + +\fBgit\-config\fP(1) \fBxdg\-open\fP(1) + + +.SH AŬTOROJ + +.MT eu@euandre.org +EuAndreh +.ME +kaj la kontribuuloj. + + +.SH MISFUNKCIOJ + +.IP \(bu +Raportu misfunkcioj al la +.MT ~euandreh/public\-inbox@lists.sr.ht +dissendolisto +.ME . +Uzu la subjekton "\f(CR[git\-permalink] BUG aŭ TASK: +\fR". +.IP \(bu +Foliumu misfunkcioj +.UR https://euandreh.xyz/git\-permalink/TODOs.html +rete +.UE . +.IP \(bu +.UR https://euandreh.xyz/git\-permalink/ +Ĉefpaĝo +.UE . +.IP \(bu +.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D +Komentoj kaj diskutoj +.UE . diff --git a/doc/git-permalink.fr.1 b/doc/git-permalink.fr.1 deleted file mode 100644 index 3dcc01a..0000000 --- a/doc/git-permalink.fr.1 +++ /dev/null @@ -1,213 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH GIT\-PERMALINK 1 @DATE@ "git\-permalink @VERSION@" "manual d'utilisateur de git\-permalink" - - -.SH NOM - -git\-permalink \- extension Git pour génerér liens web permanent (permalink) -de fichiers dans un dépôt. - - -.SH SYNOPSIS - -\fBgit\-permalink\fP [\fIOPTIONS\fP] \fIFICHIER\fP [\fILINENO\fP] - - -.SH DESCRIPTION - -\fBgit\-permalink\fP utilise Git pour prendre a) le commit au \fIHEAD\fP et b) le -\fIremote.origin.url\fP avec \fBgit\-config\fP(1), et se possible c) un modèle de -substituition d'URL. Il utilise ces valeurs pour construire un URL -\fIpermanent\fP, avec le commit inclus pour garantir la unicitè, e -optionalement le numeró de la ligne choisi. - -\fBgit\-permalink\fP après utilise \fBxdg\-open\fP(1) pour ouvrir l'URL. - -.SH OPTIONS - -.TP -\fB\-p\fP -Seulement imprimez le lien d'URL web dans la sortie standard (STDOUT), -n'essayez pas de l'ouvrir avec \fBxdg\-open\fP(1) ou faire quelques choses avec -lui. Par défaut cela est désactivé. - -.TP -\fB\-\-help\fP, \fB\-h\fP -Affiche message d'aide. - -.TP -\fB\-\-version\fP, \fB\-V\fP -Imprime le numeró de version. - - -.SH CONFIGURATION - -.SS "RÉFÉRENCES DISTANTES PRISES EN CHARGE" - -La liste de références distantes prises en charge est: - -.RS -.IP \(bu -git.euandreh.xyz (où git\-permalink est hébergé =p) -.IP \(bu -sourcehut -.IP \(bu -git.kernel.org -.IP \(bu -savannah -.IP \(bu -notabug -.IP \(bu -codeberg -.IP \(bu -bitbucket -.IP \(bu -pagure -.IP \(bu -gitlab -.IP \(bu -github -.RE - -Les changements pour ajouter plus de sites d'hébergement de code sont les -bienvenus! - -Regarde -.UR https://euandreh.xyz/git\-permalink/TODOs.html#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a -#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a -.UE -pour les discussions et -plus d'information. - -.SS MODÈLES - -Si vous souhaitez configurer le modèle de substitution d'URL pour un projet -que a un références distantes que n'est pas prises en charge, vous utilize -\fBgit\-config\fP(1). - -Il y a deux options de configuration disponible: - -.TP -\fBgit\-permalink.template\-file\-commit\fP -Un modèle de substitution d'URL où le nom du \fIfichier\fP est avant, et le -\fIcommit\fP est après. cgit utilise cette type d'URL, comme dans: - -.nf - https://git.euandreh.xyz/fallible/tree/%s?id=%s -.fi - -Dans cet example, le nom du \fIfichier\fP est avant et le \fIcommit\fP est à la -fin, après le "id=". - -.TP -\fBgit\-permalink.template\-commit\-file\fP -Un modèle de substitution d'URL où le \fIcommit\fP est avant, et le nom du -\fIfichier\fP est après. sourcehut utilise cette type d'URL, comme dans: - -.nf - https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s -.fi - -Dans cet example, le \fIcommit\fP est avant dans le chemin de l'URL, et le -\fIfichier\fP est après. - -.P -Si aucune options n'est pas trouvé par \fBgit\-config\fP(1) et \fBgit\-permalink\fP -ne peut pas deviner l'URL, cela se termine par une erreur. - - -.SH EXAMPLES - -Ouvrez \fIsrc/fold.c\fP d'un projet qui a de référence distante pointée a -\fIsourcehut\fP: - -.nf - $ git permalink src/fold.c 125 - Ouverture de https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 -.fi - -Géneréz un lien des lignes 59 à 94 de \fInongnu/packages/clojure.scm\fP dans un -projet hébergér sur \fIgitlab\fP, mais seulement imprimez le lien \fIsans\fP -l'ouvrir avec \fBxdg\-open\fP(1): - -.nf - $ git permalink \-p nongnu/packages/clojure.scm 59\-94 - https://gitlab.com/nonguix/nonguix/\-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59\-94 -.fi - -.P -Configurez un modèle de substitution d'URL, et ouvrir le fichier -\fIsrc/app_add.c\fP sans choisir un numeró de ligne: - -.nf - $ git config git\-permalink.template\-file\-commit 'https://git.alpinelinux.org/apk\-tools/tree/%s?id=%s' - $ git permalink src/app_add.c - Ouverture de https://git.alpinelinux.org/apk\-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 -.fi - -.P -Ouvrez \fI\-\-help\fP: - -.nf - $ git permalink \-\- \-\-help - Ouverture de https://git.euandreh.xyz/non\-existent\-repository/tree/\-\-help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e -.fi - -.SH "CODES DE SORTIE" - -.TP -\fB0\fP -Exécution réussie. - -.TP -\fB1\fP -Références distante non prise en charge. Voir la liste de références prises -en charge dans RÉFÉRENCES DISTANTES PRISE EN CHARGE, et comme ajouter un à -partir d'un modèles dans MODÈLES. - -.TP -\fB2\fP -Arguments invalides. - - -.SH "VOIR AUSSI" - -\fBgit\-config\fP(1) \fBxdg\-open\fP(1) - - -.SH AUTEURS - -.MT eu@euandre.org -EuAndreh -.ME -et les contributeurs. - - -.SH BUGS - -.IP \(bu -Soumettre un bogue dans la -.MT ~euandreh/public\-inbox@lists.sr.ht -liste -de diffusion -.ME . -Utilise le sujèt "\f(CR[git\-permalink] BUG ou TASK: -\fR". -.IP \(bu -Parcourir les bogues -.UR https://euandreh.xyz/git\-permalink/TODOs.html -en -ligne -.UE . -.IP \(bu -.UR https://euandreh.xyz/git\-permalink/ -Page d'accueil -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D -Commentaires et discussions -.UE . diff --git a/doc/git-permalink.fr.1.in b/doc/git-permalink.fr.1.in new file mode 100644 index 0000000..3dcc01a --- /dev/null +++ b/doc/git-permalink.fr.1.in @@ -0,0 +1,213 @@ +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GIT\-PERMALINK 1 @DATE@ "git\-permalink @VERSION@" "manual d'utilisateur de git\-permalink" + + +.SH NOM + +git\-permalink \- extension Git pour génerér liens web permanent (permalink) +de fichiers dans un dépôt. + + +.SH SYNOPSIS + +\fBgit\-permalink\fP [\fIOPTIONS\fP] \fIFICHIER\fP [\fILINENO\fP] + + +.SH DESCRIPTION + +\fBgit\-permalink\fP utilise Git pour prendre a) le commit au \fIHEAD\fP et b) le +\fIremote.origin.url\fP avec \fBgit\-config\fP(1), et se possible c) un modèle de +substituition d'URL. Il utilise ces valeurs pour construire un URL +\fIpermanent\fP, avec le commit inclus pour garantir la unicitè, e +optionalement le numeró de la ligne choisi. + +\fBgit\-permalink\fP après utilise \fBxdg\-open\fP(1) pour ouvrir l'URL. + +.SH OPTIONS + +.TP +\fB\-p\fP +Seulement imprimez le lien d'URL web dans la sortie standard (STDOUT), +n'essayez pas de l'ouvrir avec \fBxdg\-open\fP(1) ou faire quelques choses avec +lui. Par défaut cela est désactivé. + +.TP +\fB\-\-help\fP, \fB\-h\fP +Affiche message d'aide. + +.TP +\fB\-\-version\fP, \fB\-V\fP +Imprime le numeró de version. + + +.SH CONFIGURATION + +.SS "RÉFÉRENCES DISTANTES PRISES EN CHARGE" + +La liste de références distantes prises en charge est: + +.RS +.IP \(bu +git.euandreh.xyz (où git\-permalink est hébergé =p) +.IP \(bu +sourcehut +.IP \(bu +git.kernel.org +.IP \(bu +savannah +.IP \(bu +notabug +.IP \(bu +codeberg +.IP \(bu +bitbucket +.IP \(bu +pagure +.IP \(bu +gitlab +.IP \(bu +github +.RE + +Les changements pour ajouter plus de sites d'hébergement de code sont les +bienvenus! + +Regarde +.UR https://euandreh.xyz/git\-permalink/TODOs.html#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a +#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a +.UE +pour les discussions et +plus d'information. + +.SS MODÈLES + +Si vous souhaitez configurer le modèle de substitution d'URL pour un projet +que a un références distantes que n'est pas prises en charge, vous utilize +\fBgit\-config\fP(1). + +Il y a deux options de configuration disponible: + +.TP +\fBgit\-permalink.template\-file\-commit\fP +Un modèle de substitution d'URL où le nom du \fIfichier\fP est avant, et le +\fIcommit\fP est après. cgit utilise cette type d'URL, comme dans: + +.nf + https://git.euandreh.xyz/fallible/tree/%s?id=%s +.fi + +Dans cet example, le nom du \fIfichier\fP est avant et le \fIcommit\fP est à la +fin, après le "id=". + +.TP +\fBgit\-permalink.template\-commit\-file\fP +Un modèle de substitution d'URL où le \fIcommit\fP est avant, et le nom du +\fIfichier\fP est après. sourcehut utilise cette type d'URL, comme dans: + +.nf + https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s +.fi + +Dans cet example, le \fIcommit\fP est avant dans le chemin de l'URL, et le +\fIfichier\fP est après. + +.P +Si aucune options n'est pas trouvé par \fBgit\-config\fP(1) et \fBgit\-permalink\fP +ne peut pas deviner l'URL, cela se termine par une erreur. + + +.SH EXAMPLES + +Ouvrez \fIsrc/fold.c\fP d'un projet qui a de référence distante pointée a +\fIsourcehut\fP: + +.nf + $ git permalink src/fold.c 125 + Ouverture de https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 +.fi + +Géneréz un lien des lignes 59 à 94 de \fInongnu/packages/clojure.scm\fP dans un +projet hébergér sur \fIgitlab\fP, mais seulement imprimez le lien \fIsans\fP +l'ouvrir avec \fBxdg\-open\fP(1): + +.nf + $ git permalink \-p nongnu/packages/clojure.scm 59\-94 + https://gitlab.com/nonguix/nonguix/\-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59\-94 +.fi + +.P +Configurez un modèle de substitution d'URL, et ouvrir le fichier +\fIsrc/app_add.c\fP sans choisir un numeró de ligne: + +.nf + $ git config git\-permalink.template\-file\-commit 'https://git.alpinelinux.org/apk\-tools/tree/%s?id=%s' + $ git permalink src/app_add.c + Ouverture de https://git.alpinelinux.org/apk\-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 +.fi + +.P +Ouvrez \fI\-\-help\fP: + +.nf + $ git permalink \-\- \-\-help + Ouverture de https://git.euandreh.xyz/non\-existent\-repository/tree/\-\-help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e +.fi + +.SH "CODES DE SORTIE" + +.TP +\fB0\fP +Exécution réussie. + +.TP +\fB1\fP +Références distante non prise en charge. Voir la liste de références prises +en charge dans RÉFÉRENCES DISTANTES PRISE EN CHARGE, et comme ajouter un à +partir d'un modèles dans MODÈLES. + +.TP +\fB2\fP +Arguments invalides. + + +.SH "VOIR AUSSI" + +\fBgit\-config\fP(1) \fBxdg\-open\fP(1) + + +.SH AUTEURS + +.MT eu@euandre.org +EuAndreh +.ME +et les contributeurs. + + +.SH BUGS + +.IP \(bu +Soumettre un bogue dans la +.MT ~euandreh/public\-inbox@lists.sr.ht +liste +de diffusion +.ME . +Utilise le sujèt "\f(CR[git\-permalink] BUG ou TASK: +\fR". +.IP \(bu +Parcourir les bogues +.UR https://euandreh.xyz/git\-permalink/TODOs.html +en +ligne +.UE . +.IP \(bu +.UR https://euandreh.xyz/git\-permalink/ +Page d'accueil +.UE . +.IP \(bu +.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D +Commentaires et discussions +.UE . diff --git a/doc/git-permalink.pt.1 b/doc/git-permalink.pt.1 deleted file mode 100644 index 5b8ae4a..0000000 --- a/doc/git-permalink.pt.1 +++ /dev/null @@ -1,210 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH GIT\-PERMALINK 1 @DATE@ "git\-permalink @VERSION@" "manual do usuário do git\-permalink" - - -.SH NOME - -git\-permalink \- extensão Git para gerar links web permanentes (permalink) de -arquivos de um repositório. - - -.SH SINOPSE - -\fBgit\-permalink\fP [\fIOPÇÕES\fP] \fIARQUIVO\fP [\fINOLINHA\fP] - - -.SH DESCRIÇÃO - -\fBgit\-permalink\fP usa o próprio Git para pegar a) o commit do \fIHEAD\fP e b) o -\fIremote.origin.url\fP usando \fBgit\-config\fP(1), e opcionalmente c) um modelo -de substituição de URL. Então ele usa esses valores para construir o link -para uma URL \fIpermanente\fP (permalink), com o commit incluso para garantir -sua unicidade, e opcionalmente o número da linha selecionada. - -\fBgit\-permalink\fP depois usa o \fBxdg\-open\fP(1) para abrir a URL. - -.SH OPÇÕES - -.TP -\fB\-p\fP -Somento imprime o link da URL web na saída padrão (STDOUT), não tenta -abrí\-lo com \fBxdg\-open\fP(1) ou fazer qualquer coisa com ele. Por padrão isso -está desligado. - -.TP -\fB\-\-help\fP, \fB\-h\fP -Mostra mensagem de ajuda. - -.TP -\fB\-\-version\fP, \fB\-V\fP -Imprime o número da versão. - - -.SH CONFIGURAÇÃO - -.SS "ORIGENS REMOTAS COM SUPORTE" - -A lista atual de origens remotas com suporte é: - -.RS -.IP \(bu -git.euandreh.xyz (onde o próprio git\-permalink está hospedado =p) -.IP \(bu -sourcehut -.IP \(bu -git.kernel.org -.IP \(bu -savannah -.IP \(bu -notabug -.IP \(bu -codeberg -.IP \(bu -bitbucket -.IP \(bu -pagure -.IP \(bu -gitlab -.IP \(bu -github -.RE - -Mudanças para adição de mais sites de hospedagem de código são bem\-vindas! - -Veja -.UR https://euandreh.xyz/git\-permalink/TODOs.html#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a -#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a -.UE -para discussão e mais -informações. - -.SS MODELOS - -Se você quiser configurar o modelo de substituição de URL de um projeto que -não tem suporte a um tipo de origem remota você pode fazê\-lo com -\fBgit\-config\fP(1). - -Há dois tipos de opções de configuração disponíveis: - -.TP -\fBgit\-permalink.template\-file\-commit\fP -Um modelo de substituição de URL em que o nome do \fIarquivo\fP vem primeiro, e -o \fIcommit\fP vem depois. cgit usa esse tipo de URL, como em: - -.nf - https://git.euandreh.xyz/fallible/tree/%s?id=%s -.fi - -Nesse exemplo, o nome do \fIarquivo\fP vem primeiro e o \fIcommit\fP vem só no -final, depois do "id=". - -.TP -\fBgit\-permalink.template\-commit\-file\fP -Um modelo de substituição de URL em que o \fIcommit\fP vem primeiro, e o nome -do \fIarquivo\fP vem depois. sourcehut usa esse tipo de URL, como em: - -.nf - https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s -.fi - -Nesse exemplo, o \fIcommit\fP aparece primeiro no caminho da URL, e o nome do -\fIarquivo\fP vem depois. - -.P -Se nenhuma das duas opções for encontrada pelo \fBgit\-config\fP(1) e o -\fBgit\-permalink\fP não consegue adivinhar a URL, ele termina com um erro. - - -.SH EXEMPLOS - -Abre o arquivo \fIsrc/fold.c\fP de um projeto com a origem apontada para o -\fIsourcehut\fP: - -.nf - $ git permalink src/fold.c 125 - Abrindo https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 -.fi - -Gera um link das linhas 59 a 94 do arquivo \fInongnu/packages/clojure.scm\fP em -um projeto hospedado no \fIgitlab\fP, mas somente o imprimie \fIsem\fP abrí\-lo com -\fBxdg\-open\fP(1): - -.nf - $ git permalink \-p nongnu/packages/clojure.scm 59\-94 - https://gitlab.com/nonguix/nonguix/\-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59\-94 -.fi - -.P -Configura um modelo de URL, e abre o arquivo \fIsrc/app_add.c\fP sem selecionar -uma linha específica: - -.nf - $ git config git\-permalink.template\-file\-commit 'https://git.alpinelinux.org/apk\-tools/tree/%s?id=%s' - $ git permalink src/app_add.c - Abrindo https://git.alpinelinux.org/apk\-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 -.fi - -.P -Abre o arquivo \fI\-\-help\fP: - -.nf - $ git permalink \-\- \-\-help - Abrindo https://git.euandreh.xyz/non\-existent\-repository/tree/\-\-help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e -.fi - -.SH "CÓDIGO DE SAÍDA" - -.TP -\fB0\fP -Execução bem\-sucedida. - -.TP -\fB1\fP -Sem suporte à origem remota. Veja a lista de quais tem suporte em ORIGENS -REMOTAS COM SUPORTE, e como adicionar origens customizadas a parteir de um -model em MODELOS. - -.TP -\fB2\fP -Argumentos inválidos. - - -.SH "VEJA TAMBÉM" - -\fBgit\-config\fP(1) \fBxdg\-open\fP(1) - - -.SH AUTORES - -.MT eu@euandre.org -EuAndreh -.ME -e colaboradores. - - -.SH BUGS - -.IP \(bu -Relate bugs na -.MT ~euandreh/public\-inbox@lists.sr.ht -lista de discussão -.ME . -Use o assunto "\f(CR[git\-permalink] BUG ou TASK: -\fR". -.IP \(bu -Veja os bugs -.UR https://euandreh.xyz/git\-permalink/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/git\-permalink/ -Página inicial -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D -Comentários e discussões -.UE . diff --git a/doc/git-permalink.pt.1.in b/doc/git-permalink.pt.1.in new file mode 100644 index 0000000..5b8ae4a --- /dev/null +++ b/doc/git-permalink.pt.1.in @@ -0,0 +1,210 @@ +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH GIT\-PERMALINK 1 @DATE@ "git\-permalink @VERSION@" "manual do usuário do git\-permalink" + + +.SH NOME + +git\-permalink \- extensão Git para gerar links web permanentes (permalink) de +arquivos de um repositório. + + +.SH SINOPSE + +\fBgit\-permalink\fP [\fIOPÇÕES\fP] \fIARQUIVO\fP [\fINOLINHA\fP] + + +.SH DESCRIÇÃO + +\fBgit\-permalink\fP usa o próprio Git para pegar a) o commit do \fIHEAD\fP e b) o +\fIremote.origin.url\fP usando \fBgit\-config\fP(1), e opcionalmente c) um modelo +de substituição de URL. Então ele usa esses valores para construir o link +para uma URL \fIpermanente\fP (permalink), com o commit incluso para garantir +sua unicidade, e opcionalmente o número da linha selecionada. + +\fBgit\-permalink\fP depois usa o \fBxdg\-open\fP(1) para abrir a URL. + +.SH OPÇÕES + +.TP +\fB\-p\fP +Somento imprime o link da URL web na saída padrão (STDOUT), não tenta +abrí\-lo com \fBxdg\-open\fP(1) ou fazer qualquer coisa com ele. Por padrão isso +está desligado. + +.TP +\fB\-\-help\fP, \fB\-h\fP +Mostra mensagem de ajuda. + +.TP +\fB\-\-version\fP, \fB\-V\fP +Imprime o número da versão. + + +.SH CONFIGURAÇÃO + +.SS "ORIGENS REMOTAS COM SUPORTE" + +A lista atual de origens remotas com suporte é: + +.RS +.IP \(bu +git.euandreh.xyz (onde o próprio git\-permalink está hospedado =p) +.IP \(bu +sourcehut +.IP \(bu +git.kernel.org +.IP \(bu +savannah +.IP \(bu +notabug +.IP \(bu +codeberg +.IP \(bu +bitbucket +.IP \(bu +pagure +.IP \(bu +gitlab +.IP \(bu +github +.RE + +Mudanças para adição de mais sites de hospedagem de código são bem\-vindas! + +Veja +.UR https://euandreh.xyz/git\-permalink/TODOs.html#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a +#task\-cebc5298\-17ad\-5c60\-dfa5\-a25b66433a3a +.UE +para discussão e mais +informações. + +.SS MODELOS + +Se você quiser configurar o modelo de substituição de URL de um projeto que +não tem suporte a um tipo de origem remota você pode fazê\-lo com +\fBgit\-config\fP(1). + +Há dois tipos de opções de configuração disponíveis: + +.TP +\fBgit\-permalink.template\-file\-commit\fP +Um modelo de substituição de URL em que o nome do \fIarquivo\fP vem primeiro, e +o \fIcommit\fP vem depois. cgit usa esse tipo de URL, como em: + +.nf + https://git.euandreh.xyz/fallible/tree/%s?id=%s +.fi + +Nesse exemplo, o nome do \fIarquivo\fP vem primeiro e o \fIcommit\fP vem só no +final, depois do "id=". + +.TP +\fBgit\-permalink.template\-commit\-file\fP +Um modelo de substituição de URL em que o \fIcommit\fP vem primeiro, e o nome +do \fIarquivo\fP vem depois. sourcehut usa esse tipo de URL, como em: + +.nf + https://git.sr.ht/~sircmpwn/scdoc/tree/%s/item/%s +.fi + +Nesse exemplo, o \fIcommit\fP aparece primeiro no caminho da URL, e o nome do +\fIarquivo\fP vem depois. + +.P +Se nenhuma das duas opções for encontrada pelo \fBgit\-config\fP(1) e o +\fBgit\-permalink\fP não consegue adivinhar a URL, ele termina com um erro. + + +.SH EXEMPLOS + +Abre o arquivo \fIsrc/fold.c\fP de um projeto com a origem apontada para o +\fIsourcehut\fP: + +.nf + $ git permalink src/fold.c 125 + Abrindo https://git.sr.ht/~sircmpwn/ctools/tree/fbf17d92f5ed1c38983f73df912f051ad0f9ef2d/item/src/fold.c#L125 +.fi + +Gera um link das linhas 59 a 94 do arquivo \fInongnu/packages/clojure.scm\fP em +um projeto hospedado no \fIgitlab\fP, mas somente o imprimie \fIsem\fP abrí\-lo com +\fBxdg\-open\fP(1): + +.nf + $ git permalink \-p nongnu/packages/clojure.scm 59\-94 + https://gitlab.com/nonguix/nonguix/\-/blob/c9d7f30bcbd3a6e3076e56a972c33963c73c4d58/nongnu/packages/clojure.scm#L59\-94 +.fi + +.P +Configura um modelo de URL, e abre o arquivo \fIsrc/app_add.c\fP sem selecionar +uma linha específica: + +.nf + $ git config git\-permalink.template\-file\-commit 'https://git.alpinelinux.org/apk\-tools/tree/%s?id=%s' + $ git permalink src/app_add.c + Abrindo https://git.alpinelinux.org/apk\-tools/tree/src/app_add.c?id=aeeb119fd8652c044cd5ceebce572b5c716914e3 +.fi + +.P +Abre o arquivo \fI\-\-help\fP: + +.nf + $ git permalink \-\- \-\-help + Abrindo https://git.euandreh.xyz/non\-existent\-repository/tree/\-\-help?id=470a9fa9329495cfcbef8cc5e32e3a38d3c3103e +.fi + +.SH "CÓDIGO DE SAÍDA" + +.TP +\fB0\fP +Execução bem\-sucedida. + +.TP +\fB1\fP +Sem suporte à origem remota. Veja a lista de quais tem suporte em ORIGENS +REMOTAS COM SUPORTE, e como adicionar origens customizadas a parteir de um +model em MODELOS. + +.TP +\fB2\fP +Argumentos inválidos. + + +.SH "VEJA TAMBÉM" + +\fBgit\-config\fP(1) \fBxdg\-open\fP(1) + + +.SH AUTORES + +.MT eu@euandre.org +EuAndreh +.ME +e colaboradores. + + +.SH BUGS + +.IP \(bu +Relate bugs na +.MT ~euandreh/public\-inbox@lists.sr.ht +lista de discussão +.ME . +Use o assunto "\f(CR[git\-permalink] BUG ou TASK: +\fR". +.IP \(bu +Veja os bugs +.UR https://euandreh.xyz/git\-permalink/TODOs.html +online +.UE . +.IP \(bu +.UR https://euandreh.xyz/git\-permalink/ +Página inicial +.UE . +.IP \(bu +.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bgit\-permalink%5D +Comentários e discussões +.UE . -- cgit v1.2.3