summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
authorLibravatar Martin Ågren <martin.agren@gmail.com>2019-03-17 19:36:03 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-03-18 15:54:17 +0900
commite605077260080584ec03be039a8c62ed2bd52e81 (patch)
treeeb69793caacfbda4c083b17ae35c0a885bb864a8 /repository.c
parentdoc-diff: support diffing from/to AsciiDoc(tor) (diff)
downloadtgif-e605077260080584ec03be039a8c62ed2bd52e81.tar.xz
doc-diff: add `--cut-header-footer`
AsciiDoc and Asciidoctor do not agree on what to write in the header and footer of each man-page, i.e., the very first and the very last line of *.[157]. Those differences can certainly be interesting in their own right, but they clutter the output of `./doc-diff --from-asciidoc --to-asciidoctor HEAD HEAD` quite a bit since the diff contains some 10-15 lines of noise per file diffed. Teach doc-diff to cut away the first two and last two lines, i.e., the header/footer and the empty line immediately following/preceding it. Because Asciidoctor uses an extra empty line compared to AsciiDoc, remove one more line at each end of the file, but only if it's empty. An alternative approach might be to pass down `--no-header-footer`, which both AsciiDoc and Asciidoctor understand, but it has some drawbacks. First of all, the result doesn't build -- `xmlto` stumbles on the resulting xml since it has multiple root elements. Second, it cuts too much -- dropping the header loses the synopsis, which would be interesting to diff. Like in the previous commit, encode this option into the directory name of the "installed" and "rendered" files. Otherwise, we wouldn't be able to trust that what we use out of that cache actually corresponds to the options given for this run. (We could optimize this caching a little since this flag doesn't affect the contents of "installed" at all, but let's punt on that.) Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.c')
0 files changed, 0 insertions, 0 deletions