git/Documentation
Jeff King a12382f994 MIDX: revert the default version to v1
We introduced midx version 2 in b2ec8e90c2 (midx: do not require packs
to be sorted in lexicographic order, 2026-02-24) and now write it by
default. The rationale was that older versions should ignore the v2 midx
and fall back to using the packs (just like we do for other midx
errors). Unfortunately this is not the case, as we have a hard die()
when we see an unknown midx version.

As a result, writing a midx with Git 2.54-rc2 puts the repository into a
state that is unusable with Git 2.53. And this midx write may happen
behind the scenes as part of normal operations, like fetch.

Let's switch back to writing v1 by default to avoid regressing the case
where multiple versions of Git are used on the same repository.

There is one gotcha, though: the v2 format is required for some new
features, like midx compaction, and running "git multi-pack-index
compact" will complain when asked to write a v1 index. The user must set
midx.version to "2" to make the feature work.

So instead of always using v1, we'll base the default on whether the
requested feature requires v2. That does mean that running midx
compaction will create a repository that can't be read by older versions
of Git. But we never do that by default; only people experimenting with
the new feature will be affected.

We have to adjust the test expectation in t5319, since it will now
generate v1 files. And our "auto-select v2" is covered by the tests in
t5335, which continue to check that compaction works without having to
set midx.version manually (and also explicitly check that asking for v1
with compaction reports the problem).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-04-16 13:45:53 -07:00
..
RelNotes The 20th batch 2026-03-24 12:31:34 -07:00
config Merge branch 'hn/status-compare-with-push' 2026-03-12 14:09:06 -07:00
howto
includes
mergetools
technical
.gitignore
BreakingChanges.adoc
CodingGuidelines Merge branch 'lo/repo-leftover-bits' 2026-03-04 10:53:01 -08:00
DecisionMaking.adoc
Makefile
MyFirstContribution.adoc Merge branch 'sd/doc-my1c-api-config-reference-fix' 2026-02-13 13:39:26 -08:00
MyFirstObjectWalk.adoc
ReviewingGuidelines.adoc
SubmittingPatches Merge branch 'jc/doc-wholesale-replace-before-next' 2026-03-19 09:54:56 -07:00
ToolsForGit.adoc
asciidoc.conf.in doc: convert git-show to synopsis style 2026-02-05 21:14:05 -08:00
asciidoctor-extensions.rb.in
blame-options.adoc
build-docdep.perl
cat-texi.perl
cmd-list.sh
config.adoc
date-formats.adoc
diff-algorithm-option.adoc
diff-context-options.adoc diff: document -U without <n> as using default context 2026-03-10 06:17:59 -07:00
diff-format.adoc
diff-generate-patch.adoc
diff-options.adoc Merge branch 'ty/doc-diff-u-wo-number' 2026-03-24 12:31:34 -07:00
doc-diff
docbook-xsl.css
docbook.xsl
docinfo-html.in
everyday.adoco
fetch-options.adoc Merge branch 'db/doc-fetch-jobs-auto' 2026-02-27 15:11:54 -08:00
fix-texi.sh
for-each-ref-options.adoc doc: fix some style issues in git-clone and for-each-ref-options 2026-02-05 21:14:05 -08:00
format-patch-caveats.adoc doc: add caveat about round-tripping format-patch 2026-02-12 14:37:56 -08:00
format-patch-end-of-commit-message.adoc doc: add caveat about round-tripping format-patch 2026-02-12 14:37:56 -08:00
fsck-msgids.adoc
generate-mergetool-list.sh
git-add.adoc Documentation: update add --force option + ignore=all config 2026-02-06 09:43:26 -08:00
git-am.adoc Merge branch 'kh/doc-am-xref' 2026-03-02 17:06:52 -08:00
git-annotate.adoc
git-apply.adoc
git-archimport.adoc
git-archive.adoc
git-backfill.adoc
git-bisect-lk2009.adoc
git-bisect.adoc
git-blame.adoc
git-branch.adoc
git-bugreport.adoc
git-bundle.adoc
git-cat-file.adoc
git-check-attr.adoc
git-check-ignore.adoc
git-check-mailmap.adoc
git-check-ref-format.adoc
git-checkout-index.adoc
git-checkout.adoc
git-cherry-pick.adoc
git-cherry.adoc
git-citool.adoc
git-clean.adoc
git-clone.adoc Merge branch 'cc/lop-filter-auto' 2026-02-25 11:54:17 -08:00
git-column.adoc
git-commit-graph.adoc
git-commit-tree.adoc
git-commit.adoc
git-config.adoc config: make 'git config list --type=<X>' work 2026-02-23 13:23:40 -08:00
git-count-objects.adoc
git-credential-cache--daemon.adoc
git-credential-cache.adoc
git-credential-store.adoc
git-credential.adoc
git-cvsexportcommit.adoc
git-cvsimport.adoc
git-cvsserver.adoc
git-daemon.adoc
git-describe.adoc
git-diagnose.adoc
git-diff-files.adoc
git-diff-index.adoc
git-diff-pairs.adoc
git-diff-tree.adoc
git-diff.adoc
git-difftool.adoc
git-fast-export.adoc
git-fast-import.adoc fast-import: add mode to sign commits with invalid signatures 2026-03-12 21:28:20 -07:00
git-fetch-pack.adoc
git-fetch.adoc
git-filter-branch.adoc
git-fmt-merge-msg.adoc
git-for-each-ref.adoc
git-for-each-repo.adoc
git-format-patch.adoc Merge branch 'mf/format-patch-honor-from-for-cover-letter' 2026-02-27 15:11:54 -08:00
git-fsck-objects.adoc
git-fsck.adoc
git-fsmonitor--daemon.adoc
git-gc.adoc
git-get-tar-commit-id.adoc
git-grep.adoc
git-gui.adoc
git-hash-object.adoc
git-help.adoc
git-history.adoc builtin/history: implement "split" subcommand 2026-03-03 15:09:37 -08:00
git-hook.adoc hook: add -z option to "git hook list" 2026-02-19 13:24:57 -08:00
git-http-backend.adoc
git-http-fetch.adoc
git-http-push.adoc
git-imap-send.adoc
git-index-pack.adoc
git-init-db.adoc
git-init.adoc
git-instaweb.adoc
git-interpret-trailers.adoc
git-last-modified.adoc last-modified: change default max-depth to 0 2026-01-20 14:13:04 -08:00
git-log.adoc
git-ls-files.adoc
git-ls-remote.adoc
git-ls-tree.adoc
git-mailinfo.adoc
git-mailsplit.adoc
git-maintenance.adoc
git-merge-base.adoc
git-merge-file.adoc merge-file: honor merge.conflictStyle outside of a repository 2026-02-07 17:04:26 -08:00
git-merge-index.adoc
git-merge-one-file.adoc
git-merge-tree.adoc
git-merge.adoc
git-mergetool--lib.adoc
git-mergetool.adoc
git-mktag.adoc
git-mktree.adoc
git-multi-pack-index.adoc MIDX: revert the default version to v1 2026-04-16 13:45:53 -07:00
git-mv.adoc
git-name-rev.adoc
git-notes.adoc
git-p4.adoc
git-pack-objects.adoc
git-pack-redundant.adoc
git-pack-refs.adoc
git-patch-id.adoc doc: patch-id: see also git-cherry(1) 2026-02-17 10:49:51 -08:00
git-prune-packed.adoc
git-prune.adoc
git-pull.adoc
git-push.adoc
git-quiltimport.adoc
git-range-diff.adoc
git-read-tree.adoc
git-rebase.adoc rebase: support --trailer 2026-03-06 13:02:20 -08:00
git-receive-pack.adoc
git-reflog.adoc
git-refs.adoc
git-remote-ext.adoc
git-remote-fd.adoc
git-remote-helpers.adoco
git-remote.adoc
git-repack.adoc
git-replace.adoc
git-replay.adoc Merge branch 'pw/replay-drop-empty' 2026-02-09 12:09:09 -08:00
git-repo.adoc Merge branch 'jt/repo-structure-extrema' 2026-03-16 10:48:14 -07:00
git-request-pull.adoc
git-rerere.adoc rerere: minor documantation update 2026-02-09 11:58:53 -08:00
git-reset.adoc
git-restore.adoc
git-rev-list.adoc
git-rev-parse.adoc
git-revert.adoc
git-rm.adoc
git-send-email.adoc Merge branch 'dt/send-email-client-cert' 2026-03-12 10:56:05 -07:00
git-send-pack.adoc
git-sh-i18n--envsubst.adoc
git-sh-i18n.adoc
git-sh-setup.adoc
git-shell.adoc
git-shortlog.adoc Merge branch 'kh/doc-shortlog-fix' 2026-02-11 12:29:07 -08:00
git-show-branch.adoc
git-show-index.adoc
git-show-ref.adoc
git-show.adoc doc: convert git-show to synopsis style 2026-02-05 21:14:05 -08:00
git-sparse-checkout.adoc
git-stage.adoc
git-stash.adoc
git-status.adoc
git-stripspace.adoc
git-submodule.adoc doc: convert git-submodule to synopsis style 2026-02-05 21:14:05 -08:00
git-svn.adoc
git-switch.adoc
git-symbolic-ref.adoc
git-tag.adoc
git-tools.adoc
git-unpack-file.adoc
git-unpack-objects.adoc
git-update-index.adoc
git-update-ref.adoc Merge branch 'sb/doc-update-ref-markup-fix' 2026-01-23 13:34:35 -08:00
git-update-server-info.adoc
git-upload-archive.adoc
git-upload-pack.adoc
git-var.adoc
git-verify-commit.adoc
git-verify-pack.adoc
git-verify-tag.adoc
git-version.adoc
git-web--browse.adoc
git-whatchanged.adoc
git-worktree.adoc Merge branch 'sb/doc-worktree-prune-expire-improvement' 2026-02-09 12:09:10 -08:00
git-write-tree.adoc
git.adoc Merge branch 'os/doc-git-custom-commands' 2026-03-16 10:48:14 -07:00
gitattributes.adoc
gitcli.adoc
gitcore-tutorial.adoc
gitcredentials.adoc
gitcvs-migration.adoc
gitdatamodel.adoc
gitdiffcore.adoc
giteveryday.adoc
gitfaq.adoc
gitformat-bundle.adoc
gitformat-chunk.adoc
gitformat-commit-graph.adoc
gitformat-index.adoc
gitformat-loose.adoc rust: add a new binary object map format 2026-02-07 17:41:03 -08:00
gitformat-pack.adoc midx: do not require packs to be sorted in lexicographic order 2026-02-24 11:16:33 -08:00
gitformat-signature.adoc
gitglossary.adoc
githooks.adoc
gitignore.adoc
gitk.adoc
gitmailmap.adoc
gitmodules.adoc Documentation: update add --force option + ignore=all config 2026-02-06 09:43:26 -08:00
gitnamespaces.adoc
gitpacking.adoc
gitprotocol-capabilities.adoc
gitprotocol-common.adoc
gitprotocol-http.adoc
gitprotocol-pack.adoc doc: gitprotocol-pack: normalize italic formatting 2026-03-02 21:35:05 -08:00
gitprotocol-v2.adoc fetch-pack: wire up and enable auto filter logic 2026-02-17 11:46:41 -08:00
gitremote-helpers.adoc
gitrepository-layout.adoc
gitrevisions.adoc
gitsubmodules.adoc
gittutorial-2.adoc
gittutorial.adoc
gitweb.adoc
gitweb.conf.adoc
gitworkflows.adoc
glossary-content.adoc
i18n.adoc
install-doc-quick.sh
install-webdoc.sh
line-range-format.adoc
line-range-options.adoc
lint-delimited-sections.perl
lint-documentation-style.perl
lint-fsck-msgids.perl
lint-gitlink.perl lint-gitlink: preemptively ignore all /ifn?def|endif/ macros 2026-01-21 08:26:00 -08:00
lint-man-end-blurb.perl
lint-man-section-order.perl
lint-manpages.sh
manpage-bold-literal.xsl
manpage-normal.xsl
manpage.xsl
merge-options.adoc
merge-strategies.adoc
meson.build Merge branch 'pw/meson-doc-mergetool' 2026-03-02 17:06:52 -08:00
object-format-disclaimer.adoc
pack-refs-options.adoc
pretty-formats.adoc doc: convert git-show to synopsis style 2026-02-05 21:14:05 -08:00
pretty-options.adoc
pull-fetch-param.adoc
ref-reachability-filters.adoc
ref-storage-format.adoc doc: fix some style issues in git-clone and for-each-ref-options 2026-02-05 21:14:05 -08:00
rerere-options.adoc doc: rerere-options.adoc: link to git-rerere(1) 2026-02-10 12:27:07 -08:00
rev-list-description.adoc
rev-list-options.adoc Merge branch 'ds/revision-maximal-only' 2026-02-25 11:54:17 -08:00
revisions.adoc
scalar.adoc
sequencer.adoc
signoff-option.adoc
texi.xsl
trace2-target-values.adoc
transfer-data-leaks.adoc
urls-remotes.adoc
urls.adoc
user-manual.adoc Merge branch 'gj/user-manual-fix-grep-example' 2026-03-24 12:31:32 -07:00