{"thread":{"id":"50157","subject":"[PATCH 0/1] i18n: add framework for localizing the manpages","startedAt":"2019-01-04T16:54:24Z","lastAt":"2019-01-07T19:29:48Z","messageCount":8,"participants":["Jean-Noël Avila","Junio C Hamano","Jean-Noël AVILA"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"366148","messageId":"20190104165406.22358-1-jn.avila@free.fr","threadId":"50157","inReplyTo":null,"subject":"[PATCH 0/1] i18n: add framework for localizing the manpages","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2019-01-04T16:54:05Z","receivedAt":"2019-01-04T16:54:24Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Hi all,\n\nThis is a second attempt at providing localized manpages of git in a central way. The first attempt[1] was to include all the changes directly in the main repo. But as Junio made me realize, staying in the main repo would have many drawbacks such as forcing possible translators to follow the workflow of Git and preventing use of third party translation tools such as Weblate.\n\nThis solution is to make the manpage localization project standalone. I finally had time to hack po4a to enhance support for specificities of git manpages. This rather light patch is only an adaptation of the Makefile to be able to use the same building rules in the translation repo. The translation repo bases the workflow on a copy of the selected manpages asciidoc source files. You can find it at\n\nhttps://github.com/jnavila/git-manpages-l10n\n\nTranslations can be filled using Weblate at https://hosted.weblate.org/projects/git-manpages/\n\n[1] https://public-inbox.org/git/20170312200248.3610-1-jn.avila@free.fr/\n\nJean-Noel Avila (1):\n  Add optional targets for documentation l10n\n\n Documentation/Makefile | 25 +++++++++++++++++++------\n 1 file changed, 19 insertions(+), 6 deletions(-)\n\n-- \n2.20.1\n\n"},{"id":"366149","messageId":"20190104165406.22358-2-jn.avila@free.fr","threadId":"50157","inReplyTo":"20190104165406.22358-1-jn.avila@free.fr","subject":"[PATCH 1/1] Add optional targets for documentation l10n","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2019-01-04T16:54:06Z","receivedAt":"2019-01-04T16:54:37Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"From: Jean-Noel Avila <jn.avila@free.fr>\n\nThe standard doc lists can be filtered to allow using the compilation\nrules with translated manpages where all the pages of the original\nversion may not be present.\n\nThe install variable are reused in the secondary repo so that the\nconfigured paths can be used for translated manpages too.\n\nSigned-off-by: Jean-Noël Avila <jn.avila@free.fr>\n---\n Documentation/Makefile | 25 +++++++++++++++++++------\n 1 file changed, 19 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex b5be2e2d3f..1f61a1fe86 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -35,13 +35,18 @@ MAN7_TXT += gittutorial-2.txt\n MAN7_TXT += gittutorial.txt\n MAN7_TXT += gitworkflows.txt\n \n-MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n+TMP_MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n+MAN_FILTER ?= $(TMP_MAN_TXT)\n+MAN_TXT = $(filter $(TMP_MAN_TXT), $(MAN_FILTER))\n+undefine TMP_MAN_TXT\n+\n MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))\n MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))\n \n OBSOLETE_HTML += everyday.html\n OBSOLETE_HTML += git-remote-helpers.html\n-DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n+\n+TMP_DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n \n ARTICLES += howto-index\n ARTICLES += git-tools\n@@ -81,11 +86,14 @@ TECH_DOCS += technical/trivial-merge\n SP_ARTICLES += $(TECH_DOCS)\n SP_ARTICLES += technical/api-index\n \n-DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n+TMP_DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n+HTML_FILTER ?= $(TMP_DOC_HTML)\n+DOC_HTML = $(filter $(HTML_FILTER),$(TMP_DOC_HTML))\n+undefine TMP_DOC_HTML\n \n-DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))\n-DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))\n-DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))\n+DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER), $(MAN1_TXT)))\n+DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER), $(MAN5_TXT)))\n+DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER), $(MAN7_TXT)))\n \n prefix ?= $(HOME)\n bindir ?= $(prefix)/bin\n@@ -444,4 +452,9 @@ print-man1:\n lint-docs::\n \t$(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl\n \n+ifeq ($(wildcard po/Makefile),po/Makefile)\n+doc-l10n install-l10n::\n+\t$(MAKE) -C po $@\n+endif\n+\n .PHONY: FORCE\n-- \n2.20.1\n\n"},{"id":"366159","messageId":"xmqqk1jkb0c9.fsf@gitster-ct.c.googlers.com","threadId":"50157","inReplyTo":"20190104165406.22358-2-jn.avila@free.fr","subject":"Re: [PATCH 1/1] Add optional targets for documentation l10n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-04T21:05:10Z","receivedAt":"2019-01-04T21:05:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël Avila <jn.avila@free.fr> writes:\n\n> From: Jean-Noel Avila <jn.avila@free.fr>\n>\n> The standard doc lists can be filtered to allow using the compilation\n> rules with translated manpages where all the pages of the original\n> version may not be present.\n>\n> The install variable are reused in the secondary repo so that the\n> configured paths can be used for translated manpages too.\n>\n> Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>\n> ---\n>  Documentation/Makefile | 25 +++++++++++++++++++------\n>  1 file changed, 19 insertions(+), 6 deletions(-)\n>\n> diff --git a/Documentation/Makefile b/Documentation/Makefile\n> index b5be2e2d3f..1f61a1fe86 100644\n> --- a/Documentation/Makefile\n> +++ b/Documentation/Makefile\n> @@ -35,13 +35,18 @@ MAN7_TXT += gittutorial-2.txt\n>  MAN7_TXT += gittutorial.txt\n>  MAN7_TXT += gitworkflows.txt\n>  \n> -MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n> +TMP_MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n> +MAN_FILTER ?= $(TMP_MAN_TXT)\n> +MAN_TXT = $(filter $(TMP_MAN_TXT), $(MAN_FILTER))\n> +undefine TMP_MAN_TXT\n> +\n\nI think your arguments to $(filter) is the other way around, but\nother than that, I think I get what you are trying to do.  Let me\nmake sure I got it right.\n\nThe idea is to use $(filter PATTERN..., TEXT) that removes words in\nTEXT that do not match any of the words in PATTERN, and for normal\nbuild, MAN_FILTER is set identical to TMP_MAN_TXT (which is the\noriginal MAN_TXT), so there is no filtering happen, but in a build\nthat does tweak MAN_FILTER, MAN_TXT can become a subset of the\noriginal MAN_TXT.\n\nAm I on the right track?\n\n>  MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))\n>  MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))\n\nAnd these act on already-filtered MAN_TXT\n\n>  OBSOLETE_HTML += everyday.html\n>  OBSOLETE_HTML += git-remote-helpers.html\n> -DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n> +\n> +TMP_DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n>  \n>  ARTICLES += howto-index\n>  ARTICLES += git-tools\n> @@ -81,11 +86,14 @@ TECH_DOCS += technical/trivial-merge\n>  SP_ARTICLES += $(TECH_DOCS)\n>  SP_ARTICLES += technical/api-index\n>  \n> -DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n> +TMP_DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n> +HTML_FILTER ?= $(TMP_DOC_HTML)\n> +DOC_HTML = $(filter $(HTML_FILTER),$(TMP_DOC_HTML))\n> +undefine TMP_DOC_HTML\n\nThis one uses $(filter) in the right direction.\n\nSo is it expected that HTML help pages that correspond to manpages\nare strict subset of manpages?  \n\nI see HTML_FILTER may be useful to filter HTML pages that come from\n$(ARTICLES), but I'd expect that all $(MAN_HTML) that came from the\nalready-filtered $(MAN_TXT) would not require any further filtering.\nWith the approach shown, the secondary project ends up needing to\nlist all the translated MAN_TXT twice (once for MAN_FILTER, and\nagain for HTML_FILTER), doesn't it?\n\nI am wondering if it makes more sense to have HTML_FILTER filter _only_\nparts of the DOC_HTML that does not come from MAN_TXT (i.e. those\n$(ARTICLES) pages).\n\n> -DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))\n> -DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))\n> -DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))\n> +DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER), $(MAN1_TXT)))\n> +DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER), $(MAN5_TXT)))\n> +DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER), $(MAN7_TXT)))\n\nThese are OK, too.\n\nBy the way, lose the SP after ',' in $(filter).  As we can see in\nthe context lines in the patch, args to $(make-functions) are\nseparated with comma without surrounding SP by convention.\n\nWhat kind of PATTERN does the secondary project supply when invoking\nthis Makefile?  If it is list of filenames, I am wondering if it is\nsimpler to have it override MAN{1,5,7}_TXT variables, without adding\nthese \"TMP_* + fliter + undef TMP_*\" dance.\n\n>  prefix ?= $(HOME)\n>  bindir ?= $(prefix)/bin\n> @@ -444,4 +452,9 @@ print-man1:\n>  lint-docs::\n>  \t$(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl\n>  \n> +ifeq ($(wildcard po/Makefile),po/Makefile)\n> +doc-l10n install-l10n::\n> +\t$(MAKE) -C po $@\n> +endif\n> +\n>  .PHONY: FORCE\n"},{"id":"366173","messageId":"220955359.FqXrlbFPp5@cayenne","threadId":"50157","inReplyTo":"xmqqk1jkb0c9.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] Add optional targets for documentation l10n","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2019-01-05T08:35:29Z","receivedAt":"2019-01-05T08:35:34Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"On Friday, 4 January 2019 22:05:10 CET Junio C Hamano wrote:\n> Jean-Noël Avila <jn.avila@free.fr> writes:\n> \n> > From: Jean-Noel Avila <jn.avila@free.fr>\n> >\n> > The standard doc lists can be filtered to allow using the compilation\n> > rules with translated manpages where all the pages of the original\n> > version may not be present.\n> >\n> > The install variable are reused in the secondary repo so that the\n> > configured paths can be used for translated manpages too.\n> >\n> > Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>\n> > ---\n> >  Documentation/Makefile | 25 +++++++++++++++++++------\n> >  1 file changed, 19 insertions(+), 6 deletions(-)\n> >\n> > diff --git a/Documentation/Makefile b/Documentation/Makefile\n> > index b5be2e2d3f..1f61a1fe86 100644\n> > --- a/Documentation/Makefile\n> > +++ b/Documentation/Makefile\n> > @@ -35,13 +35,18 @@ MAN7_TXT += gittutorial-2.txt\n> >  MAN7_TXT += gittutorial.txt\n> >  MAN7_TXT += gitworkflows.txt\n> >  \n> > -MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n> > +TMP_MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n> > +MAN_FILTER ?= $(TMP_MAN_TXT)\n> > +MAN_TXT = $(filter $(TMP_MAN_TXT), $(MAN_FILTER))\n> > +undefine TMP_MAN_TXT\n> > +\n> \n> I think your arguments to $(filter) is the other way around, but\n> other than that, I think I get what you are trying to do.  Let me\n> make sure I got it right.\n> \n> The idea is to use $(filter PATTERN..., TEXT) that removes words in\n> TEXT that do not match any of the words in PATTERN, and for normal\n> build, MAN_FILTER is set identical to TMP_MAN_TXT (which is the\n> original MAN_TXT), so there is no filtering happen, but in a build\n> that does tweak MAN_FILTER, MAN_TXT can become a subset of the\n> original MAN_TXT.\n> \n> Am I on the right track?\n>\n\nYes that's exactly the purpose of this trick. In fact, $(filter) in this \nconfiguration is equivalent to an intersection of lists, so the order does not \nchange the end result.\n \n> >  MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))\n> >  MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))\n> \n> And these act on already-filtered MAN_TXT\n> \n\nYes the filtered list fans out to the outputs.\n\n> >  OBSOLETE_HTML += everyday.html\n> >  OBSOLETE_HTML += git-remote-helpers.html\n> > -DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n> > +\n> > +TMP_DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n> >  \n> >  ARTICLES += howto-index\n> >  ARTICLES += git-tools\n> > @@ -81,11 +86,14 @@ TECH_DOCS += technical/trivial-merge\n> >  SP_ARTICLES += $(TECH_DOCS)\n> >  SP_ARTICLES += technical/api-index\n> >  \n> > -DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n> > +TMP_DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n> > +HTML_FILTER ?= $(TMP_DOC_HTML)\n> > +DOC_HTML = $(filter $(HTML_FILTER),$(TMP_DOC_HTML))\n> > +undefine TMP_DOC_HTML\n> \n> This one uses $(filter) in the right direction.\n> \n> So is it expected that HTML help pages that correspond to manpages\n> are strict subset of manpages?  \n> \n> I see HTML_FILTER may be useful to filter HTML pages that come from\n> $(ARTICLES), but I'd expect that all $(MAN_HTML) that came from the\n> already-filtered $(MAN_TXT) would not require any further filtering.\n> With the approach shown, the secondary project ends up needing to\n> list all the translated MAN_TXT twice (once for MAN_FILTER, and\n> again for HTML_FILTER), doesn't it?\n\nThe issue I had here is that DOC_HTML is a superset of of MAN_HTML (which \nneeded to be translated anyway for MAN_XML) and I have no way to remove from \nthe difference of them the files that are not already translated. So a second \nfilter is needed, even if now, MAN_FILTER==HTML_FILTER.\n\nAs the translations expand hopefully, we will add the html documentation.\n\n> \n> I am wondering if it makes more sense to have HTML_FILTER filter _only_\n> parts of the DOC_HTML that does not come from MAN_TXT (i.e. those\n> $(ARTICLES) pages).\n> \n\nIt can be done. That would separate manpage filter from doc filter. The \nsecondary project can be simplified.\n\n> > -DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))\n> > -DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))\n> > -DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))\n> > +DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER), $(MAN1_TXT)))\n> > +DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER), $(MAN5_TXT)))\n> > +DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER), $(MAN7_TXT)))\n> \n> These are OK, too.\n> \n> By the way, lose the SP after ',' in $(filter).  As we can see in\n> the context lines in the patch, args to $(make-functions) are\n> separated with comma without surrounding SP by convention.\n> \n> What kind of PATTERN does the secondary project supply when invoking\n> this Makefile?  If it is list of filenames, I am wondering if it is\n> simpler to have it override MAN{1,5,7}_TXT variables, without adding\n> these \"TMP_* + fliter + undef TMP_*\" dance.\n\nAh, I see. The filter from MAN{1,5,7}_TXT would ripple the same way as MAN_TXT, \njust one level upstream.  The filtering at this level would no longer be \nneeded.\n\nUnfortunately, the TMP_* dance would also be needed because these variables \nare built in several steps by append operations, and once filtered, the \noriginal variables are still useless. My Makefile-fu is low, so I may be \nmissing something about redefining variables.\n\nMore generally, is this setup sustainable?\n\n\n\n"},{"id":"366174","messageId":"20190105134438.11271-1-jn.avila@free.fr","threadId":"50157","inReplyTo":"20190104165406.22358-1-jn.avila@free.fr","subject":"[PATCH v2] Add optional targets for documentation l10n","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2019-01-05T13:44:38Z","receivedAt":"2019-01-05T13:47:49Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"From: Jean-Noel Avila <jn.avila@free.fr>\n\nThe standard doc lists can be filtered to allow using the compilation\nrules with translated manpages where all the pages of the original\nversion may not be present.\n\nThe install variable are reused in the secondary repo so that the\nconfigured paths can be used for translated manpages too.\n\nSigned-off-by: Jean-Noël Avila <jn.avila@free.fr>\n---\n\nThe TMP_* dance was removed. The MAN{1,5,7} filtering was preserved, to keep the dispatching policy of manpages in a single place.\n\n\nDocumentation/Makefile | 22 +++++++++++++++++-----\n 1 file changed, 17 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex b5be2e2d3f..c8450d6425 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -35,13 +35,18 @@ MAN7_TXT += gittutorial-2.txt\n MAN7_TXT += gittutorial.txt\n MAN7_TXT += gitworkflows.txt\n \n+ifdef MAN_FILTER\n+MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))\n+else\n MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n+MAN_FILTER = $(MAN_TXT)\n+endif\n+\n MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))\n MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))\n \n OBSOLETE_HTML += everyday.html\n OBSOLETE_HTML += git-remote-helpers.html\n-DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n \n ARTICLES += howto-index\n ARTICLES += git-tools\n@@ -81,11 +86,13 @@ TECH_DOCS += technical/trivial-merge\n SP_ARTICLES += $(TECH_DOCS)\n SP_ARTICLES += technical/api-index\n \n-DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n+SP_ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n+HTML_FILTER ?= $(SP_ARTICLES_HTML) $(OBSOLETE_HTML)\n+DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(SP_ARTICLES_HTML) $(OBSOLETE_HTML))\n \n-DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))\n-DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))\n-DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))\n+DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER), $(MAN1_TXT)))\n+DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER), $(MAN5_TXT)))\n+DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER), $(MAN7_TXT)))\n \n prefix ?= $(HOME)\n bindir ?= $(prefix)/bin\n@@ -444,4 +451,9 @@ print-man1:\n lint-docs::\n \t$(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl\n \n+ifeq ($(wildcard po/Makefile),po/Makefile)\n+doc-l10n install-l10n::\n+\t$(MAKE) -C po $@\n+endif\n+\n .PHONY: FORCE\n-- \n2.20.1\n\n"},{"id":"366267","messageId":"xmqqimz09yko.fsf@gitster-ct.c.googlers.com","threadId":"50157","inReplyTo":"20190105134438.11271-1-jn.avila@free.fr","subject":"Re: [PATCH v2] Add optional targets for documentation l10n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-07T17:17:43Z","receivedAt":"2019-01-07T17:17:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël Avila <jn.avila@free.fr> writes:\n\n> +ifdef MAN_FILTER\n> +MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))\n> +else\n>  MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n> +MAN_FILTER = $(MAN_TXT)\n> +endif\n\nOK.\n\n>  OBSOLETE_HTML += everyday.html\n>  OBSOLETE_HTML += git-remote-helpers.html\n> -DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n>  \n>  ARTICLES += howto-index\n>  ARTICLES += git-tools\n> @@ -81,11 +86,13 @@ TECH_DOCS += technical/trivial-merge\n>  SP_ARTICLES += $(TECH_DOCS)\n>  SP_ARTICLES += technical/api-index\n>  \n> -DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n\n> +SP_ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n\nI'd call that $(ARTICLES_HTML); SP_ARTICLES are those pages that\nwant to become regular articles but singled out because they need\nspecial handling to format.\n\n> +HTML_FILTER ?= $(SP_ARTICLES_HTML) $(OBSOLETE_HTML)\n> +DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(SP_ARTICLES_HTML) $(OBSOLETE_HTML))\n\n> -DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))\n> -DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))\n> -DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))\n> +DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER), $(MAN1_TXT)))\n> +DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER), $(MAN5_TXT)))\n> +DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER), $(MAN7_TXT)))\n\nMakes sense; s/, /,/, though.\n"},{"id":"366276","messageId":"20190107192112.25957-1-jn.avila@free.fr","threadId":"50157","inReplyTo":"20190104165406.22358-1-jn.avila@free.fr","subject":"[PATCH v3] Add optional targets for documentation l10n","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2019-01-07T19:21:12Z","receivedAt":"2019-01-07T19:21:23Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"From: Jean-Noel Avila <jn.avila@free.fr>\n\nThe standard doc lists can be filtered to allow using the compilation\nrules with translated manpages where all the pages of the original\nversion may not be present.\n\nThe install variable are reused in the secondary repo so that the\nconfigured paths can be used for translated manpages too.\n\nSigned-off-by: Jean-Noël Avila <jn.avila@free.fr>\n---\n Documentation/Makefile | 22 +++++++++++++++++-----\n 1 file changed, 17 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex b5be2e2d3f..2bd2fb11f4 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -35,13 +35,18 @@ MAN7_TXT += gittutorial-2.txt\n MAN7_TXT += gittutorial.txt\n MAN7_TXT += gitworkflows.txt\n \n+ifdef MAN_FILTER\n+MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))\n+else\n MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)\n+MAN_FILTER = $(MAN_TXT)\n+endif\n+\n MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))\n MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))\n \n OBSOLETE_HTML += everyday.html\n OBSOLETE_HTML += git-remote-helpers.html\n-DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)\n \n ARTICLES += howto-index\n ARTICLES += git-tools\n@@ -81,11 +86,13 @@ TECH_DOCS += technical/trivial-merge\n SP_ARTICLES += $(TECH_DOCS)\n SP_ARTICLES += technical/api-index\n \n-DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n+ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))\n+HTML_FILTER ?= $(ARTICLES_HTML) $(OBSOLETE_HTML)\n+DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(ARTICLES_HTML) $(OBSOLETE_HTML))\n \n-DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))\n-DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))\n-DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))\n+DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER),$(MAN1_TXT)))\n+DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER),$(MAN5_TXT)))\n+DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER),$(MAN7_TXT)))\n \n prefix ?= $(HOME)\n bindir ?= $(prefix)/bin\n@@ -444,4 +451,9 @@ print-man1:\n lint-docs::\n \t$(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl\n \n+ifeq ($(wildcard po/Makefile),po/Makefile)\n+doc-l10n install-l10n::\n+\t$(MAKE) -C po $@\n+endif\n+\n .PHONY: FORCE\n-- \n2.20.1\n\n"},{"id":"366279","messageId":"xmqqh8ek8dw8.fsf@gitster-ct.c.googlers.com","threadId":"50157","inReplyTo":"220955359.FqXrlbFPp5@cayenne","subject":"Re: [PATCH 1/1] Add optional targets for documentation l10n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-07T19:29:43Z","receivedAt":"2019-01-07T19:29:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël AVILA <jn.avila@free.fr> writes:\n\n>> The idea is to use $(filter PATTERN..., TEXT) that removes words in\n>> TEXT that do not match any of the words in PATTERN, and for normal\n>> build, MAN_FILTER is set identical to TMP_MAN_TXT (which is the\n>> original MAN_TXT), so there is no filtering happen, but in a build\n>> that does tweak MAN_FILTER, MAN_TXT can become a subset of the\n>> original MAN_TXT.\n>> \n>> Am I on the right track?\n>>\n>\n> Yes that's exactly the purpose of this trick. In fact, $(filter) in this \n> configuration is equivalent to an intersection of lists, so the order does not \n> change the end result.\n\nThat is only true if MAN_FILTER is literally a list of \"I want\nexactly these things\", without any pattern.  Once a future caller\nwants to say \"We now have translations for pages from [a-m]*\", it\nbecomes apparent again that the order is wrong.\n\nAnd if the caller is supposed to have a literal list of pages, not a\npattern, then it may be sufficient to update our Makefile so that\nthe caller can override the literal list of pages we (incrementally)\ncompute with its own list without any filtering.\n\n> Ah, I see. The filter from MAN{1,5,7}_TXT would ripple the same way as MAN_TXT, \n> just one level upstream.  The filtering at this level would no longer be \n> needed.\n\nYup.  I see you sent v2; let me read it.\n\nThanks.\n\n\n"}]}