diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/CodingGuidelines | 37 | ||||
-rw-r--r-- | Documentation/Makefile | 20 | ||||
-rw-r--r-- | Documentation/RelNotes/2.11.1.txt | 48 | ||||
-rw-r--r-- | Documentation/RelNotes/2.12.0.txt | 124 | ||||
-rw-r--r-- | Documentation/SubmittingPatches | 13 | ||||
-rw-r--r-- | Documentation/asciidoctor-extensions.rb | 28 | ||||
-rwxr-xr-x | Documentation/cat-texi.perl | 21 | ||||
-rw-r--r-- | Documentation/config.txt | 7 | ||||
-rw-r--r-- | Documentation/git-relink.txt | 30 | ||||
-rw-r--r-- | Documentation/git-tag.txt | 2 | ||||
-rw-r--r-- | Documentation/git-verify-tag.txt | 2 | ||||
-rw-r--r-- | Documentation/technical/api-hashmap.txt | 4 | ||||
-rw-r--r-- | Documentation/technical/api-in-core-index.txt | 21 | ||||
-rw-r--r-- | Documentation/texi.xsl | 26 |
14 files changed, 286 insertions, 97 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 4cd95da6b1..a4191aa388 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -206,11 +206,38 @@ For C programs: x = 1; } - is frowned upon. A gray area is when the statement extends - over a few lines, and/or you have a lengthy comment atop of - it. Also, like in the Linux kernel, if there is a long list - of "else if" statements, it can make sense to add braces to - single line blocks. + is frowned upon. But there are a few exceptions: + + - When the statement extends over a few lines (e.g., a while loop + with an embedded conditional, or a comment). E.g.: + + while (foo) { + if (x) + one(); + else + two(); + } + + if (foo) { + /* + * This one requires some explanation, + * so we're better off with braces to make + * it obvious that the indentation is correct. + */ + doit(); + } + + - When there are multiple arms to a conditional and some of them + require braces, enclose even a single line block in braces for + consistency. E.g.: + + if (foo) { + doit(); + } else { + one(); + two(); + three(); + } - We try to avoid assignments in the condition of an "if" statement. diff --git a/Documentation/Makefile b/Documentation/Makefile index a9fb497b83..b5be2e2d3f 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -120,6 +120,7 @@ INSTALL_INFO = install-info DOCBOOK2X_TEXI = docbook2x-texi DBLATEX = dblatex ASCIIDOC_DBLATEX_DIR = /etc/asciidoc/dblatex +DBLATEX_COMMON = -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty ifndef PERL_PATH PERL_PATH = /usr/bin/perl endif @@ -173,6 +174,16 @@ ifdef GNU_ROFF XMLTO_EXTRA += -m manpage-quote-apos.xsl endif +ifdef USE_ASCIIDOCTOR +ASCIIDOC = asciidoctor +ASCIIDOC_CONF = +ASCIIDOC_HTML = xhtml5 +ASCIIDOC_DOCBOOK = docbook45 +ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions +ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;' +DBLATEX_COMMON = +endif + SHELL_PATH ?= $(SHELL) # Shell quote; SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) @@ -368,13 +379,14 @@ user-manual.texi: user-manual.xml user-manual.pdf: user-manual.xml $(QUIET_DBLATEX)$(RM) $@+ $@ && \ - $(DBLATEX) -o $@+ -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty $< && \ + $(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \ mv $@+ $@ -gitman.texi: $(MAN_XML) cat-texi.perl +gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ - ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \ - --to-stdout $(xml) &&) true) > $@++ && \ + ($(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 $@+ $@ diff --git a/Documentation/RelNotes/2.11.1.txt b/Documentation/RelNotes/2.11.1.txt index 74b193f1a8..9cd14c8197 100644 --- a/Documentation/RelNotes/2.11.1.txt +++ b/Documentation/RelNotes/2.11.1.txt @@ -116,5 +116,53 @@ Fixes since v2.11 will never come. Teach the client side to notice this condition and abort the transfer. + * Some platforms no longer understand "latin-1" that is still seen in + the wild in e-mail headers; replace them with "iso-8859-1" that is + more widely known when conversion fails from/to it. + + * Update the procedure to generate "tags" for developer support. + + * Update the definition of the MacOSX test environment used by + TravisCI. + + * A few git-svn updates. + + * Compression setting for producing packfiles were spread across + three codepaths, one of which did not honor any configuration. + Unify these so that all of them honor core.compression and + pack.compression variables the same way. + + * "git fast-import" sometimes mishandled while rebalancing notes + tree, which has been fixed. + + * Recent update to the default abbreviation length that auto-scales + lacked documentation update, which has been corrected. + + * Leakage of lockfiles in the config subsystem has been fixed. + + * It is natural that "git gc --auto" may not attempt to pack + everything into a single pack, and there is no point in warning + when the user has configured the system to use the pack bitmap, + leading to disabling further "gc". + + * "git archive" did not read the standard configuration files, and + failed to notice a file that is marked as binary via the userdiff + driver configuration. + + * "git blame --porcelain" misidentified the "previous" <commit, path> + pair (aka "source") when contents came from two or more files. + + * "git rebase -i" with a recent update started showing an incorrect + count when squashing more than 10 commits. + + * "git <cmd> @{push}" on a detached HEAD used to segfault; it has + been corrected to error out with a message. + + * Tighten a test to avoid mistaking an extended ERE regexp engine as + a PRE regexp engine. + + * Typing ^C to pager, which usually does not kill it, killed Git and + took the pager down as a collateral damage in certain process-tree + structure. This has been fixed. Also contains various documentation updates and code clean-ups. diff --git a/Documentation/RelNotes/2.12.0.txt b/Documentation/RelNotes/2.12.0.txt index 17409fa147..9c3f94ae2d 100644 --- a/Documentation/RelNotes/2.12.0.txt +++ b/Documentation/RelNotes/2.12.0.txt @@ -11,8 +11,10 @@ Backward compatibility notes. is not scheduled to happen in the upcoming release (yet). * The historical argument order "git merge <msg> HEAD <commit>..." - has been deprecated for quite some time, and will be removed in the - upcoming release. + has been deprecated for quite some time, and will be removed in a + future release. + + * An ancient script "git relink" has been removed. Updates since v2.11 @@ -64,7 +66,6 @@ UI, Workflows & Features * Some platforms no longer understand "latin-1" that is still seen in the wild in e-mail headers; replace them with "iso-8859-1" that is more widely known when conversion fails from/to it. - (merge df3755888b jc/latin-1 later to maint). * "git grep" has been taught to optionally recurse into submodules. @@ -85,6 +86,30 @@ UI, Workflows & Features same release were present (e.g. when 2.0, 2.0-beta1, and 2.0-beta2 are there and the code needs to compare 2.0-beta1 and 2.0-beta2). + * "git submodule push" learned "--recurse-submodules=only option to + push submodules out without pushing the top-level superproject. + + * "git tag" and "git verify-tag" learned to put GPG verification + status in their "--format=<placeholders>" output format. + + * An ancient repository conversion tool left in contrib/ has been + removed. + + * "git show-ref HEAD" used with "--verify" because the user is not + interested in seeing refs/remotes/origin/HEAD, and used with + "--head" because the user does not want HEAD to be filtered out, + i.e. "git show-ref --head --verify HEAD", did not work as expected. + + * "git submodule add" used to be confused and refused to add a + locally created repository; users can now use "--force" option + to add them. + (merge 619acfc78c sb/submodule-add-force later to maint). + + * Some people feel the default set of colors used by "git log --graph" + rather limiting. A mechanism to customize the set of colors has + been introduced. + (merge 512aba261a nd/log-graph-configurable-colors later to maint). + Performance, Internal Implementation, Development Support etc. @@ -101,7 +126,6 @@ Performance, Internal Implementation, Development Support etc. * The character width table has been updated to match Unicode 9.0 * Update the procedure to generate "tags" for developer support. - (merge 046e4c1c09 jk/make-tags-find-sources-tweak later to maint). * The codeflow of setting NOATIME and CLOEXEC on file descriptors Git opens has been simplified. @@ -131,6 +155,15 @@ Performance, Internal Implementation, Development Support etc. * Adjust documentation to help AsciiDoctor render better while not breaking the rendering done by AsciiDoc. + * The sequencer machinery has been further enhanced so that a later + set of patches can start using it to reimplement "rebase -i". + + * Update the definition of the MacOSX test environment used by + TravisCI. + + * Rewrite a scripted porcelain "git difftool" in C. + (merge 94d3997ecc js/difftool-builtin later to maint). + Also contains various documentation updates and code clean-ups. @@ -148,7 +181,6 @@ notes for details). * "git svn" did not work well with path components that are "0", and some configuration variable it uses were not documented. - (merge ea9a93dcc2 ew/svn-fixes later to maint). * "git rev-parse --symbolic" failed with a more recent notation like "HEAD^-1" and "HEAD^!". @@ -271,41 +303,32 @@ notes for details). three codepaths, one of which did not honor any configuration. Unify these so that all of them honor core.compression and pack.compression variables the same way. - (merge 8de7eeb54b jc/compression-config later to maint). * "git fast-import" sometimes mishandled while rebalancing notes tree, which has been fixed. - (merge 405d7f4af6 mh/fast-import-notes-fix-new later to maint). * Recent update to the default abbreviation length that auto-scales lacked documentation update, which has been corrected. - (merge 48d5014dd4 jc/abbrev-autoscale-config later to maint). * Leakage of lockfiles in the config subsystem has been fixed. - (merge c06fa62dfc nd/config-misc-fixes later to maint). * It is natural that "git gc --auto" may not attempt to pack everything into a single pack, and there is no point in warning when the user has configured the system to use the pack bitmap, leading to disabling further "gc". - (merge 1c409a705c dt/disable-bitmap-in-auto-gc later to maint). * "git archive" did not read the standard configuration files, and failed to notice a file that is marked as binary via the userdiff driver configuration. - (merge 965cba2e7e jk/archive-zip-userdiff-config later to maint). * "git blame --porcelain" misidentified the "previous" <commit, path> pair (aka "source") when contents came from two or more files. - (merge 4e76832984 jk/blame-fixes later to maint). * "git rebase -i" with a recent update started showing an incorrect count when squashing more than 10 commits. - (merge 356b8ecff1 jk/rebase-i-squash-count-fix later to maint). * "git <cmd> @{push}" on a detached HEAD used to segfault; it has been corrected to error out with a message. - (merge b10731f43d km/branch-get-push-while-detached later to maint). * Running "git add a/b" when "a" is a submodule correctly errored out, but without a meaningful error message. @@ -314,7 +337,6 @@ notes for details). * Typing ^C to pager, which usually does not kill it, killed Git and took the pager down as a collateral damage in certain process-tree structure. This has been fixed. - (merge 46df6906f3 jk/execv-dashed-external later to maint). * "git mergetool" without any pathspec on the command line that is run from a subdirectory became no-op in Git v2.11 by mistake, which @@ -325,11 +347,77 @@ notes for details). * Tighten a test to avoid mistaking an extended ERE regexp engine as a PRE regexp engine. - (merge 7675c7bd01 jk/grep-e-could-be-extended-beyond-posix later to maint). + + * An error message with an ASCII control character like '\r' in it + can alter the message to hide its early part, which is problematic + when a remote side gives such an error message that the local side + will relay with a "remote: " prefix. + (merge f290089879 jk/vreport-sanitize later to maint). + + * "git fsck" inspects loose objects more carefully now. + (merge cce044df7f jk/loose-object-fsck later to maint). + + * A crashing bug introduced in v2.11 timeframe has been found (it is + triggerable only in fast-import) and fixed. + (merge abd5a00268 jk/clear-delta-base-cache-fix later to maint). + + * With an anticipatory tweak for remotes defined in ~/.gitconfig + (e.g. "remote.origin.prune" set to true, even though there may or + may not actually be "origin" remote defined in a particular Git + repository), "git remote rename" and other commands misinterpreted + and behaved as if such a non-existing remote actually existed. + (merge e459b073fb js/remote-rename-with-half-configured-remote later to maint). + + * A few codepaths had to rely on a global variable when sorting + elements of an array because sort(3) API does not allow extra data + to be passed to the comparison function. Use qsort_s() when + natively available, and a fallback implementation of it when not, + to eliminate the need, which is a prerequisite for making the + codepath reentrant. + (merge 83fc4d64fe rs/qsort-s later to maint). + + * "git fsck --connectivity-check" was not working at all. + (merge a2b22854bd jk/fsck-connectivity-check-fix later to maint). + + * After starting "git rebase -i", which first opens the user's editor + to edit the series of patches to apply, but before saving the + contents of that file, "git status" failed to show the current + state (i.e. you are in an interactive rebase session, but you have + applied no steps yet) correctly. + (merge df9ded4984 js/status-pre-rebase-i later to maint). + + * Test tweak for FreeBSD where /usr/bin/unzip is unsuitable to run + our tests but /usr/local/bin/unzip is usable. + (merge d98b2c5fce js/unzip-in-usr-bin-workaround later to maint). + + * "git p4" did not work well with multiple git-p4.mapUser entries on + Windows. + (merge c3c2b05776 gv/mingw-p4-mapuser later to maint). + + * "git help" enumerates executable files in $PATH; the implementation + of "is this file executable?" on Windows has been optimized. + (merge c755015f79 hv/mingw-help-is-executable later to maint). + + * Test tweaks for those who have default ACL in their git source tree + that interfere with the umask test. + (merge d549d21307 mm/reset-facl-before-umask-test later to maint). + + * Names of the various hook scripts must be spelled exactly, but on + Windows, an .exe binary must be named with .exe suffix; notice + $GIT_DIR/hooks/<hookname>.exe as a valid <hookname> hook. + (merge 235be51fbe js/mingw-hooks-with-exe-suffix later to maint). + + * Asciidoctor, an alternative reimplementation of AsciiDoc, still + needs some changes to work with documents meant to be formatted + with AsciiDoc. "make USE_ASCIIDOCTOR=YesPlease" to use it out of + the box to document our pages is getting closer to reality. + (merge 55d2d812e4 bc/use-asciidoctor-opt later to maint). * Other minor doc, test and build updates and code cleanups. (merge f2627d9b19 sb/submodule-config-cleanup later to maint). (merge 384f1a167b sb/unpack-trees-cleanup later to maint). - (merge 3f05402ac0 ad/bisect-terms later to maint). (merge 874444b704 rh/diff-orderfile-doc later to maint). - (merge c68d2d7c2b ws/request-pull-code-cleanup later to maint). + (merge eafd5d9483 cw/doc-sign-off later to maint). + (merge 0aaad415bc rs/absolute-pathdup later to maint). + (merge 4432dd6b5b rs/receive-pack-cleanup later to maint). + (merge 540a398e9c sg/mailmap-self later to maint). diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 08352deaae..3faf7eb884 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches @@ -216,12 +216,11 @@ that it will be postponed. Exception: If your mailer is mangling patches then someone may ask you to re-send them using MIME, that is OK. -Do not PGP sign your patch, at least for now. Most likely, your -maintainer or other people on the list would not have your PGP -key and would not bother obtaining it anyway. Your patch is not -judged by who you are; a good patch from an unknown origin has a -far better chance of being accepted than a patch from a known, -respected origin that is done poorly or does incorrect things. +Do not PGP sign your patch. Most likely, your maintainer or other people on the +list would not have your PGP key and would not bother obtaining it anyway. +Your patch is not judged by who you are; a good patch from an unknown origin +has a far better chance of being accepted than a patch from a known, respected +origin that is done poorly or does incorrect things. If you really really really really want to do a PGP signed patch, format it as "multipart/signed", not a text/plain message @@ -246,7 +245,7 @@ patch. *2* The mailing list: git@vger.kernel.org -(5) Sign your work +(5) Certify your work by adding your "Signed-off-by: " line To improve tracking of who did what, we've borrowed the "sign-off" procedure from the Linux kernel project on patches diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb new file mode 100644 index 0000000000..ec83b4959e --- /dev/null +++ b/Documentation/asciidoctor-extensions.rb @@ -0,0 +1,28 @@ +require 'asciidoctor' +require 'asciidoctor/extensions' + +module Git + module Documentation + class LinkGitProcessor < Asciidoctor::Extensions::InlineMacroProcessor + use_dsl + + named :chrome + + def process(parent, target, attrs) + if parent.document.basebackend? 'html' + prefix = parent.document.attr('git-relative-html-prefix') + %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>\n) + elsif parent.document.basebackend? 'docbook' + "<citerefentry>\n" \ + "<refentrytitle>#{target}</refentrytitle>" \ + "<manvolnum>#{attrs[1]}</manvolnum>\n" \ + "</citerefentry>\n" + end + end + end + end +end + +Asciidoctor::Extensions.register do + inline_macro Git::Documentation::LinkGitProcessor, :linkgit +end diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl index 87437f8a95..14d2f83415 100755 --- a/Documentation/cat-texi.perl +++ b/Documentation/cat-texi.perl @@ -1,9 +1,12 @@ #!/usr/bin/perl -w +use strict; +use warnings; + my @menu = (); my $output = $ARGV[0]; -open TMP, '>', "$output.tmp"; +open my $tmp, '>', "$output.tmp"; while (<STDIN>) { next if (/^\\input texinfo/../\@node Top/); @@ -11,13 +14,13 @@ while (<STDIN>) { if (s/^\@top (.*)/\@node $1,,,Top/) { push @menu, $1; } - s/\(\@pxref{\[(URLS|REMOTES)\]}\)//; + s/\(\@pxref\{\[(URLS|REMOTES)\]}\)//; s/\@anchor\{[^{}]*\}//g; - print TMP; + print $tmp $_; } -close TMP; +close $tmp; -printf '\input texinfo +print '\input texinfo @setfilename gitman.info @documentencoding UTF-8 @dircategory Development @@ -28,16 +31,16 @@ printf '\input texinfo @top Git Manual Pages @documentlanguage en @menu -', $menu[0]; +'; for (@menu) { print "* ${_}::\n"; } print "\@end menu\n"; -open TMP, '<', "$output.tmp"; -while (<TMP>) { +open $tmp, '<', "$output.tmp"; +while (<$tmp>) { print; } -close TMP; +close $tmp; print "\@bye\n"; unlink "$output.tmp"; diff --git a/Documentation/config.txt b/Documentation/config.txt index af2ae4cc02..fc78139c21 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -170,6 +170,9 @@ The position of any attributes with respect to the colors be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`, `no-ul`, etc). + +An empty color string produces no color effect at all. This can be used +to avoid coloring specific elements without disabling color entirely. ++ For git's pre-defined color slots, the attributes are meant to be reset at the beginning of each item in the colored output. So setting `color.decorate.branch` to `black` will paint that branch name in a @@ -2036,6 +2039,10 @@ log.follow:: i.e. it cannot be used to follow multiple files and does not work well on non-linear history. +log.graphColors:: + A list of colors, separated by commas, that can be used to draw + history lines in `git log --graph`. + log.showRoot:: If true, the initial commit will be shown as a big creation event. This is equivalent to a diff against an empty tree. diff --git a/Documentation/git-relink.txt b/Documentation/git-relink.txt deleted file mode 100644 index 3b33c99510..0000000000 --- a/Documentation/git-relink.txt +++ /dev/null @@ -1,30 +0,0 @@ -git-relink(1) -============= - -NAME ----- -git-relink - Hardlink common objects in local repositories - -SYNOPSIS --------- -[verse] -'git relink' [--safe] <dir>... <master_dir> - -DESCRIPTION ------------ -This will scan 1 or more object repositories and look for objects in common -with a master repository. Objects not already hardlinked to the master -repository will be replaced with a hardlink to the master repository. - -OPTIONS -------- ---safe:: - Stops if two objects with the same hash exist but have different sizes. - Default is to warn and continue. - -<dir>:: - Directories containing a .git/objects/ subdirectory. - -GIT ---- -Part of the linkgit:git[1] suite diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index 5055a96823..8e70c5b6a4 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -15,7 +15,7 @@ SYNOPSIS 'git tag' [-n[<num>]] -l [--contains <commit>] [--points-at <object>] [--column[=<options>] | --no-column] [--create-reflog] [--sort=<key>] [--format=<format>] [--[no-]merged [<commit>]] [<pattern>...] -'git tag' -v <tagname>... +'git tag' -v [--format=<format>] <tagname>... DESCRIPTION ----------- diff --git a/Documentation/git-verify-tag.txt b/Documentation/git-verify-tag.txt index d590edcebd..0b8075dad9 100644 --- a/Documentation/git-verify-tag.txt +++ b/Documentation/git-verify-tag.txt @@ -8,7 +8,7 @@ git-verify-tag - Check the GPG signature of tags SYNOPSIS -------- [verse] -'git verify-tag' <tag>... +'git verify-tag' [--format=<format>] <tag>... DESCRIPTION ----------- diff --git a/Documentation/technical/api-hashmap.txt b/Documentation/technical/api-hashmap.txt index 28f5a8b715..a3f020cd9e 100644 --- a/Documentation/technical/api-hashmap.txt +++ b/Documentation/technical/api-hashmap.txt @@ -188,7 +188,9 @@ Returns the removed entry, or NULL if not found. `void *hashmap_iter_next(struct hashmap_iter *iter)`:: `void *hashmap_iter_first(struct hashmap *map, struct hashmap_iter *iter)`:: - Used to iterate over all entries of a hashmap. + Used to iterate over all entries of a hashmap. Note that it is + not safe to add or remove entries to the hashmap while + iterating. + `hashmap_iter_init` initializes a `hashmap_iter` structure. + diff --git a/Documentation/technical/api-in-core-index.txt b/Documentation/technical/api-in-core-index.txt deleted file mode 100644 index adbdbf5d75..0000000000 --- a/Documentation/technical/api-in-core-index.txt +++ /dev/null @@ -1,21 +0,0 @@ -in-core index API -================= - -Talk about <read-cache.c> and <cache-tree.c>, things like: - -* cache -> the_index macros -* read_index() -* write_index() -* ie_match_stat() and ie_modified(); how they are different and when to - use which. -* index_name_pos() -* remove_index_entry_at() -* remove_file_from_index() -* add_file_to_index() -* add_index_entry() -* refresh_index() -* discard_index() -* cache_tree_invalidate_path() -* cache_tree_update() - -(JC, Linus) diff --git a/Documentation/texi.xsl b/Documentation/texi.xsl new file mode 100644 index 0000000000..0f8ff07eca --- /dev/null +++ b/Documentation/texi.xsl @@ -0,0 +1,26 @@ +<!-- texi.xsl: + convert refsection elements into refsect elements that docbook2texi can + understand --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:output method="xml" + encoding="UTF-8" + doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" + doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" /> + +<xsl:template match="//refsection"> + <xsl:variable name="element">refsect<xsl:value-of select="count(ancestor-or-self::refsection)" /></xsl:variable> + <xsl:element name="{$element}"> + <xsl:apply-templates select="@*|node()" /> + </xsl:element> +</xsl:template> + +<!-- Copy all other nodes through. --> +<xsl:template match="node()|@*"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" /> + </xsl:copy> +</xsl:template> + +</xsl:stylesheet> |