Skip to content

Commit 5feb880

Browse files
committed
docs: fix repository-layout when building with breaking changes
Since commit 8ccc75c (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 c5bc9a7 (Makefile: wire up build option for deprecated features, 2025-01-22). This is to avoid the awkward double negative !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 <[email protected]>
1 parent 0394451 commit 5feb880

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Documentation/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ asciidoc.conf: asciidoc.conf.in FORCE
221221
$(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
222222
endif
223223

224+
ifdef WITH_BREAKING_CHANGES
225+
ASCIIDOC_EXTRA += -awith-breaking-changes
226+
endif
227+
224228
ASCIIDOC_DEPS += docinfo.html
225229

226230
SHELL_PATH ?= $(SHELL)

Documentation/gitrepository-layout.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ config.worktree::
152152
working directory in multiple working directory setup (see
153153
linkgit:git-worktree[1]).
154154

155+
ifndef::with-breaking-changes[]
155156
branches::
156157
A deprecated way to store shorthands to be used
157158
to specify a URL to 'git fetch', 'git pull' and 'git push'.
@@ -164,6 +165,7 @@ branches::
164165
"$GIT_COMMON_DIR/branches" will be used instead.
165166
+
166167
Git will stop reading remotes from this directory in Git 3.0.
168+
endif::with-breaking-changes[]
167169

168170
hooks::
169171
Hooks are customization scripts used by various Git
@@ -231,6 +233,7 @@ info/sparse-checkout::
231233
This file stores sparse checkout patterns.
232234
See also: linkgit:git-read-tree[1].
233235

236+
ifndef::with-breaking-changes[]
234237
remotes::
235238
Stores shorthands for URL and default refnames for use
236239
when interacting with remote repositories via 'git fetch',
@@ -241,6 +244,7 @@ remotes::
241244
"$GIT_COMMON_DIR/remotes" will be used instead.
242245
+
243246
Git will stop reading remotes from this directory in Git 3.0.
247+
endif::with-breaking-changes[]
244248

245249
logs::
246250
Records of changes made to refs are stored in this directory.

Documentation/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ elif docs_backend == 'asciidoctor'
283283
]
284284
endif
285285

286+
if get_option('breaking_changes')
287+
asciidoc_common_options += ['--attribute', 'with-breaking-changes']
288+
endif
289+
286290
git = find_program('git', required: false)
287291
xmlto = find_program('xmlto')
288292

0 commit comments

Comments
 (0)