Skip to content

Commit 92f8da8

Browse files
phillipwoodgitster
authored andcommitted
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 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6a64ac7 commit 92f8da8

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
@@ -224,6 +224,10 @@ asciidoc.conf: asciidoc.conf.in FORCE
224224
$(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
225225
endif
226226

227+
ifdef WITH_BREAKING_CHANGES
228+
ASCIIDOC_EXTRA += -awith-breaking-changes
229+
endif
230+
227231
ASCIIDOC_DEPS += docinfo.html
228232

229233
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
@@ -284,6 +284,10 @@ elif docs_backend == 'asciidoctor'
284284
]
285285
endif
286286

287+
if get_option('breaking_changes')
288+
asciidoc_common_options += ['--attribute', 'with-breaking-changes']
289+
endif
290+
287291
xmlto = find_program('xmlto', dirs: program_path)
288292

289293
cmd_lists = [

0 commit comments

Comments
 (0)