From: Scott Lamb <hidden> Date: 2016-06-15 22:43:13
If pipefail is available (GNU bash >= 3.00), fail when asciidoc returns
error rather than possibly later during XSLT.
Signed-off-by: Scott Lamb <redacted>
---
This is my first git patch, so please let me know if I got the procedure
wrong.
Documentation/Makefile | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
From: Jonas Fonseca <hidden> Date: 2016-06-15 22:43:13
On 6/1/07, Martin Waitz [off-list ref] wrote:
On Thu, May 31, 2007 at 11:23:57PM -0700, Scott Lamb wrote:
quoted
If pipefail is available (GNU bash >= 3.00), fail when asciidoc returns
error rather than possibly later during XSLT.
perhaps we should simply change the pipe ordering to get asciidoc
to the end of the pipeline so that all shells respect its exit code?
For tig I also adopted the nice man page headers git has. However, I have
used asciidoc attributes provided on the command line avoid having to
use sed. I can make a patch later if nobody beats me. The required changes
are outlined below.
something like (untested):
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $< |
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
$(ASCIIDOC_EXTRA) -o $@+ -
More untested stuff. Use -a to define git_version attribute:
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@ $<
Then change the @@GIT_VERSION@@ symbol in asciidoc.conf to {git_version}.
--
Jonas Fonseca
From: Jeff King <hidden> Date: 2016-06-15 22:43:13
On Fri, Jun 01, 2007 at 10:36:21AM +0200, Martin Waitz wrote:
perhaps we should simply change the pipe ordering to get asciidoc
to the end of the pipeline so that all shells respect its exit code?
[...]
something like (untested):
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $< |
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
$(ASCIIDOC_EXTRA) -o $@+ -
That won't work. The text @@GIT_VERSION@@ is pulled in from the
asciidoc.conf file, so it's not even in the source file; it's only in
the built product.
As Jonas suggested, making it an asciidoc attribute is much more
elegant (patch even tested!):
-- >8 --
Documentation: robustify asciidoc GIT_VERSION replacement
Instead of using sed on the resulting file, we now have a
git_version asciidoc attribute. This means that we don't
pipe the output of asciidoc, which means we can detect build
failures.
Problem reported by Scott Lamb, solution suggested by Jonas Fonseca.
Signed-off-by: Jeff King <redacted>
---
Documentation/Makefile | 6 ++----
Documentation/asciidoc.conf | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
Hmm, now the $@+ intermediary shouldn't be necessary anymore - with "-
o" it's asciidoc's responsibility to handle the output file correctly.
I think there's a lightbulb joke here somewhere. ;)
--
Scott Lamb <http://www.slamb.org/>