{"thread":{"id":"8383","subject":"[PATCH] catch asciidoc failures","startedAt":"2007-06-01T06:23:57Z","lastAt":"2007-06-01T09:46:04Z","messageCount":7,"participants":["Scott Lamb","Martin Waitz","Jonas Fonseca","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43719","messageId":"11806790373908-git-send-email-slamb@slamb.org","threadId":"8383","inReplyTo":null,"subject":"[PATCH] catch asciidoc failures","fromName":"Scott Lamb","fromEmail":"slamb@slamb.org","sentAt":"2007-06-01T06:23:57Z","receivedAt":"2007-06-01T06:23:57Z","isPatch":true,"sender":{"key":"slamb@slamb.org","avatar":null},"body":"If pipefail is available (GNU bash >= 3.00), fail when asciidoc returns\nerror rather than possibly later during XSLT.\n\nSigned-off-by: Scott Lamb <slamb@slamb.org>\n---\nThis is my first git patch, so please let me know if I got the procedure\nwrong.\n\n Documentation/Makefile |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 3f92783..48c245c 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -111,6 +111,7 @@ clean:\n \n %.html : %.txt\n \trm -f $@+ $@\n+\tset -o pipefail 2>/dev/null; \\\n \t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n \t\t$(ASCIIDOC_EXTRA) -o - $< | \\\n \t\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n@@ -121,6 +122,7 @@ clean:\n \n %.xml : %.txt\n \trm -f $@+ $@\n+\tset -o pipefail 2>/dev/null; \\\n \t$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \\\n \t\t$(ASCIIDOC_EXTRA) -o - $< | \\\n \t\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n-- \n1.5.2\n"},{"id":"43727","messageId":"20070601083621.GB3521@admingilde.org","threadId":"8383","inReplyTo":"11806790373908-git-send-email-slamb@slamb.org","subject":"Re: [PATCH] catch asciidoc failures","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-06-01T08:36:21Z","receivedAt":"2007-06-01T08:36:21Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Thu, May 31, 2007 at 11:23:57PM -0700, Scott Lamb wrote:\n> If pipefail is available (GNU bash >= 3.00), fail when asciidoc returns\n> error rather than possibly later during XSLT.\n\nperhaps we should simply change the pipe ordering to get asciidoc\nto the end of the pipeline so that all shells respect its exit code?\n\n> --- a/Documentation/Makefile\n> +++ b/Documentation/Makefile\n> @@ -111,6 +111,7 @@ clean:\n>  \n>  %.html : %.txt\n>  \trm -f $@+ $@\n> +\tset -o pipefail 2>/dev/null; \\\n>  \t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n>  \t\t$(ASCIIDOC_EXTRA) -o - $< | \\\n>  \t\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n\nsomething like (untested):\n\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $< |\n\t\t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n\t\t\t$(ASCIIDOC_EXTRA) -o $@+ -\n\n-- \nMartin Waitz\n"},{"id":"43729","messageId":"2c6b72b30706010155k4a3745b0i3ac2d22fa5a4f534@mail.gmail.com","threadId":"8383","inReplyTo":"20070601083621.GB3521@admingilde.org","subject":"Re: [PATCH] catch asciidoc failures","fromName":"Jonas Fonseca","fromEmail":"jonas.fonseca@gmail.com","sentAt":"2007-06-01T08:55:03Z","receivedAt":"2007-06-01T08:55:03Z","isPatch":true,"sender":{"key":"jonas.fonseca@gmail.com","avatar":"https://gravatar.com/avatar/9b7fa23cce50269e5d164312b6ac5ae818a180f837b38f28f3bdf689dd7f96cd?d=mp&s=160"},"body":"On 6/1/07, Martin Waitz <tali@admingilde.org> wrote:\n> On Thu, May 31, 2007 at 11:23:57PM -0700, Scott Lamb wrote:\n> > If pipefail is available (GNU bash >= 3.00), fail when asciidoc returns\n> > error rather than possibly later during XSLT.\n>\n> perhaps we should simply change the pipe ordering to get asciidoc\n> to the end of the pipeline so that all shells respect its exit code?\n\nFor tig I also adopted the nice man page headers git has. However, I have\nused  asciidoc attributes provided on the command line avoid having to\nuse sed. I can make a patch later if nobody beats me. The required changes\nare outlined below.\n\n> > --- a/Documentation/Makefile\n> > +++ b/Documentation/Makefile\n> > @@ -111,6 +111,7 @@ clean:\n> >\n> >  %.html : %.txt\n> >       rm -f $@+ $@\n> > +     set -o pipefail 2>/dev/null; \\\n> >       $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n> >               $(ASCIIDOC_EXTRA) -o - $< | \\\n> >               sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n>\n> something like (untested):\n>         sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $< |\n>                 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n>                         $(ASCIIDOC_EXTRA) -o $@+ -\n\nMore untested stuff. Use -a to define git_version attribute:\n\n$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n                         $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@ $<\n\nThen change the @@GIT_VERSION@@ symbol in asciidoc.conf to {git_version}.\n\n-- \nJonas Fonseca\n"},{"id":"43731","messageId":"20070601091030.GA2215@coredump.intra.peff.net","threadId":"8383","inReplyTo":"20070601083621.GB3521@admingilde.org","subject":"Re: [PATCH] catch asciidoc failures","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-06-01T09:10:30Z","receivedAt":"2007-06-01T09:10:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 01, 2007 at 10:36:21AM +0200, Martin Waitz wrote:\n\n> perhaps we should simply change the pipe ordering to get asciidoc\n> to the end of the pipeline so that all shells respect its exit code?\n> [...]\n> something like (untested):\n> \tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $< |\n> \t\t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n> \t\t\t$(ASCIIDOC_EXTRA) -o $@+ -\n\nThat won't work. The text @@GIT_VERSION@@ is pulled in from the\nasciidoc.conf file, so it's not even in the source file; it's only in\nthe built product.\n\nAs Jonas suggested, making it an asciidoc attribute is much more\nelegant (patch even tested!):\n\n-- >8 --\nDocumentation: robustify asciidoc GIT_VERSION replacement\n\nInstead of using sed on the resulting file, we now have a\ngit_version asciidoc attribute. This means that we don't\npipe the output of asciidoc, which means we can detect build\nfailures.\n\nProblem reported by Scott Lamb, solution suggested by Jonas Fonseca.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/Makefile      |    6 ++----\n Documentation/asciidoc.conf |    2 +-\n 2 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 3f92783..4064b38 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -112,8 +112,7 @@ clean:\n %.html : %.txt\n \trm -f $@+ $@\n \t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n-\t\t$(ASCIIDOC_EXTRA) -o - $< | \\\n-\t\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n+\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<\n \tmv $@+ $@\n \n %.1 %.5 %.7 : %.xml\n@@ -122,8 +121,7 @@ clean:\n %.xml : %.txt\n \trm -f $@+ $@\n \t$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \\\n-\t\t$(ASCIIDOC_EXTRA) -o - $< | \\\n-\t\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n+\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<\n \tmv $@+ $@\n \n user-manual.xml: user-manual.txt user-manual.conf\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nindex fa7dc94..60e15ba 100644\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -40,7 +40,7 @@ template::[header-declarations]\n <refentrytitle>{mantitle}</refentrytitle>\n <manvolnum>{manvolnum}</manvolnum>\n <refmiscinfo class=\"source\">Git</refmiscinfo>\n-<refmiscinfo class=\"version\">@@GIT_VERSION@@</refmiscinfo>\n+<refmiscinfo class=\"version\">{git_version}</refmiscinfo>\n <refmiscinfo class=\"manual\">Git Manual</refmiscinfo>\n </refmeta>\n <refnamediv>\n-- \n1.5.2.871.g0ff23\n"},{"id":"43736","messageId":"20070601093929.GC3521@admingilde.org","threadId":"8383","inReplyTo":"20070601091030.GA2215@coredump.intra.peff.net","subject":"Re: [PATCH] catch asciidoc failures","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-06-01T09:39:29Z","receivedAt":"2007-06-01T09:39:29Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Fri, Jun 01, 2007 at 05:10:30AM -0400, Jeff King wrote:\n> As Jonas suggested, making it an asciidoc attribute is much more\n> elegant (patch even tested!):\n\nvery nice!\nDoes that need any special asciidoc version?\n\n-- \nMartin Waitz\n"},{"id":"43737","messageId":"20070601094351.GA10037@coredump.intra.peff.net","threadId":"8383","inReplyTo":"20070601093929.GC3521@admingilde.org","subject":"Re: [PATCH] catch asciidoc failures","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-06-01T09:43:51Z","receivedAt":"2007-06-01T09:43:51Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 01, 2007 at 11:39:29AM +0200, Martin Waitz wrote:\n\n> very nice!\n> Does that need any special asciidoc version?\n\nI don't think so, but I'm not an asciidoc expert. Flipping through the\nchangelog, it looks like '-a' has existed since before 7.0.\n\n-Peff\n"},{"id":"43738","messageId":"FA77F6B4-2BC0-4714-9A82-749F70291BD0@slamb.org","threadId":"8383","inReplyTo":"20070601091030.GA2215@coredump.intra.peff.net","subject":"Re: [PATCH] catch asciidoc failures","fromName":"Scott Lamb","fromEmail":"slamb@slamb.org","sentAt":"2007-06-01T09:46:04Z","receivedAt":"2007-06-01T09:46:04Z","isPatch":true,"sender":{"key":"slamb@slamb.org","avatar":null},"body":"\nOn Jun 1, 2007, at 2:10 AM, Jeff King wrote:\n\n>  %.html : %.txt\n>  \trm -f $@+ $@\n>  \t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \\\n> -\t\t$(ASCIIDOC_EXTRA) -o - $< | \\\n> -\t\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+\n> +\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<\n>  \tmv $@+ $@\n\nHmm, now the $@+ intermediary shouldn't be necessary anymore - with \"- \no\" it's asciidoc's responsibility to handle the output file correctly.\n\nI think there's a lightbulb joke here somewhere. ;)\n\n-- \nScott Lamb <http://www.slamb.org/>\n"}]}