Skip to content
Permalink
Browse files

fixup! Avoid illegal filenames when building Documentation on NTFS

The problem this patch tried to solve is that `+` is not a valid part of
a file name on FAT file systems, so it won't work in general.

In practice, it still will work, at least for building Git for Windows,
because the MSYS2 runtime uses a trick inherited from Cygwin to handle
file names that would be illegal: the characters are simply mapped into
a private Unicode page.

This patch was soundly rejected on the Git mailing list (see
gitgitgadget#216 for details), in particular
after this developer figured out that `+` is actually a valid file name
character on NTFS.

So let's drop it from Git for Windows' patch thicket.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed Jul 29, 2019
1 parent 32a748d commit ddd892d6a105e62d2a1b8748e8493d37054eaff4
Showing with 44 additions and 44 deletions.
  1. +44 −44 Documentation/Makefile
@@ -297,9 +297,9 @@ docdep_prereqs = \
cmd-list.made $(cmds_txt)

doc.dep : $(docdep_prereqs) $(wildcard *.txt) $(wildcard config/*.txt) build-docdep.perl
$(QUIET_GEN)$(RM) $@.new $@ && \
$(PERL_PATH) ./build-docdep.perl >$@.new $(QUIET_STDERR) && \
mv $@.new $@
$(QUIET_GEN)$(RM) $@+ $@ && \
$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
mv $@+ $@

-include doc.dep

@@ -344,8 +344,8 @@ GIT-ASCIIDOCFLAGS: FORCE
fi

clean:
$(RM) *.xml *.xml.new *.html *.html.new *.1 *.5 *.7
$(RM) *.texi *.texi.new *.texi.new.new git.info gitman.info
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
$(RM) *.pdf
$(RM) howto-index.txt howto/*.html doc.dep
$(RM) technical/*.html technical/api-index.txt
@@ -355,14 +355,14 @@ clean:
$(RM) GIT-ASCIIDOCFLAGS

$(MAN_HTML): %.html : %.txt asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_HTML) -d manpage -o $@.new $< && \
mv $@.new $@
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
mv $@+ $@

$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_HTML) -o $@.new $< && \
mv $@.new $@
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -o $@+ $< && \
mv $@+ $@

manpage-base-url.xsl: manpage-base-url.xsl.in
$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
@@ -372,14 +372,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<

%.xml : %.txt asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_XML) -d manpage -o $@.new $< && \
mv $@.new $@
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_XML) -d manpage -o $@+ $< && \
mv $@+ $@

user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_XML) -d book -o $@.new $< && \
mv $@.new $@
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_XML) -d book -o $@+ $< && \
mv $@+ $@

technical/api-index.txt: technical/api-index-skel.txt \
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -397,46 +397,46 @@ XSLT = docbook.xsl
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css

user-manual.html: user-manual.xml $(XSLT)
$(QUIET_XSLTPROC)$(RM) $@.new $@ && \
xsltproc $(XSLTOPTS) -o $@.new $(XSLT) $< && \
mv $@.new $@
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
mv $@+ $@

git.info: user-manual.texi
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi

user-manual.texi: user-manual.xml
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@.new.new && \
$(PERL_PATH) fix-texi.perl <$@.new.new >$@.new && \
rm $@.new.new && \
mv $@.new $@
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
$(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
rm $@++ && \
mv $@+ $@

user-manual.pdf: user-manual.xml
$(QUIET_DBLATEX)$(RM) $@.new $@ && \
$(DBLATEX) -o $@.new $(DBLATEX_COMMON) $< && \
mv $@.new $@
$(QUIET_DBLATEX)$(RM) $@+ $@ && \
$(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \
mv $@+ $@

gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml).new texi.xsl $(xml) && \
$(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml).new && \
rm $(xml).new &&) true) > $@.new.new && \
$(PERL_PATH) cat-texi.perl $@ <$@.new.new >$@.new && \
rm $@.new.new && \
mv $@.new $@
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \
$(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \
rm $(xml)+ &&) true) > $@++ && \
$(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
rm $@++ && \
mv $@+ $@

gitman.info: gitman.texi
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi

$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@.new && \
mv $@.new $@
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
mv $@+ $@

howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
$(QUIET_GEN)$(RM) $@.new $@ && \
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@.new && \
mv $@.new $@
$(QUIET_GEN)$(RM) $@+ $@ && \
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
mv $@+ $@

$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
@@ -445,10 +445,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs

howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt GIT-ASCIIDOCFLAGS
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
sed -e '1,/^$$/d' $< | \
$(TXT_TO_HTML) - >$@.new && \
mv $@.new $@
$(TXT_TO_HTML) - >$@+ && \
mv $@+ $@

install-webdoc : html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)

0 comments on commit ddd892d

Please sign in to comment.
You can’t perform that action at this time.