git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>,
	Junio C Hamano <gitster@pobox.com>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Phillip Wood <phillip.wood@dunelm.org.uk>,
	Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: [PATCH v2] docs: fix repository-layout when building with breaking changes
Date: Wed, 05 Mar 2025 10:42:37 +0000	[thread overview]
Message-ID: <pull.1871.v2.git.1741171357627.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1871.git.1741018310447.gitgitgadget@gmail.com>

From: Phillip Wood <phillip.wood@dunelm.org.uk>

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>
---
    docs: fix repository-layout when building with breaking changes
    
    Thanks to Junio and Patrick for their comments on V1. I've renamed the
    attribute to with-breaking-changes as suggested. I'll add a patch to
    rename the test prerequisite to match this when I re-roll
    https://lore.kernel.org/git/pull.1863.git.1740149837.gitgitgadget@gmail.com/
    to use WITH_BREAKING_CHANGES.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1871%2Fphillipwood%2Fbreaking-changes-documentation-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1871/phillipwood/breaking-changes-documentation-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1871

Range-diff vs v1:

 1:  42877011c6d ! 1:  d8dcdca4c2b docs: fix repository-layout when building with breaking changes
     @@ Commit message
          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
     -    "without-breaking-changes" and use it to make the inclusion of those
     -    sections of the documentation conditional. The name of the attribute is
     -    based on the similar test prerequisite added in c5bc9a7f94a (Makefile:
     -    wire up build option for deprecated features, 2025-01-22).
     +    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>
      
     @@ Documentation/Makefile: asciidoc.conf: asciidoc.conf.in FORCE
       	$(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
       endif
       
     -+ifndef WITH_BREAKING_CHANGES
     -+ASCIIDOC_EXTRA += -awithout-breaking-changes
     ++ifdef WITH_BREAKING_CHANGES
     ++ASCIIDOC_EXTRA += -awith-breaking-changes
      +endif
      +
       ASCIIDOC_DEPS += docinfo.html
     @@ Documentation/gitrepository-layout.adoc: config.worktree::
       	working directory in multiple working directory setup (see
       	linkgit:git-worktree[1]).
       
     -+ifdef::without-breaking-changes[]
     ++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'.
     @@ Documentation/gitrepository-layout.adoc: branches::
       	"$GIT_COMMON_DIR/branches" will be used instead.
       +
       Git will stop reading remotes from this directory in Git 3.0.
     -+endif::without-breaking-changes[]
     ++endif::with-breaking-changes[]
       
       hooks::
       	Hooks are customization scripts used by various Git
     @@ Documentation/gitrepository-layout.adoc: info/sparse-checkout::
       	This file stores sparse checkout patterns.
       	See also: linkgit:git-read-tree[1].
       
     -+ifdef::without-breaking-changes[]
     ++ifndef::with-breaking-changes[]
       remotes::
       	Stores shorthands for URL and default refnames for use
       	when interacting with remote repositories via 'git fetch',
     @@ Documentation/gitrepository-layout.adoc: remotes::
       	"$GIT_COMMON_DIR/remotes" will be used instead.
       +
       Git will stop reading remotes from this directory in Git 3.0.
     -+endif::without-breaking-changes[]
     ++endif::with-breaking-changes[]
       
       logs::
       	Records of changes made to refs are stored in this directory.
     @@ Documentation/meson.build: elif docs_backend == 'asciidoctor'
         ]
       endif
       
     -+if not get_option('breaking_changes')
     -+   asciidoc_common_options += ['--attribute', 'without-breaking-changes']
     ++if get_option('breaking_changes')
     ++   asciidoc_common_options += ['--attribute', 'with-breaking-changes']
      +endif
      +
     - git = find_program('git', required: false)
     - xmlto = find_program('xmlto')
     + xmlto = find_program('xmlto', dirs: program_path)
       
     + cmd_lists = [


 Documentation/Makefile                  | 4 ++++
 Documentation/gitrepository-layout.adoc | 4 ++++
 Documentation/meson.build               | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index c9a7cf662f0..671267a8ac7 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -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)
diff --git a/Documentation/gitrepository-layout.adoc b/Documentation/gitrepository-layout.adoc
index 6348ef1dcdf..7421ef956d3 100644
--- a/Documentation/gitrepository-layout.adoc
+++ b/Documentation/gitrepository-layout.adoc
@@ -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.
diff --git a/Documentation/meson.build b/Documentation/meson.build
index 0a0f2bfa14a..594546d68b1 100644
--- a/Documentation/meson.build
+++ b/Documentation/meson.build
@@ -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 = [

base-commit: db91954e18654eeebc54c900f44c704002e1866d
-- 
gitgitgadget

  parent reply	other threads:[~2025-03-05 10:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 16:11 [PATCH] docs: fix repository-layout when building with breaking changes Phillip Wood via GitGitGadget
2025-03-03 18:18 ` Junio C Hamano
2025-03-04  6:35   ` Patrick Steinhardt
2025-03-04 10:23     ` Phillip Wood
2025-03-04 16:04       ` Junio C Hamano
2025-03-05 10:42 ` Phillip Wood via GitGitGadget [this message]
2025-03-05 15:53   ` [PATCH] docs: fix check-docs with WITH_BREAKING_CHANGES Junio C Hamano
2025-03-07 10:32     ` Phillip Wood
2025-03-07 15:07       ` Phillip Wood
2025-03-07 19:55         ` Junio C Hamano
2025-03-07 22:42         ` Karthik Nayak
2025-03-09 10:52           ` Phillip Wood
2025-03-09 10:52         ` Phillip Wood
2025-03-10  6:42           ` Patrick Steinhardt
2025-03-11 14:40             ` Patrick Steinhardt
2025-03-12 10:39               ` phillip.wood123
2025-03-12 13:43                 ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1871.v2.git.1741171357627.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).