git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Documentation: fix man page dependency on asciidoc.conf
@ 2013-01-05 16:00 John Keeping
  2013-01-05 23:28 ` Jonathan Nieder
  0 siblings, 1 reply; 6+ messages in thread
From: John Keeping @ 2013-01-05 16:00 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano

When building manual pages, the source text is transformed to XML with
AsciiDoc before the man pages are generated from the XML with xmlto.

Fix the dependency in the Makefile so that the XML files are rebuilt
when asciidoc.conf changes and not just the manual pages from unchanged
XML.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 Documentation/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index e53d333..71d2b4a 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -178,7 +178,7 @@ all: html man
 
 html: $(DOC_HTML)
 
-$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
+$(DOC_HTML) $(MAN_XML): asciidoc.conf
 
 man: man1 man5 man7
 man1: $(DOC_MAN1)
-- 
1.8.0.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Documentation: fix man page dependency on asciidoc.conf
  2013-01-05 16:00 [PATCH] Documentation: fix man page dependency on asciidoc.conf John Keeping
@ 2013-01-05 23:28 ` Jonathan Nieder
  2013-01-06  6:51   ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2013-01-05 23:28 UTC (permalink / raw
  To: John Keeping; +Cc: git, Junio C Hamano, Sergey Vlasov

John Keeping wrote:

> When building manual pages, the source text is transformed to XML with
> AsciiDoc before the man pages are generated from the XML with xmlto.
>
> Fix the dependency in the Makefile so that the XML files are rebuilt
> when asciidoc.conf changes and not just the manual pages from unchanged
> XML.

Good catch, thanks.

Would something like the following make sense, to make it more obvious
how the dependency needs to be adjusted if we change the $(ASCIIDOC)
command line for some reason?

diff --git i/Documentation/Makefile w/Documentation/Makefile
index e53d333e..971977b8 100644
--- i/Documentation/Makefile
+++ w/Documentation/Makefile
@@ -178,8 +178,6 @@ all: html man
 
 html: $(DOC_HTML)
 
-$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
-
 man: man1 man5 man7
 man1: $(DOC_MAN1)
 man5: $(DOC_MAN5)
@@ -257,7 +255,7 @@ clean:
 	$(RM) $(cmds_txt) *.made
 	$(RM) manpage-base-url.xsl
 
-$(MAN_HTML): %.html : %.txt
+$(MAN_HTML): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
@@ -270,7 +268,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 	$(QUIET_XMLTO)$(RM) $@ && \
 	$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 
-%.xml : %.txt
+%.xml : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
@@ -286,7 +284,7 @@ technical/api-index.txt: technical/api-index-skel.txt \
 	$(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
 
 technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
-$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt
+$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
 
diff --git i/t/test-terminal.perl w/t/test-terminal.perl
index 10172aee..1fb373f2 100755
--- i/t/test-terminal.perl
+++ w/t/test-terminal.perl
@@ -31,7 +31,7 @@ sub finish_child {
 	} elsif ($? & 127) {
 		my $code = $? & 127;
 		warn "died of signal $code";
-		return $code - 128;
+		return $code + 128;
 	} else {
 		return $? >> 8;
 	}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Documentation: fix man page dependency on asciidoc.conf
  2013-01-05 23:28 ` Jonathan Nieder
@ 2013-01-06  6:51   ` Junio C Hamano
  2013-01-06 12:01     ` [PATCH] docs: manpage XML depends " Jonathan Nieder
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2013-01-06  6:51 UTC (permalink / raw
  To: Jonathan Nieder; +Cc: John Keeping, git, Sergey Vlasov

Jonathan Nieder <jrnieder@gmail.com> writes:

> John Keeping wrote:
>
>> When building manual pages, the source text is transformed to XML with
>> AsciiDoc before the man pages are generated from the XML with xmlto.
>>
>> Fix the dependency in the Makefile so that the XML files are rebuilt
>> when asciidoc.conf changes and not just the manual pages from unchanged
>> XML.
>
> Good catch, thanks.
>
> Would something like the following make sense, to make it more obvious
> how the dependency needs to be adjusted if we change the $(ASCIIDOC)
> command line for some reason?

I think such a more explicit approach is easier to understand, than
a separate "By the way, I do not define any rule to build these
targets using asciidoc.conf, but I know they depend on it" rule.

Care to do a real patch?

Thanks.


> diff --git i/Documentation/Makefile w/Documentation/Makefile
> index e53d333e..971977b8 100644
> --- i/Documentation/Makefile
> +++ w/Documentation/Makefile
> @@ -178,8 +178,6 @@ all: html man
>  
>  html: $(DOC_HTML)
>  
> -$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
> -
>  man: man1 man5 man7
>  man1: $(DOC_MAN1)
>  man5: $(DOC_MAN5)
> @@ -257,7 +255,7 @@ clean:
>  	$(RM) $(cmds_txt) *.made
>  	$(RM) manpage-base-url.xsl
>  
> -$(MAN_HTML): %.html : %.txt
> +$(MAN_HTML): %.html : %.txt asciidoc.conf
>  	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
>  	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
>  		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
> @@ -270,7 +268,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
>  	$(QUIET_XMLTO)$(RM) $@ && \
>  	$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
>  
> -%.xml : %.txt
> +%.xml : %.txt asciidoc.conf
>  	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
>  	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
>  		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
> @@ -286,7 +284,7 @@ technical/api-index.txt: technical/api-index-skel.txt \
>  	$(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
>  
>  technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
> -$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt
> +$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
>  	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
>  		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
>  
> diff --git i/t/test-terminal.perl w/t/test-terminal.perl
> index 10172aee..1fb373f2 100755
> --- i/t/test-terminal.perl
> +++ w/t/test-terminal.perl
> @@ -31,7 +31,7 @@ sub finish_child {
>  	} elsif ($? & 127) {
>  		my $code = $? & 127;
>  		warn "died of signal $code";
> -		return $code - 128;
> +		return $code + 128;
>  	} else {
>  		return $? >> 8;
>  	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] docs: manpage XML depends on asciidoc.conf
  2013-01-06  6:51   ` Junio C Hamano
@ 2013-01-06 12:01     ` Jonathan Nieder
  2013-01-06 12:33       ` John Keeping
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2013-01-06 12:01 UTC (permalink / raw
  To: Junio C Hamano; +Cc: John Keeping, git, Sergey Vlasov, Thomas Ackermann

When building manual pages, the source text is transformed to XML with
AsciiDoc before the man pages are generated from the XML with xmlto.

Fix the dependencies in the Makefile so that the XML files are rebuilt
when asciidoc.conf changes and not just the manual pages from
unchanged XML, and move the dependencies from a recipeless rule to the
rules with commands that use asciidoc.conf to make the dependencies
easier to understand and maintain.

Reported-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Junio C Hamano wrote:

> Care to do a real patch?

Here you go.

 Documentation/Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index e53d333e..971977b8 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -178,8 +178,6 @@ all: html man
 
 html: $(DOC_HTML)
 
-$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
-
 man: man1 man5 man7
 man1: $(DOC_MAN1)
 man5: $(DOC_MAN5)
@@ -257,7 +255,7 @@ clean:
 	$(RM) $(cmds_txt) *.made
 	$(RM) manpage-base-url.xsl
 
-$(MAN_HTML): %.html : %.txt
+$(MAN_HTML): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
@@ -270,7 +268,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 	$(QUIET_XMLTO)$(RM) $@ && \
 	$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 
-%.xml : %.txt
+%.xml : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
@@ -286,7 +284,7 @@ technical/api-index.txt: technical/api-index-skel.txt \
 	$(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
 
 technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
-$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt
+$(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
 
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] docs: manpage XML depends on asciidoc.conf
  2013-01-06 12:01     ` [PATCH] docs: manpage XML depends " Jonathan Nieder
@ 2013-01-06 12:33       ` John Keeping
  2013-01-06 23:19         ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: John Keeping @ 2013-01-06 12:33 UTC (permalink / raw
  To: Jonathan Nieder; +Cc: Junio C Hamano, git, Sergey Vlasov, Thomas Ackermann

On Sun, Jan 06, 2013 at 04:01:53AM -0800, Jonathan Nieder wrote:
> When building manual pages, the source text is transformed to XML with
> AsciiDoc before the man pages are generated from the XML with xmlto.
> 
> Fix the dependencies in the Makefile so that the XML files are rebuilt
> when asciidoc.conf changes and not just the manual pages from
> unchanged XML, and move the dependencies from a recipeless rule to the
> rules with commands that use asciidoc.conf to make the dependencies
> easier to understand and maintain.
> 
> Reported-by: John Keeping <john@keeping.me.uk>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---

This fixes the problem I wanted to fix (as well as being clearer for the
future), so FWIW:

Tested-by: John Keeping <john@keeping.me.uk>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] docs: manpage XML depends on asciidoc.conf
  2013-01-06 12:33       ` John Keeping
@ 2013-01-06 23:19         ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2013-01-06 23:19 UTC (permalink / raw
  To: John Keeping; +Cc: Jonathan Nieder, git, Sergey Vlasov, Thomas Ackermann

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-06 23:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05 16:00 [PATCH] Documentation: fix man page dependency on asciidoc.conf John Keeping
2013-01-05 23:28 ` Jonathan Nieder
2013-01-06  6:51   ` Junio C Hamano
2013-01-06 12:01     ` [PATCH] docs: manpage XML depends " Jonathan Nieder
2013-01-06 12:33       ` John Keeping
2013-01-06 23:19         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).