]> git.ipfire.org Git - thirdparty/git.git/commitdiff
docs: fix repository-layout when building with breaking changes
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 5 Mar 2025 10:42:37 +0000 (10:42 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Mar 2025 15:25:11 +0000 (07:25 -0800)
Since commit 8ccc75c2452 (remote: announce removal of "branches/" and
"remotes/", 2025-01-22) enabling WITH_BREAKING_CHANGES when building git
removes support for reading branches from ".git/branches" and remotes
from ".git/remotes". However those locations are still documented in
gitrepository-layout.adoc even though the build does not support them.

Rectify this by adding a new document attribute "with-breaking-changes"
and use it to make the inclusion of those sections of the documentation
conditional. Note that the name of the attribute does not match the test
prerequisite WITHOUT_BREAKING_CHANGES added in c5bc9a7f94a (Makefile:
wire up build option for deprecated features, 2025-01-22). This is to
avoid the awkward double negative ifndef::without_breaking_changes for
documentation that should be included when WITH_BREAKING_CHANGES is
enabled. The test prerequisite will be renamed to match the
documentation attribute in a future patch series.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/Makefile
Documentation/gitrepository-layout.adoc
Documentation/meson.build

index c9a7cf662f0c43a22566273cc014f18d82528836..671267a8ac7af6c298af716b4be1a0b4900be396 100644 (file)
@@ -224,6 +224,10 @@ asciidoc.conf: asciidoc.conf.in FORCE
        $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
 endif
 
+ifdef WITH_BREAKING_CHANGES
+ASCIIDOC_EXTRA += -awith-breaking-changes
+endif
+
 ASCIIDOC_DEPS += docinfo.html
 
 SHELL_PATH ?= $(SHELL)
index 6348ef1dcdf842d628b219b1e7bc6fbae6be8981..7421ef956d35ac626a19c3af5c4cc18491695dd2 100644 (file)
@@ -152,6 +152,7 @@ config.worktree::
        working directory in multiple working directory setup (see
        linkgit:git-worktree[1]).
 
+ifndef::with-breaking-changes[]
 branches::
        A deprecated way to store shorthands to be used
        to specify a URL to 'git fetch', 'git pull' and 'git push'.
@@ -164,6 +165,7 @@ branches::
        "$GIT_COMMON_DIR/branches" will be used instead.
 +
 Git will stop reading remotes from this directory in Git 3.0.
+endif::with-breaking-changes[]
 
 hooks::
        Hooks are customization scripts used by various Git
@@ -231,6 +233,7 @@ info/sparse-checkout::
        This file stores sparse checkout patterns.
        See also: linkgit:git-read-tree[1].
 
+ifndef::with-breaking-changes[]
 remotes::
        Stores shorthands for URL and default refnames for use
        when interacting with remote repositories via 'git fetch',
@@ -241,6 +244,7 @@ remotes::
        "$GIT_COMMON_DIR/remotes" will be used instead.
 +
 Git will stop reading remotes from this directory in Git 3.0.
+endif::with-breaking-changes[]
 
 logs::
        Records of changes made to refs are stored in this directory.
index 0a0f2bfa14ab88be2aa916622704a6d768ce4781..594546d68b12c1a72efd6e1cdf84ad9006ad5eba 100644 (file)
@@ -284,6 +284,10 @@ elif docs_backend == 'asciidoctor'
   ]
 endif
 
+if get_option('breaking_changes')
+   asciidoc_common_options += ['--attribute', 'with-breaking-changes']
+endif
+
 xmlto = find_program('xmlto', dirs: program_path)
 
 cmd_lists = [