doc: add caveat about turning off commit-graph

The doc `technical/commit-graph.adoc` says that replace objects and commit grafts turn off commit-graph: Commit grafts and replace objects can change the shape of the commit history. The latter can also be enabled/disabled on the fly using `--no-replace-objects`. This leads to difficulty storing both possible interpretations of a commit id, especially when computing generation numbers. The commit-graph will not be read or written when replace-objects or grafts are present. But this isn’t mentioned in the user-facing doc. Let’s mention it on git-replace(1) and git-commit-graph(1). Acked-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kristoffer Haugsbakk committed May 7, 2026 at 21:42 UTC 48c855bb8f17b86188a704cf8c0c5b4f6a316ade
2 files changed +13
Documentation/git-commit-graph.adoc
+6
@@ -146,6 +146,12 @@ $ git show-ref -s | git commit-graph write --stdin-commits
146 $ git rev-parse HEAD | git commit-graph write --stdin-commits --append
147 ------------------------------------------------
148
149 +CAVEATS
150 +-------
151 +
152 +The existence of replace objects or commit grafts turns off reading or
153 +writing to the commit-graph. See linkgit:git-replace[1].
154 +
155 CONFIGURATION
156 -------------
157
Documentation/git-replace.adoc
+7
@@ -145,6 +145,13 @@ commit instead of the replaced commit.
145 There may be other problems when using 'git rev-list' related to
146 pending objects.
147
148 +CAVEATS
149 +-------
150 +
151 +The existence of replace objects or commit grafts turns off reading or
152 +writing to the commit-graph, which can cause performance issues. See
153 +linkgit:git-commit-graph[1].
154 +
155 SEE ALSO
156 --------
157 linkgit:git-hash-object[1]