{"thread":{"id":"66210","subject":"[RFC PATCH 00/14] git organize: record file placement and apply it","startedAt":"2026-08-23T17:19:18Z","lastAt":"2026-08-24T20:03:52Z","messageCount":18,"participants":["Michael Montalbo","Oswald Buddenhagen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"551082","messageId":"20260823171915.2662373-1-mmontalbo@gmail.com","threadId":"66210","inReplyTo":null,"subject":"[RFC PATCH 00/14] git organize: record file placement and apply it","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:44Z","receivedAt":"2026-08-23T17:19:18Z","isPatch":true,"body":"This series adds git organize, a command that records where a project's\nfiles belong and moves the files that are not there yet. It is inspired\nby the series to move the libgit.a sources under lib/ [1], and the\nsub-thread there on grouping files by signals already present in the\ntree [2]. That sub-thread asked which such signals identify a group of\nfiles that could move into a subdirectory. This RFC attempts to provide\none answer, a tool that records such groups of files and applies the\nappropriate moves.\n\ngit organize has two jobs. It records a project's file-placement\nguideline in a tracked file, so the guideline travels with the\nrepository. And it moves a file to its recorded directory, repoints the\nreferences to it, and stages the result; because a move can repoint the\nmoved file's own references, the change is a rename plus mechanical\nreference repoints rather than an exact content-identical rename. The\ntool holds no layout of its own: a project states the placement, and git\norganize records it and performs the moves.\n\nThe guideline is .gitorganize. Its [scope] section lists the governed\nfiles as pathspecs. Its [layout] section holds ordered \"label:value =\ndirectory\" rules, where the first rule a file matches names its\ndirectory. Its [labels] section records one line per recorded source,\nholding its component and role; apply repoints a moved file's line to\nits new path, and a file already inside a layout directory before it was\nrecorded has no line. Two configured commands supply the\nproject-specific parts: the labeler records a file's labels, and the\norganizer returns the reference edits for a move and declines a move\nwhose references it cannot repoint. A line already in [labels] is kept\nas recorded, so git organize apply --labels-only fills a file that has\nno line and leaves the rest; a placement set by hand or in an earlier\nrun stands.\n\nFor Git's own tree, the reference labeler answers [2] from signals\nalready in the history. It reads the \"area:\" prefix a file's commits\ncarry most often, mined with git log --follow so a rename keeps the\nfile's past, and a committed map consolidates those prefixes into\ncomponents. A file whose prefix is too broad, unmapped, or absent falls\nback to its filename, and a file that its prefix does not place but that\nchanges chiefly alongside one component is drawn into it. Each recorded\nline also carries the prefix, the file's #include coupling, and its\nco-change profile, so a reader sees the signals a placement rests on.\nThe advisory prefix= text is mildly git-version sensitive, because git\nlog --follow rename heuristics differ across git versions; the placed\ncomponent does not vary, because the map keys on both a file's old-name\ntoken and its current-name token, which resolve to the same component.\n\ngit organize status reports the governed files in groups: in place, to\nmove, backlog (a file recorded with no directory), and a recorded path\nthat no longer exists. With --exit-code it fails when a file is out of\nplace. Before any carve it reports\n\n    $ git organize status\n    organize: 495 in scope (113 in place, 303 to move, 79 backlog)\n\nThis series carves the subsystems whose files reference each other: odb,\nrefs, pack, diff, revision, index, setup, and transport. Measured\nintra-component #include coupling puts odb as the most tightly coupled,\nso it is carved first; the remaining subsystems are all internally\ncohesive, without a strict coupling rank among them. Each carve is one\ncommit that moves the subsystem's sources and headers into its directory\nand repoints every reference: the #include lines, the Makefile and\nmeson.build entries, the contrib CMake build, and the #include examples\nin the tutorials. Because apply --label selects a single subsystem, the\nmoves arrive one commit at a time, each self-contained and reviewable on\nits own, rather than as one sweeping rename. After these eight carves\nstatus reports\n\n    $ git organize status\n    organize: 495 in scope (380 in place, 36 to move, 79 backlog)\n\nA carve is a rename plus mechanical reference repoints, including the\nmoved file's own #include lines, so git blame and git log --follow still\ntrack it; it changes where a file lives, not what it depends on. Where\neach file belongs is the project's judgment, recorded in the layout and\noffered here to be argued and replaced: bisect.c sits under revision/\nbecause it uses the revision machinery, but whether it should instead\nstand on its own, as rev-list and log do, is exactly the kind of call\nthe labeler makes and the series invites reviewers to correct. A relabel\nand a re-run follow any such decision.\n\nTwo groups remain: 36 files the layout places but leaves uncarved here\n(archive, convert, merge, notes, and submodule), and 79 in backlog with\nno directory yet. The same labeler and organizer produce those patches.\nEach carve also updates .gitorganize, the tool's own record, so a carve\ntaken upstream drops that line and stands on its own as ordinary renames\nand repoints; the tool need not be merged for a carve to be useful.\n\nThe target directories are not built into the tool: changing only the\n[layout] entries (component:odb = lib/odb, and so on) yields a layout\nnested under lib/, which builds. That is how this pairs with the series\nmoving the libgit.a sources under lib/ [1]: the directory can be\nlib/<component>, so the same tool groups those sources further under\nlib/ rather than proposing an alternate top-level layout.\n\n[1] https://lore.kernel.org/git/20260701-pks-libgit-in-subdir-v3-0-5e4860056094@pks.im/T/#m39669398367d8b79af9a40080996d475193a6d2b\n[2] https://lore.kernel.org/git/20260701-pks-libgit-in-subdir-v3-0-5e4860056094@pks.im/T/#mfd455931a236cca8d669fdfcc0ef1d7127237cd6\n\nMichael Montalbo (14):\n  organize: add the git organize builtin\n  organize: add the labeler, organizer, and apply --labels-only\n  organize: add status --exit-code\n  organize: add the --label selector\n  organize: declare Git's scope and layout\n  organize: record a label for every source in scope\n  odb: gather the odb sources under odb/\n  refs: gather the refs sources under refs/\n  pack: gather the pack sources under pack/\n  diff: gather the diff sources under diff/\n  revision: gather the revision sources under revision/\n  index: gather the index sources under index/\n  setup: gather the setup sources under setup/\n  transport: gather the transport sources under transport/\n\n .gitignore                                    |   1 +\n .gitorganize                                  | 494 ++++++++++++\n Documentation/Makefile                        |   4 +-\n Documentation/MyFirstContribution.adoc        |  10 +-\n Documentation/MyFirstObjectWalk.adoc          |  10 +-\n Documentation/git-organize.adoc               | 199 +++++\n Documentation/meson.build                     |   1 +\n Makefile                                      | 309 ++++----\n add-interactive.c                             |  18 +-\n add-patch.c                                   |  16 +-\n advice.c                                      |   4 +-\n apply.c                                       |  30 +-\n apply.h                                       |   2 +-\n archive-tar.c                                 |   4 +-\n archive-zip.c                                 |   8 +-\n archive.c                                     |  22 +-\n archive.h                                     |   2 +-\n attr.c                                        |  20 +-\n branch.c                                      |  18 +-\n builtin.h                                     |   3 +-\n builtin/add.c                                 |  20 +-\n builtin/am.c                                  |  28 +-\n builtin/apply.c                               |   2 +-\n builtin/archive.c                             |   4 +-\n builtin/backfill.c                            |  28 +-\n builtin/bisect.c                              |  12 +-\n builtin/blame.c                               |  28 +-\n builtin/branch.c                              |  18 +-\n builtin/bugreport.c                           |   6 +-\n builtin/bundle.c                              |   6 +-\n builtin/cat-file.c                            |  32 +-\n builtin/check-attr.c                          |   8 +-\n builtin/check-ignore.c                        |   8 +-\n builtin/check-mailmap.c                       |   6 +-\n builtin/check-ref-format.c                    |   4 +-\n builtin/checkout--worker.c                    |  12 +-\n builtin/checkout-index.c                      |  16 +-\n builtin/checkout.c                            |  56 +-\n builtin/clean.c                               |  12 +-\n builtin/clone.c                               |  42 +-\n builtin/column.c                              |   2 +-\n builtin/commit-graph.c                        |  14 +-\n builtin/commit-tree.c                         |  10 +-\n builtin/commit.c                              |  34 +-\n builtin/config.c                              |  10 +-\n builtin/count-objects.c                       |  10 +-\n builtin/credential-cache--daemon.c            |   2 +-\n builtin/credential-store.c                    |   2 +-\n builtin/credential.c                          |   4 +-\n builtin/describe.c                            |  28 +-\n builtin/diff-files.c                          |  12 +-\n builtin/diff-index.c                          |  14 +-\n builtin/diff-pairs.c                          |  12 +-\n builtin/diff-tree.c                           |  16 +-\n builtin/diff.c                                |  26 +-\n builtin/difftool.c                            |  20 +-\n builtin/fast-export.c                         |  32 +-\n builtin/fast-import.c                         |  32 +-\n builtin/fetch-pack.c                          |  14 +-\n builtin/fetch.c                               |  38 +-\n builtin/fmt-merge-msg.c                       |   2 +-\n builtin/for-each-ref.c                        |  10 +-\n builtin/for-each-repo.c                       |   4 +-\n builtin/fsck.c                                |  40 +-\n builtin/fsmonitor--daemon.c                   |  14 +-\n builtin/gc.c                                  |  30 +-\n builtin/get-tar-commit-id.c                   |   2 +-\n builtin/grep.c                                |  26 +-\n builtin/hash-object.c                         |  12 +-\n builtin/help.c                                |   8 +-\n builtin/history.c                             |  26 +-\n builtin/hook.c                                |   6 +-\n builtin/index-pack.c                          |  38 +-\n builtin/init-db.c                             |   6 +-\n builtin/interpret-trailers.c                  |   4 +-\n builtin/last-modified.c                       |  24 +-\n builtin/log.c                                 |  52 +-\n builtin/ls-files.c                            |  20 +-\n builtin/ls-remote.c                           |   8 +-\n builtin/ls-tree.c                             |  12 +-\n builtin/mailinfo.c                            |   2 +-\n builtin/merge-base.c                          |  10 +-\n builtin/merge-file.c                          |  14 +-\n builtin/merge-index.c                         |   4 +-\n builtin/merge-ours.c                          |   6 +-\n builtin/merge-recursive.c                     |   4 +-\n builtin/merge-tree.c                          |  20 +-\n builtin/merge.c                               |  44 +-\n builtin/mktag.c                               |  10 +-\n builtin/mktree.c                              |   6 +-\n builtin/multi-pack-index.c                    |  12 +-\n builtin/mv.c                                  |  20 +-\n builtin/name-rev.c                            |  22 +-\n builtin/notes.c                               |  16 +-\n builtin/organize.c                            | 153 ++++\n builtin/pack-objects.c                        |  66 +-\n builtin/pack-redundant.c                      |   4 +-\n builtin/pack-refs.c                           |   2 +-\n builtin/patch-id.c                            |  10 +-\n builtin/prune-packed.c                        |   2 +-\n builtin/prune.c                               |  24 +-\n builtin/pull.c                                |  22 +-\n builtin/push.c                                |  16 +-\n builtin/range-diff.c                          |   6 +-\n builtin/read-tree.c                           |  22 +-\n builtin/rebase.c                              |  26 +-\n builtin/receive-pack.c                        |  52 +-\n builtin/reflog.c                              |  14 +-\n builtin/refs.c                                |  10 +-\n builtin/remote-ext.c                          |   4 +-\n builtin/remote-fd.c                           |   2 +-\n builtin/remote.c                              |  16 +-\n builtin/repack.c                              |  18 +-\n builtin/replace.c                             |  16 +-\n builtin/replay.c                              |   8 +-\n builtin/repo.c                                |  22 +-\n builtin/rerere.c                              |   6 +-\n builtin/reset.c                               |  32 +-\n builtin/rev-list.c                            |  40 +-\n builtin/rev-parse.c                           |  34 +-\n builtin/revert.c                              |   6 +-\n builtin/rm.c                                  |  20 +-\n builtin/send-pack.c                           |  18 +-\n builtin/shortlog.c                            |  12 +-\n builtin/show-branch.c                         |  16 +-\n builtin/show-index.c                          |   4 +-\n builtin/show-ref.c                            |  10 +-\n builtin/sparse-checkout.c                     |  20 +-\n builtin/stash.c                               |  42 +-\n builtin/stripspace.c                          |   6 +-\n builtin/submodule--helper.c                   |  36 +-\n builtin/symbolic-ref.c                        |   6 +-\n builtin/tag.c                                 |  24 +-\n builtin/unpack-file.c                         |  10 +-\n builtin/unpack-objects.c                      |  24 +-\n builtin/update-index.c                        |  34 +-\n builtin/update-ref.c                          |  10 +-\n builtin/update-server-info.c                  |   6 +-\n builtin/upload-archive.c                      |   6 +-\n builtin/upload-pack.c                         |  16 +-\n builtin/var.c                                 |   8 +-\n builtin/verify-commit.c                       |   8 +-\n builtin/verify-pack.c                         |   4 +-\n builtin/verify-tag.c                          |  10 +-\n builtin/worktree.c                            |  22 +-\n builtin/write-tree.c                          |   8 +-\n chdir-notify.c                                |   2 +-\n color.c                                       |   2 +-\n column.c                                      |   2 +-\n command-list.txt                              |   1 +\n common-init.c                                 |   8 +-\n compat/fsmonitor/fsm-health-darwin.c          |   6 +-\n compat/fsmonitor/fsm-health-linux.c           |   6 +-\n compat/fsmonitor/fsm-health-win32.c           |   6 +-\n compat/fsmonitor/fsm-ipc-unix.c               |  10 +-\n compat/fsmonitor/fsm-ipc-win32.c              |   4 +-\n compat/fsmonitor/fsm-listen-darwin.c          |   6 +-\n compat/fsmonitor/fsm-listen-linux.c           |   8 +-\n compat/fsmonitor/fsm-listen-win32.c           |   6 +-\n compat/fsmonitor/fsm-path-utils-darwin.c      |   4 +-\n compat/fsmonitor/fsm-path-utils-linux.c       |   4 +-\n compat/fsmonitor/fsm-path-utils-win32.c       |   4 +-\n compat/fsmonitor/fsm-settings-unix.c          |  10 +-\n compat/fsmonitor/fsm-settings-win32.c         |  10 +-\n compat/mingw.c                                |  12 +-\n compat/precompose_utf8.c                      |   4 +-\n compat/regex/regex.c                          |   2 +-\n compat/sha1-chunked.c                         |   2 +-\n compat/simple-ipc/ipc-win32.c                 |   2 +-\n compat/win32/path-utils.c                     |   4 +-\n compat/win32/trace2_win32_process_info.c      |   2 +-\n contrib/buildsystems/CMakeLists.txt           |   6 +-\n contrib/libgit-sys/public_symbol_export.c     |   4 +-\n contrib/organize/git-layout.map               |  41 +\n contrib/organize/labeler                      | 333 ++++++++\n contrib/organize/organizer                    | 334 ++++++++\n convert.c                                     |   8 +-\n convert.h                                     |   2 +-\n credential.c                                  |   6 +-\n csum-file.c                                   |   2 +-\n csum-file.h                                   |   2 +-\n daemon.c                                      |  10 +-\n diagnose.c                                    |   8 +-\n combine-diff.c => diff/combine-diff.c         |  26 +-\n diff-lib.c => diff/diff-lib.c                 |  30 +-\n diff-merges.c => diff/diff-merges.c           |   4 +-\n diff-merges.h => diff/diff-merges.h           |   0\n diff-no-index.c => diff/diff-no-index.c       |  12 +-\n diff.c => diff/diff.c                         |  38 +-\n diff.h => diff/diff.h                         |   4 +-\n diffcore-break.c => diff/diffcore-break.c     |   8 +-\n diffcore-delta.c => diff/diffcore-delta.c     |   2 +-\n diffcore-order.c => diff/diffcore-order.c     |   4 +-\n diffcore-pickaxe.c => diff/diffcore-pickaxe.c |  10 +-\n diffcore-rename.c => diff/diffcore-rename.c   |  10 +-\n diffcore-rotate.c => diff/diffcore-rotate.c   |   4 +-\n diffcore.h => diff/diffcore.h                 |   2 +-\n patch-ids.c => diff/patch-ids.c               |   8 +-\n patch-ids.h => diff/patch-ids.h               |   2 +-\n range-diff.c => diff/range-diff.c             |  20 +-\n range-diff.h => diff/range-diff.h             |   2 +-\n tree-diff.c => diff/tree-diff.c               |  14 +-\n userdiff.c => diff/userdiff.c                 |   6 +-\n userdiff.h => diff/userdiff.h                 |   0\n xdiff-interface.c => diff/xdiff-interface.c   |   8 +-\n xdiff-interface.h => diff/xdiff-interface.h   |   2 +-\n editor.c                                      |   4 +-\n exec-cmd.c                                    |   2 +-\n fmt-merge-msg.c                               |  20 +-\n gettext.c                                     |   2 +-\n git.c                                         |  17 +-\n gpg-interface.c                               |  10 +-\n grep.c                                        |  14 +-\n grep.h                                        |   2 +-\n help.c                                        |  16 +-\n hex.c                                         |   2 +-\n hex.h                                         |   2 +-\n http-backend.c                                |  22 +-\n http-fetch.c                                  |  10 +-\n http-push.c                                   |  34 +-\n imap-send.c                                   |   8 +-\n cache-tree.c => index/cache-tree.c            |  18 +-\n cache-tree.h => index/cache-tree.h            |   4 +-\n checkout.c => index/checkout.c                |  12 +-\n checkout.h => index/checkout.h                |   2 +-\n dir-iterator.c => index/dir-iterator.c        |   4 +-\n dir-iterator.h => index/dir-iterator.h        |   0\n dir.c => index/dir.c                          |  28 +-\n dir.h => index/dir.h                          |   6 +-\n entry.c => index/entry.c                      |  18 +-\n entry.h => index/entry.h                      |   0\n .../fsmonitor--daemon.h                       |   2 +-\n fsmonitor-ipc.c => index/fsmonitor-ipc.c      |   4 +-\n fsmonitor-ipc.h => index/fsmonitor-ipc.h      |   0\n fsmonitor-ll.h => index/fsmonitor-ll.h        |   0\n .../fsmonitor-path-utils.h                    |   0\n .../fsmonitor-settings.c                      |  10 +-\n .../fsmonitor-settings.h                      |   0\n fsmonitor.c => index/fsmonitor.c              |  14 +-\n fsmonitor.h => index/fsmonitor.h              |  10 +-\n name-hash.c => index/name-hash.c              |  10 +-\n name-hash.h => index/name-hash.h              |   0\n .../parallel-checkout.c                       |  14 +-\n .../parallel-checkout.h                       |   0\n pathspec.c => index/pathspec.c                |  14 +-\n pathspec.h => index/pathspec.h                |   0\n preload-index.c => index/preload-index.c      |  18 +-\n preload-index.h => index/preload-index.h      |   0\n read-cache-ll.h => index/read-cache-ll.h      |   4 +-\n read-cache.c => index/read-cache.c            |  50 +-\n read-cache.h => index/read-cache.h            |   8 +-\n resolve-undo.c => index/resolve-undo.c        |  10 +-\n resolve-undo.h => index/resolve-undo.h        |   2 +-\n sparse-index.c => index/sparse-index.c        |  22 +-\n sparse-index.h => index/sparse-index.h        |   0\n split-index.c => index/split-index.c          |   8 +-\n split-index.h => index/split-index.h          |   2 +-\n statinfo.c => index/statinfo.c                |   6 +-\n statinfo.h => index/statinfo.h                |   0\n symlinks.c => index/symlinks.c                |   4 +-\n symlinks.h => index/symlinks.h                |   0\n unpack-trees.c => index/unpack-trees.c        |  38 +-\n unpack-trees.h => index/unpack-trees.h        |   4 +-\n wt-status.c => index/wt-status.c              |  36 +-\n wt-status.h => index/wt-status.h              |   4 +-\n khash.h                                       |   2 +-\n lockfile.c                                    |   2 +-\n mailinfo.c                                    |   4 +-\n mailmap.c                                     |  10 +-\n merge-blobs.c                                 |   4 +-\n merge-ll.c                                    |   4 +-\n merge-ort-wrappers.c                          |  12 +-\n merge-ort.c                                   |  46 +-\n merge-ort.h                                   |   2 +-\n merge.c                                       |  14 +-\n meson.build                                   | 285 +++----\n negotiator/default.c                          |  10 +-\n negotiator/noop.c                             |   2 +-\n negotiator/skipping.c                         |  10 +-\n notes-cache.c                                 |  12 +-\n notes-merge.c                                 |  22 +-\n notes-utils.c                                 |   8 +-\n notes.c                                       |  14 +-\n alloc.c => odb/alloc.c                        |  14 +-\n alloc.h => odb/alloc.h                        |   0\n blob.c => odb/blob.c                          |   4 +-\n blob.h => odb/blob.h                          |   2 +-\n cbtree.c => odb/cbtree.c                      |   2 +-\n cbtree.h => odb/cbtree.h                      |   0\n commit-slab-decl.h => odb/commit-slab-decl.h  |   0\n commit-slab-impl.h => odb/commit-slab-impl.h  |   0\n commit-slab.h => odb/commit-slab.h            |   4 +-\n commit.c => odb/commit.c                      |  42 +-\n commit.h => odb/commit.h                      |   2 +-\n fsck.c => odb/fsck.c                          |  30 +-\n fsck.h => odb/fsck.h                          |   4 +-\n hash-lookup.c => odb/hash-lookup.c            |   6 +-\n hash-lookup.h => odb/hash-lookup.h            |   0\n hash.c => odb/hash.c                          |   2 +-\n hash.h => odb/hash.h                          |   2 +-\n loose.c => odb/loose.c                        |  12 +-\n loose.h => odb/loose.h                        |   0\n match-trees.c => odb/match-trees.c            |  12 +-\n match-trees.h => odb/match-trees.h            |   0\n .../object-file-convert.c                     |  12 +-\n .../object-file-convert.h                     |   2 +-\n object-file.c => odb/object-file.c            |  24 +-\n object-file.h => odb/object-file.h            |   4 +-\n object-name.c => odb/object-name.c            |  40 +-\n object-name.h => odb/object-name.h            |   2 +-\n object.c => odb/object.c                      |  20 +-\n object.h => odb/object.h                      |   2 +-\n odb.c => odb/odb.c                            |  30 +-\n odb.h => odb/odb.h                            |   6 +-\n oid-array.c => odb/oid-array.c                |   4 +-\n oid-array.h => odb/oid-array.h                |   2 +-\n oidmap.c => odb/oidmap.c                      |   4 +-\n oidmap.h => odb/oidmap.h                      |   2 +-\n oidset.c => odb/oidset.c                      |   2 +-\n oidset.h => odb/oidset.h                      |   0\n oidtree.c => odb/oidtree.c                    |   4 +-\n oidtree.h => odb/oidtree.h                    |   4 +-\n replace-object.c => odb/replace-object.c      |  12 +-\n replace-object.h => odb/replace-object.h      |   6 +-\n odb/source-files.c                            |  18 +-\n odb/source-inmemory.c                         |   8 +-\n odb/source-loose.c                            |  12 +-\n odb/source-packed.c                           |  10 +-\n odb/source-packed.h                           |   2 +-\n odb/source.c                                  |   4 +-\n odb/source.h                                  |   4 +-\n odb/streaming.c                               |   8 +-\n odb/streaming.h                               |   4 +-\n tag.c => odb/tag.c                            |  20 +-\n tag.h => odb/tag.h                            |   2 +-\n tmp-objdir.c => odb/tmp-objdir.c              |  12 +-\n tmp-objdir.h => odb/tmp-objdir.h              |   0\n odb/transaction.h                             |   2 +-\n tree-walk.c => odb/tree-walk.c                |  16 +-\n tree-walk.h => odb/tree-walk.h                |   2 +-\n tree.c => odb/tree.c                          |  16 +-\n tree.h => odb/tree.h                          |   2 +-\n organize/gitorganize-format.c                 | 266 +++++++\n organize/gitorganize-format.h                 |  38 +\n organize/labeler-protocol.c                   |  52 ++\n organize/labeler-protocol.h                   |  15 +\n organize/organize.c                           | 487 ++++++++++++\n organize/organize.h                           | 102 +++\n organize/organizer-protocol.c                 | 254 ++++++\n organize/organizer-protocol.h                 |  18 +\n oss-fuzz/fuzz-commit-graph.c                  |   4 +-\n oss-fuzz/fuzz-config.c                        |   2 +-\n oss-fuzz/fuzz-pack-headers.c                  |   2 +-\n oss-fuzz/fuzz-pack-idx.c                      |   4 +-\n bloom.c => pack/bloom.c                       |  20 +-\n bloom.h => pack/bloom.h                       |   0\n chunk-format.c => pack/chunk-format.c         |   4 +-\n chunk-format.h => pack/chunk-format.h         |   2 +-\n commit-graph.c => pack/commit-graph.c         |  34 +-\n commit-graph.h => pack/commit-graph.h         |   4 +-\n delta-islands.c => pack/delta-islands.c       |  26 +-\n delta-islands.h => pack/delta-islands.h       |   0\n delta.h => pack/delta.h                       |   0\n diff-delta.c => pack/diff-delta.c             |   2 +-\n midx-write.c => pack/midx-write.c             |  22 +-\n midx.c => pack/midx.c                         |  16 +-\n midx.h => pack/midx.h                         |   0\n .../pack-bitmap-write.c                       |  38 +-\n pack-bitmap.c => pack/pack-bitmap.c           |  32 +-\n pack-bitmap.h => pack/pack-bitmap.h           |   6 +-\n pack-check.c => pack/pack-check.c             |  12 +-\n pack-mtimes.c => pack/pack-mtimes.c           |   6 +-\n pack-mtimes.h => pack/pack-mtimes.h           |   0\n pack-objects.c => pack/pack-objects.c         |  10 +-\n pack-objects.h => pack/pack-objects.h         |   6 +-\n pack-revindex.c => pack/pack-revindex.c       |  10 +-\n pack-revindex.h => pack/pack-revindex.h       |   0\n pack-write.c => pack/pack-write.c             |  18 +-\n pack.h => pack/pack.h                         |   2 +-\n packfile-list.c => pack/packfile-list.c       |   4 +-\n packfile-list.h => pack/packfile-list.h       |   0\n packfile.c => pack/packfile.c                 |  40 +-\n packfile.h => pack/packfile.h                 |  12 +-\n patch-delta.c => pack/patch-delta.c           |   2 +-\n prune-packed.c => pack/prune-packed.c         |   8 +-\n prune-packed.h => pack/prune-packed.h         |   0\n pseudo-merge.c => pack/pseudo-merge.c         |  14 +-\n pseudo-merge.h => pack/pseudo-merge.h         |   0\n reachable.c => pack/reachable.c               |  28 +-\n reachable.h => pack/reachable.h               |   0\n repack-cruft.c => pack/repack-cruft.c         |   6 +-\n repack-filtered.c => pack/repack-filtered.c   |   4 +-\n repack-geometry.c => pack/repack-geometry.c   |   8 +-\n repack-midx.c => pack/repack-midx.c           |  14 +-\n repack-promisor.c => pack/repack-promisor.c   |   8 +-\n repack.c => pack/repack.c                     |  12 +-\n repack.h => pack/repack.h                     |   2 +-\n server-info.c => pack/server-info.c           |  20 +-\n server-info.h => pack/server-info.h           |   0\n pager.c                                       |   8 +-\n parse-options-cb.c                            |  10 +-\n path-walk.c                                   |  28 +-\n path-walk.h                                   |   2 +-\n path.c                                        |  12 +-\n path.h                                        |   2 +-\n progress.c                                    |   2 +-\n prompt.c                                      |   4 +-\n rebase-interactive.c                          |  14 +-\n refs/files-backend.c                          |  24 +-\n refs/iterator.c                               |   2 +-\n ls-refs.c => refs/ls-refs.c                   |  14 +-\n ls-refs.h => refs/ls-refs.h                   |   0\n pack-refs.c => refs/pack-refs.c               |  10 +-\n pack-refs.h => refs/pack-refs.h               |   0\n refs/packed-backend.c                         |  14 +-\n refs/ref-cache.c                              |   6 +-\n refs/ref-cache.h                              |   2 +-\n ref-filter.c => refs/ref-filter.c             |  36 +-\n ref-filter.h => refs/ref-filter.h             |   6 +-\n reflog-walk.c => refs/reflog-walk.c           |  12 +-\n reflog-walk.h => refs/reflog-walk.h           |   0\n reflog.c => refs/reflog.c                     |  16 +-\n reflog.h => refs/reflog.h                     |   2 +-\n refs/refs-internal.h                          |   2 +-\n refs.c => refs/refs.c                         |  26 +-\n refs.h => refs/refs.h                         |   8 +-\n refspec.c => refs/refspec.c                   |   8 +-\n refspec.h => refs/refspec.h                   |   0\n refs/reftable-backend.c                       |  20 +-\n worktree.c => refs/worktree.c                 |  16 +-\n worktree.h => refs/worktree.h                 |   2 +-\n replay.c                                      |  10 +-\n replay.h                                      |   2 +-\n rerere.c                                      |  18 +-\n reset.c                                       |  14 +-\n reset.h                                       |   4 +-\n bisect.c => revision/bisect.c                 |  30 +-\n bisect.h => revision/bisect.h                 |   0\n blame.c => revision/blame.c                   |  30 +-\n blame.h => revision/blame.h                   |   4 +-\n commit-reach.c => revision/commit-reach.c     |  14 +-\n commit-reach.h => revision/commit-reach.h     |   4 +-\n decorate.c => revision/decorate.c             |   4 +-\n decorate.h => revision/decorate.h             |   0\n graph.c => revision/graph.c                   |   8 +-\n graph.h => revision/graph.h                   |   2 +-\n line-log.c => revision/line-log.c             |  28 +-\n line-log.h => revision/line-log.h             |   2 +-\n line-range.c => revision/line-range.c         |   6 +-\n line-range.h => revision/line-range.h         |   0\n .../list-objects-filter-options.c             |   6 +-\n .../list-objects-filter-options.h             |   2 +-\n .../list-objects-filter.c                     |  20 +-\n .../list-objects-filter.h                     |   0\n list-objects.c => revision/list-objects.c     |  26 +-\n list-objects.h => revision/list-objects.h     |   0\n list.h => revision/list.h                     |   0\n log-tree.c => revision/log-tree.c             |  42 +-\n log-tree.h => revision/log-tree.h             |   0\n pretty.c => revision/pretty.c                 |  18 +-\n pretty.h => revision/pretty.h                 |   0\n revision.c => revision/revision.c             |  68 +-\n revision.h => revision/revision.h             |  18 +-\n shallow.c => revision/shallow.c               |  28 +-\n shallow.h => revision/shallow.h               |   6 +-\n run-command.c                                 |   8 +-\n scalar.c                                      |  14 +-\n sequencer.c                                   |  44 +-\n sequencer.h                                   |   2 +-\n alias.c => setup/alias.c                      |   4 +-\n alias.h => setup/alias.h                      |   0\n config.c => setup/config.c                    |  16 +-\n config.h => setup/config.h                    |   2 +-\n environment.c => setup/environment.c          |  16 +-\n environment.h => setup/environment.h          |   2 +-\n hook.c => setup/hook.c                        |   8 +-\n hook.h => setup/hook.h                        |   2 +-\n ident.c => setup/ident.c                      |   4 +-\n ident.h => setup/ident.h                      |   0\n repo-settings.c => setup/repo-settings.c      |  12 +-\n repo-settings.h => setup/repo-settings.h      |   0\n repository.c => setup/repository.c            |  24 +-\n repository.h => setup/repository.h            |   4 +-\n setup.c => setup/setup.c                      |  20 +-\n setup.h => setup/setup.h                      |   2 +-\n version.c => setup/version.c                  |   2 +-\n version.h => setup/version.h                  |   0\n shell.c                                       |   2 +-\n simple-ipc.h                                  |   2 +-\n sub-process.c                                 |   2 +-\n submodule-config.c                            |  14 +-\n submodule-config.h                            |   4 +-\n submodule.c                                   |  36 +-\n t/helper/test-advise.c                        |   6 +-\n t/helper/test-bitmap.c                        |   8 +-\n t/helper/test-bloom.c                         |   8 +-\n t/helper/test-bundle-uri.c                    |   6 +-\n t/helper/test-cache-tree.c                    |  10 +-\n t/helper/test-config.c                        |   4 +-\n t/helper/test-delta.c                         |   2 +-\n t/helper/test-dir-iterator.c                  |   2 +-\n t/helper/test-dump-cache-tree.c               |  12 +-\n t/helper/test-dump-fsmonitor.c                |   6 +-\n t/helper/test-dump-split-index.c              |   8 +-\n t/helper/test-dump-untracked-cache.c          |   8 +-\n t/helper/test-find-pack.c                     |   8 +-\n t/helper/test-fsmonitor-client.c              |   8 +-\n t/helper/test-hash-speed.c                    |   2 +-\n t/helper/test-lazy-init-name-hash.c           |  10 +-\n t/helper/test-match-trees.c                   |  10 +-\n t/helper/test-name-hash.c                     |   2 +-\n t/helper/test-pack-deltas.c                   |  10 +-\n t/helper/test-pack-mtimes.c                   |   8 +-\n t/helper/test-parse-pathspec-file.c           |   2 +-\n t/helper/test-partial-clone.c                 |   6 +-\n t/helper/test-path-utils.c                    |   6 +-\n t/helper/test-path-walk.c                     |  18 +-\n t/helper/test-pkt-line.c                      |   4 +-\n t/helper/test-proc-receive.c                  |   4 +-\n t/helper/test-progress.c                      |   2 +-\n t/helper/test-reach.c                         |  12 +-\n t/helper/test-read-cache.c                    |  10 +-\n t/helper/test-read-graph.c                    |  10 +-\n t/helper/test-read-midx.c                     |  14 +-\n t/helper/test-ref-store.c                     |  12 +-\n t/helper/test-reftable.c                      |   2 +-\n t/helper/test-repository.c                    |  14 +-\n t/helper/test-revision-walking.c              |  14 +-\n t/helper/test-rot13-filter.c                  |   2 +-\n t/helper/test-scrap-cache-tree.c              |  10 +-\n t/helper/test-serve-v2.c                      |   6 +-\n t/helper/test-sha1.c                          |   2 +-\n t/helper/test-sha256.c                        |   2 +-\n t/helper/test-submodule-config.c              |  10 +-\n t/helper/test-submodule-nested-repo-config.c  |   4 +-\n t/helper/test-submodule.c                     |   6 +-\n t/helper/test-subprocess.c                    |   2 +-\n t/helper/test-synthesize.c                    |  12 +-\n t/helper/test-trace2.c                        |   4 +-\n t/helper/test-userdiff.c                      |   6 +-\n t/helper/test-write-cache.c                   |   6 +-\n t/meson.build                                 |   1 +\n t/t0096-organize.sh                           | 739 ++++++++++++++++++\n t/unit-tests/lib-oid.h                        |   2 +-\n t/unit-tests/test-lib.c                       |   2 +-\n t/unit-tests/u-dir.c                          |   2 +-\n t/unit-tests/u-example-decorate.c             |   6 +-\n t/unit-tests/u-list-objects-filter-options.c  |   2 +-\n t/unit-tests/u-odb-inmemory.c                 |   6 +-\n t/unit-tests/u-oid-array.c                    |   2 +-\n t/unit-tests/u-oidmap.c                       |   4 +-\n t/unit-tests/u-oidtree.c                      |   4 +-\n t/unit-tests/u-reftable-stack.c               |   2 +-\n t/unit-tests/u-strcmp-offset.c                |   2 +-\n tempfile.h                                    |   2 +-\n trace.c                                       |   4 +-\n trace2.c                                      |   4 +-\n trace2/tr2_cfg.c                              |   2 +-\n trace2/tr2_sysenv.c                           |   4 +-\n trace2/tr2_tgt_event.c                        |   6 +-\n trace2/tr2_tgt_normal.c                       |   6 +-\n trace2/tr2_tgt_perf.c                         |   6 +-\n trailer.c                                     |   8 +-\n trailer.h                                     |   2 +-\n bundle-uri.c => transport/bundle-uri.c        |  16 +-\n bundle-uri.h => transport/bundle-uri.h        |   0\n bundle.c => transport/bundle.c                |  24 +-\n bundle.h => transport/bundle.h                |   2 +-\n connect.c => transport/connect.c              |  26 +-\n connect.h => transport/connect.h              |   2 +-\n connected.c => transport/connected.c          |  10 +-\n connected.h => transport/connected.h          |   0\n .../fetch-negotiator.c                        |   4 +-\n .../fetch-negotiator.h                        |   0\n .../fetch-object-info.c                       |  10 +-\n .../fetch-object-info.h                       |   4 +-\n fetch-pack.c => transport/fetch-pack.c        |  50 +-\n fetch-pack.h => transport/fetch-pack.h        |   6 +-\n .../git-curl-compat.h                         |   0\n http-walker.c => transport/http-walker.c      |  16 +-\n http.c => transport/http.c                    |  22 +-\n http.h => transport/http.h                    |   2 +-\n pkt-line.c => transport/pkt-line.c            |   4 +-\n pkt-line.h => transport/pkt-line.h            |   0\n .../promisor-remote.c                         |  14 +-\n .../promisor-remote.h                         |   2 +-\n protocol-caps.c => transport/protocol-caps.c  |  12 +-\n protocol-caps.h => transport/protocol-caps.h  |   0\n protocol.c => transport/protocol.c            |   6 +-\n protocol.h => transport/protocol.h            |   0\n remote-curl.c => transport/remote-curl.c      |  26 +-\n remote.c => transport/remote.c                |  30 +-\n remote.h => transport/remote.h                |   4 +-\n send-pack.c => transport/send-pack.c          |  24 +-\n send-pack.h => transport/send-pack.h          |   0\n serve.c => transport/serve.c                  |  22 +-\n serve.h => transport/serve.h                  |   0\n sideband.c => transport/sideband.c            |   6 +-\n sideband.h => transport/sideband.h            |   0\n .../transport-helper.c                        |  22 +-\n .../transport-internal.h                      |   2 +-\n transport.c => transport/transport.c          |  38 +-\n transport.h => transport/transport.h          |   6 +-\n upload-pack.c => transport/upload-pack.c      |  42 +-\n upload-pack.h => transport/upload-pack.h      |   0\n walker.c => transport/walker.c                |  18 +-\n walker.h => transport/walker.h                |   2 +-\n urlmatch.h                                    |   2 +-\n versioncmp.c                                  |   2 +-\n 609 files changed, 6909 insertions(+), 3368 deletions(-)\n create mode 100644 .gitorganize\n create mode 100644 Documentation/git-organize.adoc\n create mode 100644 builtin/organize.c\n create mode 100644 contrib/organize/git-layout.map\n create mode 100755 contrib/organize/labeler\n create mode 100755 contrib/organize/organizer\n rename combine-diff.c => diff/combine-diff.c (99%)\n rename diff-lib.c => diff/diff-lib.c (98%)\n rename diff-merges.c => diff/diff-merges.c (98%)\n rename diff-merges.h => diff/diff-merges.h (100%)\n rename diff-no-index.c => diff/diff-no-index.c (98%)\n rename diff.c => diff/diff.c (99%)\n rename diff.h => diff/diff.h (99%)\n rename diffcore-break.c => diff/diffcore-break.c (98%)\n rename diffcore-delta.c => diff/diffcore-delta.c (99%)\n rename diffcore-order.c => diff/diffcore-order.c (97%)\n rename diffcore-pickaxe.c => diff/diffcore-pickaxe.c (98%)\n rename diffcore-rename.c => diff/diffcore-rename.c (99%)\n rename diffcore-rotate.c => diff/diffcore-rotate.c (95%)\n rename diffcore.h => diff/diffcore.h (99%)\n rename patch-ids.c => diff/patch-ids.c (97%)\n rename patch-ids.h => diff/patch-ids.h (98%)\n rename range-diff.c => diff/range-diff.c (98%)\n rename range-diff.h => diff/range-diff.h (98%)\n rename tree-diff.c => diff/tree-diff.c (99%)\n rename userdiff.c => diff/userdiff.c (99%)\n rename userdiff.h => diff/userdiff.h (100%)\n rename xdiff-interface.c => diff/xdiff-interface.c (98%)\n rename xdiff-interface.h => diff/xdiff-interface.h (99%)\n rename cache-tree.c => index/cache-tree.c (99%)\n rename cache-tree.h => index/cache-tree.h (97%)\n rename checkout.c => index/checkout.c (91%)\n rename checkout.h => index/checkout.h (94%)\n rename dir-iterator.c => index/dir-iterator.c (99%)\n rename dir-iterator.h => index/dir-iterator.h (100%)\n rename dir.c => index/dir.c (99%)\n rename dir.h => index/dir.h (99%)\n rename entry.c => index/entry.c (98%)\n rename entry.h => index/entry.h (100%)\n rename fsmonitor--daemon.h => index/fsmonitor--daemon.h (99%)\n rename fsmonitor-ipc.c => index/fsmonitor-ipc.c (98%)\n rename fsmonitor-ipc.h => index/fsmonitor-ipc.h (100%)\n rename fsmonitor-ll.h => index/fsmonitor-ll.h (100%)\n rename fsmonitor-path-utils.h => index/fsmonitor-path-utils.h (100%)\n rename fsmonitor-settings.c => index/fsmonitor-settings.c (97%)\n rename fsmonitor-settings.h => index/fsmonitor-settings.h (100%)\n rename fsmonitor.c => index/fsmonitor.c (99%)\n rename fsmonitor.h => index/fsmonitor.h (94%)\n rename name-hash.c => index/name-hash.c (99%)\n rename name-hash.h => index/name-hash.h (100%)\n rename parallel-checkout.c => index/parallel-checkout.c (98%)\n rename parallel-checkout.h => index/parallel-checkout.h (100%)\n rename pathspec.c => index/pathspec.c (99%)\n rename pathspec.h => index/pathspec.h (100%)\n rename preload-index.c => index/preload-index.c (94%)\n rename preload-index.h => index/preload-index.h (100%)\n rename read-cache-ll.h => index/read-cache-ll.h (99%)\n rename read-cache.c => index/read-cache.c (99%)\n rename read-cache.h => index/read-cache.h (91%)\n rename resolve-undo.c => index/resolve-undo.c (96%)\n rename resolve-undo.h => index/resolve-undo.h (97%)\n rename sparse-index.c => index/sparse-index.c (98%)\n rename sparse-index.h => index/sparse-index.h (100%)\n rename split-index.c => index/split-index.c (99%)\n rename split-index.h => index/split-index.h (98%)\n rename statinfo.c => index/statinfo.c (97%)\n rename statinfo.h => index/statinfo.h (100%)\n rename symlinks.c => index/symlinks.c (99%)\n rename symlinks.h => index/symlinks.h (100%)\n rename unpack-trees.c => index/unpack-trees.c (99%)\n rename unpack-trees.h => index/unpack-trees.h (98%)\n rename wt-status.c => index/wt-status.c (99%)\n rename wt-status.h => index/wt-status.h (98%)\n rename alloc.c => odb/alloc.c (94%)\n rename alloc.h => odb/alloc.h (100%)\n rename blob.c => odb/blob.c (89%)\n rename blob.h => odb/blob.h (96%)\n rename cbtree.c => odb/cbtree.c (99%)\n rename cbtree.h => odb/cbtree.h (100%)\n rename commit-slab-decl.h => odb/commit-slab-decl.h (100%)\n rename commit-slab-impl.h => odb/commit-slab-impl.h (100%)\n rename commit-slab.h => odb/commit-slab.h (97%)\n rename commit.c => odb/commit.c (98%)\n rename commit.h => odb/commit.h (99%)\n rename fsck.c => odb/fsck.c (99%)\n rename fsck.h => odb/fsck.h (99%)\n rename hash-lookup.c => odb/hash-lookup.c (97%)\n rename hash-lookup.h => odb/hash-lookup.h (100%)\n rename hash.c => odb/hash.c (99%)\n rename hash.h => odb/hash.h (99%)\n rename loose.c => odb/loose.c (97%)\n rename loose.h => odb/loose.h (100%)\n rename match-trees.c => odb/match-trees.c (98%)\n rename match-trees.h => odb/match-trees.h (100%)\n rename object-file-convert.c => odb/object-file-convert.c (98%)\n rename object-file-convert.h => odb/object-file-convert.h (96%)\n rename object-file.c => odb/object-file.c (99%)\n rename object-file.h => odb/object-file.h (99%)\n rename object-name.c => odb/object-name.c (98%)\n rename object-name.h => odb/object-name.h (99%)\n rename object.c => odb/object.c (98%)\n rename object.h => odb/object.h (99%)\n rename odb.c => odb/odb.c (98%)\n rename odb.h => odb/odb.h (99%)\n rename oid-array.c => odb/oid-array.c (97%)\n rename oid-array.h => odb/oid-array.h (99%)\n rename oidmap.c => odb/oidmap.c (97%)\n rename oidmap.h => odb/oidmap.h (99%)\n rename oidset.c => odb/oidset.c (99%)\n rename oidset.h => odb/oidset.h (100%)\n rename oidtree.c => odb/oidtree.c (98%)\n rename oidtree.h => odb/oidtree.h (97%)\n rename replace-object.c => odb/replace-object.c (94%)\n rename replace-object.h => odb/replace-object.h (96%)\n rename tag.c => odb/tag.c (95%)\n rename tag.h => odb/tag.h (96%)\n rename tmp-objdir.c => odb/tmp-objdir.c (97%)\n rename tmp-objdir.h => odb/tmp-objdir.h (100%)\n rename tree-walk.c => odb/tree-walk.c (99%)\n rename tree-walk.h => odb/tree-walk.h (99%)\n rename tree.c => odb/tree.c (96%)\n rename tree.h => odb/tree.h (98%)\n create mode 100644 organize/gitorganize-format.c\n create mode 100644 organize/gitorganize-format.h\n create mode 100644 organize/labeler-protocol.c\n create mode 100644 organize/labeler-protocol.h\n create mode 100644 organize/organize.c\n create mode 100644 organize/organize.h\n create mode 100644 organize/organizer-protocol.c\n create mode 100644 organize/organizer-protocol.h\n rename bloom.c => pack/bloom.c (98%)\n rename bloom.h => pack/bloom.h (100%)\n rename chunk-format.c => pack/chunk-format.c (98%)\n rename chunk-format.h => pack/chunk-format.h (98%)\n rename commit-graph.c => pack/commit-graph.c (99%)\n rename commit-graph.h => pack/commit-graph.h (99%)\n rename delta-islands.c => pack/delta-islands.c (97%)\n rename delta-islands.h => pack/delta-islands.h (100%)\n rename delta.h => pack/delta.h (100%)\n rename diff-delta.c => pack/diff-delta.c (99%)\n rename midx-write.c => pack/midx-write.c (99%)\n rename midx.c => pack/midx.c (99%)\n rename midx.h => pack/midx.h (100%)\n rename pack-bitmap-write.c => pack/pack-bitmap-write.c (98%)\n rename pack-bitmap.c => pack/pack-bitmap.c (99%)\n rename pack-bitmap.h => pack/pack-bitmap.h (98%)\n rename pack-check.c => pack/pack-check.c (97%)\n rename pack-mtimes.c => pack/pack-mtimes.c (97%)\n rename pack-mtimes.h => pack/pack-mtimes.h (100%)\n rename pack-objects.c => pack/pack-objects.c (97%)\n rename pack-objects.h => pack/pack-objects.h (99%)\n rename pack-revindex.c => pack/pack-revindex.c (99%)\n rename pack-revindex.h => pack/pack-revindex.h (100%)\n rename pack-write.c => pack/pack-write.c (98%)\n rename pack.h => pack/pack.h (99%)\n rename packfile-list.c => pack/packfile-list.c (96%)\n rename packfile-list.h => pack/packfile-list.h (100%)\n rename packfile.c => pack/packfile.c (99%)\n rename packfile.h => pack/packfile.h (98%)\n rename patch-delta.c => pack/patch-delta.c (98%)\n rename prune-packed.c => pack/prune-packed.c (89%)\n rename prune-packed.h => pack/prune-packed.h (100%)\n rename pseudo-merge.c => pack/pseudo-merge.c (99%)\n rename pseudo-merge.h => pack/pseudo-merge.h (100%)\n rename reachable.c => pack/reachable.c (95%)\n rename reachable.h => pack/reachable.h (100%)\n rename repack-cruft.c => pack/repack-cruft.c (97%)\n rename repack-filtered.c => pack/repack-filtered.c (96%)\n rename repack-geometry.c => pack/repack-geometry.c (98%)\n rename repack-midx.c => pack/repack-midx.c (99%)\n rename repack-promisor.c => pack/repack-promisor.c (97%)\n rename repack.c => pack/repack.c (98%)\n rename repack.h => pack/repack.h (99%)\n rename server-info.c => pack/server-info.c (96%)\n rename server-info.h => pack/server-info.h (100%)\n rename ls-refs.c => refs/ls-refs.c (96%)\n rename ls-refs.h => refs/ls-refs.h (100%)\n rename pack-refs.c => refs/pack-refs.c (92%)\n rename pack-refs.h => refs/pack-refs.h (100%)\n rename ref-filter.c => refs/ref-filter.c (99%)\n rename ref-filter.h => refs/ref-filter.h (98%)\n rename reflog-walk.c => refs/reflog-walk.c (98%)\n rename reflog-walk.h => refs/reflog-walk.h (100%)\n rename reflog.c => refs/reflog.c (98%)\n rename reflog.h => refs/reflog.h (99%)\n rename refs.c => refs/refs.c (99%)\n rename refs.h => refs/refs.h (99%)\n rename refspec.c => refs/refspec.c (99%)\n rename refspec.h => refs/refspec.h (100%)\n rename worktree.c => refs/worktree.c (99%)\n rename worktree.h => refs/worktree.h (99%)\n rename bisect.c => revision/bisect.c (98%)\n rename bisect.h => revision/bisect.h (100%)\n rename blame.c => revision/blame.c (99%)\n rename blame.h => revision/blame.h (98%)\n rename commit-reach.c => revision/commit-reach.c (99%)\n rename commit-reach.h => revision/commit-reach.h (99%)\n rename decorate.c => revision/decorate.c (97%)\n rename decorate.h => revision/decorate.h (100%)\n rename graph.c => revision/graph.c (99%)\n rename graph.h => revision/graph.h (99%)\n rename line-log.c => revision/line-log.c (98%)\n rename line-log.h => revision/line-log.h (96%)\n rename line-range.c => revision/line-range.c (98%)\n rename line-range.h => revision/line-range.h (100%)\n rename list-objects-filter-options.c => revision/list-objects-filter-options.c (99%)\n rename list-objects-filter-options.h => revision/list-objects-filter-options.h (99%)\n rename list-objects-filter.c => revision/list-objects-filter.c (98%)\n rename list-objects-filter.h => revision/list-objects-filter.h (100%)\n rename list-objects.c => revision/list-objects.c (96%)\n rename list-objects.h => revision/list-objects.h (100%)\n rename list.h => revision/list.h (100%)\n rename log-tree.c => revision/log-tree.c (98%)\n rename log-tree.h => revision/log-tree.h (100%)\n rename pretty.c => revision/pretty.c (99%)\n rename pretty.h => revision/pretty.h (100%)\n rename revision.c => revision/revision.c (99%)\n rename revision.h => revision/revision.h (98%)\n rename shallow.c => revision/shallow.c (98%)\n rename shallow.h => revision/shallow.h (97%)\n rename alias.c => setup/alias.c (98%)\n rename alias.h => setup/alias.h (100%)\n rename config.c => setup/config.c (99%)\n rename config.h => setup/config.h (99%)\n rename environment.c => setup/environment.c (98%)\n rename environment.h => setup/environment.h (99%)\n rename hook.c => setup/hook.c (99%)\n rename hook.h => setup/hook.h (99%)\n rename ident.c => setup/ident.c (99%)\n rename ident.h => setup/ident.h (100%)\n rename repo-settings.c => setup/repo-settings.c (97%)\n rename repo-settings.h => setup/repo-settings.h (100%)\n rename repository.c => setup/repository.c (97%)\n rename repository.h => setup/repository.h (99%)\n rename setup.c => setup/setup.c (99%)\n rename setup.h => setup/setup.h (99%)\n rename version.c => setup/version.c (98%)\n rename version.h => setup/version.h (100%)\n create mode 100755 t/t0096-organize.sh\n rename bundle-uri.c => transport/bundle-uri.c (99%)\n rename bundle-uri.h => transport/bundle-uri.h (100%)\n rename bundle.c => transport/bundle.c (97%)\n rename bundle.h => transport/bundle.h (97%)\n rename connect.c => transport/connect.c (99%)\n rename connect.h => transport/connect.h (98%)\n rename connected.c => transport/connected.c (97%)\n rename connected.h => transport/connected.h (100%)\n rename fetch-negotiator.c => transport/fetch-negotiator.c (90%)\n rename fetch-negotiator.h => transport/fetch-negotiator.h (100%)\n rename fetch-object-info.c => transport/fetch-object-info.c (96%)\n rename fetch-object-info.h => transport/fetch-object-info.h (91%)\n rename fetch-pack.c => transport/fetch-pack.c (98%)\n rename fetch-pack.h => transport/fetch-pack.h (97%)\n rename git-curl-compat.h => transport/git-curl-compat.h (100%)\n rename http-walker.c => transport/http-walker.c (98%)\n rename http.c => transport/http.c (99%)\n rename http.h => transport/http.h (99%)\n rename pkt-line.c => transport/pkt-line.c (99%)\n rename pkt-line.h => transport/pkt-line.h (100%)\n rename promisor-remote.c => transport/promisor-remote.c (99%)\n rename promisor-remote.h => transport/promisor-remote.h (99%)\n rename protocol-caps.c => transport/protocol-caps.c (95%)\n rename protocol-caps.h => transport/protocol-caps.h (100%)\n rename protocol.c => transport/protocol.c (96%)\n rename protocol.h => transport/protocol.h (100%)\n rename remote-curl.c => transport/remote-curl.c (99%)\n rename remote.c => transport/remote.c (99%)\n rename remote.h => transport/remote.h (99%)\n rename send-pack.c => transport/send-pack.c (98%)\n rename send-pack.h => transport/send-pack.h (100%)\n rename serve.c => transport/serve.c (96%)\n rename serve.h => transport/serve.h (100%)\n rename sideband.c => transport/sideband.c (99%)\n rename sideband.h => transport/sideband.h (100%)\n rename transport-helper.c => transport/transport-helper.c (99%)\n rename transport-internal.h => transport/transport-internal.h (98%)\n rename transport.c => transport/transport.c (98%)\n rename transport.h => transport/transport.h (98%)\n rename upload-pack.c => transport/upload-pack.c (98%)\n rename upload-pack.h => transport/upload-pack.h (100%)\n rename walker.c => transport/walker.c (97%)\n rename walker.h => transport/walker.h (97%)\n\n\nbase-commit: 1a3e64c6c4a623626ff0687008732a8e007e2a1c\n-- \n2.54.0\n\n"},{"id":"551084","messageId":"20260823171915.2662373-2-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 01/14] organize: add the git organize builtin","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:45Z","receivedAt":"2026-08-23T17:19:19Z","isPatch":true,"body":"Add \"git organize\", a builtin that reconciles a source tree against a\nlayout the project declares. A project records where each file belongs,\nand git organize reports the files that sit elsewhere and, on request,\nmoves them into place. As .gitignore declares what stays untracked and\n.mailmap declares canonical author names, git organize adds .gitorganize,\nwhich declares the directory a file belongs in.\n\n.gitorganize has three sections. [scope] lists the pathspecs of the files\nin scope, one per line; with no [scope] section nothing is in scope.\n[layout] is the project's placement map, hand-authored: ordered\n\"label:value = directory\" rules, and a file takes the directory of the\nfirst rule its labels satisfy, so rule order matters. Git lists\nrole:public = . and role:program = . ahead of the component rules, so an\ninterface header or a program that also matches a component stays at root.\n[labels] records each file's labels, one line per source in scope with its\nkey=value labels.\n\n\"git organize status\" reads [labels] and reports the files that sit outside\ntheir directory, the backlog, and a recorded path that no longer exists. It\nruns nothing and changes nothing.\n\n\"git organize apply\" moves each out-of-place file into its directory as one\ngit apply --index transaction; a content-identical rename lets git log\n--follow and git blame track the file. It stages the result and repoints\neach moved file's [labels] line to its new path.\n\nThe .gitorganize reader and writer live in organize/gitorganize-format.c;\nthe engine that plans and applies the moves lives in organize/organize.c.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitignore                      |   1 +\n Documentation/git-organize.adoc |  82 ++++++++\n Documentation/meson.build       |   1 +\n Makefile                        |   3 +\n builtin.h                       |   1 +\n builtin/organize.c              | 110 +++++++++++\n command-list.txt                |   1 +\n git.c                           |   1 +\n meson.build                     |   3 +\n organize/gitorganize-format.c   | 261 ++++++++++++++++++++++++++\n organize/gitorganize-format.h   |  38 ++++\n organize/organize.c             | 320 ++++++++++++++++++++++++++++++++\n organize/organize.h             |  77 ++++++++\n t/meson.build                   |   1 +\n t/t0096-organize.sh             | 185 ++++++++++++++++++\n 15 files changed, 1085 insertions(+)\n create mode 100644 Documentation/git-organize.adoc\n create mode 100644 builtin/organize.c\n create mode 100644 organize/gitorganize-format.c\n create mode 100644 organize/gitorganize-format.h\n create mode 100644 organize/organize.c\n create mode 100644 organize/organize.h\n create mode 100755 t/t0096-organize.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 4da58c6754..b85ce2b13a 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -118,6 +118,7 @@\n /git-mv\n /git-name-rev\n /git-notes\n+/git-organize\n /git-p4\n /git-pack-redundant\n /git-pack-objects\ndiff --git a/Documentation/git-organize.adoc b/Documentation/git-organize.adoc\nnew file mode 100644\nindex 0000000000..4ff76f5c13\n--- /dev/null\n+++ b/Documentation/git-organize.adoc\n@@ -0,0 +1,82 @@\n+git-organize(1)\n+===============\n+\n+NAME\n+----\n+git-organize - Reconcile a source tree against a declared layout\n+\n+\n+SYNOPSIS\n+--------\n+[verse]\n+'git organize status'\n+'git organize apply'\n+\n+\n+DESCRIPTION\n+-----------\n+A project declares where each of its files belongs, and git organize\n+reports the files that sit elsewhere and, on request, moves them into\n+place. As `.gitignore` declares what stays untracked and `.mailmap`\n+declares canonical author names, `.gitorganize` declares the directory a\n+file belongs in.\n+\n+`.gitorganize` at the repository root has three sections. `[scope]` names\n+the files in scope, one pathspec per line; with no `[scope]` section\n+nothing is in scope. `[layout]` is the project's placement map, authored by\n+hand: ordered `<label>:<value> = <directory>` rules (`.` is the repository\n+root). A file's labels are matched against the rules in order, and the first\n+rule it satisfies places it; a file matching no rule is the backlog.\n+`[labels]` holds the recorded labels, one line per\n+source in scope, `<path> <key>=<value> ...`, with every label the project\n+defines. A placed file is listed too, so its `[labels]` line records its\n+labels, independently of the directory name. Only a label named in a rule\n+places a file.\n+\n+`git organize status` reads `[labels]` and reports the out-of-place files,\n+the backlog, a file in scope that `[labels]` does not record, and a\n+recorded path that no longer exists. It runs nothing and\n+changes nothing.\n+\n+`git organize apply` reconciles the tree. It moves each out-of-place file\n+into its directory. A move is a content-identical rename, so `git log\n+--follow` and `git blame` track the file exactly. apply stages the result\n+and repoints each carved file's `[labels]` line to its new path, carrying\n+its labels. It commits nothing. apply requires a clean worktree.\n+\n+\n+COMMANDS\n+--------\n+\n+status::\n+\tReport the files whose placement value names a directory they are not\n+\tin (the moves), the backlog (recorded files with no matching\n+\trule), a file in scope that `[labels]` does not record, and a recorded\n+\tpath that no longer exists. Changes nothing.\n+\n+apply::\n+\tMove each out-of-place file into its directory as a content-identical\n+\trename, repoint each carved file's `[labels]` line to its new path, and\n+\tstage the result. apply requires a clean worktree, so the change can be\n+\tdiscarded as a whole.\n+\n+\n+FILES\n+-----\n+`.gitorganize`::\n+\tThe declaration, at the repository root, in three sections. `[scope]`\n+\tnames the files in scope, one pathspec per line; with no `[scope]`\n+\tsection nothing is in scope. `[layout]` is the project's placement map:\n+\tordered `<label>:<value> = <directory>` rules (`.` is the root), where a\n+\tfile takes the directory of the first rule its labels satisfy, and a\n+\tfile matching no rule is the backlog. `[labels]` holds the recorded\n+\tlabels, one `<path> <key>=<value> ...` line per source in scope,\n+\tincluding placed files. The project writes `[scope]` and `[layout]`; the\n+\tmove apply repoints a carved file's line. A `#` line is a comment; git\n+\torganize rewrites the file whole, keeping the hand-authored `[scope]`\n+\tand `[layout]` verbatim.\n+\n+\n+GIT\n+---\n+Part of the linkgit:git[1] suite\ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex f4854f802d..8793c927b5 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -98,6 +98,7 @@ manpages = {\n   'git-mv.adoc' : 1,\n   'git-name-rev.adoc' : 1,\n   'git-notes.adoc' : 1,\n+  'git-organize.adoc' : 1,\n   'git-p4.adoc' : 1,\n   'git-pack-objects.adoc' : 1,\n   'git-pack-refs.adoc' : 1,\ndiff --git a/Makefile b/Makefile\nindex d4b775953d..da7c4df7d3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1237,6 +1237,8 @@ LIB_OBJS += oid-array.o\n LIB_OBJS += oidmap.o\n LIB_OBJS += oidset.o\n LIB_OBJS += oidtree.o\n+LIB_OBJS += organize/gitorganize-format.o\n+LIB_OBJS += organize/organize.o\n LIB_OBJS += pack-bitmap-write.o\n LIB_OBJS += pack-bitmap.o\n LIB_OBJS += pack-check.o\n@@ -1465,6 +1467,7 @@ BUILTIN_OBJS += builtin/multi-pack-index.o\n BUILTIN_OBJS += builtin/mv.o\n BUILTIN_OBJS += builtin/name-rev.o\n BUILTIN_OBJS += builtin/notes.o\n+BUILTIN_OBJS += builtin/organize.o\n BUILTIN_OBJS += builtin/pack-objects.o\n ifndef WITH_BREAKING_CHANGES\n BUILTIN_OBJS += builtin/pack-redundant.o\ndiff --git a/builtin.h b/builtin.h\nindex 4e47a4ebd3..0ac855e534 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -224,6 +224,7 @@ int cmd_multi_pack_index(int argc, const char **argv, const char *prefix, struct\n int cmd_mv(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_name_rev(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_notes(int argc, const char **argv, const char *prefix, struct repository *repo);\n+int cmd_organize(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_pack_objects(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_pack_redundant(int argc, const char **argv, const char *prefix, struct repository *repo);\n int cmd_patch_id(int argc, const char **argv, const char *prefix, struct repository *repo);\ndiff --git a/builtin/organize.c b/builtin/organize.c\nnew file mode 100644\nindex 0000000000..9462d8687f\n--- /dev/null\n+++ b/builtin/organize.c\n@@ -0,0 +1,110 @@\n+/*\n+ * \"git organize\": reconcile a source tree against a declared layout.\n+ *\n+ * cmd_organize parses arguments and drives the organize engine (organize.c).\n+ * status reports the files in scope whose matching rule names a directory they\n+ * are not in yet (the moves), the backlog (files with no matching rule), and a\n+ * declared path that no longer exists. apply moves the misplaced files and\n+ * stages the result.\n+ */\n+#include \"builtin.h\"\n+#include \"gettext.h\"\n+#include \"organize/organize.h\"\n+#include \"parse-options.h\"\n+#include \"repository.h\"\n+\n+static const char *const organize_usage[] = {\n+\t\"git organize status\",\n+\t\"git organize apply\",\n+\tNULL\n+};\n+\n+static int organize_status(struct repository *repo)\n+{\n+\tstruct organize_plan plan = ORGANIZE_PLAN_INIT;\n+\tint to_move, backlog, unrecorded, orphans;\n+\n+\torganize_plan_build(repo, &plan);\n+\tto_move = (int)plan.moves_nr;\n+\tbacklog = (int)plan.backlog.nr;\n+\tunrecorded = (int)plan.unrecorded.nr;\n+\torphans = (int)plan.orphans.nr;\n+\n+\t/*\n+\t * A summary over the files in scope: how many are already in place,\n+\t * how many move, and how many match no rule.\n+\t */\n+\tif (plan.in_scope)\n+\t\tprintf(_(\"organize: %d in scope (%d in place, %d to move, \"\n+\t\t\t \"%d backlog)\\n\"),\n+\t\t       plan.in_scope, plan.in_place, to_move, backlog);\n+\n+\tif (to_move) {\n+\t\tprintf(_(\"to move:\\n\"));\n+\t\tfor (size_t i = 0; i < plan.moves_nr; i++)\n+\t\t\tprintf(\"  %-32s -> %s\\n\", plan.moves[i].src,\n+\t\t\t       plan.moves[i].dst);\n+\t\tprintf(_(\"%d file(s) would move\\n\"), to_move);\n+\t} else {\n+\t\tprintf(_(\"in place; nothing to move\\n\"));\n+\t}\n+\tif (backlog) {\n+\t\tprintf(_(\"backlog:\\n\"));\n+\t\tfor (size_t i = 0; i < plan.backlog.nr; i++)\n+\t\t\tprintf(\"  %s\\n\", plan.backlog.items[i].string);\n+\t}\n+\tif (unrecorded) {\n+\t\tprintf(_(\"in scope but unrecorded:\\n\"));\n+\t\tfor (size_t i = 0; i < plan.unrecorded.nr; i++)\n+\t\t\tprintf(\"  %s\\n\", plan.unrecorded.items[i].string);\n+\t}\n+\tif (orphans) {\n+\t\tprintf(_(\"declared but missing:\\n\"));\n+\t\tfor (size_t i = 0; i < plan.orphans.nr; i++)\n+\t\t\tprintf(\"  %s\\n\", plan.orphans.items[i].string);\n+\t}\n+\n+\torganize_plan_release(&plan);\n+\treturn 0;\n+}\n+\n+static int organize_apply(struct repository *repo)\n+{\n+\tstruct organize_plan plan = ORGANIZE_PLAN_INIT;\n+\n+\torganize_plan_build(repo, &plan);\n+\tif (!plan.moves_nr) {\n+\t\tprintf(_(\"organize apply: nothing to do\\n\"));\n+\t\torganize_plan_release(&plan);\n+\t\treturn 0;\n+\t}\n+\n+\torganize_plan_apply(repo, &plan);\n+\n+\tprintf(_(\"organize apply: %d move(s).\\n\"), (int)plan.moves_nr);\n+\tprintf(_(\"organize apply: the result is staged; nothing is committed.\\n\"));\n+\n+\torganize_plan_release(&plan);\n+\treturn 0;\n+}\n+\n+int cmd_organize(int argc,\n+\t\t const char **argv,\n+\t\t const char *prefix,\n+\t\t struct repository *repo)\n+{\n+\tstruct option options[] = {\n+\t\tOPT_END()\n+\t};\n+\tconst char *subcmd;\n+\n+\targc = parse_options(argc, argv, prefix, options, organize_usage, 0);\n+\tsubcmd = argc ? argv[0] : \"status\";\n+\tif (argc > 1)\n+\t\tdie(_(\"git organize: too many arguments\"));\n+\tif (!strcmp(subcmd, \"status\"))\n+\t\treturn organize_status(repo);\n+\telse if (!strcmp(subcmd, \"apply\"))\n+\t\treturn organize_apply(repo);\n+\tdie(_(\"git organize: unknown subcommand '%s'\"), subcmd);\n+}\ndiff --git a/command-list.txt b/command-list.txt\nindex 21b802c420..c9892258f2 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -147,6 +147,7 @@ git-multi-pack-index                    plumbingmanipulators\n git-mv                                  mainporcelain           worktree\n git-name-rev                            plumbinginterrogators\n git-notes                               mainporcelain\n+git-organize                            ancillarymanipulators           complete\n git-p4                                  foreignscminterface\n git-pack-objects                        plumbingmanipulators\n git-pack-redundant                      plumbinginterrogators\ndiff --git a/git.c b/git.c\nindex e5f1811b6b..cd2d325585 100644\n--- a/git.c\n+++ b/git.c\n@@ -617,6 +617,7 @@ static struct cmd_struct commands[] = {\n \t{ \"mv\", cmd_mv, RUN_SETUP | NEED_WORK_TREE },\n \t{ \"name-rev\", cmd_name_rev, RUN_SETUP },\n \t{ \"notes\", cmd_notes, RUN_SETUP },\n+\t{ \"organize\", cmd_organize, RUN_SETUP | NEED_WORK_TREE },\n \t{ \"pack-objects\", cmd_pack_objects, RUN_SETUP },\n #ifndef WITH_BREAKING_CHANGES\n \t{ \"pack-redundant\", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT | DEPRECATED },\ndiff --git a/meson.build b/meson.build\nindex d86f2acd2b..a2d987b124 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -442,6 +442,8 @@ libgit_sources = [\n   'oidmap.c',\n   'oidset.c',\n   'oidtree.c',\n+  'organize/gitorganize-format.c',\n+  'organize/organize.c',\n   'pack-bitmap-write.c',\n   'pack-bitmap.c',\n   'pack-check.c',\n@@ -677,6 +679,7 @@ builtin_sources = [\n   'builtin/mv.c',\n   'builtin/name-rev.c',\n   'builtin/notes.c',\n+  'builtin/organize.c',\n   'builtin/pack-objects.c',\n   'builtin/pack-refs.c',\n   'builtin/patch-id.c',\ndiff --git a/organize/gitorganize-format.c b/organize/gitorganize-format.c\nnew file mode 100644\nindex 0000000000..cdade12f5b\n--- /dev/null\n+++ b/organize/gitorganize-format.c\n@@ -0,0 +1,261 @@\n+#include \"git-compat-util.h\"\n+#include \"gitorganize-format.h\"\n+#include \"gettext.h\"\n+#include \"quote.h\"\n+#include \"read-cache-ll.h\"\n+#include \"strbuf.h\"\n+#include \"string-list.h\"\n+#include \"wrapper.h\"\n+\n+void gitorganize_clear(struct gitorganize *g)\n+{\n+\tfor (size_t i = 0; i < g->rules_nr; i++) {\n+\t\tfree(g->rules[i].label);\n+\t\tfree(g->rules[i].value);\n+\t\tfree(g->rules[i].dir);\n+\t}\n+\tFREE_AND_NULL(g->rules);\n+\tg->rules_nr = g->rules_alloc = 0;\n+\tstrbuf_release(&g->header);\n+\tstring_list_clear(&g->scope, 0);\n+\tstring_list_clear(&g->records, 1);\t/* util is an xstrdup'd string */\n+}\n+\n+static void layout_add(struct gitorganize *g, const char *label,\n+\t\t       const char *value, const char *dir)\n+{\n+\tstruct layout_rule *rule;\n+\n+\tALLOC_GROW(g->rules, g->rules_nr + 1, g->rules_alloc);\n+\trule = &g->rules[g->rules_nr++];\n+\trule->label = xstrdup(label);\n+\trule->value = xstrdup(value);\n+\trule->dir = xstrdup(dir);\n+}\n+\n+/* Read a path token (C-quoted or bare) at `p` into `out`; return its end. */\n+const char *read_path_token(const char *p, struct strbuf *out)\n+{\n+\tsize_t len;\n+\n+\tstrbuf_reset(out);\n+\tif (*p == '\"') {\n+\t\tconst char *endp;\n+\t\tif (unquote_c_style(out, p, &endp))\n+\t\t\tdie(_(\"organize: malformed quoted path\"));\n+\t\treturn endp;\n+\t}\n+\tlen = strcspn(p, \" \\t\\n\");\n+\tstrbuf_add(out, p, len);\n+\treturn p + len;\n+}\n+\n+/*\n+ * Copy the value of `key` from the space-separated \"k=value ...\" string\n+ * `labels` into `out`. Return out->buf, or NULL when `key` is absent.\n+ */\n+static const char *label_value(const char *labels, const char *key,\n+\t\t\tstruct strbuf *out)\n+{\n+\tsize_t keylen = strlen(key);\n+\n+\twhile (*labels) {\n+\t\tconst char *end = strchrnul(labels, ' ');\t/* this token is [labels, end) */\n+\n+\t\tif (!strncmp(labels, key, keylen) && labels[keylen] == '=') {\n+\t\t\tconst char *value = labels + keylen + 1;\t/* just past \"key=\" */\n+\n+\t\t\tstrbuf_reset(out);\n+\t\t\tstrbuf_add(out, value, end - value);\n+\t\t\treturn out->buf;\n+\t\t}\n+\t\tif (!*end)\n+\t\t\tbreak;\t\t/* that was the last token */\n+\t\tlabels = end + 1;\t/* step over the space to the next */\n+\t}\n+\treturn NULL;\n+}\n+\n+/*\n+ * The first rule a file's labels satisfy, or NULL (the backlog). Rules are\n+ * tried in order, so an earlier rule takes precedence.\n+ */\n+struct layout_rule *layout_match(struct gitorganize *g, const char *labels,\n+\t\t\t\t struct strbuf *value_buf)\n+{\n+\tfor (size_t i = 0; i < g->rules_nr; i++) {\n+\t\tstruct layout_rule *rule = &g->rules[i];\n+\t\tconst char *value = label_value(labels, rule->label, value_buf);\n+\n+\t\tif (value && !strcmp(value, rule->value))\n+\t\t\treturn rule;\n+\t}\n+\treturn NULL;\n+}\n+\n+/*\n+ * Parse a `label:value = directory` [layout] rule and add it to `g`; die on a\n+ * malformed rule or an unsafe directory. `line` is the original text, for\n+ * error messages.\n+ */\n+static void parse_layout_rule(struct gitorganize *g, const char *trimmed,\n+\t\t\t      const char *line)\n+{\n+\tconst char *equals = strchr(trimmed, '='), *colon;\n+\tstruct strbuf left = STRBUF_INIT, dir = STRBUF_INIT;\n+\tstruct strbuf label = STRBUF_INIT, value = STRBUF_INIT;\n+\n+\tif (!equals)\n+\t\tdie(_(\"organize: .gitorganize: [layout] requires \"\n+\t\t      \"'label:value = directory' in: %s\"), line);\n+\tstrbuf_add(&left, trimmed, equals - trimmed);\n+\tstrbuf_trim(&left);\n+\tstrbuf_addstr(&dir, equals + 1);\n+\tstrbuf_trim(&dir);\n+\twhile (dir.len && dir.buf[dir.len - 1] == '/')\n+\t\tstrbuf_setlen(&dir, dir.len - 1);\t/* tolerate a trailing slash */\n+\tcolon = strchr(left.buf, ':');\n+\tif (!colon)\n+\t\tdie(_(\"organize: .gitorganize: [layout] requires \"\n+\t\t      \"'label:value = directory' in: %s\"), line);\n+\tstrbuf_add(&label, left.buf, colon - left.buf);\n+\tstrbuf_trim(&label);\n+\tstrbuf_addstr(&value, colon + 1);\n+\tstrbuf_trim(&value);\n+\tif (!label.len || !value.len || !dir.len)\n+\t\tdie(_(\"organize: .gitorganize: [layout] requires \"\n+\t\t      \"'label:value = directory' in: %s\"), line);\n+\tif (strcmp(dir.buf, \".\") && !verify_path(dir.buf, 0))\n+\t\tdie(_(\"organize: .gitorganize: [layout] directory \"\n+\t\t      \"must be inside the tree: %s\"), dir.buf);\n+\tlayout_add(g, label.buf, value.buf, dir.buf);\n+\tstrbuf_release(&left);\n+\tstrbuf_release(&dir);\n+\tstrbuf_release(&label);\n+\tstrbuf_release(&value);\n+}\n+\n+/*\n+ * Parse .gitorganize into `g`: the [scope] pathspecs (g->scope), the [layout]\n+ * rules (g->rules), the verbatim [scope] and [layout] header (g->header, kept\n+ * for round-tripping on write), and the [labels] records (g->records, each\n+ * path -> its \"k=value k=value\" string in util). A missing file leaves `g`\n+ * empty.\n+ */\n+void gitorganize_read(struct gitorganize *g)\n+{\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tstruct string_list lines = STRING_LIST_INIT_NODUP;\n+\tstruct strbuf path = STRBUF_INIT;\n+\tenum { NONE, SCOPE, LAYOUT, LABELS } section = NONE;\n+\n+\tif (strbuf_read_file(&buf, \".gitorganize\", 0) < 0) {\n+\t\tstrbuf_release(&buf);\n+\t\treturn;\n+\t}\n+\tstring_list_split_in_place(&lines, buf.buf, \"\\n\", -1);\n+\tfor (size_t i = 0; i < lines.nr; i++) {\n+\t\tchar *line = lines.items[i].string;\n+\t\tsize_t len = strlen(line);\n+\t\tconst char *trimmed;\n+\n+\t\tif (len && line[len - 1] == '\\r')\n+\t\t\tline[len - 1] = '\\0';\t/* tolerate CRLF line endings */\n+\t\tif (!*line && i + 1 == lines.nr)\n+\t\t\tcontinue;\t/* trailing empty from the final newline */\n+\t\ttrimmed = line + strspn(line, \" \\t\");\n+\n+\t\tif (!strcmp(trimmed, \"[scope]\")) {\n+\t\t\tsection = SCOPE;\n+\t\t\tstrbuf_addf(&g->header, \"%s\\n\", line);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(trimmed, \"[layout]\")) {\n+\t\t\tsection = LAYOUT;\n+\t\t\tstrbuf_addf(&g->header, \"%s\\n\", line);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(trimmed, \"[labels]\")) {\n+\t\t\tsection = LABELS;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\t/*\n+\t\t * [scope] and [layout] are hand-authored and round-tripped, so\n+\t\t * every line (comments and blanks included) is kept in the\n+\t\t * header; only a content line feeds the parsed rules.\n+\t\t */\n+\t\tif (section == SCOPE || section == LAYOUT) {\n+\t\t\tstrbuf_addf(&g->header, \"%s\\n\", line);\n+\t\t\tif (!*trimmed || *trimmed == '#')\n+\t\t\t\tcontinue;\n+\t\t\tif (section == SCOPE)\n+\t\t\t\tstring_list_append(&g->scope, trimmed);\n+\t\t\telse\n+\t\t\t\tparse_layout_rule(g, trimmed, line);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (section == LABELS) {\n+\t\t\tconst char *p;\n+\n+\t\t\tif (!*trimmed || *trimmed == '#')\n+\t\t\t\tcontinue;\n+\t\t\tp = read_path_token(trimmed, &path);\n+\t\t\tif (!path.len)\n+\t\t\t\tdie(_(\"organize: .gitorganize: [labels] line has \"\n+\t\t\t\t      \"no path: %s\"), line);\n+\t\t\t/*\n+\t\t\t * A quoted path token can end mid-line (\"a\"junk); a\n+\t\t\t * label list must be set off by whitespace, so require\n+\t\t\t * whitespace or end-of-line after the path.\n+\t\t\t */\n+\t\t\tif (*p && *p != ' ' && *p != '\\t' && *p != '\\n')\n+\t\t\t\tdie(_(\"organize: .gitorganize: trailing text \"\n+\t\t\t\t      \"after path: %s\"), line);\n+\t\t\tp += strspn(p, \" \\t\");\n+\t\t\tif (string_list_has_string(&g->records, path.buf))\n+\t\t\t\tdie(_(\"organize: .gitorganize: '%s' listed twice\"),\n+\t\t\t\t    path.buf);\n+\t\t\tstring_list_insert(&g->records, path.buf)->util =\n+\t\t\t\txstrdup(p);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (*trimmed && *trimmed != '#')\n+\t\t\tdie(_(\"organize: .gitorganize: line outside \"\n+\t\t\t      \"[scope]/[layout]/[labels]: %s\"), line);\n+\t}\n+\tstring_list_clear(&lines, 0);\n+\tstrbuf_release(&path);\n+\tstrbuf_release(&buf);\n+}\n+\n+/*\n+ * Write .gitorganize from `g`: its verbatim [scope] and [layout] header\n+ * (g->header), then the [labels] records (g->records, each path -> its\n+ * \"k=value k=value\" string in util), one `<path> <k=value ...>` line per entry\n+ * in the list's sorted order. A path that needs it is C-quoted.\n+ */\n+void gitorganize_write(struct gitorganize *g)\n+{\n+\tstruct strbuf out = STRBUF_INIT;\n+\n+\tif (g->header.len)\n+\t\tstrbuf_addbuf(&out, &g->header);\n+\telse\n+\t\tstrbuf_addstr(&out, \"[layout]\\n\");\n+\tstrbuf_addstr(&out, \"[labels]\\n\");\n+\tfor (size_t i = 0; i < g->records.nr; i++) {\n+\t\tconst char *labels = g->records.items[i].util;\n+\n+\t\tquote_c_style(g->records.items[i].string, &out, NULL, 0);\n+\t\tif (labels && *labels) {\n+\t\t\tstrbuf_addch(&out, ' ');\n+\t\t\tstrbuf_addstr(&out, labels);\n+\t\t}\n+\t\tstrbuf_addch(&out, '\\n');\n+\t}\n+\twrite_file_buf(\".gitorganize\", out.buf, out.len);\n+\tstrbuf_release(&out);\n+}\ndiff --git a/organize/gitorganize-format.h b/organize/gitorganize-format.h\nnew file mode 100644\nindex 0000000000..d499545a25\n--- /dev/null\n+++ b/organize/gitorganize-format.h\n@@ -0,0 +1,38 @@\n+#ifndef GITORGANIZE_FORMAT_H\n+#define GITORGANIZE_FORMAT_H\n+\n+#include \"strbuf.h\"\n+#include \"string-list.h\"\n+\n+struct layout_rule {\n+\tchar *label;\n+\tchar *value;\n+\tchar *dir;\n+};\n+\n+/*\n+ * The parsed .gitorganize file: the [scope] pathspecs, the [layout] rules, the\n+ * verbatim [scope] and [layout] header (round-tripped on write), and the\n+ * [labels] records (each path -> its \"k=value ...\" string in util).\n+ */\n+struct gitorganize {\n+\tstruct string_list scope;\n+\tstruct layout_rule *rules;\n+\tsize_t rules_nr, rules_alloc;\n+\tstruct strbuf header;\n+\tstruct string_list records;\n+};\n+#define GITORGANIZE_INIT { \\\n+\t.scope = STRING_LIST_INIT_DUP, \\\n+\t.header = STRBUF_INIT, \\\n+\t.records = STRING_LIST_INIT_DUP, \\\n+}\n+\n+void gitorganize_clear(struct gitorganize *g);\n+const char *read_path_token(const char *p, struct strbuf *out);\n+struct layout_rule *layout_match(struct gitorganize *g, const char *labels,\n+\t\t\t\t struct strbuf *value_buf);\n+void gitorganize_read(struct gitorganize *g);\n+void gitorganize_write(struct gitorganize *g);\n+\n+#endif /* GITORGANIZE_FORMAT_H */\ndiff --git a/organize/organize.c b/organize/organize.c\nnew file mode 100644\nindex 0000000000..0d9850dfc0\n--- /dev/null\n+++ b/organize/organize.c\n@@ -0,0 +1,320 @@\n+#include \"git-compat-util.h\"\n+#include \"organize.h\"\n+#include \"gitorganize-format.h\"\n+#include \"gettext.h\"\n+#include \"pathspec.h\"\n+#include \"quote.h\"\n+#include \"read-cache-ll.h\"\n+#include \"repository.h\"\n+#include \"run-command.h\"\n+#include \"strbuf.h\"\n+#include \"string-list.h\"\n+#include \"strvec.h\"\n+#include \"wrapper.h\"\n+#include \"wt-status.h\"\n+\n+/*\n+ * The [layout] rule whose directory equals `path`'s directory, or NULL when\n+ * `path` is a root file or its directory matches no rule. A file in a [layout]\n+ * directory is in place, whatever its recorded label; its directory alone\n+ * tells git organize it is in place.\n+ */\n+static struct layout_rule *layout_dir_rule(struct gitorganize *g,\n+\t\t\t\t\t   const char *path)\n+{\n+\tconst char *slash = strrchr(path, '/');\n+\tsize_t dirlen;\n+\n+\tif (!slash)\n+\t\treturn NULL;\t\t/* a root file */\n+\tdirlen = slash - path;\n+\tfor (size_t i = 0; i < g->rules_nr; i++) {\n+\t\tstruct layout_rule *r = &g->rules[i];\n+\n+\t\tif (strcmp(r->dir, \".\") && strlen(r->dir) == dirlen &&\n+\t\t    !strncmp(path, r->dir, dirlen))\n+\t\t\treturn r;\n+\t}\n+\treturn NULL;\n+}\n+\n+/*\n+ * Read the index once into two lists: every tracked file in `tracked_files`,\n+ * and the governed subset in `scoped_files`. A file is governed when it matches\n+ * the [scope] pathspecs (a candidate to label and move) or when it already sits\n+ * in a [layout] directory (kept in scope so a file added under a carved\n+ * directory does not slip in ungoverned). With no [scope] pathspecs and no\n+ * [layout] rules, no file is governed.\n+ */\n+static void collect_index(struct repository *repo, struct gitorganize *g,\n+\t\t\t  struct string_list *scoped_files,\n+\t\t\t  struct string_list *tracked_files)\n+{\n+\tstruct pathspec pathspec;\n+\tstruct strvec specs = STRVEC_INIT;\n+\n+\tfor (size_t i = 0; i < g->scope.nr; i++)\n+\t\tstrvec_push(&specs, g->scope.items[i].string);\n+\tparse_pathspec(&pathspec, 0, PATHSPEC_PREFER_FULL, \"\", specs.v);\n+\n+\tif (repo_read_index(repo) < 0)\n+\t\tdie(_(\"organize: could not read the index\"));\n+\tfor (size_t i = 0; i < repo->index->cache_nr; i++) {\n+\t\tconst char *name = repo->index->cache[i]->name;\n+\n+\t\tstring_list_insert(tracked_files, name);\n+\t\tif (g->scope.nr &&\n+\t\t    match_pathspec(repo->index, &pathspec, name,\n+\t\t\t\t   strlen(name), 0, NULL, 0))\n+\t\t\tstring_list_insert(scoped_files, name);\n+\t\telse if (layout_dir_rule(g, name))\n+\t\t\tstring_list_insert(scoped_files, name);\n+\t}\n+\tclear_pathspec(&pathspec);\n+\tstrvec_clear(&specs);\n+}\n+\n+/*\n+ * The parsed .gitorganize (gitorg) and the tree state that status, apply, and\n+ * labeling all read: the files in scope (scoped_files) and every tracked_files\n+ * file.\n+ */\n+struct organize_ctx {\n+\tstruct gitorganize gitorg;\n+\tstruct string_list scoped_files;\n+\tstruct string_list tracked_files;\n+};\n+#define ORGANIZE_CTX_INIT { \\\n+\t.gitorg = GITORGANIZE_INIT, \\\n+\t.scoped_files = STRING_LIST_INIT_DUP, \\\n+\t.tracked_files = STRING_LIST_INIT_DUP, \\\n+}\n+\n+static void organize_ctx_load(struct repository *repo, struct organize_ctx *ctx)\n+{\n+\tgitorganize_read(&ctx->gitorg);\n+\tcollect_index(repo, &ctx->gitorg, &ctx->scoped_files,\n+\t\t      &ctx->tracked_files);\n+}\n+\n+static void organize_ctx_release(struct organize_ctx *ctx)\n+{\n+\tgitorganize_clear(&ctx->gitorg);\n+\tstring_list_clear(&ctx->scoped_files, 0);\n+\tstring_list_clear(&ctx->tracked_files, 0);\n+}\n+\n+static void add_move(struct organize_plan *plan, const char *src,\n+\t\t     char *dst, const char *value)\n+{\n+\tstruct organize_move *m;\n+\n+\tALLOC_GROW(plan->moves, plan->moves_nr + 1, plan->moves_alloc);\n+\tm = &plan->moves[plan->moves_nr++];\n+\tm->src = xstrdup(src);\n+\tm->dst = dst;\n+\tm->rule_value = xstrdup(value);\n+}\n+\n+void organize_plan_build(struct repository *repo, struct organize_plan *plan)\n+{\n+\tstruct organize_ctx ctx = ORGANIZE_CTX_INIT;\n+\tstruct string_list seen = STRING_LIST_INIT_DUP;\n+\tstruct strbuf value_buf = STRBUF_INIT;\n+\n+\torganize_ctx_load(repo, &ctx);\n+\n+\t/*\n+\t * Classify each recorded entry by the rule its labels match. A file\n+\t * already in the rule's directory is in place. A file in another\n+\t * directory is a move. A file whose labels match no rule is backlog.\n+\t */\n+\tfor (size_t i = 0; i < ctx.gitorg.records.nr; i++) {\n+\t\tconst char *path = ctx.gitorg.records.items[i].string;\n+\t\tconst char *labels = ctx.gitorg.records.items[i].util;\n+\t\tconst char *base, *target, *slash;\n+\t\tstruct layout_rule *rule;\n+\t\tstruct strbuf dst = STRBUF_INIT;\n+\n+\t\tif (!string_list_has_string(&ctx.tracked_files, path))\n+\t\t\tcontinue;\t/* an orphan, handled below */\n+\t\tstring_list_insert(&seen, path);\n+\t\tplan->in_scope++;\n+\n+\t\trule = layout_match(&ctx.gitorg, labels, &value_buf);\n+\t\tif (!rule) {\n+\t\t\tstring_list_append(&plan->backlog, path);\n+\t\t\tcontinue;\n+\t\t}\n+\t\ttarget = rule->dir;\n+\n+\t\t/* the path the rule names: dir/base, or base at the root */\n+\t\tslash = strrchr(path, '/');\n+\t\tbase = slash ? slash + 1 : path;\n+\t\tif (!strcmp(target, \".\"))\n+\t\t\tstrbuf_addstr(&dst, base);\n+\t\telse\n+\t\t\tstrbuf_addf(&dst, \"%s/%s\", target, base);\n+\n+\t\tif (!strcmp(dst.buf, path))\n+\t\t\tplan->in_place++;\t/* already in place */\n+\t\telse\n+\t\t\tadd_move(plan, path, strbuf_detach(&dst, NULL), rule->value);\n+\t\tstrbuf_release(&dst);\n+\t}\n+\n+\t/*\n+\t * The loop above covered every file with a [labels] line. A file in scope\n+\t * with no such line falls into one of two groups. A file already in a\n+\t * [layout] directory is in place; the tree is truth, so it needs no\n+\t * [labels] line. A root file with no line is unrecorded; it is a mismatch\n+\t * between the tree and [labels] and does not count toward in_scope, like\n+\t * an orphan.\n+\t */\n+\tfor (size_t i = 0; i < ctx.scoped_files.nr; i++) {\n+\t\tconst char *path = ctx.scoped_files.items[i].string;\n+\n+\t\tif (string_list_has_string(&seen, path))\n+\t\t\tcontinue;\n+\t\tif (layout_dir_rule(&ctx.gitorg, path)) {\n+\t\t\tplan->in_scope++;\n+\t\t\tplan->in_place++;\n+\t\t} else {\n+\t\t\tstring_list_append(&plan->unrecorded, path);\n+\t\t}\n+\t}\n+\n+\t/* A recorded path that is no longer a tracked_files file is an orphan. */\n+\tfor (size_t i = 0; i < ctx.gitorg.records.nr; i++)\n+\t\tif (!string_list_has_string(&ctx.tracked_files, ctx.gitorg.records.items[i].string))\n+\t\t\tstring_list_append(&plan->orphans, ctx.gitorg.records.items[i].string);\n+\n+\torganize_ctx_release(&ctx);\n+\tstring_list_clear(&seen, 0);\n+\tstrbuf_release(&value_buf);\n+}\n+\n+/* Whether the worktree has staged or unstaged changes to any tracked file. */\n+static int worktree_dirty(struct repository *repo)\n+{\n+\tif (repo_read_index(repo) < 0)\n+\t\tdie(_(\"organize: could not read the index\"));\n+\treturn has_unstaged_changes(repo, 0) || has_uncommitted_changes(repo, 0);\n+}\n+\n+/* Map each move's src to its dst, in `dst_of`. */\n+static void plan_dst_map(struct organize_plan *plan, struct string_list *dst_of)\n+{\n+\tfor (size_t i = 0; i < plan->moves_nr; i++)\n+\t\tstring_list_insert(dst_of, plan->moves[i].src)->util =\n+\t\t\tplan->moves[i].dst;\n+}\n+\n+/* A content-identical rename entry per move. */\n+static void build_rename_patch(struct organize_plan *plan, struct strbuf *out)\n+{\n+\tfor (size_t i = 0; i < plan->moves_nr; i++) {\n+\t\tstruct organize_move *m = &plan->moves[i];\n+\n+\t\t/* These are tracked_files source paths, which need no quoting. */\n+\t\tstrbuf_addf(out, \"diff --git a/%s b/%s\\n\", m->src, m->dst);\n+\t\tstrbuf_addstr(out, \"similarity index 100%\\n\");\n+\t\tstrbuf_addf(out, \"rename from %s\\n\", m->src);\n+\t\tstrbuf_addf(out, \"rename to %s\\n\", m->dst);\n+\t}\n+}\n+\n+static int git_apply_index(const char *patch, size_t len)\n+{\n+\tstruct child_process cp = CHILD_PROCESS_INIT;\n+\n+\tcp.git_cmd = 1;\n+\tstrvec_pushl(&cp.args, \"apply\", \"--index\", NULL);\n+\treturn pipe_command(&cp, patch, len, NULL, 0, NULL, 0);\n+}\n+\n+/*\n+ * Repoint each carved file's [labels] line to its new path, carrying its labels\n+ * unchanged: only its location changes. Returns nonzero when [labels] changed.\n+ */\n+static int repoint_moved_declarations(struct organize_plan *plan)\n+{\n+\tstruct gitorganize g = GITORGANIZE_INIT;\n+\tstruct string_list dst_of = STRING_LIST_INIT_NODUP;\n+\tstruct string_list new_records = STRING_LIST_INIT_DUP;\n+\tint changed = 0;\n+\n+\tplan_dst_map(plan, &dst_of);\n+\tgitorganize_read(&g);\n+\n+\t/*\n+\t * Rewrite [labels]: an entry whose file moved (found in dst_of) takes\n+\t * its new path (dst_of's util) and keeps its labels (the record's util).\n+\t */\n+\tfor (size_t i = 0; i < g.records.nr; i++) {\n+\t\tconst char *path = g.records.items[i].string;\n+\t\tconst char *labels = g.records.items[i].util;\n+\t\tstruct string_list_item *moved =\n+\t\t\tstring_list_lookup(&dst_of, path);\n+\n+\t\tif (moved) {\n+\t\t\tpath = moved->util;\n+\t\t\tchanged = 1;\n+\t\t}\n+\t\tstring_list_insert(&new_records, path)->util = xstrdup(labels);\n+\t}\n+\n+\t/* Install the rewritten [labels]; gitorganize_clear frees it below. */\n+\tstring_list_clear(&g.records, 1);\n+\tg.records = new_records;\n+\tif (changed)\n+\t\tgitorganize_write(&g);\n+\n+\tgitorganize_clear(&g);\n+\tstring_list_clear(&dst_of, 0);\n+\treturn changed;\n+}\n+\n+void organize_plan_apply(struct repository *repo, struct organize_plan *plan)\n+{\n+\tstruct strbuf patch = STRBUF_INIT;\n+\n+\tif (worktree_dirty(repo))\n+\t\tdie(_(\"organize apply: the worktree has uncommitted changes; \"\n+\t\t      \"commit or stash first\"));\n+\n+\t/*\n+\t * Content-identical renames for every move, applied as one\n+\t * git apply --index transaction, so a failure leaves the tree untouched.\n+\t */\n+\tbuild_rename_patch(plan, &patch);\n+\tif (patch.len && git_apply_index(patch.buf, patch.len))\n+\t\tdie(_(\"organize apply: the change does not apply cleanly; \"\n+\t\t      \"nothing was changed\"));\n+\n+\tif (repoint_moved_declarations(plan)) {\n+\t\tstruct child_process add = CHILD_PROCESS_INIT;\n+\n+\t\tadd.git_cmd = 1;\n+\t\tstrvec_pushl(&add.args, \"add\", \".gitorganize\", NULL);\n+\t\tif (run_command(&add))\n+\t\t\tdie(_(\"organize apply: staging .gitorganize failed; \"\n+\t\t\t      \"restore with git reset --hard\"));\n+\t}\n+\n+\tstrbuf_release(&patch);\n+}\n+\n+void organize_plan_release(struct organize_plan *plan)\n+{\n+\tfor (size_t i = 0; i < plan->moves_nr; i++) {\n+\t\tfree(plan->moves[i].src);\n+\t\tfree(plan->moves[i].dst);\n+\t\tfree(plan->moves[i].rule_value);\n+\t}\n+\tFREE_AND_NULL(plan->moves);\n+\tplan->moves_nr = plan->moves_alloc = 0;\n+\tstring_list_clear(&plan->backlog, 0);\n+\tstring_list_clear(&plan->unrecorded, 0);\n+\tstring_list_clear(&plan->orphans, 0);\n+}\ndiff --git a/organize/organize.h b/organize/organize.h\nnew file mode 100644\nindex 0000000000..c26453d2be\n--- /dev/null\n+++ b/organize/organize.h\n@@ -0,0 +1,77 @@\n+#ifndef ORGANIZE_H\n+#define ORGANIZE_H\n+\n+#include \"string-list.h\"\n+\n+struct repository;\n+\n+/*\n+ * The git organize engine. A project declares where each file belongs, and\n+ * git organize reconciles the tree against that declaration.\n+ *\n+ * The committed declaration lives in .gitorganize, a file organize owns, in\n+ * three sections:\n+ *\n+ *   [scope]    the scope pathspecs, one per line; no [scope] section means\n+ *     nothing is in scope.\n+ *\n+ *   [layout]   the project's placement map, hand-authored: ordered\n+ *     `<label>:<value> = <directory>` rules (`.` is the root). A file's labels\n+ *     are matched against the rules in order, and the first rule it satisfies\n+ *     places it; a file matching no rule is backlog. Only a label named in\n+ *     a rule places a file.\n+ *\n+ *   [labels]   the recorded labels, one line per source in scope, `<path> <key>=\n+ *     <value> ...`, with every label the project defines. Placed files are listed\n+ *     too, so a placed file's [labels] line records its labels, independently of\n+ *     the directory name.\n+ *\n+ *   status  Read [labels] and report the files in scope whose matching rule\n+ *     names a directory they are not in yet (the moves), the backlog, and a\n+ *     recorded path that no longer exists.\n+ *\n+ *   apply   Perform the moves. A move is a content-identical rename, applied as\n+ *     one git apply --index transaction. A carved file's [labels] line is\n+ *     repointed to its new path, carrying its labels.\n+ */\n+\n+struct organize_move {\n+\tchar *src;\t/* current path */\n+\tchar *dst;\t/* declared path */\n+\tchar *rule_value;\t/* the matched rule's value */\n+};\n+\n+struct organize_plan {\n+\tstruct organize_move *moves;\n+\tsize_t moves_nr, moves_alloc;\n+\tstruct string_list backlog;\t/* recorded files that match no rule */\n+\tstruct string_list unrecorded;\t/* scope files with no [labels] record */\n+\tstruct string_list orphans;\t/* declared paths that no longer exist */\n+\tint in_scope;\t\t\t/* files in scope */\n+\tint in_place;\t\t\t/* files in scope already at their declared location */\n+};\n+\n+#define ORGANIZE_PLAN_INIT { \\\n+\t.backlog = STRING_LIST_INIT_DUP, \\\n+\t.unrecorded = STRING_LIST_INIT_DUP, \\\n+\t.orphans = STRING_LIST_INIT_DUP, \\\n+}\n+\n+/*\n+ * Read the .gitorganize declaration and record every file whose matching\n+ * rule names a directory it is not in as a move. Also record the backlog\n+ * (recorded files that match no rule), the unrecorded files (in scope,\n+ * no [labels] line), and the orphans (declared paths\n+ * that no longer exist).\n+ */\n+void organize_plan_build(struct repository *repo, struct organize_plan *plan);\n+\n+/*\n+ * Perform the plan: apply the moves as one content-identical-rename\n+ * transaction; the result is staged. Requires a clean worktree.\n+ */\n+void organize_plan_apply(struct repository *repo, struct organize_plan *plan);\n+\n+void organize_plan_release(struct organize_plan *plan);\n+\n+#endif /* ORGANIZE_H */\ndiff --git a/t/meson.build b/t/meson.build\nindex 2133c840da..fba20fc069 100644\n--- a/t/meson.build\n+++ b/t/meson.build\n@@ -127,6 +127,7 @@ integration_tests = [\n   't0092-diagnose.sh',\n   't0093-verify-cache-df-gap.sh',\n   't0095-bloom.sh',\n+  't0096-organize.sh',\n   't0100-previous.sh',\n   't0101-at-syntax.sh',\n   't0200-gettext-basic.sh',\ndiff --git a/t/t0096-organize.sh b/t/t0096-organize.sh\nnew file mode 100755\nindex 0000000000..a352a1c7d1\n--- /dev/null\n+++ b/t/t0096-organize.sh\n@@ -0,0 +1,185 @@\n+#!/bin/sh\n+\n+test_description='git organize reconciles a tree against a declared layout'\n+\n+. ./test-lib.sh\n+\n+# There is no labeler yet, so tests write .gitorganize by hand: root *.c/*.h in\n+# scope, odb/refs components, and a [labels] census.\n+write_declaration () {\n+\tcat >.gitorganize <<-\\EOF\n+\t[scope]\n+\t:(glob)*.c\n+\t:(glob)*.h\n+\t[layout]\n+\trole:public = .\n+\trole:program = .\n+\tcomponent:odb = odb\n+\tcomponent:refs = refs\n+\t[labels]\n+\tblob.c component=odb role=lib\n+\theader.h component=? role=public\n+\trefs.c component=refs role=lib\n+\tEOF\n+}\n+\n+test_expect_success 'setup a tree and a declaration' '\n+\techo blob >blob.c &&\n+\techo refs >refs.c &&\n+\techo header >header.h &&\n+\tgit add . &&\n+\tgit commit -m init &&\n+\twrite_declaration &&\n+\tgit add .gitorganize &&\n+\tgit commit -m declare\n+'\n+\n+test_expect_success 'status reports the files to move' '\n+\tgit organize status >actual &&\n+\t# header.h is public (in place at root); blob.c and refs.c move next\n+\ttest_grep \"organize: 3 in scope (1 in place, 2 to move, 0 backlog)\" actual &&\n+\ttest_grep \"blob.c  *-> odb/blob.c\" actual &&\n+\ttest_grep \"refs.c  *-> refs/refs.c\" actual &&\n+\ttest_grep ! header.h actual &&\n+\ttest_grep \"2 file(s) would move\" actual\n+'\n+\n+test_expect_success 'apply moves files as content-identical renames and repoints [labels]' '\n+\tgit organize apply &&\n+\tgit diff --cached -M --name-status >actual &&\n+\ttest_grep \"^R100.*blob.c.*odb/blob.c\" actual &&\n+\ttest_grep \"^R100.*refs.c.*refs/refs.c\" actual &&\n+\ttest_path_is_file odb/blob.c &&\n+\ttest_path_is_file refs/refs.c &&\n+\ttest_path_is_file header.h &&\n+\ttest_path_is_missing blob.c &&\n+\ttest_path_is_missing refs.c &&\n+\tgit diff --cached --name-only >staged &&\n+\ttest_grep \"^.gitorganize$\" staged &&\n+\tgit commit -m reconciled &&\n+\tgit organize status >actual &&\n+\ttest_grep \"nothing to move\" actual &&\n+\ttest_grep \"^odb/blob.c component=odb\" .gitorganize &&\n+\ttest_grep \"^refs/refs.c component=refs\" .gitorganize &&\n+\ttest_grep ! \"^blob.c \" .gitorganize &&\n+\ttest_grep ! \"^refs.c \" .gitorganize &&\n+\ttest_grep \"^header.h component=? role=public\" .gitorganize\n+'\n+\n+test_expect_success 'apply refuses a dirty worktree' '\n+\tgit init dirty &&\n+\t(\n+\t\tcd dirty &&\n+\t\techo blob >blob.c &&\n+\t\techo other >other.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[scope]\n+\t\t:(glob)*.c\n+\t\t[layout]\n+\t\tcomponent:odb = odb\n+\t\t[labels]\n+\t\tblob.c component=odb\n+\t\tother.c component=?\n+\t\tEOF\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\techo dirty >>other.c &&\n+\t\ttest_must_fail git organize apply 2>err &&\n+\t\ttest_grep \"uncommitted changes\" err\n+\t)\n+'\n+\n+test_expect_success 'a file in scope with no matching rule is backlog' '\n+\tgit init backlog &&\n+\t(\n+\t\tcd backlog &&\n+\t\techo a >a.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[scope]\n+\t\t:(glob)*.c\n+\t\t[layout]\n+\t\tcomponent:odb = odb\n+\t\t[labels]\n+\t\ta.c component=?\n+\t\tEOF\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize status >actual &&\n+\t\ttest_grep \"backlog\" actual &&\n+\t\ttest_grep \"^  a.c$\" actual\n+\t)\n+'\n+\n+test_expect_success 'status reports a declared path that no longer exists' '\n+\tgit init orphan &&\n+\t(\n+\t\tcd orphan &&\n+\t\techo a >a.c &&\n+\t\techo b >b.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[scope]\n+\t\t:(glob)*.c\n+\t\t[layout]\n+\t\trole:public = .\n+\t\t[labels]\n+\t\ta.c role=public\n+\t\tb.c role=public\n+\t\tEOF\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit rm -q b.c &&\n+\t\tgit commit -m drop-b &&\n+\t\tgit organize status >actual &&\n+\t\ttest_grep \"declared but missing\" actual &&\n+\t\ttest_grep \"  b.c\" actual\n+\t)\n+'\n+\n+test_expect_success 'status rejects a malformed .gitorganize' '\n+\tgit init bad &&\n+\t(\n+\t\tcd bad &&\n+\t\techo a >a.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[layout]\n+\t\tcomponent:odb = odb\n+\t\t[labels]\n+\t\ta.c component=odb\n+\t\ta.c component=odb\n+\t\tEOF\n+\t\ttest_must_fail git organize status 2>err &&\n+\t\ttest_grep \"listed twice\" err &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[layout]\n+\t\tnocolon = .\n+\t\tEOF\n+\t\ttest_must_fail git organize status 2>err &&\n+\t\ttest_grep \"label:value = directory\" err &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[layout]\n+\t\tcomponent:x = ../evil\n+\t\tEOF\n+\t\ttest_must_fail git organize status 2>err &&\n+\t\ttest_grep \"must be inside the tree\" err &&\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\tstray line\n+\t\tEOF\n+\t\ttest_must_fail git organize status 2>err &&\n+\t\ttest_grep \"line outside\" err\n+\t)\n+'\n+\n+test_expect_success 'a subcommand rejects extra operands' '\n+\ttest_must_fail git -C bad organize status junk 2>err &&\n+\ttest_grep \"too many arguments\" err\n+'\n+\n+test_done\n-- \n2.54.0\n\n"},{"id":"551083","messageId":"20260823171915.2662373-4-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 03/14] organize: add status --exit-code","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:47Z","receivedAt":"2026-08-23T17:19:21Z","isPatch":true,"body":"git organize status reports and always returns zero. A project that keeps\nits tree reconciled needs status to fail when the tree drifts, so a check\ncan gate on the result.\n\nAdd --exit-code. status returns 1 when a file is out of place or a recorded\npath no longer exists, and 0 otherwise. A standing backlog alone does not\nfail it: a backlog file matches no rule, so it is not out of place.\n--exit-code changes no output.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n Documentation/git-organize.adoc | 15 ++++++++++++---\n builtin/organize.c              | 12 +++++++-----\n t/t0096-organize.sh             | 20 +++++++++++++++-----\n 3 files changed, 34 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/git-organize.adoc b/Documentation/git-organize.adoc\nindex 8b216146b6..37ada38234 100644\n--- a/Documentation/git-organize.adoc\n+++ b/Documentation/git-organize.adoc\n@@ -9,7 +9,7 @@ git-organize - Reconcile a source tree against a declared layout\n SYNOPSIS\n --------\n [verse]\n-'git organize status'\n+'git organize status' [--exit-code]\n 'git organize apply'\n 'git organize apply' --labels-only [--reseed]\n \n@@ -44,7 +44,9 @@ is not in yet.\n `git organize status` reads `[labels]` and reports the out-of-place files,\n the backlog, a file in scope that `[labels]` does not record, and a\n recorded path that no longer exists. status runs no\n-configured command and changes nothing.\n+configured command and changes nothing. With `--exit-code` it exits\n+non-zero when a file is out of place, a file in scope is unrecorded, or a\n+recorded path is missing; a standing backlog alone does not fail it.\n \n `git organize apply` reconciles the tree. It moves each out-of-place file\n into its directory. A move that git organize makes on its own is a\n@@ -72,7 +74,9 @@ status::\n \tin (the moves), the backlog (recorded files with no matching\n \trule), a file in scope that `[labels]` does not record, and a recorded\n \tpath that no longer exists. Runs no configured\n-\tcommand and changes nothing.\n+\tcommand and changes nothing. With `--exit-code`, exit non-zero when a\n+\tfile is out of place, a file in scope is unrecorded, or a recorded path\n+\tis missing.\n \n apply::\n \tMove each out-of-place file into its directory as a content-identical\n@@ -92,6 +96,11 @@ never do.\n OPTIONS\n -------\n \n+--exit-code::\n+\tExit non-zero from status when a file is out of place, a file in scope\n+\tis unrecorded, or a recorded path is missing. A standing backlog alone\n+\tdoes not fail it. Changes no output.\n+\n --labels-only::\n \tWith apply, run the labeler and record the labels; move no file. A\n \trecorded file keeps its line; the labeler only seeds a file that has no\ndiff --git a/builtin/organize.c b/builtin/organize.c\nindex 354ba2151f..35247c5aef 100644\n--- a/builtin/organize.c\n+++ b/builtin/organize.c\n@@ -15,13 +15,13 @@\n #include \"repository.h\"\n \n static const char *const organize_usage[] = {\n-\t\"git organize status\",\n+\t\"git organize status [--exit-code]\",\n \t\"git organize apply\",\n \t\"git organize apply --labels-only [--reseed]\",\n \tNULL\n };\n \n-static int organize_status(struct repository *repo)\n+static int organize_status(struct repository *repo, int exit_code)\n {\n \tstruct organize_plan plan = ORGANIZE_PLAN_INIT;\n \tint to_move, backlog, unrecorded, orphans;\n@@ -67,7 +67,7 @@ static int organize_status(struct repository *repo)\n \t}\n \n \torganize_plan_release(&plan);\n-\treturn 0;\n+\treturn exit_code && (to_move || unrecorded || orphans) ? 1 : 0;\n }\n \n static int organize_apply(struct repository *repo)\n@@ -106,8 +106,10 @@ int cmd_organize(int argc,\n \t\t const char *prefix,\n \t\t struct repository *repo)\n {\n-\tint labels_only = 0, reseed = 0;\n+\tint exit_code = 0, labels_only = 0, reseed = 0;\n \tstruct option options[] = {\n+\t\tOPT_BOOL(0, \"exit-code\", &exit_code,\n+\t\t\t N_(\"exit non-zero from status when a file is out of place\")),\n \t\tOPT_BOOL(0, \"labels-only\", &labels_only,\n \t\t\t N_(\"with apply, run the labeler and record the labels\")),\n \t\tOPT_BOOL(0, \"reseed\", &reseed,\n@@ -126,7 +128,7 @@ int cmd_organize(int argc,\n \tif (!strcmp(subcmd, \"status\")) {\n \t\tif (labels_only)\n \t\t\tdie(_(\"git organize: --labels-only is an apply option\"));\n-\t\tret = organize_status(repo);\n+\t\tret = organize_status(repo, exit_code);\n \t} else if (!strcmp(subcmd, \"apply\")) {\n \t\tif (labels_only) {\n \t\t\torganize_run_labeler(repo, reseed);\ndiff --git a/t/t0096-organize.sh b/t/t0096-organize.sh\nindex c2e6539ef2..d8de3c7e90 100755\n--- a/t/t0096-organize.sh\n+++ b/t/t0096-organize.sh\n@@ -156,6 +156,10 @@ test_expect_success 'status reports the files to move' '\n \ttest_grep \"2 file(s) would move\" actual\n '\n \n+test_expect_success 'status --exit-code fails when a file is out of place' '\n+\ttest_expect_code 1 git organize status --exit-code\n+'\n+\n test_expect_success 'apply moves files as content-identical renames and repoints [labels]' '\n \tgit organize apply &&\n \tgit diff --cached -M --name-status >actual &&\n@@ -169,6 +173,7 @@ test_expect_success 'apply moves files as content-identical renames and repoints\n \tgit diff --cached --name-only >staged &&\n \ttest_grep \"^.gitorganize$\" staged &&\n \tgit commit -m reconciled &&\n+\tgit organize status --exit-code &&\n \tgit organize status >actual &&\n \ttest_grep \"nothing to move\" actual &&\n \ttest_grep \"^odb/blob.c component=odb\" .gitorganize &&\n@@ -435,7 +440,8 @@ test_expect_success 'a basename shared across directories does not collide' '\n \t\ttest_path_is_file odb/dup.c &&\n \t\ttest_path_is_file sub/dup.c &&\n \t\ttest_path_is_missing dup.c &&\n-\t\tgit commit -m reconciled\n+\t\tgit commit -m reconciled &&\n+\t\tgit organize status --exit-code\n \t)\n '\n \n@@ -484,17 +490,20 @@ test_expect_success 'a file in scope with no recorded label is unrecorded' '\n \t\tgit commit -m declare &&\n \t\tgit organize apply --labels-only &&\n \t\tgit commit -m labels &&\n-\t\t# a.c is recorded but matches no rule: backlog\n+\t\t# a.c is recorded but matches no rule, so it is backlog; a\n+\t\t# standing backlog alone does not fail --exit-code\n \t\tgit organize status >actual &&\n \t\ttest_grep \"backlog:\" actual &&\n \t\ttest_grep \"^  a.c$\" actual &&\n-\t\t# a source in scope that [labels] never recorded is unrecorded\n+\t\tgit organize status --exit-code &&\n+\t\t# a source in scope that [labels] never recorded is unrecorded drift\n \t\techo b >b.c &&\n \t\tgit add b.c &&\n \t\tgit commit -m add-b &&\n \t\tgit organize status >actual &&\n \t\ttest_grep \"in scope but unrecorded:\" actual &&\n-\t\ttest_grep \"^  b.c$\" actual\n+\t\ttest_grep \"^  b.c$\" actual &&\n+\t\ttest_expect_code 1 git organize status --exit-code\n \t)\n '\n \n@@ -519,7 +528,8 @@ test_expect_success 'status reports a recorded path that no longer exists' '\n \t\tgit commit -m drop-b &&\n \t\tgit organize status >actual &&\n \t\ttest_grep \"declared but missing\" actual &&\n-\t\ttest_grep \"  b.c\" actual\n+\t\ttest_grep \"  b.c\" actual &&\n+\t\ttest_expect_code 1 git organize status --exit-code\n \t)\n '\n \n-- \n2.54.0\n\n"},{"id":"551087","messageId":"20260823171915.2662373-3-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 02/14] organize: add the labeler, organizer, and apply --labels-only","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:46Z","receivedAt":"2026-08-23T17:19:22Z","isPatch":true,"body":"The core builtin reconciles a tree against a hand-written [labels] section,\nbut nothing fills [labels] in and every move is a bare rename. A project\nneeds to record where each file belongs and to repoint the references a\nmove breaks.\n\nAdd the two configured commands that supply that judgment, the way a merge\ndriver's command is configured in git config:\n\n  organize.labeler    records a [labels] line per root file in scope\n  organize.organizer  returns edits for the files a move touches\n\ngit organize apply --labels-only runs the labeler and writes [labels],\npreserving the lines of already placed files. Plain git organize apply,\nwhen an organizer is configured, hands it the standing moves over a pipe;\nthe organizer returns a patch of the edits and a reason for any move it\ndeclines. The moves and the patch apply as one git apply transaction, so a\nfailure leaves the tree untouched. A declined move keeps its file and its\n[labels] line.\n\nThe organizer patch is validated before anything applies. It may edit a\nreferring file, or rename a moved file as it edits it, but it must not add,\ndelete, or copy files, and any rename must match a planned move.\n\nAdd a reference labeler and organizer under contrib/organize for Git's own\ntree. The labeler places each source by the \"area:\" prefix its own commits\ncarry most often, mined with git log --follow: the area its authors name\nneed not be its filename, so ws.c files under whitespace and\ndiffcore-pickaxe.c under pickaxe. git-layout.map groups these prefix tokens\ninto components under [tokens]; odb owns object, object-file, blob, tag, and\nso on. A source whose prefix is a broad area name that also swept its\nneighbors, or that has too little history to name an area, falls back to its\nfilename through the [names] section. A source that neither section places,\nbut that changes chiefly alongside one component, is promoted there. A\nsource that couples broadly stays at the root. Each record also carries the\nprefix, the #include coupling, and the co-change profile as advisory\nsignals. The organizer repoints the moved build object in the Makefile and\nmeson.build, and rewrites the #include of each moved header to its new path\nacross the tree.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n Documentation/git-organize.adoc | 108 ++++++-\n Makefile                        |   2 +\n builtin/organize.c              |  48 +++-\n contrib/organize/git-layout.map |  41 +++\n contrib/organize/labeler        | 333 ++++++++++++++++++++++\n contrib/organize/organizer      | 334 ++++++++++++++++++++++\n meson.build                     |   2 +\n organize/gitorganize-format.c   |   5 +\n organize/labeler-protocol.c     |  52 ++++\n organize/labeler-protocol.h     |  15 +\n organize/organize.c             | 165 ++++++++++-\n organize/organize.h             |  50 +++-\n organize/organizer-protocol.c   | 254 +++++++++++++++++\n organize/organizer-protocol.h   |  18 ++\n t/t0096-organize.sh             | 479 +++++++++++++++++++++++++++++---\n 15 files changed, 1817 insertions(+), 89 deletions(-)\n create mode 100644 contrib/organize/git-layout.map\n create mode 100755 contrib/organize/labeler\n create mode 100755 contrib/organize/organizer\n create mode 100644 organize/labeler-protocol.c\n create mode 100644 organize/labeler-protocol.h\n create mode 100644 organize/organizer-protocol.c\n create mode 100644 organize/organizer-protocol.h\n\ndiff --git a/Documentation/git-organize.adoc b/Documentation/git-organize.adoc\nindex 4ff76f5c13..8b216146b6 100644\n--- a/Documentation/git-organize.adoc\n+++ b/Documentation/git-organize.adoc\n@@ -11,6 +11,7 @@ SYNOPSIS\n [verse]\n 'git organize status'\n 'git organize apply'\n+'git organize apply' --labels-only [--reseed]\n \n \n DESCRIPTION\n@@ -31,18 +32,36 @@ rule it satisfies places it; a file matching no rule is the backlog.\n source in scope, `<path> <key>=<value> ...`, with every label the project\n defines. A placed file is listed too, so its `[labels]` line records its\n labels, independently of the directory name. Only a label named in a rule\n-places a file.\n+places a file; a label named in no rule places nothing and is recorded for a\n+reader.\n+\n+The labeler and organizer live in config: `organize.labeler` and\n+`organize.organizer`. A label is a key and value the labeler attaches to a\n+file. `git organize apply --labels-only` runs the labeler and records the\n+labels. A file is out of place when its matching rule names a directory it\n+is not in yet.\n \n `git organize status` reads `[labels]` and reports the out-of-place files,\n the backlog, a file in scope that `[labels]` does not record, and a\n-recorded path that no longer exists. It runs nothing and\n-changes nothing.\n+recorded path that no longer exists. status runs no\n+configured command and changes nothing.\n \n `git organize apply` reconciles the tree. It moves each out-of-place file\n-into its directory. A move is a content-identical rename, so `git log\n---follow` and `git blame` track the file exactly. apply stages the result\n-and repoints each carved file's `[labels]` line to its new path, carrying\n-its labels. It commits nothing. apply requires a clean worktree.\n+into its directory. A move that git organize makes on its own is a\n+content-identical rename, so `git log --follow` and `git blame` track the\n+file exactly. apply stages the result and repoints each carved file's\n+`[labels]` line to its new path, carrying its labels. It commits nothing.\n+\n+A move can require an edit elsewhere, such as repointing a reference in\n+another file, or an edit to the moved file itself, such as repointing its\n+own references. A project supplies those edits with an organizer, its\n+`organize.organizer` command. apply hands the organizer its\n+moves. The organizer returns a patch of the edits and, for any move it\n+cannot complete, a reason to skip it. When the organizer edits a file as it\n+moves, git's rename detection matches it while its similarity stays above\n+the rename threshold. apply applies the moves and the patch as one\n+transaction. With no organizer configured, apply moves the files and makes\n+no other edit.\n \n \n COMMANDS\n@@ -52,13 +71,59 @@ status::\n \tReport the files whose placement value names a directory they are not\n \tin (the moves), the backlog (recorded files with no matching\n \trule), a file in scope that `[labels]` does not record, and a recorded\n-\tpath that no longer exists. Changes nothing.\n+\tpath that no longer exists. Runs no configured\n+\tcommand and changes nothing.\n \n apply::\n \tMove each out-of-place file into its directory as a content-identical\n-\trename, repoint each carved file's `[labels]` line to its new path, and\n-\tstage the result. apply requires a clean worktree, so the change can be\n-\tdiscarded as a whole.\n+\trename, apply the organizer's edits, repoint each carved file's\n+\t`[labels]` line to its new path, and stage the result. apply requires a\n+\tclean worktree, so the change can be discarded as a whole.\n++\n+With `--labels-only`, apply instead records the `[labels]` line for every root\n+file in scope and stages the file. A file already recorded keeps its line, so a\n+placement chosen by hand or in an earlier run stands; the labeler only seeds a\n+file that has no line yet. With `--reseed`, re-derive every line from the\n+labeler, discarding the recorded placements. This is the only path that runs a\n+labeler; `git organize apply` without `--labels-only` and `git organize status`\n+never do.\n+\n+\n+OPTIONS\n+-------\n+\n+--labels-only::\n+\tWith apply, run the labeler and record the labels; move no file. A\n+\trecorded file keeps its line; the labeler only seeds a file that has no\n+\tline yet.\n+\n+--reseed::\n+\tWith apply `--labels-only`, re-derive every `[labels]` line from the\n+\tlabeler, discarding the recorded placements. Use it to re-apply the\n+\tlabeler after its map changes; without it a recorded line is kept.\n+\n+\n+CONFIGURATION\n+-------------\n+organize.labeler::\n+\tThe command that records the labels. `git organize apply\n+\t--labels-only` runs it over the root files in scope. It writes one\n+\trecord per file on its standard output: the path, a NUL, its\n+\tspace-separated `key=value` labels, a NUL. A file in scope with no\n+\trecord is unrecorded, reported apart from the backlog. Use user or\n+\tsystem config for this setting; do\n+\tnot take it from a repository file.\n+\n+organize.organizer::\n+\tThe command that returns move edits. apply runs it over the moves. It\n+\treads the pending moves on its standard input and returns a patch and\n+\tany skip reasons; see PROTOCOL. Optional. Without it, apply performs the\n+\tmoves and makes no other edit. Use user or system config for this\n+\tsetting; do not take it from a repository file.\n+\n+The labeler and organizer are trusted, the way a clean or smudge filter or a\n+hook is trusted. Set them in user or system config, so a repository you clone\n+cannot supply its own.\n \n \n FILES\n@@ -71,10 +136,23 @@ FILES\n \tfile takes the directory of the first rule its labels satisfy, and a\n \tfile matching no rule is the backlog. `[labels]` holds the recorded\n \tlabels, one `<path> <key>=<value> ...` line per source in scope,\n-\tincluding placed files. The project writes `[scope]` and `[layout]`; the\n-\tmove apply repoints a carved file's line. A `#` line is a comment; git\n-\torganize rewrites the file whole, keeping the hand-authored `[scope]`\n-\tand `[layout]` verbatim.\n+\tincluding placed files. The project writes `[scope]` and `[layout]`;\n+\t`git organize apply --labels-only` writes `[labels]`, and the move apply\n+\trepoints a carved file's line. A `#` line is a comment; git organize\n+\trewrites the file whole, keeping the hand-authored `[scope]` and\n+\t`[layout]` verbatim.\n+\n+\n+PROTOCOL\n+--------\n+apply speaks a line protocol with the organizer over a pipe. It writes the\n+version line `git-organize 1 organize`, then a `move <src> <dst> <label>`\n+line per pending move, with C-quoted paths. The organizer replies with the\n+same version line. For each declined move, it writes `reject <src>\n+<reason>`. It may then write `patch`, followed by a git patch that runs to\n+the end of its output. The patch may edit referring files and may rename a\n+moved file as it edits it, but it must not add, delete, or copy files, and\n+any rename must match a planned move.\n \n \n GIT\ndiff --git a/Makefile b/Makefile\nindex da7c4df7d3..86297e9459 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1238,7 +1238,9 @@ LIB_OBJS += oidmap.o\n LIB_OBJS += oidset.o\n LIB_OBJS += oidtree.o\n LIB_OBJS += organize/gitorganize-format.o\n+LIB_OBJS += organize/labeler-protocol.o\n LIB_OBJS += organize/organize.o\n+LIB_OBJS += organize/organizer-protocol.o\n LIB_OBJS += pack-bitmap-write.o\n LIB_OBJS += pack-bitmap.o\n LIB_OBJS += pack-check.o\ndiff --git a/builtin/organize.c b/builtin/organize.c\nindex 9462d8687f..354ba2151f 100644\n--- a/builtin/organize.c\n+++ b/builtin/organize.c\n@@ -5,7 +5,8 @@\n  * status reports the files in scope whose matching rule names a directory they\n  * are not in yet (the moves), the backlog (files with no matching rule), and a\n  * declared path that no longer exists. apply moves the misplaced files and\n- * stages the result.\n+ * stages the result; apply --labels-only instead runs the labeler and records\n+ * the labels.\n  */\n #include \"builtin.h\"\n #include \"gettext.h\"\n@@ -16,6 +17,7 @@\n static const char *const organize_usage[] = {\n \t\"git organize status\",\n \t\"git organize apply\",\n+\t\"git organize apply --labels-only [--reseed]\",\n \tNULL\n };\n \n@@ -71,6 +73,7 @@ static int organize_status(struct repository *repo)\n static int organize_apply(struct repository *repo)\n {\n \tstruct organize_plan plan = ORGANIZE_PLAN_INIT;\n+\tint moved = 0, rejected = 0;\n \n \torganize_plan_build(repo, &plan);\n \tif (!plan.moves_nr) {\n@@ -81,7 +84,17 @@ static int organize_apply(struct repository *repo)\n \n \torganize_plan_apply(repo, &plan);\n \n-\tprintf(_(\"organize apply: %d move(s).\\n\"), (int)plan.moves_nr);\n+\tfor (size_t i = 0; i < plan.moves_nr; i++) {\n+\t\tif (plan.moves[i].skip_reason)\n+\t\t\trejected++;\n+\t\telse\n+\t\t\tmoved++;\n+\t}\n+\tprintf(_(\"organize apply: %d move(s), %d skipped.\\n\"), moved, rejected);\n+\tfor (size_t i = 0; i < plan.moves_nr; i++)\n+\t\tif (plan.moves[i].skip_reason)\n+\t\t\tprintf(\"  skipped %-28s %s\\n\", plan.moves[i].src,\n+\t\t\t       plan.moves[i].skip_reason);\n \tprintf(_(\"organize apply: the result is staged; nothing is committed.\\n\"));\n \n \torganize_plan_release(&plan);\n@@ -93,18 +106,39 @@ int cmd_organize(int argc,\n \t\t const char *prefix,\n \t\t struct repository *repo)\n {\n+\tint labels_only = 0, reseed = 0;\n \tstruct option options[] = {\n+\t\tOPT_BOOL(0, \"labels-only\", &labels_only,\n+\t\t\t N_(\"with apply, run the labeler and record the labels\")),\n+\t\tOPT_BOOL(0, \"reseed\", &reseed,\n+\t\t\t N_(\"with apply --labels-only, re-derive every recorded label\")),\n \t\tOPT_END()\n \t};\n \tconst char *subcmd;\n+\tint ret;\n \n \targc = parse_options(argc, argv, prefix, options, organize_usage, 0);\n \tsubcmd = argc ? argv[0] : \"status\";\n \tif (argc > 1)\n \t\tdie(_(\"git organize: too many arguments\"));\n-\tif (!strcmp(subcmd, \"status\"))\n-\t\treturn organize_status(repo);\n-\telse if (!strcmp(subcmd, \"apply\"))\n-\t\treturn organize_apply(repo);\n-\tdie(_(\"git organize: unknown subcommand '%s'\"), subcmd);\n+\tif (reseed && !labels_only)\n+\t\tdie(_(\"git organize: --reseed is a --labels-only option\"));\n+\tif (!strcmp(subcmd, \"status\")) {\n+\t\tif (labels_only)\n+\t\t\tdie(_(\"git organize: --labels-only is an apply option\"));\n+\t\tret = organize_status(repo);\n+\t} else if (!strcmp(subcmd, \"apply\")) {\n+\t\tif (labels_only) {\n+\t\t\torganize_run_labeler(repo, reseed);\n+\t\t\tprintf(_(\"organize apply --labels-only: the declaration is \"\n+\t\t\t\t \"staged; nothing is committed.\\n\"));\n+\t\t\tret = 0;\n+\t\t} else {\n+\t\t\tret = organize_apply(repo);\n+\t\t}\n+\t} else {\n+\t\tdie(_(\"git organize: unknown subcommand '%s'\"), subcmd);\n+\t}\n+\n+\treturn ret;\n }\ndiff --git a/contrib/organize/git-layout.map b/contrib/organize/git-layout.map\nnew file mode 100644\nindex 0000000000..580d556b92\n--- /dev/null\n+++ b/contrib/organize/git-layout.map\n@@ -0,0 +1,41 @@\n+# Git component layout for the reference labeler, in two sections.\n+#\n+# [tokens] lists, per component directory, the commit-subject prefix tokens\n+# that belong to it. A file is placed by the \"area:\" prefix its own commits\n+# carry most often, mined with git log --follow. The area its authors name need\n+# not be its filename (ws.c files under whitespace, diffcore-pickaxe.c under\n+# pickaxe). The fine tokens consolidate into a component; that consolidation is\n+# the project knowledge a mechanical pass cannot supply.\n+#\n+# [names] lists the filename token, the name before the first hyphen. A file\n+# whose dominant prefix is a broad area name that also swept its neighbors\n+# (commit, config, refs, ...), or whose commits name no area, is placed by\n+# its filename instead. Program sources stay at the root.\n+[tokens]\n+odb: blob commit-slab fsck hash loose match-trees object object-file object-file-convert object-name odb oidmap oidset oidtree replace-object replace_object sha1-array sha1-lookup sha1_name tag tmp-objdir tree tree-walk\n+refs: ls-refs pack-refs ref-filter reflog reflog-walk refspec worktree\n+pack: bloom chunk-format commit-graph delta-islands diff-delta midx pack-bitmap pack-bitmap-write pack-check pack-mtimes pack-objects pack-revindex pack-write packfile patch-delta prune prune-packed pseudo-merge reachable repack repack-promisor server-info\n+diff: combine-diff diff diff-merges diffcore-break diffcore-delta diffcore-order diffcore-rename patch-ids pickaxe range-diff tree-diff userdiff xdiff-interface\n+merge: fmt-merge-msg ll-merge merge merge-blobs merge-ort rerere\n+revision: bisect blame commit-reach decorate format-patch graph line-log line-range list list-objects list-objects-filter list-objects-filter-options pretty revision shallow\n+index: cache-tree checkout dir dir-iterator entry fsmonitor fsmonitor--daemon fsmonitor-ll fsmonitor-settings name-hash parallel-checkout pathspec preload-index read-cache resolve-undo sparse-index split-index statinfo symlinks unpack-trees wt-status\n+setup: alias hook ident repository setup version\n+convert: attr convert whitespace\n+transport: bundle bundle-uri cat-file connect connected fetch-negotiator fetch-pack http pkt-line promisor-remote protocol protocol-caps remote remote-curl send-pack serve sideband transport transport-helper upload-pack walker\n+notes: notes notes-cache notes-merge\n+submodule: submodule submodule-config\n+archive: archive archive-tar archive-zip\n+[names]\n+odb: object odb oid oidmap oidset oidtree loose blob tag commit tree replace match tmp fsck hash sha1dc streaming\n+refs: refs refspec reflog ref ls worktree\n+pack: pack packfile midx delta prune reachable server bloom chunk pseudo repack\n+diff: diff diffcore combine range userdiff xdiff patch pickaxe\n+merge: merge rerere fmt\n+revision: revision log bisect shallow blame line graph decorate list pretty\n+index: read cache split sparse unpack name preload resolve statinfo entry parallel dir pathspec checkout symlinks fsmonitor wt\n+setup: config setup environment repository repo ident alias version hook\n+convert: attr convert ws whitespace\n+transport: transport remote connect connected send fetch upload walker http protocol serve pkt sideband bundle promisor\n+notes: notes\n+submodule: submodule\n+archive: archive\ndiff --git a/contrib/organize/labeler b/contrib/organize/labeler\nnew file mode 100755\nindex 0000000000..2116015f2d\n--- /dev/null\n+++ b/contrib/organize/labeler\n@@ -0,0 +1,333 @@\n+#!/usr/bin/perl\n+# Reference labeler for git organize(1). This is a demonstration; a real\n+# project supplies its own.\n+#\n+# git organize keeps the root *.c and *.h sources in scope. The labeler prints\n+# one NUL-terminated label record per file,\n+#\n+#     <path> \\0 component=<dir> role=<role> prefix=<token> \\\n+#               includes=<c>:<n>,... cochange=<c>:<n>,... \\0\n+#\n+# component names the directory to move the file into. component and role are\n+# the labels git organize acts on. prefix, includes, and cochange are advisory\n+# signals the labeler records for a human to read.\n+#\n+# COMPONENT. The labeler names each file's component from the \"area:\" prefix its\n+# own commits carry most often, mined with `git log --follow` over the file's\n+# whole history. The area its authors name need not match its filename: ws.c\n+# goes under whitespace, diffcore-pickaxe.c under pickaxe. The [tokens] section\n+# of git-layout.map maps the fine prefix tokens to component directories. When a\n+# file's dominant prefix is a broad area name that also swept its neighbors\n+# (commit, config, refs, ...), or its commits name no area, the labeler falls\n+# back to the file's name through the [names] section.\n+# When neither section names a component, the labeler applies a co-change test:\n+# a file that changes chiefly alongside one component moves there, and any other\n+# file gets component=? (backlog). Programs (Makefile PROGRAM_OBJS) stay at the\n+# root.\n+#\n+# ADVISORY. prefix is the dominant token itself. includes is the file's #include\n+# coupling, each included in-scope header bucketed by its component. cochange\n+# is the components the file co-changes with, mined from focused commits (<= 25\n+# files). includes and cochange list the strongest components first, capped at\n+# five. A human reads them to see where a file couples and whether git-layout.map\n+# named a different component than a raw signal would.\n+#\n+# Usage:\n+#     labeler                the label records on stdout\n+\n+use strict;\n+use warnings;\n+use File::Temp qw(tempdir);\n+use POSIX ();\n+\n+my $CAP = 5;\t\t\t# most-coupled components kept in an advisory list\n+\n+my $top = `git rev-parse --show-toplevel`;\n+chomp $top;\n+chdir $top or die \"organize labeler: cannot cd to $top: $!\\n\";\n+(my $here = $0) =~ s{/[^/]*$}{};\n+my $mapfile = \"$here/git-layout.map\";\n+\n+# git-layout.map: [tokens] maps a commit-prefix token to its component, [names]\n+# maps a filename token to its component.\n+my (%tok_dir, %name_dir, $section);\n+open my $map, '<', $mapfile or die \"organize labeler: cannot read $mapfile: $!\\n\";\n+while (<$map>) {\n+\tnext if /^#/;\n+\tif (/^\\[(\\w+)\\]\\s*$/) { $section = $1; next; }\n+\tnext unless /:/;\n+\tmy ($dir, $tokens) = split /:/, $_, 2;\n+\tmy $into = $section eq 'tokens' ? \\%tok_dir : \\%name_dir;\n+\t$into->{$_} = $dir for split ' ', $tokens;\n+}\n+close $map;\n+\n+# The standalone programs, from the Makefile.\n+my %is_program;\n+open my $mk, '<', 'Makefile' or die \"organize labeler: cannot read Makefile: $!\\n\";\n+while (<$mk>) {\n+\t$is_program{\"$1.c\"} = 1 if /^\\s*PROGRAM_OBJS\\s*\\+?=\\s*(\\S+)\\.o/;\n+}\n+close $mk;\n+\n+# Prefix tokens that name no area: mass-change and non-source markers. The\n+# labeler ignores a commit subject led by one of these when tallying components.\n+my %noise = map { $_ => 1 } qw(\n+\ttreewide cocci coccinelle comments comment makefile doc docs\n+\tdocumentation style cleanup misc various global build ci test tests\n+\tconfig.mak wildmatch);\n+\n+# The name of a file with its extension and directory removed, lowercased.\n+sub stem {\n+\tmy ($p) = @_;\n+\t$p =~ s{.*/}{};\n+\t$p =~ s/\\.[ch]$//;\n+\treturn lc $p;\n+}\n+\n+# The filename token: the stem up to its first hyphen (object-file -> object).\n+sub name_token {\n+\tmy ($s) = @_;\n+\t$s =~ s/-.*//;\n+\treturn $s;\n+}\n+\n+# A prefix token with a file-suffix variant folded to its base (commit.c and\n+# serve.[ch] -> commit and serve), lowercased and trimmed.\n+sub normalize {\n+\tmy ($t) = @_;\n+\t$t = lc $t;\n+\t$t =~ s/^\\s+//;\n+\t$t =~ s/\\s+$//;\n+\t$t =~ s/\\*?\\.\\[ch\\]$//;\n+\t$t =~ s/\\*?\\.[ch]$//;\n+\t$t =~ s/\\*?\\.py$//;\n+\treturn $t;\n+}\n+\n+sub is_noise {\n+\tmy ($t) = @_;\n+\treturn 1 if $t eq '';\n+\treturn 1 if $t =~ m{[ ,\\[\\]{}()*/'\"]};\n+\treturn 1 if $noise{$t};\n+\treturn 0;\n+}\n+\n+# The token matches the file's name: it is the stem, an extension of it, or a\n+# hyphen-prefix of it. Used only to break a tie between equally frequent tokens.\n+sub affinity {\n+\tmy ($t, $s) = @_;\n+\treturn 1 if $t eq $s;\n+\treturn 1 if index($s, \"$t-\") == 0;\n+\treturn 1 if index($t, $s) == 0;\n+\treturn 0;\n+}\n+\n+# The commit-prefix token a file's history carries most often, or undef when its\n+# history names no area. Ties break toward a token that matches the file's name,\n+# then by name.\n+sub dominant_prefix {\n+\tmy ($file) = @_;\n+\tmy $s = stem($file);\n+\tmy %count;\n+\tfor my $subject (split /\\n/, `git log --follow --no-merges --format=%s -- \"$file\"`) {\n+\t\tmy $i = index($subject, ':');\n+\t\tnext if $i <= 0;\n+\t\tmy $t = normalize(substr($subject, 0, $i));\n+\t\tnext if is_noise($t);\n+\t\t$count{$t} += 1;\n+\t}\n+\treturn undef unless %count;\n+\tmy @ranked = sort {\n+\t\t$count{$b} <=> $count{$a}\n+\t\t\tor affinity($b, $s) <=> affinity($a, $s)\n+\t\t\tor $a cmp $b\n+\t} keys %count;\n+\treturn $ranked[0];\n+}\n+\n+# The component and dominant prefix for a file: the component from the prefix\n+# token via [tokens], else from the filename token via [names], else the\n+# backlog. Programs stay at the root. Kept side-effect free so a worker process\n+# can call it (see pass 1).\n+sub classify {\n+\tmy ($file) = @_;\n+\tmy $p = dominant_prefix($file);\n+\tmy $prefix = defined $p ? $p : '?';\n+\treturn ('?', $prefix) if $is_program{$file};\n+\treturn ($tok_dir{$p}, $prefix) if defined $p && exists $tok_dir{$p};\n+\tmy $d = $name_dir{ name_token(stem($file)) };\n+\treturn (defined $d ? $d : '?', $prefix);\n+}\n+\n+# Pass 1: name the component for every scoped file, recording its component and\n+# dominant prefix. The `git log --follow` mining dominates the run, so fan the\n+# files across a pool of worker processes (ORGANIZE_JOBS, default the CPU count).\n+# Each worker writes \"path<TAB>component<TAB>prefix\" for its share, and the\n+# parent reads them back.\n+my (%component, %prefix);\n+my @files = grep { length } (split(/\\n/, `git ls-files ':(glob)*.c'`),\n+\t\t\t     split(/\\n/, `git ls-files ':(glob)*.h'`));\n+{\n+\tmy $jobs = $ENV{ORGANIZE_JOBS};\n+\tif (!$jobs) { chomp($jobs = `nproc 2>/dev/null`); $jobs ||= 4; }\n+\t$jobs = scalar(@files) if @files && $jobs > @files;\n+\t$jobs = 1 if $jobs < 1;\n+\tmy $dir = tempdir(CLEANUP => 1);\n+\tmy @pids;\n+\tfor my $j (0 .. $jobs - 1) {\n+\t\tmy $pid = fork();\n+\t\tdie \"organize labeler: cannot fork: $!\\n\" unless defined $pid;\n+\t\tif (!$pid) {\n+\t\t\topen my $out, '>', \"$dir/$j\" or POSIX::_exit(1);\n+\t\t\tmy $n = 0;\n+\t\t\tfor (my $i = $j; $i < @files; $i += $jobs) {\n+\t\t\t\tmy ($c, $p) = classify($files[$i]);\n+\t\t\t\tprint {$out} \"$files[$i]\\t$c\\t$p\\n\";\n+\t\t\t\t$n++;\n+\t\t\t}\n+\t\t\t# Write a trailing sentinel line to prove the worker ran\n+\t\t\t# to the end. A worker that dies mid-run leaves a\n+\t\t\t# truncated file with no sentinel, which the parent\n+\t\t\t# rejects rather than read as a short but valid share.\n+\t\t\t# The parent matches this exact line, \"# done <count>\";\n+\t\t\t# a record line is TAB-separated, so it cannot collide.\n+\t\t\tprint {$out} \"# done $n\\n\";\n+\t\t\tclose $out or POSIX::_exit(1);\n+\t\t\tPOSIX::_exit(0);\t# skip END/DESTROY so the tempdir survives\n+\t\t}\n+\t\tpush @pids, $pid;\n+\t}\n+\tfor my $pid (@pids) {\n+\t\twaitpid($pid, 0);\n+\t\tdie \"organize labeler: a worker failed\\n\" if $?;\n+\t}\n+\tfor my $j (0 .. $jobs - 1) {\n+\t\topen my $in, '<', \"$dir/$j\"\n+\t\t\tor die \"organize labeler: worker $j left no output\\n\";\n+\t\tmy $sentinel = 0;\n+\t\twhile (<$in>) {\n+\t\t\tchomp;\n+\t\t\tif (/^# done [0-9]+$/) { $sentinel = 1; next; }\n+\t\t\tmy ($f, $c, $p) = split /\\t/, $_, 3;\n+\t\t\t$component{$f} = $c;\n+\t\t\t$prefix{$f} = $p;\n+\t\t}\n+\t\tclose $in;\n+\t\tdie \"organize labeler: worker $j left truncated output\\n\"\n+\t\t\tunless $sentinel;\n+\t}\n+}\n+\n+# Pass 2a: the #include coupling profile, each included in-scope header\n+# bucketed by its component.\n+sub includes_profile {\n+\tmy ($file) = @_;\n+\topen my $fh, '<', $file or return {};\n+\tmy %prof;\n+\twhile (<$fh>) {\n+\t\tnext unless /^\\s*#\\s*include\\s*\"([^\"]+)\"/;\n+\t\t(my $inc = $1) =~ s{.*/}{};\t# includes name the header directly\n+\t\tmy $c = $component{$inc};\n+\t\t$prof{$c}++ if defined $c && $c ne '?';\n+\t}\n+\tclose $fh;\n+\treturn \\%prof;\n+}\n+\n+# Pass 2b: the co-change profile. A focused commit (<= 25 files) ties every pair\n+# of files it touches; tally each file's scoped neighbors by their component.\n+my %cochange;\n+{\n+\tmy @batch;\n+\tmy $flush = sub {\n+\t\treturn if @batch > 25;\n+\t\tmy @scoped = grep { exists $component{$_} } @batch;\n+\t\treturn if @scoped < 2;\n+\t\tfor my $f (@scoped) {\n+\t\t\tfor my $g (@scoped) {\n+\t\t\t\tnext if $g eq $f;\n+\t\t\t\tmy $c = $component{$g};\n+\t\t\t\t$cochange{$f}{$c}++ if $c ne '?';\n+\t\t\t}\n+\t\t}\n+\t};\n+\topen my $log, '-|', qw(git log --no-merges --format=%x01 --name-only)\n+\t\tor die \"organize labeler: cannot read the commit log: $!\\n\";\n+\tmy $started = 0;\n+\twhile (my $line = <$log>) {\n+\t\tchomp $line;\n+\t\tif ($line =~ /^\\x01/) {\n+\t\t\t$flush->() if $started;\n+\t\t\t@batch = ();\n+\t\t\t$started = 1;\n+\t\t} elsif ($line ne '') {\n+\t\t\tpush @batch, $line;\n+\t\t}\n+\t}\n+\t$flush->() if $started;\n+\tclose $log;\n+}\n+\n+# Pass 3: promote a backlog file whose co-change coupling concentrates on one\n+# component. The prefix and name gave this file no component, but it co-changes\n+# chiefly with a single component, and its #includes do not point elsewhere, so\n+# the labeler moves it to that component. A file that couples broadly stays at\n+# the root. A .c and its .h combine their coupling and take the same component,\n+# so a pair moves as one. The thresholds keep only a concentrated signal with\n+# enough evidence behind it (alloc and cbtree join odb, git-curl-compat joins\n+# transport; csum-file and mem-pool stay at the root as too diffuse or too\n+# sparse).\n+my $PROMOTE_SHARE = 0.60;\n+my $PROMOTE_COUNT = 15;\n+{\n+\tmy %pair;\n+\tfor my $file (@files) {\n+\t\tnext if $component{$file} ne '?' || $is_program{$file};\n+\t\t(my $stem = $file) =~ s/\\.[ch]$//;\n+\t\tpush @{$pair{$stem}}, $file;\n+\t}\n+\tmy @promote;\t\t\t# [ [files], component ], decided before applying\n+\tfor my $stem (sort keys %pair) {\n+\t\tmy (%co, %inc);\n+\t\tfor my $file (@{$pair{$stem}}) {\n+\t\t\t$co{$_}  += $cochange{$file}{$_} for keys %{$cochange{$file} || {}};\n+\t\t\tmy $ip = includes_profile($file);\n+\t\t\t$inc{$_} += $ip->{$_} for keys %$ip;\n+\t\t}\n+\t\tnext unless %co;\n+\t\tmy $total = 0; $total += $_ for values %co;\n+\t\tmy ($top) = sort { $co{$b} <=> $co{$a} or $a cmp $b } keys %co;\n+\t\tnext unless $co{$top} >= $PROMOTE_COUNT\n+\t\t\t && $co{$top} / $total >= $PROMOTE_SHARE;\n+\t\tif (%inc) {\t\t# an #include profile must not point elsewhere\n+\t\t\tmy ($itop) = sort { $inc{$b} <=> $inc{$a} or $a cmp $b } keys %inc;\n+\t\t\tnext unless $itop eq $top;\n+\t\t}\n+\t\tpush @promote, [ $pair{$stem}, $top ];\n+\t}\n+\tfor my $p (@promote) {\n+\t\t$component{$_} = $p->[1] for @{$p->[0]};\n+\t}\n+}\n+\n+# A \"c:n,c:n\" advisory list: the strongest components first, capped at $CAP.\n+sub advisory {\n+\tmy ($prof) = @_;\n+\tmy @c = sort { $prof->{$b} <=> $prof->{$a} or $a cmp $b } keys %$prof;\n+\t@c = @c[0 .. $CAP - 1] if @c > $CAP;\n+\treturn join ',', map { \"$_:$prof->{$_}\" } @c;\n+}\n+\n+for my $file (@files) {\n+\tmy $c = $component{$file};\n+\tmy $role = $is_program{$file} ? 'program'\n+\t\t : $file =~ /\\.h$/ ? ($c eq '?' ? 'public' : 'header')\n+\t\t : 'lib';\n+\tmy $rec = \"component=$c role=$role prefix=$prefix{$file}\";\n+\tmy $inc = advisory(includes_profile($file));\n+\tmy $cox = advisory($cochange{$file} || {});\n+\t$rec .= \" includes=$inc\" if length $inc;\n+\t$rec .= \" cochange=$cox\" if length $cox;\n+\tprint \"$file\\0$rec\\0\";\n+}\ndiff --git a/contrib/organize/organizer b/contrib/organize/organizer\nnew file mode 100755\nindex 0000000000..56c805301b\n--- /dev/null\n+++ b/contrib/organize/organizer\n@@ -0,0 +1,334 @@\n+#!/usr/bin/perl\n+# Reference organizer for git organize(1). This is a demonstration; a real\n+# project supplies its own.\n+#\n+# When a .c source moves into a component directory, its build object moves\n+# with it; when a .h header moves, every #include of it must be repointed to\n+# the new path (the Git build uses -I. only, so an include names the full path).\n+# The organizer reads the pending moves and returns a patch that repoints\n+# every reference the reorganization leaves stale across Git's build systems:\n+#\n+#   Makefile                 the moved object list (stem.o/.s/.sp) and any\n+#                            bare source name in a list (LOCALIZED_C_CORE)\n+#   meson.build              the moved source path\n+#   Documentation/Makefile   a moved header named by a ../<name>.h argument\n+#   contrib/buildsystems/CMakeLists.txt\n+#                            a moved .c named bare or by ${CMAKE_SOURCE_DIR}/\n+#   #include \"foo.h\"         -> #include \"dir/foo.h\" in every C includer\n+#   Documentation/**/*.adoc  a tutorial #include \"foo.h\" example line\n+#\n+# An include may name the header bare or by a ../ path (from a subdirectory),\n+# and may write \"#include\" or \"# include\"; the repoint names the full path,\n+# which -I. resolves from any directory. An includer that itself moves is\n+# renamed-with-modification (its rename plus the repoint); a stationary\n+# includer is edited in place. The .adoc tutorials always name the full new\n+# path, so their #include example lines are repointed unconditionally, without\n+# the shadow/depth resolution a real C include needs.\n+#\n+# The organizer declines any move whose references it cannot repoint. It\n+# repoints every #include in the tracked C sources and tutorials, except that\n+# frozen test data under t/tNNNN/ is deliberately left alone: those files are\n+# fixtures (for example a mailinfo.c that git am replays byte for byte), so an\n+# apparent #include in them is data, not a reference to follow. Outside those\n+# fixtures, the only reference it can miss is one in a build file. After it\n+# edits the build files above, it rejects a move whose old path a build file\n+# still names (in a build file it does not edit, or in a form its edit missed).\n+# That file stays at the root with its references intact, and apply moves the\n+# rest.\n+#\n+# The code runs in four phases:\n+#   Phase 1  read the \"move <src> <dst>\" lines from stdin.\n+#   Phase 2  edit the build files as if every move happened, then reject a\n+#            move a build file still names (build_edits, names_missing_path).\n+#   Phase 3  build the new content of every file the accepted moves change\n+#            (build_edits, include_edits, adoc_edits).\n+#   Phase 4  emit one diff per changed file: a stationary file in place, an\n+#            includer that itself moves as a rename-with-modification.\n+# Name matching lives in the boundary regexes ($LB, $LB_ROOT, $RB) and in\n+# include_names_root.\n+\n+use strict;\n+use warnings;\n+use File::Temp qw(tempdir);\n+\n+my $protocol = \"git-organize 1 organize\";\n+chomp(my $top = `git rev-parse --show-toplevel`);\n+chdir $top or die \"organize organizer: cannot cd to $top: $!\\n\";\n+\n+sub unquote {\n+\tmy ($s) = @_;\n+\treturn $s unless $s =~ /\\A\"(.*)\"\\z/s;\n+\tmy $body = $1;\n+\tmy %esc = (a=>\"\\a\", b=>\"\\b\", t=>\"\\t\", n=>\"\\n\", v=>\"\\013\",\n+\t\tf=>\"\\f\", r=>\"\\r\", '\"'=>'\"', '\\\\'=>'\\\\');\n+\t$body =~ s{\\\\([0-7]{1,3}|.)}\n+\t\t{ exists $esc{$1} ? $esc{$1} : $1 =~ /\\A[0-7]/ ? chr(oct $1) : $1 }ges;\n+\treturn $body;\n+}\n+sub shift_token {\n+\t$_[0] =~ s/\\A\\s+//;\n+\tmy $tok = $_[0] =~ s/\\A(\"(?:\\\\.|[^\"\\\\])*\")// ? $1 : $_[0] =~ s/\\A(\\S+)// ? $1\n+\t\t: die \"organize organizer: malformed move line\\n\";\n+\treturn unquote($tok);\n+}\n+sub slurp { open my $fh,'<',$_[0] or die \"cannot read $_[0]: $!\\n\"; local $/; <$fh> }\n+\n+# Boundary vocabulary. A moved name matches only as a whole path component, so\n+# remote.c never matches inside ls-remote.c and a subdirectory sibling\n+# (builtin/remote.c) keeps its prefix and stays. Every name match below flanks\n+# the name with these boundaries:\n+#   $LB       left: not preceded by a name character\n+#   $LB_ROOT  left, root only: also not preceded by a path separator\n+#   $RB       right: the name token ends here\n+#   $DIRS     an optional ../ and directory prefix before a name\n+my $LB      = qr/(?<![A-Za-z0-9_.\\-])/;\n+my $LB_ROOT = qr/(?<![A-Za-z0-9_.\\-\\/])/;\n+my $RB      = qr/(?![A-Za-z0-9])/;\n+my $DIRS    = qr/(?:\\.\\.?\\/)*(?:[A-Za-z0-9_.\\-]+\\/)*/;\n+# bare_re: a bare root name, at a hard left boundary with no path separator, so\n+# a subdir sibling (builtin/remote.c) keeps its prefix and stays.\n+sub bare_re { my ($name) = @_; qr/$LB_ROOT\\Q$name\\E$RB/ }\n+# cmake_re: a root .c named bare or as ${CMAKE_SOURCE_DIR}/<name> (captured in\n+# $1). The name follows the CMAKE variable slash or a hard boundary, never a\n+# real subdirectory component, so a nested source (compat/win32/headless.c)\n+# stays.\n+sub cmake_re {\n+\tmy ($name) = @_;\n+\tqr/$LB(?:(\\$\\{CMAKE_SOURCE_DIR\\}\\/)|$LB_ROOT)\\Q$name\\E$RB/;\n+}\n+\n+# === Phase 1: read the pending moves ===\n+my @moves;\n+while (my $line = <STDIN>) {\n+\tnext unless $line =~ s/\\Amove //;\n+\tmy $src = shift_token($line); my $dst = shift_token($line);\n+\tpush @moves, [$src, $dst];\n+}\n+\n+# The build files the organizer edits. A moved .c is a build object (Makefile /\n+# meson) and may also appear as a bare source name in a Makefile list and as a\n+# path in the contrib CMake build. A moved .h is named by a ../ argument in\n+# Documentation/Makefile. An absent build file is skipped.\n+my @buildfiles = ('Makefile', 'meson.build',\n+\t'Documentation/Makefile', 'contrib/buildsystems/CMakeLists.txt');\n+\n+# Edit the build files for the given moves, returning path -> edited content\n+# (undef for an absent file).\n+sub build_edits {\n+\tmy ($moves) = @_;\n+\tmy %build = map { $_ => (-e $_ ? slurp($_) : undef) } @buildfiles;\n+\tfor my $m (@$moves) {\n+\t\tmy ($src, $dst) = @$m;\n+\t\t(my $stem = $src) =~ s/\\.[ch]\\z//;\n+\t\t(my $dir = $dst) =~ s{/[^/]*\\z}{};\n+\t\t# A ../ argument in Documentation/Makefile names a moved header\n+\t\t# (../fsck.h feeds lint-fsck-msgids.perl). The ../ steps out of\n+\t\t# Documentation/ to the root, so ../<dst> names the new path.\n+\t\tif ($src !~ /\\.c\\z/) {\n+\t\t\tmy $mk = 'Documentation/Makefile';\n+\t\t\t$build{$mk} =~ s{$LB\\.\\./\\Q$src\\E$RB}{../$dst}g\n+\t\t\t\tif defined $build{$mk};\n+\t\t\tnext;\n+\t\t}\n+\t\t# A moved .c: Makefile object (stem.o/.s/.sp) and meson path.\n+\t\t$build{'Makefile'} =~ s{(^|\\s)\\Q$stem\\E\\.(sp|s|o)$RB}{$1$dir/$stem.$2}mg\n+\t\t\tif defined $build{'Makefile'};\n+\t\t$build{'meson.build'} =~ s{'\\Q$src\\E'}{'$dst'}g\n+\t\t\tif defined $build{'meson.build'};\n+\t\t# A bare source name in a Makefile list (LOCALIZED_C_CORE).\n+\t\tif (defined $build{'Makefile'}) {\n+\t\t\tmy $re = bare_re($src);\n+\t\t\t$build{'Makefile'} =~ s{$re}{$dst}g;\n+\t\t}\n+\t\t# The contrib CMake names a .c bare or by ${CMAKE_SOURCE_DIR}/.\n+\t\tif (defined $build{'contrib/buildsystems/CMakeLists.txt'}) {\n+\t\t\tmy $re = cmake_re($src);\n+\t\t\t$build{'contrib/buildsystems/CMakeLists.txt'} =~\n+\t\t\t\ts{$re}{($1 // '') . $dst}ge;\n+\t\t}\n+\t}\n+\treturn \\%build;\n+}\n+\n+# The paths that exist once every move is made: the tracked files, less each\n+# old path, plus each new path.\n+my %exists = map { $_ => 1 } split /\\n/, `git ls-files`;\n+for my $m (@moves) { delete $exists{$m->[0]}; $exists{$m->[1]} = 1; }\n+\n+# A referenced path token, normalized to a repository-relative path.\n+sub norm_ref {\n+\tmy ($t) = @_;\n+\twhile ($t =~ m{\\A\\.\\.?/}) { $t =~ s{\\A[^/]*/}{}; }\n+\t$t =~ s{\\A/+}{};\n+\treturn $t;\n+}\n+# Whether a build file's content still names $old at a path that will not exist\n+# once the moves are made. A comment names a file rather than a rule, so it is\n+# skipped.\n+sub names_missing_path {\n+\tmy ($content, $old) = @_;\n+\t(my $base = $old) =~ s{.*/}{};\n+\tfor my $line (split /\\n/, $content) {\n+\t\tnext if $line =~ /\\A\\s*#/;\n+\t\twhile ($line =~ /$LB($DIRS)\\Q$base\\E$RB/g) {\n+\t\t\treturn 1 unless $exists{norm_ref($1 . $base)};\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+# === Phase 2: decide the rejects (completeness contract) ===\n+# Edit the build files as if every move happened, then a move whose old path a\n+# build file still names is one the organizer cannot fully repoint. The search\n+# covers the edited build files and every other build file in the tree.\n+my $build_for_rejects = build_edits(\\@moves);\n+my @rejects;\n+for my $m (@moves) {\n+\tmy ($src) = @$m;\n+\t(my $base = $src) =~ s{.*/}{};\n+\tmy $grep = \"git grep -lF -e '$base' --\"\n+\t\t. \" '*Makefile' '*.mak' '*meson.build' '*CMakeLists.txt'\"\n+\t\t. \" 'config.mak*' 2>/dev/null\";\n+\tmy @files = grep { length } split /\\n/, `$grep`;\n+\tfor my $f (@files) {\n+\t\tmy $edited = $build_for_rejects->{$f};\n+\t\tmy $content = defined $edited ? $edited : slurp($f);\n+\t\tif (names_missing_path($content, $src)) {\n+\t\t\tpush @rejects, [$src, \"a build file names it and the \"\n+\t\t\t\t. \"organizer cannot repoint that reference\"];\n+\t\t\tlast;\n+\t\t}\n+\t}\n+}\n+\n+my %rejected = map { $_->[0] => 1 } @rejects;\n+my @accepted = grep { !$rejected{$_->[0]} } @moves;\n+my %dst_of = map { $_->[0] => $_->[1] } @accepted;\n+\n+# Whether a #include names the moved ROOT header rather than a same-named header\n+# in the includer's own directory. A ../ include names the root only when its\n+# ../ count matches the includer's depth (one ../ from a depth-1 file reaches\n+# the root). A bare include names the root unless a sibling header in the\n+# includer's own directory shadows it (reftable/tree.h shadows a root tree.h).\n+sub include_names_root {\n+\tmy ($dots, $depth, $fdir, $src) = @_;\n+\tmy $up = $dots =~ tr{/}{};\n+\treturn $up == $depth if $up;\n+\treturn $depth == 0 || !(-e \"$fdir/$src\");\n+}\n+\n+# For each accepted header move, repoint #include \"foo.h\" (bare or ../ path) to\n+# the full new path in every C includer, keeping an include that resolves to a\n+# shadowing local header (per include_names_root) unchanged. Returns includer\n+# path -> edited content.\n+sub include_edits {\n+\tmy ($moves) = @_;\n+\tmy %repoint;   # includer -> list of [src, dst]\n+\tfor my $m (@$moves) {\n+\t\tmy ($src, $dst) = @$m;\n+\t\tnext unless $src =~ /\\.h\\z/;\n+\t\t(my $re = $src) =~ s/\\./\\\\./g;\n+\t\tmy $pat = '#[[:blank:]]*include[[:blank:]]*\"(\\.\\./)*' . $re . '\"';\n+\t\tmy $grep = \"git grep -lE '$pat' --\"\n+\t\t\t. \" '*.c' '*.h' ':(exclude)t/t[0-9][0-9][0-9][0-9]/**'\";\n+\t\tfor my $inc (split /\\n/, `$grep`) {\n+\t\t\tpush @{$repoint{$inc}}, [$src, $dst];\n+\t\t}\n+\t}\n+\tmy %edited;\n+\tfor my $f (keys %repoint) {\n+\t\tmy $text = slurp($f);\n+\t\t(my $fdir = $f) =~ s{/?[^/]*\\z}{};\n+\t\tmy $depth = $fdir eq '' ? 0 : 1 + ($fdir =~ tr{/}{});\n+\t\tfor my $e (@{$repoint{$f}}) {\n+\t\t\tmy ($src, $dst) = @$e;\n+\t\t\t$text =~ s{^(\\h*#\\h*include\\h*\")((?:\\.\\./)*)\\Q$src\\E(\")}{\n+\t\t\t\tinclude_names_root($2, $depth, $fdir, $src)\n+\t\t\t\t\t? \"$1$dst$3\" : \"$1$2$src$3\"\n+\t\t\t}egm;\n+\t\t}\n+\t\t$edited{$f} = $text;\n+\t}\n+\treturn \\%edited;\n+}\n+\n+# For each accepted header move, repoint the tutorial #include \"foo.h\" example\n+# lines. A tutorial always names the full new path, so the repoint is\n+# unconditional (no shadow/depth resolution) and matches the #include anywhere\n+# in the line, at the start of a code block or in backticks mid-prose. Only the\n+# quoted path changes; the #include spelling is left as written. Returns\n+# tutorial path -> edited content.\n+sub adoc_edits {\n+\tmy ($moves) = @_;\n+\tmy %repoint;   # tutorial -> list of [src, dst]\n+\tfor my $m (@$moves) {\n+\t\tmy ($src, $dst) = @$m;\n+\t\tnext unless $src =~ /\\.h\\z/;\n+\t\t(my $re = $src) =~ s/\\./\\\\./g;\n+\t\tmy $apat = '#[[:blank:]]*include[[:blank:]]*\"' . $re . '\"';\n+\t\tmy $grep = \"git grep -lE '$apat' --\"\n+\t\t\t. \" 'Documentation/*.adoc' 'Documentation/**/*.adoc'\"\n+\t\t\t. \" ':(exclude)t/t[0-9][0-9][0-9][0-9]/**'\";\n+\t\tfor my $doc (split /\\n/, `$grep`) {\n+\t\t\tpush @{$repoint{$doc}}, [$src, $dst];\n+\t\t}\n+\t}\n+\tmy %edited;\n+\tfor my $f (keys %repoint) {\n+\t\tmy $text = slurp($f);\n+\t\tfor my $e (@{$repoint{$f}}) {\n+\t\t\tmy ($src, $dst) = @$e;\n+\t\t\t$text =~ s{(#\\h*include\\h*\")\\Q$src\\E(\")}{$1$dst$2}g;\n+\t\t}\n+\t\t$edited{$f} = $text;\n+\t}\n+\treturn \\%edited;\n+}\n+\n+# === Phase 3: collect the edits over the accepted moves ===\n+# A rejected move stays at the root, so its build references, includers, and\n+# tutorials keep naming it unchanged.\n+my $build = build_edits(\\@accepted);\n+my $includers = include_edits(\\@accepted);\n+my $tutorials = adoc_edits(\\@accepted);\n+\n+# === Phase 4: emit the patch ===\n+my $tmp = tempdir(CLEANUP => 1);\n+# hunk body (from the first @@) of a diff between $orig and the edited $text\n+sub hunk {\n+\tmy ($orig, $text) = @_;\n+\topen my $o, '>', \"$tmp/e\" or die; print {$o} $text; close $o;\n+\tmy $d = `git diff --no-index -- \"$orig\" \"$tmp/e\"`;\n+\tmy $i = index($d, \"\\n\\@\\@\");\n+\treturn $i < 0 ? '' : substr($d, $i + 1);\n+}\n+# A file's diff for the emitted patch: a plain hunk when $from and $to match, a\n+# rename-with-modification when they differ. An empty $hunk yields no diff.\n+sub diff_hunk {\n+\tmy ($from, $to, $hunk) = @_;\n+\treturn '' unless length $hunk;\n+\tmy $out = \"diff --git a/$from b/$to\\n\";\n+\t$out .= \"rename from $from\\nrename to $to\\n\" if $from ne $to;\n+\treturn $out . \"--- a/$from\\n+++ b/$to\\n$hunk\";\n+}\n+\n+# One diff per edited file, in a fixed order: build files, then includers, then\n+# tutorials. A build file and a tutorial stay in place; an includer that itself\n+# moves is a rename-with-modification (its new path is $dst_of{$f}).\n+my $patch = '';\n+for my $f (@buildfiles) {\n+\tnext unless defined $build->{$f};\n+\tmy $orig = slurp($f);\n+\tnext if $build->{$f} eq $orig;\n+\t$patch .= diff_hunk($f, $f, hunk($f, $build->{$f}));\n+}\n+for my $f (sort keys %$includers) {\n+\t$patch .= diff_hunk($f, $dst_of{$f} // $f, hunk($f, $includers->{$f}));\n+}\n+for my $f (sort keys %$tutorials) {\n+\t$patch .= diff_hunk($f, $f, hunk($f, $tutorials->{$f}));\n+}\n+\n+print \"$protocol\\n\";\n+print \"reject $_->[0] $_->[1]\\n\" for @rejects;\n+if (length $patch) { print \"patch\\n\"; print $patch; }\ndiff --git a/meson.build b/meson.build\nindex a2d987b124..38ec7d4f40 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -443,7 +443,9 @@ libgit_sources = [\n   'oidset.c',\n   'oidtree.c',\n   'organize/gitorganize-format.c',\n+  'organize/labeler-protocol.c',\n   'organize/organize.c',\n+  'organize/organizer-protocol.c',\n   'pack-bitmap-write.c',\n   'pack-bitmap.c',\n   'pack-check.c',\ndiff --git a/organize/gitorganize-format.c b/organize/gitorganize-format.c\nindex cdade12f5b..541dd373aa 100644\n--- a/organize/gitorganize-format.c\n+++ b/organize/gitorganize-format.c\n@@ -246,6 +246,11 @@ void gitorganize_write(struct gitorganize *g)\n \telse\n \t\tstrbuf_addstr(&out, \"[layout]\\n\");\n \tstrbuf_addstr(&out, \"[labels]\\n\");\n+\tstrbuf_addstr(&out,\n+\t\t      \"# The recorded placement of each source; edit a line to \"\n+\t\t      \"change it.\\n\"\n+\t\t      \"# apply --labels-only fills in unrecorded sources; \"\n+\t\t      \"--reseed re-derives all.\\n\");\n \tfor (size_t i = 0; i < g->records.nr; i++) {\n \t\tconst char *labels = g->records.items[i].util;\n \ndiff --git a/organize/labeler-protocol.c b/organize/labeler-protocol.c\nnew file mode 100644\nindex 0000000000..6541412c18\n--- /dev/null\n+++ b/organize/labeler-protocol.c\n@@ -0,0 +1,52 @@\n+#include \"git-compat-util.h\"\n+#include \"labeler-protocol.h\"\n+#include \"gettext.h\"\n+#include \"run-command.h\"\n+#include \"strbuf.h\"\n+#include \"string-list.h\"\n+#include \"strvec.h\"\n+#include \"wrapper.h\"\n+\n+/*\n+ * Run the labeler and record, in `labeled` (path -> its \"k=value k=value\" string in\n+ * util), each scoped_files file it labels. The labeler writes `path \\0 labels \\0`\n+ * per file, where labels is its space-separated key=value labels.\n+ */\n+void run_labeler(const char *cmd, struct string_list *scoped_files,\n+\t\t struct string_list *labeled)\n+{\n+\tstruct child_process cp = CHILD_PROCESS_INIT;\n+\tstruct strbuf out = STRBUF_INIT;\n+\tconst char *p, *end;\n+\n+\tstrvec_push(&cp.args, cmd);\n+\tcp.use_shell = 1;\n+\tif (capture_command(&cp, &out, 0))\n+\t\tdie(_(\"organize apply --labels-only: labeler failed: %s\"), cmd);\n+\n+\tp = out.buf;\n+\tend = out.buf + out.len;\n+\twhile (p < end) {\n+\t\tconst char *path = p;\n+\t\tconst char *labels;\n+\n+\t\tp += strlen(p) + 1;\n+\t\tif (p > end)\n+\t\t\tdie(_(\"organize apply --labels-only: truncated labeler record\"));\n+\t\tlabels = p;\n+\t\tp += strlen(p) + 1;\n+\t\tif (p > end)\n+\t\t\tdie(_(\"organize apply --labels-only: truncated labeler record\"));\n+\t\tif (strchr(labels, '\\n'))\n+\t\t\tdie(_(\"organize apply --labels-only: a label must not \"\n+\t\t\t      \"contain a newline: %s\"), path);\n+\n+\t\tif (!string_list_has_string(scoped_files, path))\n+\t\t\tcontinue;\t/* not a scoped_files file */\n+\t\tif (string_list_has_string(labeled, path))\n+\t\t\tdie(_(\"organize: duplicate labeler record for '%s'\"),\n+\t\t\t    path);\n+\t\tstring_list_insert(labeled, path)->util = xstrdup(labels);\n+\t}\n+\tstrbuf_release(&out);\n+}\ndiff --git a/organize/labeler-protocol.h b/organize/labeler-protocol.h\nnew file mode 100644\nindex 0000000000..0c2ea01686\n--- /dev/null\n+++ b/organize/labeler-protocol.h\n@@ -0,0 +1,15 @@\n+#ifndef LABELER_PROTOCOL_H\n+#define LABELER_PROTOCOL_H\n+\n+struct string_list;\n+\n+/*\n+ * The labeler protocol. git organize runs the configured labeler and\n+ * records, in `labeled` (path -> its \"k=value ...\" string in util), the\n+ * labels it returns for every file in `scoped_files`. The labeler writes one\n+ * `path \\0 labels \\0` record per file.\n+ */\n+void run_labeler(const char *cmd, struct string_list *scoped_files,\n+\t\t struct string_list *labeled);\n+\n+#endif /* LABELER_PROTOCOL_H */\ndiff --git a/organize/organize.c b/organize/organize.c\nindex 0d9850dfc0..8c623444c0 100644\n--- a/organize/organize.c\n+++ b/organize/organize.c\n@@ -1,6 +1,9 @@\n #include \"git-compat-util.h\"\n #include \"organize.h\"\n #include \"gitorganize-format.h\"\n+#include \"labeler-protocol.h\"\n+#include \"organizer-protocol.h\"\n+#include \"config.h\"\n #include \"gettext.h\"\n #include \"pathspec.h\"\n #include \"quote.h\"\n@@ -13,6 +16,19 @@\n #include \"wrapper.h\"\n #include \"wt-status.h\"\n \n+/* The configured command organize.<key> (labeler or organizer), or NULL. */\n+static const char *organize_command(struct repository *repo, const char *key)\n+{\n+\tstruct strbuf k = STRBUF_INIT;\n+\tconst char *cmd;\n+\n+\tstrbuf_addf(&k, \"organize.%s\", key);\n+\tif (repo_config_get_string_tmp(repo, k.buf, &cmd))\n+\t\tcmd = NULL;\n+\tstrbuf_release(&k);\n+\treturn cmd;\n+}\n+\n /*\n  * The [layout] rule whose directory equals `path`'s directory, or NULL when\n  * `path` is a root file or its directory matches no rule. A file in a [layout]\n@@ -114,6 +130,7 @@ static void add_move(struct organize_plan *plan, const char *src,\n \tm->src = xstrdup(src);\n \tm->dst = dst;\n \tm->rule_value = xstrdup(value);\n+\tm->skip_reason = NULL;\n }\n \n void organize_plan_build(struct repository *repo, struct organize_plan *plan)\n@@ -202,25 +219,66 @@ static int worktree_dirty(struct repository *repo)\n \treturn has_unstaged_changes(repo, 0) || has_uncommitted_changes(repo, 0);\n }\n \n-/* Map each move's src to its dst, in `dst_of`. */\n+/* Map each standing (non-rejected) move's src to its dst, in `dst_of`. */\n static void plan_dst_map(struct organize_plan *plan, struct string_list *dst_of)\n {\n \tfor (size_t i = 0; i < plan->moves_nr; i++)\n-\t\tstring_list_insert(dst_of, plan->moves[i].src)->util =\n-\t\t\tplan->moves[i].dst;\n+\t\tif (!plan->moves[i].skip_reason)\n+\t\t\tstring_list_insert(dst_of, plan->moves[i].src)->util =\n+\t\t\t\tplan->moves[i].dst;\n+}\n+\n+/*\n+ * Emit `<prefix><name>` for a `diff --git` header the way git's diff does: when\n+ * the prefixed path needs C-quoting, wrap the whole unit in one pair of double\n+ * quotes (\"a/<escaped>\") rather than quoting the name alone. An ordinary path\n+ * is emitted verbatim, so the header is byte-identical to git's diff.\n+ */\n+static void add_diff_git_path(struct strbuf *out, const char *prefix,\n+\t\t\t      const char *name)\n+{\n+\tif (quote_c_style(prefix, NULL, NULL, CQUOTE_NODQ) ||\n+\t    quote_c_style(name, NULL, NULL, CQUOTE_NODQ)) {\n+\t\tstrbuf_addch(out, '\"');\n+\t\tquote_c_style(prefix, out, NULL, CQUOTE_NODQ);\n+\t\tquote_c_style(name, out, NULL, CQUOTE_NODQ);\n+\t\tstrbuf_addch(out, '\"');\n+\t} else {\n+\t\tstrbuf_addstr(out, prefix);\n+\t\tstrbuf_addstr(out, name);\n+\t}\n }\n \n-/* A content-identical rename entry per move. */\n-static void build_rename_patch(struct organize_plan *plan, struct strbuf *out)\n+/*\n+ * A content-identical rename entry per standing move the organizer did not\n+ * claim. A claimed move is one the organizer renames itself, with content\n+ * changes, so git leaves that entry to the organizer's patch.\n+ */\n+static void build_rename_patch(struct organize_plan *plan,\n+\t\t\t       struct string_list *claimed, struct strbuf *out)\n {\n \tfor (size_t i = 0; i < plan->moves_nr; i++) {\n \t\tstruct organize_move *m = &plan->moves[i];\n \n-\t\t/* These are tracked_files source paths, which need no quoting. */\n-\t\tstrbuf_addf(out, \"diff --git a/%s b/%s\\n\", m->src, m->dst);\n+\t\tif (m->skip_reason || string_list_has_string(claimed, m->src))\n+\t\t\tcontinue;\n+\t\t/*\n+\t\t * C-quote the paths the way git's diff does, so a byte special\n+\t\t * to the patch format (newline, quote, ...) is escaped. An\n+\t\t * ordinary path passes through unquoted, so this is byte-for-\n+\t\t * byte git's rename header.\n+\t\t */\n+\t\tstrbuf_addstr(out, \"diff --git \");\n+\t\tadd_diff_git_path(out, \"a/\", m->src);\n+\t\tstrbuf_addch(out, ' ');\n+\t\tadd_diff_git_path(out, \"b/\", m->dst);\n+\t\tstrbuf_addch(out, '\\n');\n \t\tstrbuf_addstr(out, \"similarity index 100%\\n\");\n-\t\tstrbuf_addf(out, \"rename from %s\\n\", m->src);\n-\t\tstrbuf_addf(out, \"rename to %s\\n\", m->dst);\n+\t\tstrbuf_addstr(out, \"rename from \");\n+\t\tquote_c_style(m->src, out, NULL, 0);\n+\t\tstrbuf_addstr(out, \"\\nrename to \");\n+\t\tquote_c_style(m->dst, out, NULL, 0);\n+\t\tstrbuf_addch(out, '\\n');\n \t}\n }\n \n@@ -235,7 +293,8 @@ static int git_apply_index(const char *patch, size_t len)\n \n /*\n  * Repoint each carved file's [labels] line to its new path, carrying its labels\n- * unchanged: only its location changes. Returns nonzero when [labels] changed.\n+ * unchanged: only its location changes. A rejected move stays put and keeps its\n+ * line. Returns nonzero when [labels] changed.\n  */\n static int repoint_moved_declarations(struct organize_plan *plan)\n {\n@@ -278,19 +337,32 @@ static int repoint_moved_declarations(struct organize_plan *plan)\n void organize_plan_apply(struct repository *repo, struct organize_plan *plan)\n {\n \tstruct strbuf patch = STRBUF_INIT;\n+\tstruct strbuf combined = STRBUF_INIT;\n+\tstruct string_list claimed = STRING_LIST_INIT_DUP;\n+\tconst char *organizer;\n \n \tif (worktree_dirty(repo))\n \t\tdie(_(\"organize apply: the worktree has uncommitted changes; \"\n \t\t      \"commit or stash first\"));\n \n+\torganizer = organize_command(repo, \"organizer\");\n+\tif (organizer)\n+\t\trun_organizer(organizer, plan, &patch, &claimed);\n+\n \t/*\n-\t * Content-identical renames for every move, applied as one\n-\t * git apply --index transaction, so a failure leaves the tree untouched.\n+\t * Content-identical renames for every unclaimed move, then the\n+\t * organizer's edits (when any), apply as one git apply --index: git\n+\t * checks the whole patch before it writes, so a patch that does not\n+\t * apply changes nothing. The [labels] update in .gitorganize follows the\n+\t * apply and is staged separately rather than as part of it.\n \t */\n-\tbuild_rename_patch(plan, &patch);\n-\tif (patch.len && git_apply_index(patch.buf, patch.len))\n+\tbuild_rename_patch(plan, &claimed, &combined);\n+\tif (patch.len)\n+\t\tstrbuf_addbuf(&combined, &patch);\n+\tif (combined.len && git_apply_index(combined.buf, combined.len))\n \t\tdie(_(\"organize apply: the change does not apply cleanly; \"\n \t\t      \"nothing was changed\"));\n+\tstrbuf_release(&combined);\n \n \tif (repoint_moved_declarations(plan)) {\n \t\tstruct child_process add = CHILD_PROCESS_INIT;\n@@ -302,15 +374,80 @@ void organize_plan_apply(struct repository *repo, struct organize_plan *plan)\n \t\t\t      \"restore with git reset --hard\"));\n \t}\n \n+\tstring_list_clear(&claimed, 0);\n \tstrbuf_release(&patch);\n }\n \n+void organize_run_labeler(struct repository *repo, int reseed)\n+{\n+\tstruct organize_ctx ctx = ORGANIZE_CTX_INIT;\n+\tstruct string_list labeled = STRING_LIST_INIT_DUP;\n+\tstruct string_list records = STRING_LIST_INIT_DUP;\n+\tstruct child_process add = CHILD_PROCESS_INIT;\n+\tconst char *cmd;\n+\n+\torganize_ctx_load(repo, &ctx);\n+\tcmd = organize_command(repo, \"labeler\");\n+\tif (!cmd)\n+\t\tdie(_(\"organize: organize.labeler is not set\"));\n+\trun_labeler(cmd, &ctx.scoped_files, &labeled);\n+\n+\t/*\n+\t * A [labels] line for every scoped_files file. A file already recorded\n+\t * keeps its line: the recorded placement is authoritative, so a decision\n+\t * made by hand or in an earlier run survives, and the labeler only seeds a\n+\t * file it has not yet placed. With reseed, take the labeler's fresh label\n+\t * for every file instead, discarding the recorded placements. Walking the\n+\t * scoped_files set keeps a new, unrecorded source visible either way. The\n+\t * loop below then preserves every placed file already listed.\n+\t */\n+\tfor (size_t i = 0; i < ctx.scoped_files.nr; i++) {\n+\t\tconst char *path = ctx.scoped_files.items[i].string;\n+\t\tstruct string_list_item *rec =\n+\t\t\tstring_list_lookup(&ctx.gitorg.records, path);\n+\t\tstruct string_list_item *it;\n+\n+\t\tif (rec && !reseed) {\n+\t\t\tstring_list_insert(&records, path)->util =\n+\t\t\t\txstrdup((const char *)rec->util);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (layout_dir_rule(&ctx.gitorg, path))\n+\t\t\tcontinue;\t/* placed by its directory; no line needed */\n+\t\tit = string_list_lookup(&labeled, path);\n+\t\tstring_list_insert(&records, path)->util =\n+\t\t\txstrdup(it ? (const char *)it->util : \"\");\n+\t}\n+\tfor (size_t i = 0; i < ctx.gitorg.records.nr; i++) {\n+\t\tconst char *path = ctx.gitorg.records.items[i].string;\n+\n+\t\tif (strchr(path, '/') &&\n+\t\t    string_list_has_string(&ctx.tracked_files, path) &&\n+\t\t    !string_list_has_string(&records, path))\n+\t\t\tstring_list_insert(&records, path)->util =\n+\t\t\t\txstrdup(ctx.gitorg.records.items[i].util);\n+\t}\n+\n+\tstring_list_clear(&ctx.gitorg.records, 1);\n+\tctx.gitorg.records = records;\t/* ctx.gitorg owns the fresh [labels] */\n+\tgitorganize_write(&ctx.gitorg);\n+\n+\tadd.git_cmd = 1;\n+\tstrvec_pushl(&add.args, \"add\", \".gitorganize\", NULL);\n+\tif (run_command(&add))\n+\t\tdie(_(\"organize apply --labels-only: staging .gitorganize failed\"));\n+\n+\torganize_ctx_release(&ctx);\n+\tstring_list_clear(&labeled, 1);\n+}\n+\n void organize_plan_release(struct organize_plan *plan)\n {\n \tfor (size_t i = 0; i < plan->moves_nr; i++) {\n \t\tfree(plan->moves[i].src);\n \t\tfree(plan->moves[i].dst);\n \t\tfree(plan->moves[i].rule_value);\n+\t\tfree(plan->moves[i].skip_reason);\n \t}\n \tFREE_AND_NULL(plan->moves);\n \tplan->moves_nr = plan->moves_alloc = 0;\ndiff --git a/organize/organize.h b/organize/organize.h\nindex c26453d2be..84e6558f8b 100644\n--- a/organize/organize.h\n+++ b/organize/organize.h\n@@ -15,30 +15,42 @@ struct repository;\n  *   [scope]    the scope pathspecs, one per line; no [scope] section means\n  *     nothing is in scope.\n  *\n- *   [layout]   the project's placement map, hand-authored: ordered\n- *     `<label>:<value> = <directory>` rules (`.` is the root). A file's labels\n- *     are matched against the rules in order, and the first rule it satisfies\n- *     places it; a file matching no rule is backlog. Only a label named in\n- *     a rule places a file.\n+ *   [layout]   the project's directory map, hand-authored: ordered\n+ *     `<label>:<value> = <directory>` rules (`.` is the root). git organize\n+ *     matches a file's labels against the rules in order; the first rule it\n+ *     satisfies names the file's directory. A file matching no rule is backlog.\n+ *     Only a rule named in [layout] moves a file.\n  *\n  *   [labels]   the recorded labels, one line per source in scope, `<path> <key>=\n- *     <value> ...`, with every label the project defines. Placed files are listed\n- *     too, so a placed file's [labels] line records its labels, independently of\n- *     the directory name.\n+ *     <value> ...`, with every label the project defines. A file already in its\n+ *     directory is listed too, so its [labels] line records its labels, apart\n+ *     from the directory name. A label named in no rule moves no file; git\n+ *     organize records it for a reader.\n+ *\n+ * The labeler and organizer commands live in config, organize.labeler and\n+ * organize.organizer.\n  *\n  *   status  Read [labels] and report the files in scope whose matching rule\n  *     names a directory they are not in yet (the moves), the backlog, and a\n  *     recorded path that no longer exists.\n  *\n- *   apply   Perform the moves. A move is a content-identical rename, applied as\n- *     one git apply --index transaction. A carved file's [labels] line is\n- *     repointed to its new path, carrying its labels.\n+ *   apply   Perform the moves. A move is a content-preserving rename. When an\n+ *     organizer is configured, hand it the moves; it returns edits to referring\n+ *     files as a patch and a reason for any move it declines. Moves and the\n+ *     patch apply as one git apply. With no organizer, each move is a plain git\n+ *     mv. A carved file's [labels] line is repointed to its new path, carrying\n+ *     its labels.\n+ *\n+ *   apply --labels-only  Run the labeler and write a [labels] line for every\n+ *     file in scope, keeping the line of a file already in its directory.\n+ *     Staged. This is the only path that runs a labeler.\n  */\n \n struct organize_move {\n \tchar *src;\t/* current path */\n \tchar *dst;\t/* declared path */\n-\tchar *rule_value;\t/* the matched rule's value */\n+\tchar *rule_value;\t/* the matched rule's value, sent to the organizer */\n+\tchar *skip_reason;\t/* why the organizer declined it; NULL when it stands */\n };\n \n struct organize_plan {\n@@ -67,11 +79,21 @@ struct organize_plan {\n void organize_plan_build(struct repository *repo, struct organize_plan *plan);\n \n /*\n- * Perform the plan: apply the moves as one content-identical-rename\n- * transaction; the result is staged. Requires a clean worktree.\n+ * Perform the plan: consult the organizer when one is configured, then apply\n+ * the standing moves and the organizer's patch; the result is staged.\n+ * Requires a clean worktree. Records each declined move's reason in the plan.\n  */\n void organize_plan_apply(struct repository *repo, struct organize_plan *plan);\n \n+/*\n+ * Fill the [labels] record for every file in scope, staged. A file already\n+ * recorded keeps its line (the recorded placement is authoritative); an\n+ * unrecorded file is seeded from the labeler (its labels, or empty when the\n+ * labeler leaves it unplaced). With reseed, re-derive every line from the\n+ * labeler, discarding the recorded placements.\n+ */\n+void organize_run_labeler(struct repository *repo, int reseed);\n+\n void organize_plan_release(struct organize_plan *plan);\n \n #endif /* ORGANIZE_H */\ndiff --git a/organize/organizer-protocol.c b/organize/organizer-protocol.c\nnew file mode 100644\nindex 0000000000..d50617e010\n--- /dev/null\n+++ b/organize/organizer-protocol.c\n@@ -0,0 +1,254 @@\n+#include \"git-compat-util.h\"\n+#include \"organizer-protocol.h\"\n+#include \"organize.h\"\n+#include \"gitorganize-format.h\"\n+#include \"apply.h\"\n+#include \"gettext.h\"\n+#include \"quote.h\"\n+#include \"run-command.h\"\n+#include \"strbuf.h\"\n+#include \"string-list.h\"\n+#include \"strvec.h\"\n+#include \"wrapper.h\"\n+\n+#define ORGANIZE_PROTOCOL \"git-organize 1 organize\"\n+\n+/* Record a skip reason for a standing move, taking ownership of `reason`. */\n+static void reject_move(struct organize_plan *plan, const char *src,\n+\t\t\tchar *reason)\n+{\n+\tfor (size_t move_idx = 0; move_idx < plan->moves_nr; move_idx++) {\n+\t\tstruct organize_move *move = &plan->moves[move_idx];\n+\n+\t\tif (!strcmp(move->src, src)) {\n+\t\t\tfree(move->skip_reason);\n+\t\t\tmove->skip_reason = reason;\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\tfree(reason);\t/* a skip_reason for a move we did not propose is ignored */\n+}\n+\n+/* Serialize the standing moves as the organizer request. */\n+static void build_request(struct organize_plan *plan, struct strbuf *request)\n+{\n+\tstrbuf_addstr(request, ORGANIZE_PROTOCOL \"\\n\");\n+\tfor (size_t move_idx = 0; move_idx < plan->moves_nr; move_idx++) {\n+\t\tstruct organize_move *move = &plan->moves[move_idx];\n+\n+\t\tif (move->skip_reason)\n+\t\t\tcontinue;\n+\t\tstrbuf_addstr(request, \"move \");\n+\t\tquote_c_style(move->src, request, NULL, 0);\n+\t\tstrbuf_addch(request, ' ');\n+\t\tquote_c_style(move->dst, request, NULL, 0);\n+\t\tstrbuf_addf(request, \" %s\\n\", move->rule_value);\n+\t}\n+}\n+\n+/* The next \"diff --git \" line, at column 0, at or after `from`, or `end`. */\n+static const char *next_entry(const char *from, const char *end)\n+{\n+\twhile (from < end) {\n+\t\tif (starts_with(from, \"diff --git \"))\n+\t\t\treturn from;\n+\t\tfrom = memchr(from, '\\n', end - from);\n+\t\tif (!from)\n+\t\t\treturn end;\n+\t\tfrom++;\n+\t}\n+\treturn end;\n+}\n+\n+/*\n+ * Whether an entry's text mentions a directory the plan moves into, so that an\n+ * in-place edit is one that repoints a reference toward a moved file rather\n+ * than an edit of an unrelated file.\n+ */\n+static int repoints_a_move(const char *entry, const char *entry_end,\n+\t\t\t   const struct string_list *dstdirs)\n+{\n+\tfor (size_t i = 0; i < dstdirs->nr; i++) {\n+\t\tconst char *dir = dstdirs->items[i].string;\n+\n+\t\tif (memmem(entry, entry_end - entry, dir, strlen(dir)))\n+\t\t\treturn 1;\n+\t}\n+\treturn 0;\n+}\n+\n+/*\n+ * The organizer is a trusted command that the repository configures, like a\n+ * clean or smudge filter. This is an integrity check on the organizer patch,\n+ * not a sandbox against a hostile organizer. It reads each entry's per-entry\n+ * header with git's own diff-header parser (parse_git_diff_header), the same\n+ * names `git apply` acts on, and refuses a header that steps outside the plan.\n+ * It does not confine what the hunks the applying patch carries may change.\n+ *\n+ * Check each entry's header and record which moves the patch claims. An entry\n+ * is one of:\n+ *   - old == new: an in-place edit. The file must stay put (not be a move) and\n+ *     the edit must repoint a reference into a directory the plan moves a file\n+ *     into, which bounds a mistaken organizer to files the moves touch.\n+ *   - old != new: a rename-with-modification. It must match a planned move\n+ *     (old -> new), which git organize then assigns to the organizer (a claim).\n+ * Refuse a header that adds, deletes, or copies a file, or changes a file's\n+ * mode; git organize controls which files exist and their modes. The patch\n+ * must be in git diff format.\n+ */\n+static void validate_patch(struct organize_plan *plan,\n+\t\t\t   const struct strbuf *patch,\n+\t\t\t   struct string_list *claimed)\n+{\n+\tstruct string_list dst_map = STRING_LIST_INIT_NODUP;\n+\tstruct string_list dstdirs = STRING_LIST_INIT_DUP;\n+\tstruct strbuf root = STRBUF_INIT;\n+\tconst char *cursor = patch->buf;\n+\tconst char *end = patch->buf + patch->len;\n+\n+\tfor (size_t move_idx = 0; move_idx < plan->moves_nr; move_idx++) {\n+\t\tstruct organize_move *move = &plan->moves[move_idx];\n+\t\tconst char *slash;\n+\n+\t\tif (move->skip_reason)\n+\t\t\tcontinue;\n+\t\tstring_list_insert(&dst_map, move->src)->util = move->dst;\n+\t\tslash = strrchr(move->dst, '/');\n+\t\tif (slash) {\n+\t\t\tstruct strbuf dir = STRBUF_INIT;\n+\n+\t\t\tstrbuf_add(&dir, move->dst, slash - move->dst + 1);\n+\t\t\tstring_list_insert(&dstdirs, dir.buf);\n+\t\t\tstrbuf_release(&dir);\n+\t\t}\n+\t}\n+\n+\twhile (cursor < end && *cursor == '\\n')\n+\t\tcursor++;\n+\tif (cursor < end && !starts_with(cursor, \"diff --git \"))\n+\t\tdie(_(\"organize apply: the organizer patch is not in git diff format\"));\n+\n+\twhile (cursor < end && starts_with(cursor, \"diff --git \")) {\n+\t\tconst char *newline = memchr(cursor, '\\n', end - cursor);\n+\t\tsize_t first = newline ? (size_t)(newline - cursor + 1)\n+\t\t\t\t       : (size_t)(end - cursor);\n+\t\tstruct patch entry;\n+\t\tint linenr = 0, hdrlen;\n+\t\tconst char *old_name, *new_name, *entry_end;\n+\t\tstruct string_list_item *dst;\n+\n+\t\tmemset(&entry, 0, sizeof(entry));\n+\t\thdrlen = parse_git_diff_header(&root, NULL, &linenr, 1, cursor,\n+\t\t\t\t\t       first, end - cursor, &entry);\n+\t\tif (hdrlen < 0)\n+\t\t\tdie(_(\"organize apply: cannot parse the organizer patch\"));\n+\t\tentry_end = next_entry(cursor + hdrlen, end);\n+\t\tif (entry.is_new || entry.is_delete || entry.is_copy)\n+\t\t\tdie(_(\"organize apply: the organizer patch must not add, \"\n+\t\t\t      \"delete, or copy files\"));\n+\t\tif (entry.old_mode != entry.new_mode)\n+\t\t\tdie(_(\"organize apply: the organizer patch must not change \"\n+\t\t\t      \"a file's mode\"));\n+\t\told_name = entry.old_name ? entry.old_name : entry.def_name;\n+\t\tnew_name = entry.new_name ? entry.new_name : entry.def_name;\n+\t\tif (!old_name || !new_name)\n+\t\t\tdie(_(\"organize apply: cannot tell which file the organizer \"\n+\t\t\t      \"patch touches\"));\n+\n+\t\tdst = string_list_lookup(&dst_map, old_name);\n+\t\tif (!strcmp(old_name, new_name)) {\n+\t\t\tif (dst)\n+\t\t\t\tdie(_(\"organize apply: the organizer patch edits %s \"\n+\t\t\t\t      \"in place, but it is part of a move\"), old_name);\n+\t\t\tif (!repoints_a_move(cursor, entry_end, &dstdirs))\n+\t\t\t\tdie(_(\"organize apply: the organizer patch edits %s \"\n+\t\t\t\t      \"in place, but the edit does not repoint a \"\n+\t\t\t\t      \"move\"), old_name);\n+\t\t} else if (!dst || strcmp(dst->util, new_name)) {\n+\t\t\tdie(_(\"organize apply: the organizer patch renames %s to %s, \"\n+\t\t\t      \"which is not a planned move\"), old_name, new_name);\n+\t\t} else {\n+\t\t\tstring_list_insert(claimed, old_name);\n+\t\t}\n+\t\trelease_patch(&entry);\n+\t\tcursor = entry_end;\n+\t}\n+\n+\tstring_list_clear(&dst_map, 0);\n+\tstring_list_clear(&dstdirs, 0);\n+\tstrbuf_release(&root);\n+}\n+\n+/*\n+ * Parse the organizer response: the version line, then the reject directives\n+ * and the optional patch, which is validated against the plan.\n+ */\n+static void parse_response(struct organize_plan *plan,\n+\t\t\t   const struct strbuf *response, struct strbuf *patch,\n+\t\t\t   struct string_list *claimed)\n+{\n+\tconst char *cursor = response->buf;\n+\tconst char *end = response->buf + response->len;\n+\tstruct strbuf path = STRBUF_INIT;\n+\n+\tif (!skip_prefix(cursor, ORGANIZE_PROTOCOL, &cursor) || *cursor != '\\n')\n+\t\tdie(_(\"organize: organizer did not send the protocol header '%s'\"),\n+\t\t    ORGANIZE_PROTOCOL);\n+\tcursor++;\n+\n+\twhile (cursor < end) {\n+\t\tconst char *newline = memchr(cursor, '\\n', end - cursor);\n+\t\tconst char *args;\n+\n+\t\tif (!newline)\n+\t\t\tdie(_(\"organize: truncated organizer response\"));\n+\n+\t\tif (skip_prefix(cursor, \"reject \", &args)) {\n+\t\t\tconst char *reason = read_path_token(args, &path);\n+\n+\t\t\t/*\n+\t\t\t * read_path_token on a quoted path unquotes past a raw\n+\t\t\t * newline, so its end (or the trimmed reason) can lie\n+\t\t\t * beyond this line's newline; a negative length would\n+\t\t\t * wrap in xstrndup below.\n+\t\t\t */\n+\t\t\tif (reason > newline)\n+\t\t\t\tdie(_(\"organize: malformed reject line\"));\n+\t\t\twhile (reason < newline && *reason == ' ')\n+\t\t\t\treason++;\n+\t\t\treject_move(plan, path.buf,\n+\t\t\t\t    xstrndup(reason, newline - reason));\n+\t\t\tcursor = newline + 1;\n+\t\t} else if (starts_with(cursor, \"patch\\n\")) {\n+\t\t\tconst char *body = newline + 1;\n+\n+\t\t\tstrbuf_add(patch, body, end - body);\n+\t\t\tif (patch->len)\n+\t\t\t\tvalidate_patch(plan, patch, claimed);\n+\t\t\tbreak;\n+\t\t} else if (newline == cursor) {\n+\t\t\tcursor = newline + 1;\t/* skip a blank line */\n+\t\t} else {\n+\t\t\tdie(_(\"organize: unexpected organizer line\"));\n+\t\t}\n+\t}\n+\tstrbuf_release(&path);\n+}\n+\n+/* Run the organizer over the standing moves, then validate its patch. */\n+void run_organizer(const char *command, struct organize_plan *plan,\n+\t\t   struct strbuf *patch, struct string_list *claimed)\n+{\n+\tstruct child_process child = CHILD_PROCESS_INIT;\n+\tstruct strbuf request = STRBUF_INIT, response = STRBUF_INIT;\n+\n+\tbuild_request(plan, &request);\n+\tstrvec_push(&child.args, command);\n+\tchild.use_shell = 1;\n+\tif (pipe_command(&child, request.buf, request.len, &response,\n+\t\t\t 0, NULL, 0))\n+\t\tdie(_(\"organize: organizer failed: %s\"), command);\n+\tparse_response(plan, &response, patch, claimed);\n+\tstrbuf_release(&request);\n+\tstrbuf_release(&response);\n+}\ndiff --git a/organize/organizer-protocol.h b/organize/organizer-protocol.h\nnew file mode 100644\nindex 0000000000..4159d4ef24\n--- /dev/null\n+++ b/organize/organizer-protocol.h\n@@ -0,0 +1,18 @@\n+#ifndef ORGANIZER_PROTOCOL_H\n+#define ORGANIZER_PROTOCOL_H\n+\n+struct organize_plan;\n+struct strbuf;\n+struct string_list;\n+\n+/*\n+ * The organizer protocol. git organize sends the standing moves to the\n+ * configured organizer, which may reject moves or return a patch of content\n+ * edits. run_organizer validates that patch against the plan, fills `patch`\n+ * with the edits and `claimed` with the moves the organizer renames itself,\n+ * and records each rejected move on the plan.\n+ */\n+void run_organizer(const char *command, struct organize_plan *plan,\n+\t\t   struct strbuf *patch, struct string_list *claimed);\n+\n+#endif /* ORGANIZER_PROTOCOL_H */\ndiff --git a/t/t0096-organize.sh b/t/t0096-organize.sh\nindex a352a1c7d1..c2e6539ef2 100755\n--- a/t/t0096-organize.sh\n+++ b/t/t0096-organize.sh\n@@ -4,9 +4,39 @@ test_description='git organize reconciles a tree against a declared layout'\n \n . ./test-lib.sh\n \n-# There is no labeler yet, so tests write .gitorganize by hand: root *.c/*.h in\n-# scope, odb/refs components, and a [labels] census.\n-write_declaration () {\n+# A labeler records blob.c under odb, refs.c under refs, header.h as public.\n+# It writes a NUL-separated path and key=value label record per file.\n+write_labeler () {\n+\twrite_script labeler <<-\\EOF\n+\tprintf 'blob.c\\0component=odb role=lib\\0'\n+\tprintf 'refs.c\\0component=refs role=lib\\0'\n+\tprintf 'header.h\\0component=? role=public\\0'\n+\tEOF\n+}\n+\n+# Point a stub organizer at the patch on its standard input; $2, if given, is\n+# the reason it declines a move.\n+write_organizer () {\n+\tcat >\"$1.patch\" &&\n+\twrite_script \"$1\" <<-EOF\n+\tcat >/dev/null\n+\tprintf 'git-organize 1 organize\\n'\n+\t${2:+printf 'reject %s\\n' '$2'}\n+\tprintf 'patch\\n'\n+\tcat $1.patch\n+\tEOF\n+}\n+\n+# Point organize at the given labeler (and optional organizer), the way a\n+# project points a merge driver at a command, and write the project-authored\n+# [scope] pathspecs and [layout] rules: role:public and role:program keep a\n+# file at the root (first match wins), a component value routes to its directory.\n+configure_organize () {\n+\tgit config organize.labeler \"$1\" &&\n+\tif test $# -gt 1\n+\tthen\n+\t\tgit config organize.organizer \"$2\"\n+\tfi &&\n \tcat >.gitorganize <<-\\EOF\n \t[scope]\n \t:(glob)*.c\n@@ -16,24 +46,106 @@ write_declaration () {\n \trole:program = .\n \tcomponent:odb = odb\n \tcomponent:refs = refs\n-\t[labels]\n-\tblob.c component=odb role=lib\n-\theader.h component=? role=public\n-\trefs.c component=refs role=lib\n \tEOF\n }\n \n-test_expect_success 'setup a tree and a declaration' '\n+test_expect_success 'setup a tree and a labeler' '\n \techo blob >blob.c &&\n \techo refs >refs.c &&\n \techo header >header.h &&\n \tgit add . &&\n \tgit commit -m init &&\n-\twrite_declaration &&\n+\twrite_labeler &&\n+\tconfigure_organize ./labeler &&\n \tgit add .gitorganize &&\n \tgit commit -m declare\n '\n \n+test_expect_success 'apply --labels-only records the labels' '\n+\tgit organize apply --labels-only &&\n+\tcat >expect <<-\\EOF &&\n+\t[scope]\n+\t:(glob)*.c\n+\t:(glob)*.h\n+\t[layout]\n+\trole:public = .\n+\trole:program = .\n+\tcomponent:odb = odb\n+\tcomponent:refs = refs\n+\t[labels]\n+\t# The recorded placement of each source; edit a line to change it.\n+\t# apply --labels-only fills in unrecorded sources; --reseed re-derives all.\n+\tblob.c component=odb role=lib\n+\theader.h component=? role=public\n+\trefs.c component=refs role=lib\n+\tEOF\n+\ttest_cmp expect .gitorganize &&\n+\tgit diff --cached --name-only >staged &&\n+\ttest_grep \"^.gitorganize$\" staged &&\n+\tgit commit -m labels\n+'\n+\n+test_expect_success 'apply --labels-only preserves a recorded label; --reseed re-derives' '\n+\tgit init preserve &&\n+\t(\n+\t\tcd preserve &&\n+\t\techo blob >blob.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\tconfigure_organize ./labeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\ttest_grep \"^blob.c component=odb\" .gitorganize &&\n+\t\t# a hand-made placement decision the labeler would not make\n+\t\tsed \"s|^blob.c component=odb|blob.c component=refs|\" .gitorganize >edited &&\n+\t\tmv edited .gitorganize &&\n+\t\t# a plain re-run keeps the recorded decision\n+\t\tgit organize apply --labels-only &&\n+\t\ttest_grep \"^blob.c component=refs\" .gitorganize &&\n+\t\ttest_grep ! \"^blob.c component=odb\" .gitorganize &&\n+\t\t# --reseed discards it and re-derives from the labeler\n+\t\tgit organize apply --labels-only --reseed &&\n+\t\ttest_grep \"^blob.c component=odb\" .gitorganize\n+\t)\n+'\n+\n+test_expect_success 'a file added under a carved directory is governed in place' '\n+\tgit init subdirs &&\n+\t(\n+\t\tcd subdirs &&\n+\t\techo blob >blob.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\tconfigure_organize ./labeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\tgit organize apply &&\n+\t\tgit commit -m carve &&\n+\t\ttest_path_is_file odb/blob.c &&\n+\t\t# the carved file alone is in scope and in place\n+\t\tgit organize status >before &&\n+\t\ttest_grep \"1 in scope\" before &&\n+\t\t# a NEW file added directly under the carved odb/ directory is\n+\t\t# governed by its location: in scope and in place, not invisible\n+\t\techo extra >odb/extra.c &&\n+\t\tgit add odb/extra.c &&\n+\t\tgit organize status >after &&\n+\t\ttest_grep \"2 in scope (2 in place\" after &&\n+\t\tgit organize status --exit-code &&\n+\t\t# a file outside any [layout] directory stays ungoverned\n+\t\tmkdir vendor &&\n+\t\techo v >vendor/z.c &&\n+\t\tgit add vendor/z.c &&\n+\t\tgit organize status >vend &&\n+\t\ttest_grep \"2 in scope\" vend\n+\t)\n+'\n+\n test_expect_success 'status reports the files to move' '\n \tgit organize status >actual &&\n \t# header.h is public (in place at root); blob.c and refs.c move next\n@@ -74,47 +186,319 @@ test_expect_success 'apply refuses a dirty worktree' '\n \t\techo other >other.c &&\n \t\tgit add . &&\n \t\tgit commit -m init &&\n-\t\tcat >.gitorganize <<-\\EOF &&\n-\t\t[scope]\n-\t\t:(glob)*.c\n-\t\t[layout]\n-\t\tcomponent:odb = odb\n-\t\t[labels]\n-\t\tblob.c component=odb\n-\t\tother.c component=?\n-\t\tEOF\n+\t\twrite_labeler &&\n+\t\tconfigure_organize ./labeler &&\n \t\tgit add .gitorganize &&\n \t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n \t\techo dirty >>other.c &&\n \t\ttest_must_fail git organize apply 2>err &&\n \t\ttest_grep \"uncommitted changes\" err\n \t)\n '\n \n-test_expect_success 'a file in scope with no matching rule is backlog' '\n-\tgit init backlog &&\n+test_expect_success 'organizer may decline a move and patch a referrer' '\n+\tgit init sub &&\n+\t(\n+\t\tcd sub &&\n+\t\techo blob >blob.c &&\n+\t\techo refs >refs.c &&\n+\t\tprintf \"blob.o\\n\" >build.list &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\twrite_organizer organizer \"refs.c held for test\" <<-\\EOF &&\n+\t\tdiff --git a/build.list b/build.list\n+\t\t--- a/build.list\n+\t\t+++ b/build.list\n+\t\t@@ -1 +1 @@\n+\t\t-blob.o\n+\t\t+odb/blob.o\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./organizer &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\tgit organize apply >out &&\n+\t\ttest_grep \"1 move(s), 1 skipped\" out &&\n+\t\ttest_grep \"skipped refs.c\" out &&\n+\t\tgit diff --cached -M --name-status >actual &&\n+\t\ttest_grep \"^R100.*blob.c.*odb/blob.c\" actual &&\n+\t\ttest_grep \"^M.*build.list\" actual &&\n+\t\techo odb/blob.o >expect &&\n+\t\ttest_cmp expect build.list &&\n+\t\ttest_path_is_file refs.c &&\n+\t\ttest_path_is_file odb/blob.c &&\n+\t\ttest_path_is_missing blob.c &&\n+\t\t# the carved file is repointed; the declined file keeps its line\n+\t\ttest_grep \"^odb/blob.c component=odb\" .gitorganize &&\n+\t\ttest_grep \"^refs.c component=refs\" .gitorganize &&\n+\t\ttest_grep ! \"^blob.c \" .gitorganize\n+\t)\n+'\n+\n+test_expect_success 'apply rejects an in-place edit of a moved file' '\n+\tgit init tamper &&\n \t(\n-\t\tcd backlog &&\n+\t\tcd tamper &&\n+\t\techo blob >blob.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\twrite_organizer tamper_organizer <<-\\EOF &&\n+\t\tdiff --git a/blob.c b/blob.c\n+\t\t--- a/blob.c\n+\t\t+++ b/blob.c\n+\t\t@@ -1 +1 @@\n+\t\t-blob\n+\t\t+tampered\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./tamper_organizer &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\ttest_must_fail git organize apply 2>err &&\n+\t\ttest_grep \"part of a move\" err &&\n+\t\t# the rejected apply changed nothing\n+\t\ttest_path_is_file blob.c &&\n+\t\ttest_path_is_missing odb/blob.c\n+\t)\n+'\n+\n+test_expect_success 'apply rejects a rename that is not a planned move' '\n+\tgit init renamer &&\n+\t(\n+\t\tcd renamer &&\n+\t\techo blob >blob.c &&\n+\t\techo readme >README &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\twrite_organizer rename_organizer <<-\\EOF &&\n+\t\tdiff --git a/README b/MOVED\n+\t\tsimilarity index 100%\n+\t\trename from README\n+\t\trename to MOVED\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./rename_organizer &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\ttest_must_fail git organize apply 2>err &&\n+\t\ttest_grep \"not a planned move\" err &&\n+\t\t# the rejected apply changed nothing\n+\t\ttest_path_is_file README &&\n+\t\ttest_path_is_missing MOVED &&\n+\t\ttest_path_is_file blob.c\n+\t)\n+'\n+\n+test_expect_success 'apply rejects a body that edits a file the header does not name' '\n+\tgit init header-lies &&\n+\t(\n+\t\tcd header-lies &&\n+\t\techo blob >blob.c &&\n+\t\techo refs >refs.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\t# the diff --git header claims the planned blob.c move, but the body\n+\t\t# edits refs.c (another moved file); apply resolves the real target\n+\t\t# from the patch, not the header, and rejects it.\n+\t\twrite_organizer liar <<-\\EOF &&\n+\t\tdiff --git a/blob.c b/odb/blob.c\n+\t\t--- a/refs.c\n+\t\t+++ b/refs.c\n+\t\t@@ -1 +1 @@\n+\t\t-refs\n+\t\t+tampered\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./liar &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\ttest_must_fail git organize apply 2>err &&\n+\t\ttest_grep \"part of a move\" err &&\n+\t\t# the rejected apply changed nothing\n+\t\ttest_grep \"^refs$\" refs.c &&\n+\t\ttest_path_is_missing refs/refs.c &&\n+\t\ttest_path_is_missing odb/blob.c\n+\t)\n+'\n+\n+test_expect_success 'apply rejects an in-place edit that repoints no move' '\n+\tgit init meddle &&\n+\t(\n+\t\tcd meddle &&\n+\t\techo blob >blob.c &&\n+\t\techo other >other.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\t# other.c does not move, and the edit names no directory the plan\n+\t\t# moves into, so it is not repointing a reference to a moved file\n+\t\twrite_organizer meddler <<-\\EOF &&\n+\t\tdiff --git a/other.c b/other.c\n+\t\t--- a/other.c\n+\t\t+++ b/other.c\n+\t\t@@ -1 +1 @@\n+\t\t-other\n+\t\t+meddled\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./meddler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\ttest_must_fail git organize apply 2>err &&\n+\t\ttest_grep \"does not repoint\" err &&\n+\t\t# the rejected apply changed nothing\n+\t\ttest_grep \"^other$\" other.c &&\n+\t\ttest_path_is_file blob.c &&\n+\t\ttest_path_is_missing odb/blob.c\n+\t)\n+'\n+\n+test_expect_success 'organizer may rename-with-modification a moved file' '\n+\tgit init renamemod &&\n+\t(\n+\t\tcd renamemod &&\n+\t\tcat >blob.c <<-\\EOF &&\n+\t\t#include \"a.h\"\n+\t\t#include \"b.h\"\n+\t\t#include \"x.h\"\n+\t\t#include \"c.h\"\n+\t\t#include \"d.h\"\n+\t\tEOF\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\twrite_organizer renamemod_organizer <<-\\EOF &&\n+\t\tdiff --git a/blob.c b/odb/blob.c\n+\t\trename from blob.c\n+\t\trename to odb/blob.c\n+\t\t--- a/blob.c\n+\t\t+++ b/odb/blob.c\n+\t\t@@ -1,5 +1,5 @@\n+\t\t #include \"a.h\"\n+\t\t #include \"b.h\"\n+\t\t-#include \"x.h\"\n+\t\t+#include \"sub/x.h\"\n+\t\t #include \"c.h\"\n+\t\t #include \"d.h\"\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./renamemod_organizer &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\tgit organize apply &&\n+\t\ttest_path_is_file odb/blob.c &&\n+\t\ttest_path_is_missing blob.c &&\n+\t\ttest_grep \"sub/x.h\" odb/blob.c &&\n+\t\tgit diff --cached -M --name-status >actual &&\n+\t\ttest_grep \"^R[0-9]*.*blob.c.*odb/blob.c\" actual &&\n+\t\ttest_grep \"^odb/blob.c component=odb role=lib\" .gitorganize &&\n+\t\ttest_grep ! \"^blob.c \" .gitorganize &&\n+\t\tgit diff --cached --name-only >staged &&\n+\t\ttest_grep \"^.gitorganize$\" staged\n+\t)\n+'\n+\n+test_expect_success 'a basename shared across directories does not collide' '\n+\tgit init dup &&\n+\t(\n+\t\tcd dup &&\n+\t\techo root >dup.c &&\n+\t\tmkdir sub &&\n+\t\techo sub >sub/dup.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\t# a labeler that labels only the root dup.c\n+\t\twrite_script duplabeler <<-\\EOF &&\n+\t\tprintf \"dup.c\\0component=odb role=lib\\0\"\n+\t\tEOF\n+\t\tconfigure_organize ./duplabeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\tgit organize status >actual &&\n+\t\ttest_grep \"dup.c  *-> odb/dup.c\" actual &&\n+\t\ttest_grep ! \"sub/dup.c\" actual &&\n+\t\tgit organize apply &&\n+\t\ttest_path_is_file odb/dup.c &&\n+\t\ttest_path_is_file sub/dup.c &&\n+\t\ttest_path_is_missing dup.c &&\n+\t\tgit commit -m reconciled\n+\t)\n+'\n+\n+test_expect_success 'a rule that maps a label to the root keeps its file in place' '\n+\tgit init prog &&\n+\t(\n+\t\tcd prog &&\n+\t\techo lib >lib.c &&\n+\t\techo tool >tool.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\t# tool.c carries role=program, which the layout maps to the root\n+\t\t# (role:program = .), so it stays; lib.c matches component:odb and moves\n+\t\twrite_script proglabeler <<-\\EOF &&\n+\t\tprintf \"lib.c\\0component=odb role=lib\\0\"\n+\t\tprintf \"tool.c\\0component=? role=program\\0\"\n+\t\tEOF\n+\t\tconfigure_organize ./proglabeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\ttest_grep \"^tool.c component=? role=program\" .gitorganize &&\n+\t\tgit commit -m labels &&\n+\t\tgit organize status >actual &&\n+\t\ttest_grep \"organize: 2 in scope (1 in place, 1 to move, 0 backlog)\" actual &&\n+\t\ttest_grep ! \"tool.c  *->\" actual &&\n+\t\tgit organize apply &&\n+\t\ttest_path_is_file tool.c &&\n+\t\ttest_path_is_file odb/lib.c &&\n+\t\ttest_path_is_missing lib.c\n+\t)\n+'\n+\n+test_expect_success 'a file in scope with no recorded label is unrecorded' '\n+\tgit init scoped &&\n+\t(\n+\t\tcd scoped &&\n \t\techo a >a.c &&\n \t\tgit add . &&\n \t\tgit commit -m init &&\n-\t\tcat >.gitorganize <<-\\EOF &&\n-\t\t[scope]\n-\t\t:(glob)*.c\n-\t\t[layout]\n-\t\tcomponent:odb = odb\n-\t\t[labels]\n-\t\ta.c component=?\n+\t\twrite_script alabeler <<-\\EOF &&\n+\t\tprintf \"a.c\\0component=? role=lib\\0\"\n \t\tEOF\n+\t\tconfigure_organize ./alabeler &&\n \t\tgit add .gitorganize &&\n \t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\t# a.c is recorded but matches no rule: backlog\n \t\tgit organize status >actual &&\n-\t\ttest_grep \"backlog\" actual &&\n-\t\ttest_grep \"^  a.c$\" actual\n+\t\ttest_grep \"backlog:\" actual &&\n+\t\ttest_grep \"^  a.c$\" actual &&\n+\t\t# a source in scope that [labels] never recorded is unrecorded\n+\t\techo b >b.c &&\n+\t\tgit add b.c &&\n+\t\tgit commit -m add-b &&\n+\t\tgit organize status >actual &&\n+\t\ttest_grep \"in scope but unrecorded:\" actual &&\n+\t\ttest_grep \"^  b.c$\" actual\n \t)\n '\n \n-test_expect_success 'status reports a declared path that no longer exists' '\n+test_expect_success 'status reports a recorded path that no longer exists' '\n \tgit init orphan &&\n \t(\n \t\tcd orphan &&\n@@ -122,17 +506,15 @@ test_expect_success 'status reports a declared path that no longer exists' '\n \t\techo b >b.c &&\n \t\tgit add . &&\n \t\tgit commit -m init &&\n-\t\tcat >.gitorganize <<-\\EOF &&\n-\t\t[scope]\n-\t\t:(glob)*.c\n-\t\t[layout]\n-\t\trole:public = .\n-\t\t[labels]\n-\t\ta.c role=public\n-\t\tb.c role=public\n+\t\twrite_script twolabeler <<-\\EOF &&\n+\t\tprintf '\\''a.c\\0component=? role=public\\0b.c\\0component=? role=public\\0'\\''\n \t\tEOF\n+\t\tconfigure_organize ./twolabeler &&\n \t\tgit add .gitorganize &&\n \t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\t# remove a recorded file outside the tool\n \t\tgit rm -q b.c &&\n \t\tgit commit -m drop-b &&\n \t\tgit organize status >actual &&\n@@ -177,6 +559,25 @@ test_expect_success 'status rejects a malformed .gitorganize' '\n \t)\n '\n \n+test_expect_success 'the recorded labels carry arbitrary key=value pairs' '\n+\tgit init extra &&\n+\t(\n+\t\tcd extra &&\n+\t\techo z >z.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_script extralabeler <<-\\EOF &&\n+\t\tprintf '\\''z.c\\0component=? role=lib note=demo\\0'\\''\n+\t\tEOF\n+\t\tconfigure_organize ./extralabeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\t# a label the engine does not place still round-trips into [labels]\n+\t\ttest_grep \"^z.c component=? role=lib note=demo\" .gitorganize\n+\t)\n+'\n+\n test_expect_success 'a subcommand rejects extra operands' '\n \ttest_must_fail git -C bad organize status junk 2>err &&\n \ttest_grep \"too many arguments\" err\n-- \n2.54.0\n\n"},{"id":"551085","messageId":"20260823171915.2662373-5-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 04/14] organize: add the --label selector","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:48Z","receivedAt":"2026-08-23T17:19:23Z","isPatch":true,"body":"status and apply act on every out-of-place file at once. To reconcile one\ngroup at a time, a caller needs a way to name a subset.\n\nAdd --label <key[=value]>. A key=value selector matches a file whose\nrecorded labels include it; a bare key matches any value of that label. The\nselector is repeatable and the matches combine, so a file matching any\nselector is included. A selector can name any recorded label, not only\nthe ones [layout] places files by.\n\ngit organize apply --label component=<name> then reconciles one component\nat a time, which is how a large layout is carved in reviewable steps.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n Documentation/git-organize.adoc | 118 ++++++++++++++++----------\n builtin/organize.c              |  25 ++++--\n organize/organize.c             |  34 +++++++-\n organize/organize.h             |   7 +-\n t/t0096-organize.sh             | 143 ++++++++++++++++++++++++++++++++\n 5 files changed, 270 insertions(+), 57 deletions(-)\n\ndiff --git a/Documentation/git-organize.adoc b/Documentation/git-organize.adoc\nindex 37ada38234..aca8934b26 100644\n--- a/Documentation/git-organize.adoc\n+++ b/Documentation/git-organize.adoc\n@@ -9,8 +9,8 @@ git-organize - Reconcile a source tree against a declared layout\n SYNOPSIS\n --------\n [verse]\n-'git organize status' [--exit-code]\n-'git organize apply'\n+'git organize status' [--exit-code] [--label <key[=value]>...]\n+'git organize apply' [--label <key[=value]>...]\n 'git organize apply' --labels-only [--reseed]\n \n \n@@ -24,16 +24,18 @@ file belongs in.\n \n `.gitorganize` at the repository root has three sections. `[scope]` names\n the files in scope, one pathspec per line; with no `[scope]` section\n-nothing is in scope. `[layout]` is the project's placement map, authored by\n-hand: ordered `<label>:<value> = <directory>` rules (`.` is the repository\n-root). A file's labels are matched against the rules in order, and the first\n-rule it satisfies places it; a file matching no rule is the backlog.\n-`[labels]` holds the recorded labels, one line per\n-source in scope, `<path> <key>=<value> ...`, with every label the project\n-defines. A placed file is listed too, so its `[labels]` line records its\n-labels, independently of the directory name. Only a label named in a rule\n-places a file; a label named in no rule places nothing and is recorded for a\n-reader.\n+nothing is in scope. `[layout]` is the project's map of where each file\n+belongs, authored by hand: ordered `<label>:<value> = <directory>` rules\n+(`.` is the repository root). A file's labels are matched against the rules in\n+order, and the first rule it satisfies gives the file its directory; a file\n+matching no rule is the backlog.\n+`[labels]` holds the recorded labels: one line, `<path> <key>=<value>\n+...`, per recorded in-scope source, with every label the project\n+defines. apply repoints a moved file's line to its new path and keeps\n+it, so a placed file keeps its record. A file that already sits inside a\n+`[layout]` directory before it is recorded has no line; its location\n+alone places it. Only a label named in a rule places a file; a label\n+named in no rule places nothing and is recorded for a reader.\n \n The labeler and organizer live in config: `organize.labeler` and\n `organize.organizer`. A label is a key and value the labeler attaches to a\n@@ -60,7 +62,7 @@ own references. A project supplies those edits with an organizer, its\n `organize.organizer` command. apply hands the organizer its\n moves. The organizer returns a patch of the edits and, for any move it\n cannot complete, a reason to skip it. When the organizer edits a file as it\n-moves, git's rename detection matches it while its similarity stays above\n+moves, Git's rename detection matches it while its similarity stays above\n the rename threshold. apply applies the moves and the patch as one\n transaction. With no organizer configured, apply moves the files and makes\n no other edit.\n@@ -70,25 +72,28 @@ COMMANDS\n --------\n \n status::\n-\tReport the files whose placement value names a directory they are not\n+\tReport the files whose matching rule names a directory they are not\n \tin (the moves), the backlog (recorded files with no matching\n \trule), a file in scope that `[labels]` does not record, and a recorded\n \tpath that no longer exists. Runs no configured\n-\tcommand and changes nothing. With `--exit-code`, exit non-zero when a\n-\tfile is out of place, a file in scope is unrecorded, or a recorded path\n-\tis missing.\n+\tcommand and changes nothing. With `--label`, limit the moves to the\n+\tfiles a label selects (see OPTIONS); the backlog, unrecorded, and\n+\tmissing lists are always reported. With `--exit-code`, exit non-zero\n+\twhen a file is out of place, a file in scope is unrecorded, or a\n+\trecorded path is missing.\n \n apply::\n \tMove each out-of-place file into its directory as a content-identical\n \trename, apply the organizer's edits, repoint each carved file's\n-\t`[labels]` line to its new path, and stage the result. apply requires a\n-\tclean worktree, so the change can be discarded as a whole.\n+\t`[labels]` line to its new path, and stage the result. With `--label`,\n+\treconcile only the files a label selects. apply requires a clean\n+\tworktree, so the change can be discarded as a whole.\n +\n With `--labels-only`, apply instead records the `[labels]` line for every root\n file in scope and stages the file. A file already recorded keeps its line, so a\n-placement chosen by hand or in an earlier run stands; the labeler only seeds a\n+directory chosen by hand or in an earlier run stands; the labeler only seeds a\n file that has no line yet. With `--reseed`, re-derive every line from the\n-labeler, discarding the recorded placements. This is the only path that runs a\n+labeler, discarding the recorded lines. This is the only path that runs a\n labeler; `git organize apply` without `--labels-only` and `git organize status`\n never do.\n \n@@ -96,6 +101,14 @@ never do.\n OPTIONS\n -------\n \n+--label <key[=value]>::\n+\tLimit the moves that status reports and apply makes to the files a\n+\tlabel selects. A `<key>=<value>` selector matches a file whose\n+\trecorded labels include it; a bare `<key>` matches any value of that\n+\tlabel. A selector can name any recorded label, not only the ones\n+\t`[layout]` places files by. Repeatable; the selectors combine, so a\n+\tfile matching any of them is included.\n+\n --exit-code::\n \tExit non-zero from status when a file is out of place, a file in scope\n \tis unrecorded, or a recorded path is missing. A standing backlog alone\n@@ -107,9 +120,11 @@ OPTIONS\n \tline yet.\n \n --reseed::\n-\tWith apply `--labels-only`, re-derive every `[labels]` line from the\n-\tlabeler, discarding the recorded placements. Use it to re-apply the\n-\tlabeler after its map changes; without it a recorded line is kept.\n+\tWith apply `--labels-only`, discard the recorded lines and re-derive\n+\tthem from the labeler. A file already placed in a `[layout]`\n+\tdirectory keeps its line, because the labeler derives labels from the\n+\tsources at the root. Use it to re-apply the labeler after its map\n+\tchanges; without it a recorded line is kept.\n \n \n CONFIGURATION\n@@ -119,20 +134,23 @@ organize.labeler::\n \t--labels-only` runs it over the root files in scope. It writes one\n \trecord per file on its standard output: the path, a NUL, its\n \tspace-separated `key=value` labels, a NUL. A file in scope with no\n-\trecord is unrecorded, reported apart from the backlog. Use user or\n-\tsystem config for this setting; do\n-\tnot take it from a repository file.\n+\trecord is unrecorded, reported apart from the backlog. This command is\n+\thonored from config at any level, repo-local `.git/config` included, and\n+\tso requires the trust you give `core.hooksPath`.\n \n organize.organizer::\n \tThe command that returns move edits. apply runs it over the moves. It\n \treads the pending moves on its standard input and returns a patch and\n \tany skip reasons; see PROTOCOL. Optional. Without it, apply performs the\n-\tmoves and makes no other edit. Use user or system config for this\n-\tsetting; do not take it from a repository file.\n+\tmoves and makes no other edit. This command is honored from config at\n+\tany level, repo-local `.git/config` included, and so requires the trust\n+\tyou give `core.hooksPath`.\n \n The labeler and organizer are trusted, the way a clean or smudge filter or a\n-hook is trusted. Set them in user or system config, so a repository you clone\n-cannot supply its own.\n+hook is trusted. Both are honored from config at any level, repo-local\n+`.git/config` included. A repository you clone does not ship its `.git/config`,\n+so a clone cannot supply them by that route, but treat a command written into\n+`.git/config` with the same care you give `core.hooksPath`.\n \n \n FILES\n@@ -140,16 +158,17 @@ FILES\n `.gitorganize`::\n \tThe declaration, at the repository root, in three sections. `[scope]`\n \tnames the files in scope, one pathspec per line; with no `[scope]`\n-\tsection nothing is in scope. `[layout]` is the project's placement map:\n-\tordered `<label>:<value> = <directory>` rules (`.` is the root), where a\n-\tfile takes the directory of the first rule its labels satisfy, and a\n-\tfile matching no rule is the backlog. `[labels]` holds the recorded\n-\tlabels, one `<path> <key>=<value> ...` line per source in scope,\n-\tincluding placed files. The project writes `[scope]` and `[layout]`;\n-\t`git organize apply --labels-only` writes `[labels]`, and the move apply\n-\trepoints a carved file's line. A `#` line is a comment; git organize\n-\trewrites the file whole, keeping the hand-authored `[scope]` and\n-\t`[layout]` verbatim.\n+\tsection nothing is in scope. `[layout]` is the project's map of where\n+\teach file belongs: ordered `<label>:<value> = <directory>` rules (`.` is\n+\tthe root), where a file takes the directory of the first rule its labels\n+\tsatisfy, and a file matching no rule is the backlog. `[labels]` holds\n+\tthe recorded labels, one `<path> <key>=<value> ...` line per in-scope\n+\tsource that a rule, not its location, places; a file already inside a\n+\t`[layout]` directory is placed by its location and has no line. The\n+\tproject writes `[scope]` and `[layout]`; `git organize apply\n+\t--labels-only` writes `[labels]`, and the move apply repoints a carved\n+\tfile's line. A `#` line is a comment; git organize rewrites the file\n+\twhole, keeping the hand-authored `[scope]` and `[layout]` verbatim.\n \n \n PROTOCOL\n@@ -159,9 +178,20 @@ version line `git-organize 1 organize`, then a `move <src> <dst> <label>`\n line per pending move, with C-quoted paths. The organizer replies with the\n same version line. For each declined move, it writes `reject <src>\n <reason>`. It may then write `patch`, followed by a git patch that runs to\n-the end of its output. The patch may edit referring files and may rename a\n-moved file as it edits it, but it must not add, delete, or copy files, and\n-any rename must match a planned move.\n+the end of its output.\n+\n+Before it runs `git apply`, git organize checks each entry in the patch with\n+Git's own diff-header parser and refuses the patch if an entry adds, deletes,\n+or copies a file, changes a file's mode, or renames a file to anything but a\n+planned move. An in-place edit must repoint a move: it must leave the file\n+where it is and mention a directory the plan moves into. So the patch git\n+organize accepts is limited to edits of referring files and to renames that\n+match a planned move.\n+\n+The organizer is a trusted, config-defined command, honored the way a clean or\n+smudge filter is. These checks catch a well-meaning organizer's mistakes; they\n+do not sandbox a hostile one, and they do not certify that the whole patch is\n+sound.\n \n \n GIT\ndiff --git a/builtin/organize.c b/builtin/organize.c\nindex 35247c5aef..925ef17128 100644\n--- a/builtin/organize.c\n+++ b/builtin/organize.c\n@@ -6,27 +6,30 @@\n  * are not in yet (the moves), the backlog (files with no matching rule), and a\n  * declared path that no longer exists. apply moves the misplaced files and\n  * stages the result; apply --labels-only instead runs the labeler and records\n- * the labels.\n+ * the labels. --label <key[=value]> (repeatable) limits status and the move\n+ * apply to files carrying a matching label.\n  */\n #include \"builtin.h\"\n #include \"gettext.h\"\n #include \"organize/organize.h\"\n #include \"parse-options.h\"\n #include \"repository.h\"\n+#include \"strvec.h\"\n \n static const char *const organize_usage[] = {\n-\t\"git organize status [--exit-code]\",\n-\t\"git organize apply\",\n+\t\"git organize status [--exit-code] [--label <key[=value]>...]\",\n+\t\"git organize apply [--label <key[=value]>...]\",\n \t\"git organize apply --labels-only [--reseed]\",\n \tNULL\n };\n \n-static int organize_status(struct repository *repo, int exit_code)\n+static int organize_status(struct repository *repo,\n+\t\t\t   const struct strvec *selectors, int exit_code)\n {\n \tstruct organize_plan plan = ORGANIZE_PLAN_INIT;\n \tint to_move, backlog, unrecorded, orphans;\n \n-\torganize_plan_build(repo, &plan);\n+\torganize_plan_build(repo, selectors, &plan);\n \tto_move = (int)plan.moves_nr;\n \tbacklog = (int)plan.backlog.nr;\n \tunrecorded = (int)plan.unrecorded.nr;\n@@ -70,12 +73,12 @@ static int organize_status(struct repository *repo, int exit_code)\n \treturn exit_code && (to_move || unrecorded || orphans) ? 1 : 0;\n }\n \n-static int organize_apply(struct repository *repo)\n+static int organize_apply(struct repository *repo, const struct strvec *selectors)\n {\n \tstruct organize_plan plan = ORGANIZE_PLAN_INIT;\n \tint moved = 0, rejected = 0;\n \n-\torganize_plan_build(repo, &plan);\n+\torganize_plan_build(repo, selectors, &plan);\n \tif (!plan.moves_nr) {\n \t\tprintf(_(\"organize apply: nothing to do\\n\"));\n \t\torganize_plan_release(&plan);\n@@ -106,8 +109,11 @@ int cmd_organize(int argc,\n \t\t const char *prefix,\n \t\t struct repository *repo)\n {\n+\tstruct strvec selectors = STRVEC_INIT;\n \tint exit_code = 0, labels_only = 0, reseed = 0;\n \tstruct option options[] = {\n+\t\tOPT_STRVEC(0, \"label\", &selectors, N_(\"key[=value]\"),\n+\t\t\t   N_(\"limit to files carrying a matching label (repeatable)\")),\n \t\tOPT_BOOL(0, \"exit-code\", &exit_code,\n \t\t\t N_(\"exit non-zero from status when a file is out of place\")),\n \t\tOPT_BOOL(0, \"labels-only\", &labels_only,\n@@ -128,7 +134,7 @@ int cmd_organize(int argc,\n \tif (!strcmp(subcmd, \"status\")) {\n \t\tif (labels_only)\n \t\t\tdie(_(\"git organize: --labels-only is an apply option\"));\n-\t\tret = organize_status(repo, exit_code);\n+\t\tret = organize_status(repo, &selectors, exit_code);\n \t} else if (!strcmp(subcmd, \"apply\")) {\n \t\tif (labels_only) {\n \t\t\torganize_run_labeler(repo, reseed);\n@@ -136,11 +142,12 @@ int cmd_organize(int argc,\n \t\t\t\t \"staged; nothing is committed.\\n\"));\n \t\t\tret = 0;\n \t\t} else {\n-\t\t\tret = organize_apply(repo);\n+\t\t\tret = organize_apply(repo, &selectors);\n \t\t}\n \t} else {\n \t\tdie(_(\"git organize: unknown subcommand '%s'\"), subcmd);\n \t}\n \n+\tstrvec_clear(&selectors);\n \treturn ret;\n }\ndiff --git a/organize/organize.c b/organize/organize.c\nindex 8c623444c0..298557a3da 100644\n--- a/organize/organize.c\n+++ b/organize/organize.c\n@@ -29,6 +29,30 @@ static const char *organize_command(struct repository *repo, const char *key)\n \treturn cmd;\n }\n \n+/*\n+ * Whether a file's labels satisfy any --label selector. labels is the file's\n+ * space-separated \"key=value\" list. A \"key=value\" selector must equal a label\n+ * exactly; a bare \"key\" matches any value of that label.\n+ */\n+static int label_selected(const char *labels, struct string_list *selectors)\n+{\n+\tfor (size_t i = 0; i < selectors->nr; i++) {\n+\t\tconst char *selector = selectors->items[i].string;\n+\t\tsize_t sellen = strlen(selector);\n+\t\tint bare = !strchr(selector, '=');\n+\n+\t\tfor (const char *l = labels; *l; ) {\n+\t\t\tconst char *sp = strchrnul(l, ' ');\n+\n+\t\t\tif (!strncmp(l, selector, sellen) &&\n+\t\t\t    (bare ? l[sellen] == '=' : sp == l + sellen))\n+\t\t\t\treturn 1;\n+\t\t\tl = *sp ? sp + 1 : sp;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n /*\n  * The [layout] rule whose directory equals `path`'s directory, or NULL when\n  * `path` is a root file or its directory matches no rule. A file in a [layout]\n@@ -133,14 +157,19 @@ static void add_move(struct organize_plan *plan, const char *src,\n \tm->skip_reason = NULL;\n }\n \n-void organize_plan_build(struct repository *repo, struct organize_plan *plan)\n+void organize_plan_build(struct repository *repo, const struct strvec *selectors,\n+\t\t\t struct organize_plan *plan)\n {\n \tstruct organize_ctx ctx = ORGANIZE_CTX_INIT;\n+\tstruct string_list want = STRING_LIST_INIT_NODUP;\n \tstruct string_list seen = STRING_LIST_INIT_DUP;\n \tstruct strbuf value_buf = STRBUF_INIT;\n \n \torganize_ctx_load(repo, &ctx);\n \n+\tfor (size_t i = 0; i < selectors->nr; i++)\n+\t\tstring_list_append(&want, selectors->v[i]);\n+\n \t/*\n \t * Classify each recorded entry by the rule its labels match. A file\n \t * already in the rule's directory is in place. A file in another\n@@ -175,7 +204,7 @@ void organize_plan_build(struct repository *repo, struct organize_plan *plan)\n \n \t\tif (!strcmp(dst.buf, path))\n \t\t\tplan->in_place++;\t/* already in place */\n-\t\telse\n+\t\telse if (!want.nr || label_selected(labels, &want))\n \t\t\tadd_move(plan, path, strbuf_detach(&dst, NULL), rule->value);\n \t\tstrbuf_release(&dst);\n \t}\n@@ -207,6 +236,7 @@ void organize_plan_build(struct repository *repo, struct organize_plan *plan)\n \t\t\tstring_list_append(&plan->orphans, ctx.gitorg.records.items[i].string);\n \n \torganize_ctx_release(&ctx);\n+\tstring_list_clear(&want, 0);\n \tstring_list_clear(&seen, 0);\n \tstrbuf_release(&value_buf);\n }\ndiff --git a/organize/organize.h b/organize/organize.h\nindex 84e6558f8b..358298376c 100644\n--- a/organize/organize.h\n+++ b/organize/organize.h\n@@ -4,6 +4,7 @@\n #include \"string-list.h\"\n \n struct repository;\n+struct strvec;\n \n /*\n  * The git organize engine. A project declares where each file belongs, and\n@@ -74,9 +75,11 @@ struct organize_plan {\n  * rule names a directory it is not in as a move. Also record the backlog\n  * (recorded files that match no rule), the unrecorded files (in scope,\n  * no [labels] line), and the orphans (declared paths\n- * that no longer exist).\n+ * that no longer exist). selectors limit the moves to files carrying one of the\n+ * named labels; an empty strvec keeps them all.\n  */\n-void organize_plan_build(struct repository *repo, struct organize_plan *plan);\n+void organize_plan_build(struct repository *repo, const struct strvec *selectors,\n+\t\t\t struct organize_plan *plan);\n \n /*\n  * Perform the plan: consult the organizer when one is configured, then apply\ndiff --git a/t/t0096-organize.sh b/t/t0096-organize.sh\nindex d8de3c7e90..297e616021 100755\n--- a/t/t0096-organize.sh\n+++ b/t/t0096-organize.sh\n@@ -160,6 +160,56 @@ test_expect_success 'status --exit-code fails when a file is out of place' '\n \ttest_expect_code 1 git organize status --exit-code\n '\n \n+test_expect_success 'status --label filters by a recorded label' '\n+\tgit organize status --label component=odb >actual &&\n+\ttest_grep \"blob.c  *-> odb/blob.c\" actual &&\n+\ttest_grep ! refs.c actual &&\n+\t# a non-placement label selects too (role, not just the placing component)\n+\tgit organize status --label role=lib >bylib &&\n+\ttest_grep \"blob.c  *-> odb/blob.c\" bylib &&\n+\ttest_grep \"refs.c  *-> refs/refs.c\" bylib &&\n+\t# header.h (role=public, in place) is not over-included by the filter\n+\ttest_grep ! \"header.h\" bylib &&\n+\t# a bare key matches any value of that label\n+\tgit organize status --label component >bykey &&\n+\ttest_grep \"blob.c  *-> odb/blob.c\" bykey &&\n+\ttest_grep \"refs.c  *-> refs/refs.c\" bykey\n+'\n+\n+test_expect_success 'apply --label moves only the selected files' '\n+\tgit init bylabel &&\n+\t(\n+\t\tcd bylabel &&\n+\t\techo blob >blob.c &&\n+\t\techo refs >refs.c &&\n+\t\techo header >header.h &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\tconfigure_organize ./labeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\t# reconcile only the odb component; refs.c must stay put\n+\t\tgit organize apply --label component=odb &&\n+\t\tgit diff --cached -M --name-status >staged &&\n+\t\ttest_grep \"^R100.*blob.c.*odb/blob.c\" staged &&\n+\t\ttest_path_is_file odb/blob.c &&\n+\t\ttest_path_is_missing blob.c &&\n+\t\t# refs.c is not selected: still at the root, absent from the staged set\n+\t\ttest_path_is_file refs.c &&\n+\t\ttest_path_is_missing refs/refs.c &&\n+\t\ttest_grep ! \"refs.c\" staged &&\n+\t\t# [labels] repointed for odb only; the refs.c line is unchanged\n+\t\ttest_grep \"^odb/blob.c component=odb\" .gitorganize &&\n+\t\ttest_grep \"^refs.c component=refs\" .gitorganize &&\n+\t\t# refs.c is still reported as a pending move\n+\t\tgit organize status >after &&\n+\t\ttest_grep \"refs.c  *-> refs/refs.c\" after\n+\t)\n+'\n+\n test_expect_success 'apply moves files as content-identical renames and repoints [labels]' '\n \tgit organize apply &&\n \tgit diff --cached -M --name-status >actual &&\n@@ -588,6 +638,99 @@ test_expect_success 'the recorded labels carry arbitrary key=value pairs' '\n \t)\n '\n \n+test_expect_success FUNNYNAMES 'apply moves a source whose name needs C-quoting' '\n+\tgit init quoted &&\n+\t(\n+\t\tcd quoted &&\n+\t\t# a double-quote in the name forces the diff header to C-quote it\n+\t\tname=\"a\\\"b.c\" &&\n+\t\techo blob >\"$name\" &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\t# a labeler for the single quoted source; the NUL-separated\n+\t\t# record carries the quote literally\n+\t\twrite_script quotedlabeler <<-\\EOF &&\n+\t\tprintf \"a\\\"b.c\\0component=odb role=lib\\0\"\n+\t\tEOF\n+\t\tconfigure_organize ./quotedlabeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\t# the rename header C-quotes the path; the move still applies\n+\t\tgit organize apply &&\n+\t\ttest_path_is_file \"odb/$name\" &&\n+\t\ttest_path_is_missing \"$name\" &&\n+\t\tgit diff --cached --name-only >staged &&\n+\t\ttest_grep \"odb/a\" staged\n+\t)\n+'\n+\n+test_expect_success 'apply rejects a malformed reject line' '\n+\tgit init badreject &&\n+\t(\n+\t\tcd badreject &&\n+\t\techo blob >blob.c &&\n+\t\techo refs >refs.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\twrite_labeler &&\n+\t\t# the reject path is quoted but unterminated on its line, so\n+\t\t# unquoting scans past the newline into the next line\n+\t\twrite_script rejector <<-\\EOF &&\n+\t\tcat >/dev/null\n+\t\tprintf \"git-organize 1 organize\\n\"\n+\t\tprintf \"reject \\\"a\\nb.c\\\" reason\\n\"\n+\t\tEOF\n+\t\tconfigure_organize ./labeler ./rejector &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\tgit organize apply --labels-only &&\n+\t\tgit commit -m labels &&\n+\t\ttest_must_fail git organize apply 2>err &&\n+\t\ttest_grep \"malformed reject line\" err\n+\t)\n+'\n+\n+test_expect_success 'apply --labels-only rejects a duplicate labeler record' '\n+\tgit init duprec &&\n+\t(\n+\t\tcd duprec &&\n+\t\techo blob >blob.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\t# the labeler emits the same scoped path twice\n+\t\twrite_script duprelabeler <<-\\EOF &&\n+\t\tprintf \"blob.c\\0component=odb role=lib\\0\"\n+\t\tprintf \"blob.c\\0component=refs role=lib\\0\"\n+\t\tEOF\n+\t\tconfigure_organize ./duprelabeler &&\n+\t\tgit add .gitorganize &&\n+\t\tgit commit -m declare &&\n+\t\ttest_must_fail git organize apply --labels-only 2>err &&\n+\t\ttest_grep \"duplicate labeler record\" err\n+\t)\n+'\n+\n+test_expect_success 'status rejects trailing junk after a quoted path' '\n+\tgit init trailing &&\n+\t(\n+\t\tcd trailing &&\n+\t\techo a >a.c &&\n+\t\tgit add . &&\n+\t\tgit commit -m init &&\n+\t\t# a quoted [labels] path with junk right after the close quote\n+\t\tcat >.gitorganize <<-\\EOF &&\n+\t\t[layout]\n+\t\tcomponent:odb = odb\n+\t\t[labels]\n+\t\t\"a.c\"junk component=odb\n+\t\tEOF\n+\t\ttest_must_fail git organize status 2>err &&\n+\t\ttest_grep \"trailing text after path\" err\n+\t)\n+'\n+\n test_expect_success 'a subcommand rejects extra operands' '\n \ttest_must_fail git -C bad organize status junk 2>err &&\n \ttest_grep \"too many arguments\" err\n-- \n2.54.0\n\n"},{"id":"551086","messageId":"20260823171915.2662373-6-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 05/14] organize: declare Git's scope and layout","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:49Z","receivedAt":"2026-08-23T17:19:25Z","isPatch":true,"body":"Author .gitorganize for Git's own tree. [scope] puts the root *.c and *.h\nsources in scope. [layout] keeps a public interface (role:public) and a\nstandalone program (role:program) at the root, and routes each component's\nsources to a directory of the same name: transport sources to transport/,\ndiff sources to diff/, and so on for the thirteen components.\n\nThis is the map alone. The next step records a label per source; the carves\nthat follow move each component into place.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize | 19 +++++++++++++++++++\n 1 file changed, 19 insertions(+)\n create mode 100644 .gitorganize\n\ndiff --git a/.gitorganize b/.gitorganize\nnew file mode 100644\nindex 0000000000..18cf3228a8\n--- /dev/null\n+++ b/.gitorganize\n@@ -0,0 +1,19 @@\n+[scope]\n+:(glob)*.c\n+:(glob)*.h\n+[layout]\n+role:public = .\n+role:program = .\n+component:odb = odb\n+component:refs = refs\n+component:pack = pack\n+component:diff = diff\n+component:merge = merge\n+component:revision = revision\n+component:index = index\n+component:setup = setup\n+component:convert = convert\n+component:transport = transport\n+component:notes = notes\n+component:submodule = submodule\n+component:archive = archive\n-- \n2.54.0\n\n"},{"id":"551088","messageId":"20260823171915.2662373-7-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 06/14] organize: record a label for every source in scope","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:50Z","receivedAt":"2026-08-23T17:19:28Z","isPatch":true,"body":"Run the reference labeler over Git's tree and record its labels in\n.gitorganize. Each source's component comes from the \"area:\" prefix its\ncommits carry most often, consolidated by git-layout.map; a source the\nprefix cannot place falls back to its filename, and one that neither places\nbut changes chiefly alongside a component is promoted there. Standalone\nprograms stay at the root, and a source that stays diffuse is component=?.\nEach line also carries the prefix, the #include coupling, and the co-change\nprofile as advisory signals.\n\nstatus now reports the whole to-move set across thirteen components:\n\n  495 in scope (113 in place, 303 to move, 79 backlog)\n\nThe 79 backlog sources, recorded component=? with role=lib, are left at\nthe root as the frontier. A public header or program also records\ncomponent=? but is kept at the root by its role.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize | 475 +++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 475 insertions(+)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex 18cf3228a8..522821522e 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -17,3 +17,478 @@ component:transport = transport\n component:notes = notes\n component:submodule = submodule\n component:archive = archive\n+[labels]\n+# The recorded placement of each source; edit a line to change it.\n+# apply --labels-only fills in unrecorded sources; --reseed re-derives all.\n+abspath.c component=? role=lib prefix=abspath cochange=setup:12,diff:6,refs:5,index:3,submodule:3\n+abspath.h component=? role=public prefix=abspath cochange=setup:1\n+add-interactive.c component=? role=lib prefix=add-interactive includes=index:3,odb:2,diff:1,refs:1,revision:1 cochange=diff:19,index:16,revision:16,odb:7,refs:6\n+add-interactive.h component=? role=public prefix=add-patch cochange=odb:2\n+add-patch.c component=? role=lib prefix=add-patch includes=setup:3,index:2,odb:2,diff:1 cochange=index:10,transport:8,odb:6,merge:4,refs:4\n+add-patch.h component=? role=public prefix=add-patch cochange=odb:1\n+advice.c component=? role=lib prefix=advice includes=setup:2 cochange=transport:18,index:12,odb:9,diff:8,revision:8\n+advice.h component=? role=public prefix=advice cochange=transport:14,index:9,odb:6,submodule:4,pack:3\n+alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2\n+alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1\n+alloc.c component=odb role=lib prefix=alloc includes=odb:6,setup:1 cochange=odb:54,revision:8,diff:6,pack:6,index:3\n+alloc.h component=odb role=header prefix=alloc cochange=odb:16,refs:1,revision:1\n+apply.c component=? role=lib prefix=apply includes=index:5,setup:4,odb:3,diff:2,merge:2 cochange=index:93,setup:43,diff:41,odb:26,merge:24\n+apply.h component=? role=public prefix=apply includes=odb:1 cochange=diff:2\n+archive-tar.c component=archive role=lib prefix=archive-tar includes=archive:1,odb:1,setup:1 cochange=archive:59,index:12,diff:9,odb:9,transport:8\n+archive-zip.c component=archive role=lib prefix=archive-zip includes=diff:2,archive:1,odb:1,setup:1 cochange=archive:57,diff:12,odb:8,index:7,transport:6\n+archive.c component=archive role=lib prefix=archive includes=odb:5,setup:3,convert:2,archive:1,index:1 cochange=archive:54,convert:42,odb:39,index:36,revision:31\n+archive.h component=archive role=header prefix=archive includes=index:1 cochange=archive:58,index:3,revision:3,convert:2,diff:1\n+attr.c component=convert role=lib prefix=attr includes=odb:3,setup:3,index:2,convert:1,refs:1 cochange=index:55,convert:54,diff:41,setup:26,revision:22\n+attr.h component=convert role=header prefix=attr cochange=convert:50,index:13,diff:9,archive:8,setup:3\n+banned.h component=? role=public prefix=banned\n+base85.c component=? role=lib prefix=base85 cochange=diff:4,pack:2,convert:1,transport:1\n+base85.h component=? role=public prefix=base85 cochange=diff:1\n+bisect.c component=revision role=lib prefix=bisect includes=odb:5,revision:5,setup:2,diff:1,index:1 cochange=revision:61,odb:32,transport:31,refs:13,diff:9\n+bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2\n+blame.c component=revision role=lib prefix=blame includes=odb:5,diff:2,index:2,pack:2,revision:2 cochange=diff:68,revision:66,odb:56,index:29,pack:22\n+blame.h component=revision role=header prefix=blame includes=diff:1,odb:1 cochange=revision:19,odb:7,diff:4,archive:1,index:1\n+blob.c component=odb role=lib prefix=object includes=odb:2 cochange=odb:131,transport:12,pack:11,revision:10,refs:5\n+blob.h component=odb role=header prefix=blob includes=odb:1 cochange=odb:33,revision:4,pack:3,transport:2\n+bloom.c component=pack role=lib prefix=bloom includes=odb:4,diff:2,pack:2,setup:2 cochange=pack:38,revision:25,diff:15,odb:6,index:2\n+bloom.h component=pack role=header prefix=bloom cochange=pack:28,revision:12,odb:1\n+branch.c component=? role=lib prefix=branch includes=refs:3,setup:3,odb:2,submodule:1,transport:1 cochange=refs:62,transport:41,setup:28,index:19,revision:12\n+branch.h component=? role=public prefix=branch cochange=setup:8,refs:4,submodule:4\n+builtin.h component=? role=public prefix=builtin includes=setup:1 cochange=diff:15,index:15,transport:12,odb:6,notes:5\n+bundle-uri.c component=transport role=lib prefix=bundle-uri includes=transport:5,odb:1,refs:1,setup:1 cochange=transport:28,setup:7,odb:4,merge:2,pack:2\n+bundle-uri.h component=transport role=header prefix=bundle-uri cochange=transport:14\n+bundle.c component=transport role=lib prefix=bundle includes=odb:3,revision:3,setup:2,transport:2,diff:1 cochange=transport:63,odb:24,revision:21,refs:17,pack:10\n+bundle.h component=transport role=header prefix=bundle includes=revision:1 cochange=transport:37,revision:5\n+cache-tree.c component=index role=lib prefix=cache-tree includes=odb:5,index:2,setup:1,transport:1 cochange=index:94,odb:69,revision:27,transport:21,diff:20\n+cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1\n+cbtree.c component=odb role=lib prefix=cbtree includes=odb:1 cochange=odb:9,diff:1,merge:1,pack:1\n+cbtree.h component=odb role=header prefix=cbtree cochange=odb:12,pack:3,setup:1,transport:1\n+chdir-notify.c component=? role=lib prefix=chdir-notify includes=revision:1 cochange=index:2,archive:1,merge:1,revision:1\n+chdir-notify.h component=? role=public prefix=chdir-notify\n+checkout.c component=index role=lib prefix=checkout includes=setup:2,index:1,odb:1,refs:1,transport:1 cochange=transport:16,refs:6,setup:5,index:3,odb:2\n+checkout.h component=index role=header prefix=checkout includes=odb:1 cochange=index:4,diff:1,odb:1,refs:1,revision:1\n+chunk-format.c component=pack role=lib prefix=chunk-format includes=odb:1,pack:1 cochange=pack:20,odb:1,transport:1\n+chunk-format.h component=pack role=header prefix=chunk-format includes=odb:1 cochange=pack:15,odb:2,setup:1,transport:1\n+color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,index:14,revision:13,setup:7,transport:7\n+color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1\n+column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2\n+column.h component=? role=public prefix=column\n+combine-diff.c component=diff role=lib prefix=combine-diff includes=odb:5,diff:4,revision:2,convert:1,refs:1 cochange=diff:198,revision:67,index:35,odb:16,transport:16\n+commit-graph.c component=pack role=lib prefix=commit-graph includes=odb:9,pack:4,setup:2,refs:1,revision:1 cochange=pack:206,odb:125,revision:47,transport:34,setup:22\n+commit-graph.h component=pack role=header prefix=commit-graph includes=odb:2 cochange=pack:92,odb:14,setup:9,revision:8,transport:5\n+commit-reach.c component=revision role=lib prefix=commit-reach includes=revision:3,odb:2,pack:1,refs:1 cochange=revision:38,odb:17,pack:15,transport:9,index:5\n+commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3\n+commit-slab-decl.h component=odb role=header prefix=commit-slab cochange=odb:6,revision:1\n+commit-slab-impl.h component=odb role=header prefix=commit-slab cochange=odb:7,pack:3,revision:1,setup:1,transport:1\n+commit-slab.h component=odb role=header prefix=commit-slab includes=odb:2 cochange=odb:8,revision:2,transport:2,index:1,merge:1\n+commit.c component=odb role=lib prefix=commit includes=odb:10,setup:4,revision:3,diff:1,index:1 cochange=odb:403,revision:147,transport:87,pack:57,setup:45\n+commit.h component=odb role=header prefix=commit includes=odb:1 cochange=odb:237,revision:205,transport:49,pack:25,notes:22\n+common-exit.c component=? role=lib prefix=common-main\n+common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1\n+common-init.h component=? role=public prefix=common-main\n+common-main.c component=? role=lib prefix=common-main cochange=setup:5,transport:4,convert:3,index:1\n+config.c component=setup role=lib prefix=config includes=setup:4,odb:2,convert:1,index:1,refs:1 cochange=setup:274,index:93,diff:75,refs:48,revision:46\n+config.h component=setup role=header prefix=config includes=setup:1 cochange=setup:100,index:30,transport:23,submodule:21,merge:6\n+connect.c component=transport role=lib prefix=connect includes=transport:7,setup:4,odb:1,refs:1 cochange=transport:238,setup:19,diff:13,index:10,refs:10\n+connect.h component=transport role=header prefix=connect includes=transport:1 cochange=transport:58,refs:1\n+connected.c component=transport role=lib prefix=connected includes=transport:3,odb:1,pack:1 cochange=transport:39,pack:31,odb:7,diff:6,index:5\n+connected.h component=transport role=header prefix=connected cochange=transport:23\n+convert.c component=convert role=lib prefix=convert includes=convert:2,index:1,merge:1,odb:1,setup:1 cochange=convert:59,diff:43,index:41,setup:30,transport:30\n+convert.h component=convert role=header prefix=convert includes=odb:1 cochange=convert:29,index:18,diff:8,setup:8,archive:4\n+copy.c component=? role=lib prefix=copy cochange=pack:6,transport:5,diff:3,odb:3,merge:2\n+copy.h component=? role=public prefix=copy cochange=transport:3,merge:2,convert:1,setup:1\n+credential.c component=? role=lib prefix=credential includes=setup:3 cochange=transport:13,index:4,odb:4,convert:2,merge:2\n+credential.h component=? role=public prefix=credential cochange=transport:6\n+csum-file.c component=? role=lib prefix=csum-file includes=odb:1 cochange=pack:49,odb:13,index:10,transport:10,diff:8\n+csum-file.h component=? role=public prefix=csum-file includes=odb:1 cochange=pack:44,odb:8,diff:5,index:5,transport:5\n+ctype.c component=? role=lib prefix=ctype cochange=setup:3,index:2,odb:1,pack:1,refs:1\n+daemon.c component=? role=program prefix=daemon includes=setup:3,transport:2 cochange=transport:77,index:14,setup:13,diff:7,refs:5\n+date.c component=? role=lib prefix=date cochange=revision:17,odb:16,refs:14,setup:9,diff:7\n+date.h component=? role=public prefix=date cochange=refs:7,revision:4,setup:2,archive:1,odb:1\n+decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1 cochange=diff:6,odb:5,revision:5,pack:2,transport:2\n+decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1\n+delta-islands.c component=pack role=lib prefix=delta-islands includes=odb:6,pack:4,diff:1,refs:1,setup:1 cochange=pack:20,odb:17,revision:7,transport:7,diff:5\n+delta-islands.h component=pack role=header prefix=delta-islands cochange=pack:6\n+delta.h component=pack role=header prefix=diff-delta cochange=pack:27,odb:19,diff:5,transport:3,convert:1\n+diagnose.c component=? role=lib prefix=diagnose includes=archive:1,index:1,odb:1,pack:1,setup:1 cochange=index:4,revision:4,odb:3,pack:3,transport:3\n+diagnose.h component=? role=public prefix=diagnose cochange=revision:2,refs:1,transport:1\n+diff-delta.c component=pack role=lib prefix=diff-delta includes=pack:1 cochange=pack:24,diff:7,index:2,odb:2,transport:2\n+diff-lib.c component=diff role=lib prefix=diff includes=index:6,odb:3,diff:2,revision:2,refs:1 cochange=diff:150,index:124,revision:47,submodule:18,odb:8\n+diff-merges.c component=diff role=lib prefix=diff-merges includes=diff:1,revision:1 cochange=revision:18,diff:17,odb:4,refs:3,index:2\n+diff-merges.h component=diff role=header prefix=diff-merges cochange=diff:11,revision:4,merge:1\n+diff-no-index.c component=diff role=lib prefix=diff includes=diff:2,index:2,odb:1,revision:1 cochange=diff:76,revision:21,index:19,refs:8,notes:7\n+diff.c component=diff role=lib prefix=diff includes=odb:5,diff:4,setup:3,convert:2,index:2 cochange=diff:610,revision:121,index:100,transport:71,setup:69\n+diff.h component=diff role=header prefix=diff includes=index:1,odb:1 cochange=diff:471,revision:83,index:29,submodule:18,odb:14\n+diffcore-break.c component=diff role=lib prefix=diffcore-break includes=odb:2,diff:1,transport:1 cochange=diff:71,pack:8,revision:7,index:5,merge:3\n+diffcore-delta.c component=diff role=lib prefix=diffcore-delta includes=diff:1 cochange=diff:26,revision:7,odb:4,index:2,refs:2\n+diffcore-order.c component=diff role=lib prefix=diffcore-order includes=diff:2 cochange=diff:19,index:8,refs:7,revision:7,pack:5\n+diffcore-pickaxe.c component=diff role=lib prefix=pickaxe includes=diff:3,odb:1,revision:1 cochange=diff:97,revision:15,notes:3,odb:3,merge:2\n+diffcore-rename.c component=diff role=lib prefix=diffcore-rename includes=diff:2,odb:2,transport:1 cochange=diff:188,index:38,revision:37,odb:21,pack:17\n+diffcore-rotate.c component=diff role=lib prefix=diff includes=diff:2 cochange=diff:14,revision:5,pack:2,merge:1,refs:1\n+diffcore.h component=diff role=header prefix=diff includes=odb:1 cochange=diff:175,revision:11,merge:10,submodule:4,odb:2\n+dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1\n+dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1\n+dir.c component=index role=lib prefix=dir includes=index:7,setup:4,odb:2,convert:1,refs:1 cochange=index:343,diff:61,setup:49,odb:37,convert:29\n+dir.h component=index role=header prefix=dir includes=index:2,odb:1 cochange=index:236,odb:13,setup:12,submodule:11,convert:10\n+editor.c component=? role=lib prefix=editor includes=setup:2 cochange=transport:20,setup:12,index:8,odb:4,submodule:4\n+editor.h component=? role=public prefix=editor cochange=transport:1\n+entry.c component=index role=lib prefix=entry includes=index:7,odb:1,setup:1,submodule:1 cochange=index:96,diff:28,convert:20,setup:17,odb:10\n+entry.h component=index role=header prefix=entry includes=convert:1 cochange=index:18,submodule:4,revision:3,transport:2,convert:1\n+environment.c component=setup role=lib prefix=environment includes=setup:5,convert:3,odb:2,merge:1,refs:1 cochange=setup:281,index:77,odb:48,refs:36,transport:28\n+environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9\n+exec-cmd.c component=? role=lib prefix=strvec includes=setup:1\n+exec-cmd.h component=? role=public prefix=argv-array cochange=refs:4,transport:4,odb:1,setup:1,submodule:1\n+fetch-negotiator.c component=transport role=lib prefix=repo-settings includes=setup:1,transport:1 cochange=setup:8,transport:7,index:2,odb:1\n+fetch-negotiator.h component=transport role=header prefix=fetch-negotiator cochange=transport:7,setup:3,odb:1,pack:1,revision:1\n+fetch-object-info.c component=transport role=lib prefix=cat-file includes=transport:3,odb:2 cochange=transport:7,odb:1\n+fetch-object-info.h component=transport role=header prefix=cat-file includes=transport:2 cochange=transport:7,odb:1\n+fetch-pack.c component=transport role=lib prefix=fetch-pack includes=transport:8,odb:7,setup:4,pack:3,revision:2 cochange=transport:303,odb:96,revision:46,pack:40,setup:25\n+fetch-pack.h component=transport role=header prefix=fetch-pack includes=odb:1,revision:1,transport:1 cochange=transport:108,odb:2,pack:2,refs:2,diff:1\n+fmt-merge-msg.c component=merge role=lib prefix=fmt-merge-msg includes=odb:3,diff:2,revision:2,setup:2,merge:1 cochange=revision:10,odb:7,index:6,diff:4,setup:4\n+fmt-merge-msg.h component=merge role=header prefix=fmt-merge-msg cochange=merge:3,setup:2\n+for-each-ref.h component=? role=public prefix=?\n+fsck.c component=odb role=lib prefix=fsck includes=odb:9,setup:3,convert:1,index:1,pack:1 cochange=odb:113,revision:46,transport:43,pack:20,setup:15\n+fsck.h component=odb role=header prefix=fsck includes=odb:2 cochange=odb:50,diff:5,revision:5,transport:5,refs:4\n+fsmonitor--daemon.h component=index role=header prefix=fsmonitor--daemon includes=index:1 cochange=index:1\n+fsmonitor-ipc.c component=index role=lib prefix=fsmonitor includes=index:1,setup:1 cochange=index:6,transport:2,merge:1,notes:1,pack:1\n+fsmonitor-ipc.h component=index role=header prefix=fsmonitor cochange=index:2\n+fsmonitor-ll.h component=index role=header prefix=fsmonitor-ll cochange=index:4\n+fsmonitor-path-utils.h component=index role=header prefix=fsmonitor cochange=index:2\n+fsmonitor-settings.c component=index role=lib prefix=fsmonitor includes=index:3,setup:2 cochange=index:17,setup:10,transport:2,diff:1,odb:1\n+fsmonitor-settings.h component=index role=header prefix=fsmonitor-settings cochange=index:11,setup:4\n+fsmonitor.c component=index role=lib prefix=fsmonitor includes=index:4,setup:3 cochange=index:37,setup:16,transport:4,merge:2,refs:2\n+fsmonitor.h component=index role=header prefix=fsmonitor includes=index:4,odb:1 cochange=index:24,setup:7,diff:3,submodule:1\n+gettext.c component=? role=lib prefix=gettext includes=setup:1 cochange=pack:5,refs:3,setup:2,transport:2,merge:1\n+gettext.h component=? role=public prefix=i18n cochange=transport:2,setup:1\n+git-compat-util.h component=? role=public prefix=git-compat-util cochange=setup:48,index:35,odb:22,pack:21,diff:17\n+git-curl-compat.h component=transport role=header prefix=git-curl-compat cochange=transport:22\n+git-zlib.c component=? role=lib prefix=git-zlib cochange=archive:2,odb:1,transport:1\n+git-zlib.h component=? role=public prefix=git-zlib cochange=archive:3,setup:2,odb:1,transport:1\n+git.c component=? role=lib prefix=git includes=setup:4,odb:2,convert:1,index:1,revision:1 cochange=setup:70,revision:54,transport:47,index:28,diff:25\n+gpg-interface.c component=? role=lib prefix=gpg-interface includes=setup:3,index:1,odb:1 cochange=revision:25,odb:22,setup:13,transport:11,diff:8\n+gpg-interface.h component=? role=public prefix=gpg-interface cochange=odb:22,revision:15,merge:4,transport:3,refs:1\n+graph.c component=revision role=lib prefix=graph includes=revision:2,odb:1,setup:1 cochange=revision:38,diff:23,index:4,odb:3,transport:3\n+graph.h component=revision role=header prefix=graph includes=diff:1 cochange=revision:19,diff:2,odb:1\n+grep.c component=? role=lib prefix=grep includes=diff:4,odb:1,revision:1,setup:1 cochange=diff:40,revision:28,transport:10,index:7,refs:7\n+grep.h component=? role=public prefix=grep includes=diff:1 cochange=revision:23,diff:10,transport:4,index:2,refs:2\n+hash-lookup.c component=odb role=lib prefix=hash includes=odb:2,index:1 cochange=pack:14,odb:12,diff:1,index:1,merge:1\n+hash-lookup.h component=odb role=header prefix=hash-lookup cochange=odb:10,pack:8,diff:1,merge:1,revision:1\n+hash.c component=odb role=lib prefix=hash includes=odb:1 cochange=odb:15,diff:2,setup:2,index:1,transport:1\n+hash.h component=odb role=header prefix=hash includes=setup:1 cochange=odb:32,pack:11,index:9,diff:7,transport:4\n+hashmap.c component=? role=lib prefix=hashmap cochange=diff:33,revision:19,index:17,refs:13,submodule:13\n+hashmap.h component=? role=public prefix=hashmap cochange=diff:39,revision:23,index:18,submodule:14,refs:13\n+help.c component=? role=lib prefix=help includes=setup:4,index:1,odb:1,refs:1,transport:1 cochange=setup:19,transport:19,diff:9,index:8,odb:7\n+help.h component=? role=public prefix=help cochange=diff:1,odb:1,revision:1,transport:1\n+hex-ll.c component=? role=lib prefix=hex-ll\n+hex-ll.h component=? role=public prefix=hex-ll\n+hex.c component=? role=lib prefix=hex includes=odb:1 cochange=odb:7,revision:5,notes:3,transport:3,refs:2\n+hex.h component=? role=public prefix=hex includes=odb:1 cochange=revision:3,odb:2,convert:1,merge:1,pack:1\n+hook.c component=setup role=lib prefix=hook includes=setup:4 cochange=setup:37,transport:10,odb:8,refs:5,diff:3\n+hook.h component=setup role=header prefix=hook includes=setup:1 cochange=setup:34,transport:6,odb:5,refs:5,pack:3\n+http-backend.c component=? role=program prefix=http-backend includes=setup:4,odb:3,transport:2,pack:1,refs:1 cochange=transport:57,pack:41,setup:19,refs:14,revision:13\n+http-fetch.c component=? role=program prefix=http-fetch includes=setup:3,transport:2 cochange=transport:46,setup:10,pack:9,index:7,refs:7\n+http-push.c component=? role=program prefix=http-push includes=odb:7,revision:3,setup:3,transport:2,diff:1 cochange=transport:272,odb:134,revision:82,pack:60,diff:34\n+http-walker.c component=transport role=lib prefix=http includes=transport:3,odb:2,pack:1,revision:1,setup:1 cochange=transport:73,pack:40,odb:17,index:11,refs:7\n+http.c component=transport role=lib prefix=http includes=transport:4,setup:3,odb:2,pack:2 cochange=transport:195,pack:71,odb:27,diff:8,setup:8\n+http.h component=transport role=header prefix=http includes=transport:1 cochange=transport:149,pack:15,diff:6,odb:4,archive:3\n+ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4\n+ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1\n+imap-send.c component=? role=program prefix=imap-send includes=setup:3,transport:1 cochange=transport:47,diff:16,index:16,refs:9,odb:8\n+iterator.h component=? role=public prefix=refs cochange=index:2,refs:2\n+json-writer.c component=? role=lib prefix=json-writer\n+json-writer.h component=? role=public prefix=json-writer cochange=transport:1\n+khash.h component=? role=public prefix=khash includes=odb:1 cochange=odb:7,pack:5,diff:4,revision:4,index:3\n+kwset.c component=? role=lib prefix=kwset cochange=convert:2,diff:1,pack:1,revision:1\n+kwset.h component=? role=public prefix=kwset\n+levenshtein.c component=? role=lib prefix=? cochange=diff:2,revision:2,odb:1\n+levenshtein.h component=? role=public prefix=? cochange=transport:2,diff:1,refs:1,setup:1\n+line-log.c component=revision role=lib prefix=line-log includes=odb:4,revision:4,diff:3,setup:2,pack:1 cochange=revision:52,diff:48,odb:23,pack:15,notes:8\n+line-log.h component=revision role=header prefix=line-log includes=diff:1 cochange=revision:20,odb:3,diff:2,setup:1,submodule:1\n+line-range.c component=revision role=lib prefix=line-range includes=diff:2,revision:1 cochange=revision:14,diff:8,archive:1,odb:1,pack:1\n+line-range.h component=revision role=header prefix=line-range cochange=revision:13\n+linear-assignment.c component=? role=lib prefix=linear-assignment cochange=diff:1,revision:1\n+linear-assignment.h component=? role=public prefix=linear-assignment\n+list-objects-filter-options.c component=revision role=lib prefix=list-objects-filter-options includes=revision:1,setup:1,transport:1 cochange=revision:39,transport:21,setup:9,diff:6,index:4\n+list-objects-filter-options.h component=revision role=header prefix=list-objects-filter includes=odb:1 cochange=revision:40,transport:17,odb:4,diff:3,refs:2\n+list-objects-filter.c component=revision role=lib prefix=list-objects-filter includes=odb:5,revision:3,diff:1,index:1 cochange=revision:32,odb:13,index:10,diff:6,pack:3\n+list-objects-filter.h component=revision role=header prefix=list-objects cochange=revision:16,odb:1\n+list-objects.c component=revision role=lib prefix=list-objects includes=odb:6,revision:4,diff:1,pack:1,setup:1 cochange=revision:91,odb:68,pack:40,transport:28,index:15\n+list-objects.h component=revision role=header prefix=list-objects cochange=revision:32,pack:13,transport:4,odb:1\n+list.h component=revision role=header prefix=list cochange=submodule:2,transport:2,index:1,revision:1\n+lockfile.c component=? role=lib prefix=lockfile includes=setup:1 cochange=refs:18,index:13,setup:9,diff:8,merge:3\n+lockfile.h component=? role=public prefix=lockfile cochange=index:5,revision:4,diff:3,refs:3,odb:2\n+log-tree.c component=revision role=lib prefix=format-patch includes=odb:8,revision:5,diff:3,setup:3,refs:2 cochange=revision:222,diff:112,odb:112,refs:31,transport:16\n+log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2\n+loose.c component=odb role=lib prefix=loose includes=odb:5,setup:1 cochange=odb:31,pack:18,setup:7,transport:6,refs:2\n+loose.h component=odb role=header prefix=loose cochange=odb:8,setup:3\n+ls-refs.c component=refs role=lib prefix=ls-refs includes=setup:3,refs:2,odb:1,transport:1 cochange=refs:26,transport:17,pack:10,revision:5,odb:4\n+ls-refs.h component=refs role=header prefix=ls-refs cochange=transport:11,refs:5,submodule:1\n+mailinfo.c component=? role=lib prefix=mailinfo includes=setup:2 cochange=transport:5,index:3,notes:3,odb:3,revision:3\n+mailinfo.h component=? role=public prefix=mailinfo\n+mailmap.c component=? role=lib prefix=mailmap includes=setup:3,odb:2 cochange=setup:13,transport:11,refs:10,index:8,revision:5\n+mailmap.h component=? role=public prefix=mailmap cochange=setup:8,revision:4,transport:2,diff:1,index:1\n+match-trees.c component=odb role=lib prefix=match-trees includes=odb:5,setup:1 cochange=odb:33,index:15,notes:15,revision:12,pack:10\n+match-trees.h component=odb role=header prefix=match-trees cochange=merge:1,odb:1\n+mem-pool.c component=? role=lib prefix=mem-pool cochange=index:6\n+mem-pool.h component=? role=public prefix=mem-pool cochange=index:4\n+merge-blobs.c component=merge role=lib prefix=object-store includes=merge:2,odb:2 cochange=merge:9,notes:3,diff:2,convert:1,odb:1\n+merge-blobs.h component=merge role=header prefix=merge-blobs cochange=merge:2\n+merge-ll.c component=merge role=lib prefix=merge-ll includes=convert:2,diff:1,merge:1,setup:1 cochange=merge:11,diff:6,transport:4,convert:2,index:2\n+merge-ll.h component=merge role=header prefix=merge-ll cochange=merge:11,diff:2,convert:1,notes:1\n+merge-ort-wrappers.c component=merge role=lib prefix=merge-ort includes=odb:4,merge:2,index:1,setup:1 cochange=merge:7,odb:2,notes:1,revision:1\n+merge-ort-wrappers.h component=merge role=header prefix=merge includes=merge:1 cochange=merge:9,odb:2,revision:1\n+merge-ort.c component=merge role=lib prefix=merge-ort includes=odb:8,index:6,diff:3,merge:2,revision:2 cochange=diff:41,merge:32,index:23,odb:23,revision:16\n+merge-ort.h component=merge role=header prefix=merge-ort includes=odb:1 cochange=merge:19,odb:2,revision:2,diff:1\n+merge.c component=merge role=lib prefix=merge includes=odb:4,index:2,merge:1,setup:1 cochange=index:22,merge:6,setup:4,diff:2,odb:2\n+merge.h component=merge role=header prefix=merge cochange=merge:1\n+mergesort.h component=? role=public prefix=mergesort cochange=odb:1\n+midx-write.c component=pack role=lib prefix=midx-write includes=pack:5,odb:2,revision:2,refs:1,setup:1 cochange=pack:100,odb:20,refs:7,transport:6,setup:4\n+midx.c component=pack role=lib prefix=midx includes=pack:5,index:1,odb:1,setup:1 cochange=pack:220,odb:34,transport:11,index:6,setup:4\n+midx.h component=pack role=header prefix=midx cochange=pack:134,odb:5,setup:2,transport:2,refs:1\n+name-hash.c component=index role=lib prefix=name-hash includes=index:3,odb:1,setup:1 cochange=diff:43,index:39,revision:18,setup:14,refs:12\n+name-hash.h component=index role=header prefix=name-hash cochange=index:7\n+notes-cache.c component=notes role=lib prefix=notes includes=odb:3,notes:1,refs:1,revision:1,setup:1 cochange=notes:37,odb:29,diff:10,index:10,revision:9\n+notes-cache.h component=notes role=header prefix=notes-cache includes=notes:1 cochange=diff:7,notes:3\n+notes-merge.c component=notes role=lib prefix=notes-merge includes=odb:4,diff:3,notes:3,index:1,merge:1 cochange=diff:54,revision:41,odb:37,notes:36,index:30\n+notes-merge.h component=notes role=header prefix=notes-merge includes=notes:1 cochange=notes:18,odb:2\n+notes-utils.c component=notes role=lib prefix=commit includes=setup:2,notes:1,odb:1,refs:1 cochange=notes:33,odb:15,refs:9,transport:9,revision:8\n+notes-utils.h component=notes role=header prefix=notes includes=notes:1 cochange=notes:17,odb:6\n+notes.c component=notes role=lib prefix=notes includes=odb:4,setup:2,notes:1,refs:1 cochange=notes:63,odb:58,revision:41,transport:36,index:24\n+notes.h component=notes role=header prefix=notes cochange=notes:55,revision:20,setup:9,odb:3,refs:2\n+object-file-convert.c component=odb role=lib prefix=object-file-convert includes=odb:5,setup:1 cochange=odb:8,setup:2,transport:1\n+object-file-convert.h component=odb role=header prefix=object-file-convert includes=odb:1 cochange=odb:4\n+object-file.c component=odb role=lib prefix=object-file includes=odb:6,index:2,pack:2,setup:2,convert:1 cochange=odb:183,pack:96,index:55,setup:30,transport:27\n+object-file.h component=odb role=header prefix=object-file includes=odb:2 cochange=odb:113,pack:30,index:12,notes:5,transport:5\n+object-name.c component=odb role=lib prefix=object-name includes=odb:8,setup:5,index:2,revision:2,pack:1 cochange=odb:46,pack:31,revision:23,setup:19,refs:18\n+object-name.h component=odb role=header prefix=object-name includes=odb:1 cochange=odb:5,revision:3,refs:2,index:1\n+object.c component=odb role=lib prefix=object includes=odb:8,index:1,pack:1 cochange=odb:265,pack:61,revision:55,transport:34,refs:17\n+object.h component=odb role=header prefix=object includes=odb:1 cochange=odb:187,revision:54,transport:41,pack:29,refs:20\n+odb.c component=odb role=lib prefix=odb includes=odb:7,pack:3,setup:3,index:1,submodule:1 cochange=odb:123,pack:64,setup:13,transport:12,index:8\n+odb.h component=odb role=header prefix=odb includes=odb:3 cochange=odb:117,pack:71,transport:16,setup:13,index:10\n+oid-array.c component=odb role=lib prefix=oid-array includes=odb:2 cochange=odb:13,pack:10,merge:2,diff:1,revision:1\n+oid-array.h component=odb role=header prefix=oid-array includes=odb:1 cochange=odb:3,diff:1,index:1,refs:1,revision:1\n+oidmap.c component=odb role=lib prefix=oidmap includes=odb:2 cochange=diff:11,revision:7,odb:6,refs:5,index:4\n+oidmap.h component=odb role=header prefix=oidmap includes=odb:1 cochange=odb:6,revision:4,index:2,transport:2,convert:1\n+oidset.c component=odb role=lib prefix=oidset includes=odb:1 cochange=odb:17,convert:2,diff:2,transport:2,index:1\n+oidset.h component=odb role=header prefix=oidset cochange=odb:17,revision:1,transport:1\n+oidtree.c component=odb role=lib prefix=oidtree includes=odb:2 cochange=odb:14,index:3,setup:2,diff:1,merge:1\n+oidtree.h component=odb role=header prefix=oidtree includes=odb:2 cochange=odb:9\n+pack-bitmap-write.c component=pack role=lib prefix=pack-bitmap-write includes=odb:7,pack:6,revision:2,setup:2,diff:1 cochange=pack:132,odb:32,revision:27,transport:10,diff:4\n+pack-bitmap.c component=pack role=lib prefix=pack-bitmap includes=pack:7,odb:3,revision:3,setup:2,diff:1 cochange=pack:232,revision:30,odb:18,transport:14,refs:7\n+pack-bitmap.h component=pack role=header prefix=pack-bitmap includes=pack:2,refs:1 cochange=pack:117,refs:5,odb:2,setup:2,revision:1\n+pack-check.c component=pack role=lib prefix=pack-check includes=odb:2,pack:2,setup:2 cochange=pack:59,odb:26,transport:23,diff:11,index:10\n+pack-mtimes.c component=pack role=lib prefix=pack-mtimes includes=pack:2,odb:1 cochange=pack:10,odb:3,transport:2,notes:1\n+pack-mtimes.h component=pack role=header prefix=pack-mtimes cochange=pack:4,odb:2,setup:1,transport:1\n+pack-objects.c component=pack role=lib prefix=pack-objects includes=pack:3,odb:1,setup:1 cochange=pack:66,diff:17,odb:16,transport:9,index:5\n+pack-objects.h component=pack role=header prefix=pack-objects includes=pack:2,odb:1 cochange=pack:44,setup:5,odb:1\n+pack-refs.c component=refs role=lib prefix=pack-refs includes=refs:2,setup:2,revision:1 cochange=refs:12,transport:8,index:2,merge:2,odb:2\n+pack-refs.h component=refs role=header prefix=pack-refs cochange=refs:5\n+pack-revindex.c component=pack role=lib prefix=pack-revindex includes=pack:3,odb:1,setup:1 cochange=pack:94,odb:7,index:6,transport:5,setup:4\n+pack-revindex.h component=pack role=header prefix=pack-revindex cochange=pack:32,odb:1\n+pack-write.c component=pack role=lib prefix=pack-write includes=pack:5,setup:2,odb:1,transport:1 cochange=pack:88,odb:21,transport:21,setup:14,index:10\n+pack.h component=pack role=header prefix=pack-write includes=odb:1 cochange=pack:72,odb:13,transport:9,setup:5,revision:1\n+packfile-list.c component=pack role=lib prefix=packfile includes=pack:2 cochange=pack:3\n+packfile-list.h component=pack role=header prefix=packfile cochange=pack:3\n+packfile.c component=pack role=lib prefix=packfile includes=odb:8,pack:7,setup:2,index:1,revision:1 cochange=pack:317,odb:134,transport:52,revision:36,index:27\n+packfile.h component=pack role=header prefix=packfile includes=odb:3,pack:1,revision:1,setup:1 cochange=pack:234,odb:66,transport:32,revision:9,setup:7\n+pager.c component=? role=lib prefix=pager includes=setup:4 cochange=setup:23,diff:9,transport:7,revision:3,submodule:3\n+pager.h component=? role=public prefix=pager cochange=diff:3,setup:2,revision:1\n+parallel-checkout.c component=index role=lib prefix=parallel-checkout includes=index:4,odb:1,setup:1,transport:1 cochange=index:26,transport:7,odb:6,diff:3,merge:3\n+parallel-checkout.h component=index role=header prefix=parallel-checkout includes=convert:1 cochange=index:12,convert:1\n+parse-options-cb.c component=? role=lib prefix=parse-options includes=odb:3,setup:2 cochange=revision:10,transport:10,diff:7,odb:4,refs:3\n+parse-options.c component=? role=lib prefix=parse-options cochange=index:14,diff:12,setup:10,transport:10,odb:6\n+parse-options.h component=? role=public prefix=parse-options cochange=diff:7,merge:4,archive:3,index:3,refs:3\n+parse.c component=? role=lib prefix=parse cochange=setup:6,index:3,pack:2,convert:1\n+parse.h component=? role=public prefix=config cochange=setup:6,index:3,pack:2,convert:1\n+patch-delta.c component=pack role=lib prefix=patch-delta includes=pack:1 cochange=pack:23,diff:2,odb:2,transport:2,convert:1\n+patch-ids.c component=diff role=lib prefix=patch-ids includes=diff:2,odb:2 cochange=diff:73,revision:34,index:14,odb:13,refs:12\n+patch-ids.h component=diff role=header prefix=patch-ids includes=diff:1 cochange=diff:15,revision:3,index:1\n+path-walk.c component=? role=lib prefix=path-walk includes=odb:9,revision:3,index:1,setup:1 cochange=index:2,revision:2,transport:2,odb:1,pack:1\n+path-walk.h component=? role=public prefix=path-walk includes=odb:1 cochange=index:2\n+path.c component=? role=lib prefix=path includes=setup:2,index:1,odb:1,pack:1,refs:1 cochange=setup:78,refs:29,index:26,transport:15,odb:12\n+path.h component=? role=public prefix=path includes=setup:1 cochange=setup:23,refs:13,odb:11,index:10,pack:8\n+pathspec.c component=index role=lib prefix=pathspec includes=index:4,setup:3,convert:1 cochange=index:89,setup:23,convert:16,diff:16,revision:9\n+pathspec.h component=index role=header prefix=pathspec cochange=index:67,diff:11,odb:9,convert:6,submodule:4\n+pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 cochange=transport:102,pack:6,convert:5,diff:5,odb:3\n+pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1\n+preload-index.c component=index role=lib prefix=preload-index includes=index:6,setup:3 cochange=index:52,setup:15,diff:12,revision:5,merge:3\n+preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1\n+pretty.c component=revision role=lib prefix=pretty includes=odb:3,revision:2,setup:2,diff:1,notes:1 cochange=revision:115,odb:72,refs:29,notes:23,transport:19\n+pretty.h component=revision role=header prefix=pretty cochange=revision:26,refs:7,diff:5,odb:5,archive:4\n+prio-queue.c component=? role=lib prefix=prio-queue cochange=odb:5,revision:5,diff:2,pack:2,transport:2\n+prio-queue.h component=? role=public prefix=prio-queue cochange=odb:3,revision:2,transport:2,pack:1\n+progress.c component=? role=lib prefix=progress includes=setup:1 cochange=index:11,diff:6,setup:6,pack:4,revision:2\n+progress.h component=? role=public prefix=progress cochange=index:5,diff:3\n+promisor-remote.c component=transport role=lib prefix=promisor-remote includes=setup:3,transport:2,odb:1,pack:1 cochange=transport:32,setup:15,odb:6,pack:5,index:4\n+promisor-remote.h component=transport role=header prefix=promisor-remote includes=setup:1 cochange=transport:18,setup:7,diff:4,index:3,revision:3\n+prompt.c component=? role=lib prefix=prompt includes=setup:2 cochange=index:7,setup:6,pack:4,diff:3,transport:2\n+prompt.h component=? role=public prefix=prompt cochange=transport:1\n+protocol-caps.c component=transport role=lib prefix=protocol-caps includes=odb:3,transport:2,setup:1 cochange=transport:6,odb:3,refs:2,merge:1,setup:1\n+protocol-caps.h component=transport role=header prefix=protocol-caps cochange=transport:6,refs:2\n+protocol.c component=transport role=lib prefix=protocol includes=setup:2,transport:1 cochange=transport:21,index:4,setup:4,refs:2,diff:1\n+protocol.h component=transport role=header prefix=protocol cochange=transport:5\n+prune-packed.c component=pack role=lib prefix=environment includes=pack:2,odb:1,setup:1 cochange=pack:13,odb:7,setup:5,diff:3,revision:3\n+prune-packed.h component=pack role=header prefix=? cochange=pack:1\n+pseudo-merge.c component=pack role=lib prefix=pseudo-merge includes=odb:3,pack:2,refs:1,setup:1 cochange=pack:21,refs:3\n+pseudo-merge.h component=pack role=header prefix=pseudo-merge cochange=pack:17\n+quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6\n+quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5\n+range-diff.c component=diff role=lib prefix=range-diff includes=diff:4,odb:2,revision:2,setup:2 cochange=diff:49,revision:26,index:9,submodule:8,setup:7\n+range-diff.h component=diff role=header prefix=range-diff includes=diff:1 cochange=diff:13,revision:4\n+reachable.c component=pack role=lib prefix=reachable includes=pack:4,odb:3,refs:2,revision:2,diff:1 cochange=odb:60,pack:57,revision:47,transport:17,refs:14\n+reachable.h component=pack role=header prefix=prune cochange=pack:5\n+read-cache-ll.h component=index role=header prefix=read-cache includes=index:1,odb:1 cochange=index:8,diff:1,odb:1,revision:1\n+read-cache.c component=index role=lib prefix=read-cache includes=index:10,odb:6,setup:4,diff:2,submodule:2 cochange=index:240,odb:81,setup:79,diff:67,pack:46\n+read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2\n+rebase-interactive.c component=? role=lib prefix=rebase-interactive includes=odb:3,setup:3,index:1 cochange=revision:4,transport:4,index:3,odb:3,merge:2\n+rebase-interactive.h component=? role=public prefix=rebase-interactive\n+rebase.c component=? role=lib prefix=rebase cochange=index:3,pack:3,setup:2,convert:1,diff:1\n+rebase.h component=? role=public prefix=pull\n+ref-filter.c component=refs role=lib prefix=ref-filter includes=odb:6,setup:5,refs:3,revision:2,index:1 cochange=refs:112,revision:59,odb:41,transport:40,index:30\n+ref-filter.h component=refs role=header prefix=ref-filter includes=odb:2,revision:1 cochange=refs:62,revision:7,transport:6,diff:5,index:4\n+reflog-walk.c component=refs role=lib prefix=reflog-walk includes=refs:2,diff:1,odb:1,revision:1,setup:1 cochange=refs:34,revision:26,index:13,diff:9,transport:8\n+reflog-walk.h component=refs role=header prefix=reflog-walk cochange=revision:23,refs:19,odb:6,archive:2,index:2\n+reflog.c component=refs role=lib prefix=refs includes=odb:3,refs:2,setup:2,revision:1 cochange=refs:18,transport:13,odb:9,revision:7,diff:4\n+reflog.h component=refs role=header prefix=reflog includes=refs:1 cochange=refs:8,odb:3,index:1,revision:1,transport:1\n+refs.c component=refs role=lib prefix=refs includes=setup:6,odb:5,refs:2,submodule:1 cochange=refs:373,transport:133,setup:116,odb:82,revision:77\n+refs.h component=refs role=header prefix=refs includes=odb:2,setup:2 cochange=refs:352,transport:55,revision:34,setup:25,odb:16\n+refspec.c component=refs role=lib prefix=refspec includes=refs:2,odb:1,transport:1 cochange=refs:27,transport:26,index:2,submodule:2\n+refspec.h component=refs role=header prefix=refspec cochange=transport:31,refs:29,submodule:3,index:2\n+remote-curl.c component=transport role=lib prefix=remote-curl includes=transport:9,setup:3,odb:1 cochange=transport:226,diff:9,revision:6,setup:5,archive:4\n+remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,transport:3,refs:2,revision:2 cochange=transport:272,refs:91,revision:56,index:51,odb:30\n+remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2\n+repack-cruft.c component=pack role=lib prefix=repack includes=pack:2,setup:1 cochange=pack:8,transport:2,odb:1\n+repack-filtered.c component=pack role=lib prefix=repack includes=pack:1,setup:1 cochange=pack:1\n+repack-geometry.c component=pack role=lib prefix=repack includes=pack:3,setup:1 cochange=pack:25,transport:2,odb:1\n+repack-midx.c component=pack role=lib prefix=repack includes=odb:3,pack:3,refs:1 cochange=pack:23,refs:3,setup:2,merge:1,odb:1\n+repack-promisor.c component=pack role=lib prefix=repack-promisor includes=pack:3,setup:1 cochange=pack:8,odb:3,revision:2\n+repack.c component=pack role=lib prefix=repack includes=pack:3,index:1,odb:1,setup:1 cochange=pack:31,transport:2,odb:1\n+repack.h component=pack role=header prefix=repack includes=revision:1 cochange=pack:28\n+replace-object.c component=odb role=lib prefix=refs includes=odb:4,refs:1,setup:1 cochange=odb:8,setup:6,refs:5,pack:3,diff:2\n+replace-object.h component=odb role=header prefix=replace-object includes=odb:2,setup:1 cochange=odb:11,setup:9,pack:4,revision:3,merge:1\n+replay.c component=? role=lib prefix=replay includes=odb:2,merge:1,refs:1,revision:1,setup:1 cochange=transport:1\n+replay.h component=? role=public prefix=replay includes=odb:1\n+repo-settings.c component=setup role=lib prefix=repo-settings includes=setup:4,pack:2 cochange=setup:65,pack:17,index:8,transport:8,odb:6\n+repo-settings.h component=setup role=header prefix=environment cochange=setup:40,pack:7,refs:6,odb:4,diff:2\n+repository.c component=setup role=lib prefix=repository includes=setup:4,odb:3,index:2,transport:2,refs:1 cochange=setup:141,odb:39,index:27,refs:18,submodule:17\n+repository.h component=setup role=header prefix=repository includes=setup:2 cochange=setup:157,index:31,refs:25,pack:22,odb:19\n+rerere.c component=merge role=lib prefix=rerere includes=index:4,merge:2,odb:2,setup:2,diff:1 cochange=index:54,merge:29,pack:26,odb:25,transport:25\n+rerere.h component=merge role=header prefix=rerere cochange=merge:16,odb:1\n+reset.c component=? role=lib prefix=reset includes=odb:3,index:2,refs:1,setup:1 cochange=index:9,merge:5,odb:3,notes:2,revision:2\n+reset.h component=? role=public prefix=reset includes=odb:1,setup:1\n+resolve-undo.c component=index role=lib prefix=resolve-undo includes=index:4,odb:1 cochange=index:33,merge:5,revision:4,diff:3,notes:2\n+resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1\n+revision.c component=revision role=lib prefix=revision includes=odb:9,revision:8,index:4,setup:4,diff:3 cochange=revision:379,diff:194,odb:181,refs:109,pack:101\n+revision.h component=revision role=header prefix=revision includes=odb:4,revision:3,diff:1,notes:1,setup:1 cochange=revision:304,odb:48,diff:24,pack:19,refs:15\n+run-command.c component=? role=lib prefix=run-command includes=setup:2,index:1,pack:1 cochange=transport:27,index:21,setup:14,odb:8,submodule:6\n+run-command.h component=? role=public prefix=run-command cochange=transport:21,setup:8,odb:6,submodule:5,refs:4\n+sane-ctype.h component=? role=public prefix=sane-ctype\n+scalar.c component=? role=lib prefix=scalar includes=index:3,setup:2,pack:1,refs:1 cochange=setup:9,transport:7,pack:4,index:3,merge:3\n+send-pack.c component=transport role=lib prefix=send-pack includes=transport:6,odb:3,setup:2,revision:1 cochange=transport:177,odb:29,revision:17,refs:15,pack:8\n+send-pack.h component=transport role=header prefix=send-pack cochange=transport:39\n+sequencer.c component=? role=lib prefix=sequencer includes=odb:8,index:5,merge:4,setup:4,revision:3 cochange=revision:84,odb:83,index:77,refs:60,transport:55\n+sequencer.h component=? role=public prefix=sequencer includes=index:1 cochange=revision:5,index:4,notes:3,odb:3,transport:3\n+serve.c component=transport role=lib prefix=serve includes=transport:6,setup:3,odb:1,refs:1 cochange=transport:53,refs:7,odb:4,setup:3,index:1\n+serve.h component=transport role=header prefix=serve cochange=transport:9,refs:3,submodule:1\n+server-info.c component=pack role=lib prefix=server-info includes=odb:5,pack:2,index:1,refs:1,setup:1 cochange=pack:40,transport:34,odb:33,setup:13,refs:10\n+server-info.h component=pack role=header prefix=server-info cochange=pack:2\n+setup.c component=setup role=lib prefix=setup includes=setup:4,odb:2,refs:2,index:1,revision:1 cochange=setup:177,refs:47,transport:44,index:39,odb:24\n+setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:70,refs:8,index:5,revision:4,submodule:4\n+sh-i18n--envsubst.c component=? role=program prefix=sh-i18n--envsubst cochange=index:3,diff:1,transport:1\n+sha1dc_git.c component=? role=lib prefix=sha1dc cochange=diff:3,odb:2,revision:2,setup:1\n+sha1dc_git.h component=? role=public prefix=sha1dc cochange=odb:2\n+shallow.c component=revision role=lib prefix=shallow includes=odb:5,revision:4,diff:1,index:1,refs:1 cochange=odb:83,transport:73,revision:31,index:20,refs:14\n+shallow.h component=revision role=header prefix=shallow includes=odb:2,setup:1 cochange=revision:10,transport:7,odb:5,diff:3,index:2\n+shell.c component=? role=program prefix=shell includes=setup:1 cochange=transport:10,setup:4,revision:2\n+shortlog.h component=? role=public prefix=shortlog cochange=revision:2\n+sideband.c component=transport role=lib prefix=sideband includes=transport:2,setup:1 cochange=transport:51,revision:6,diff:5,index:5,refs:4\n+sideband.h component=transport role=header prefix=sideband cochange=transport:23\n+sigchain.c component=? role=lib prefix=sigchain cochange=diff:2,transport:1\n+sigchain.h component=? role=public prefix=sigchain cochange=diff:2\n+simple-ipc.h component=? role=public prefix=simple-ipc includes=transport:1 cochange=submodule:1\n+sparse-index.c component=index role=lib prefix=sparse-index includes=index:7,setup:3,odb:1 cochange=index:42,setup:17,diff:2,odb:2,revision:1\n+sparse-index.h component=index role=header prefix=sparse-index cochange=index:16,setup:4,merge:1,revision:1\n+split-index.c component=index role=lib prefix=split-index includes=index:2,odb:1,setup:1 cochange=index:46,odb:5,revision:4,pack:3,merge:2\n+split-index.h component=index role=header prefix=split-index includes=odb:1 cochange=index:21,archive:1,merge:1,revision:1\n+stable-qsort.c component=? role=lib prefix=stable-qsort\n+statinfo.c component=index role=lib prefix=environment includes=setup:2,index:1 cochange=index:9,setup:6,diff:2,odb:1,revision:1\n+statinfo.h component=index role=header prefix=statinfo cochange=index:8,odb:1,revision:1\n+strbuf.c component=? role=lib prefix=strbuf cochange=index:16,odb:12,setup:11,revision:10,transport:10\n+strbuf.h component=? role=public prefix=strbuf cochange=revision:15,index:14,odb:14,diff:7,setup:7\n+string-list.c component=? role=lib prefix=string-list cochange=transport:14,index:8,notes:7,refs:7,diff:5\n+string-list.h component=? role=public prefix=string-list cochange=transport:19,index:6,notes:6,diff:5,refs:5\n+strmap.c component=? role=lib prefix=strmap\n+strmap.h component=? role=public prefix=strmap\n+strvec.c component=? role=lib prefix=strvec\n+strvec.h component=? role=public prefix=strvec cochange=submodule:3,revision:2,index:1,transport:1\n+sub-process.c component=? role=lib prefix=sub-process includes=transport:1 cochange=diff:19,convert:12,revision:11,index:8,refs:8\n+sub-process.h component=? role=public prefix=sub-process cochange=convert:8,transport:6,refs:5,diff:4,odb:4\n+submodule-config.c component=submodule role=lib prefix=submodule-config includes=odb:3,setup:3,submodule:2,index:1 cochange=submodule:60,setup:41,diff:36,revision:27,odb:22\n+submodule-config.h component=submodule role=header prefix=submodule-config includes=odb:1,setup:1,submodule:1 cochange=submodule:54,setup:9,odb:3,diff:2,index:2\n+submodule.c component=submodule role=lib prefix=submodule includes=odb:5,setup:4,diff:2,index:2,refs:2 cochange=submodule:134,diff:83,setup:66,index:60,revision:49\n+submodule.h component=submodule role=header prefix=submodule cochange=submodule:128,index:22,diff:21,transport:17,setup:6\n+symlinks.c component=index role=lib prefix=symlinks includes=index:1,setup:1 cochange=index:23,diff:3,archive:2,convert:1,revision:1\n+symlinks.h component=index role=header prefix=symlinks cochange=index:9,diff:1\n+tag.c component=odb role=lib prefix=tag includes=odb:7,setup:2,pack:1 cochange=odb:189,transport:36,pack:32,revision:29,refs:14\n+tag.h component=odb role=header prefix=tag includes=odb:1 cochange=odb:60,transport:10,revision:8,refs:7,pack:6\n+tar.h component=? role=public prefix=tar-tree\n+tempfile.c component=? role=lib prefix=tempfile cochange=pack:5,setup:4,index:3,odb:3,revision:3\n+tempfile.h component=? role=public prefix=tempfile includes=revision:1 cochange=revision:3,diff:2,index:2,setup:2\n+thread-utils.c component=? role=lib prefix=thread-utils cochange=diff:1\n+thread-utils.h component=? role=public prefix=thread-utils cochange=transport:1\n+tmp-objdir.c component=odb role=lib prefix=tmp-objdir includes=odb:3,setup:2,index:1 cochange=pack:24,odb:23,setup:8,transport:5,revision:3\n+tmp-objdir.h component=odb role=header prefix=tmp-objdir cochange=odb:8,revision:3,setup:1\n+trace.c component=? role=lib prefix=trace includes=setup:2 cochange=setup:26,transport:13,index:11,odb:4,diff:2\n+trace.h component=? role=public prefix=trace cochange=transport:6,index:5,odb:4,pack:3,revision:3\n+trace2.c component=? role=lib prefix=trace2 includes=setup:2 cochange=setup:2\n+trace2.h component=? role=public prefix=trace2 cochange=setup:2\n+trailer.c component=? role=lib prefix=trailer includes=setup:2,odb:1,revision:1 cochange=transport:13,revision:12,odb:8,index:7,refs:6\n+trailer.h component=? role=public prefix=trailer includes=revision:1 cochange=revision:7,refs:1\n+transport-helper.c component=transport role=lib prefix=transport-helper includes=transport:4,odb:2,refs:2,setup:2,pack:1 cochange=transport:210,refs:23,revision:16,odb:14,index:12\n+transport-internal.h component=transport role=header prefix=transport includes=transport:1 cochange=transport:42,refs:3,odb:1,submodule:1\n+transport.c component=transport role=lib prefix=transport includes=transport:12,setup:3,odb:2,refs:2,submodule:1 cochange=transport:482,refs:35,setup:31,submodule:29,revision:21\n+transport.h component=transport role=header prefix=transport includes=transport:2,revision:1 cochange=transport:249,submodule:6,odb:4,revision:2,diff:1\n+tree-diff.c component=diff role=lib prefix=tree-diff includes=odb:3,diff:2,index:1,setup:1 cochange=diff:115,odb:56,revision:53,index:36,notes:12\n+tree-walk.c component=odb role=lib prefix=tree-walk includes=odb:4,index:3,setup:1 cochange=odb:70,index:61,diff:31,revision:24,pack:13\n+tree-walk.h component=odb role=header prefix=tree-walk includes=odb:1 cochange=odb:64,diff:23,index:23,revision:21,notes:7\n+tree.c component=odb role=lib prefix=tree includes=odb:6,setup:2 cochange=odb:212,revision:45,index:36,pack:25,transport:21\n+tree.h component=odb role=header prefix=tree includes=odb:1 cochange=odb:75,revision:12,archive:8,index:6,pack:5\n+unicode-width.h component=? role=public prefix=unicode\n+unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2,setup:1\n+unix-socket.h component=? role=public prefix=unix-socket\n+unix-stream-server.c component=? role=lib prefix=unix-stream-server\n+unix-stream-server.h component=? role=public prefix=unix-stream-server\n+unpack-trees.c component=index role=lib prefix=unpack-trees includes=index:11,odb:3,setup:3,submodule:2,convert:1 cochange=index:262,odb:49,diff:41,transport:19,revision:18\n+unpack-trees.h component=index role=header prefix=unpack-trees includes=convert:1,index:1,odb:1 cochange=index:75,diff:9,odb:6,setup:5,merge:4\n+upload-pack.c component=transport role=lib prefix=upload-pack includes=transport:6,odb:4,revision:4,setup:4,diff:1 cochange=transport:198,odb:88,revision:80,refs:55,pack:34\n+upload-pack.h component=transport role=header prefix=upload-pack cochange=transport:18,refs:5,submodule:1\n+url.c component=? role=lib prefix=url cochange=transport:12,revision:8,diff:6,index:2,refs:2\n+url.h component=? role=public prefix=url cochange=transport:9,revision:4,submodule:1\n+urlmatch.c component=? role=lib prefix=urlmatch cochange=diff:3,odb:2,revision:2,setup:2,transport:2\n+urlmatch.h component=? role=public prefix=urlmatch includes=setup:1 cochange=transport:1\n+usage.c component=? role=lib prefix=usage cochange=index:3,odb:2,diff:1,revision:1,setup:1\n+userdiff.c component=diff role=lib prefix=userdiff includes=setup:2,convert:1,diff:1 cochange=diff:41,convert:34,archive:11,index:7,transport:6\n+userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1\n+utf8.c component=? role=lib prefix=utf8 cochange=revision:6,index:3,setup:3,transport:2,convert:1\n+utf8.h component=? role=public prefix=utf8 cochange=revision:6,index:2,setup:2,transport:2,convert:1\n+varint.c component=? role=lib prefix=varint cochange=index:2,transport:1\n+varint.h component=? role=public prefix=varint cochange=index:2,transport:1\n+version.c component=setup role=lib prefix=version includes=setup:1 cochange=setup:8,transport:2\n+version.h component=setup role=header prefix=version cochange=setup:8,transport:2\n+versioncmp.c component=? role=lib prefix=versioncmp includes=setup:1 cochange=setup:5,pack:3,transport:3,index:2,refs:2\n+versioncmp.h component=? role=public prefix=versioncmp cochange=refs:1\n+walker.c component=transport role=lib prefix=refs includes=odb:6,refs:1,setup:1,transport:1 cochange=odb:70,transport:55,revision:42,refs:24,pack:17\n+walker.h component=transport role=header prefix=walker includes=transport:1 cochange=transport:19\n+wildmatch.c component=? role=lib prefix=hex cochange=index:4,refs:3,diff:1,odb:1,revision:1\n+wildmatch.h component=? role=public prefix=? cochange=index:3,refs:2,diff:1,revision:1,setup:1\n+worktree.c component=refs role=lib prefix=worktree includes=setup:4,index:2,refs:2 cochange=refs:73,setup:53,index:22,submodule:13,pack:11\n+worktree.h component=refs role=header prefix=worktree includes=refs:1 cochange=refs:61,revision:10,pack:5,setup:5,odb:4\n+wrapper.c component=? role=lib prefix=wrapper cochange=setup:21,index:16,pack:6,transport:5,convert:4\n+wrapper.h component=? role=public prefix=wrapper cochange=index:2,revision:1,setup:1\n+write-or-die.c component=? role=lib prefix=write-or-die cochange=pack:6,setup:6,index:4,transport:2,convert:1\n+write-or-die.h component=? role=public prefix=write-or-die\n+ws.c component=convert role=lib prefix=whitespace includes=convert:2 cochange=convert:24,diff:18,archive:9,index:5,setup:5\n+ws.h component=convert role=header prefix=whitespace cochange=diff:5,convert:2,setup:2\n+wt-status.c component=index role=lib prefix=wt-status includes=odb:5,index:4,setup:3,diff:2,refs:2 cochange=index:149,diff:83,transport:55,refs:45,revision:45\n+wt-status.h component=index role=header prefix=wt-status includes=index:1,transport:1 cochange=index:89,diff:10,refs:9,revision:4,transport:4\n+xdiff-interface.c component=diff role=lib prefix=xdiff-interface includes=setup:2,diff:1,odb:1 cochange=diff:73,index:5,merge:3,notes:3,refs:3\n+xdiff-interface.h component=diff role=header prefix=xdiff-interface includes=odb:1 cochange=diff:62,index:2,notes:2,merge:1,odb:1\n-- \n2.54.0\n\n"},{"id":"551089","messageId":"20260823171915.2662373-9-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 08/14] refs: gather the refs sources under refs/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:52Z","receivedAt":"2026-08-23T17:19:32Z","isPatch":true,"body":"Move the 8 refs C sources and 8 headers into refs/ as renames. Repoint\nevery reference to their old paths to the new ones: the #include lines\nacross the tree, the Makefile and meson.build build entries.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                        | 32 ++++++++++++++---------------\n Makefile                            | 16 +++++++--------\n add-interactive.c                   |  2 +-\n archive.c                           |  2 +-\n attr.c                              |  2 +-\n bisect.c                            |  2 +-\n blame.c                             |  2 +-\n branch.c                            |  6 +++---\n builtin/am.c                        |  2 +-\n builtin/bisect.c                    |  2 +-\n builtin/blame.c                     |  2 +-\n builtin/branch.c                    |  6 +++---\n builtin/check-ref-format.c          |  2 +-\n builtin/checkout.c                  |  2 +-\n builtin/clone.c                     |  4 ++--\n builtin/config.c                    |  2 +-\n builtin/describe.c                  |  2 +-\n builtin/fast-export.c               |  4 ++--\n builtin/fast-import.c               |  2 +-\n builtin/fetch.c                     |  4 ++--\n builtin/for-each-ref.c              |  2 +-\n builtin/fsck.c                      |  4 ++--\n builtin/gc.c                        |  6 +++---\n builtin/history.c                   |  2 +-\n builtin/init-db.c                   |  2 +-\n builtin/log.c                       |  4 ++--\n builtin/ls-remote.c                 |  2 +-\n builtin/merge.c                     |  4 ++--\n builtin/name-rev.c                  |  2 +-\n builtin/notes.c                     |  4 ++--\n builtin/pack-objects.c              |  2 +-\n builtin/pack-refs.c                 |  2 +-\n builtin/pull.c                      |  4 ++--\n builtin/push.c                      |  2 +-\n builtin/rebase.c                    |  2 +-\n builtin/receive-pack.c              |  4 ++--\n builtin/reflog.c                    |  6 +++---\n builtin/refs.c                      |  6 +++---\n builtin/remote.c                    |  4 ++--\n builtin/replace.c                   |  2 +-\n builtin/replay.c                    |  2 +-\n builtin/repo.c                      |  4 ++--\n builtin/reset.c                     |  2 +-\n builtin/rev-list.c                  |  2 +-\n builtin/rev-parse.c                 |  2 +-\n builtin/show-branch.c               |  2 +-\n builtin/sparse-checkout.c           |  2 +-\n builtin/stash.c                     |  6 +++---\n builtin/submodule--helper.c         |  4 ++--\n builtin/symbolic-ref.c              |  2 +-\n builtin/tag.c                       |  4 ++--\n builtin/update-index.c              |  2 +-\n builtin/update-ref.c                |  2 +-\n builtin/var.c                       |  2 +-\n builtin/verify-tag.c                |  2 +-\n builtin/worktree.c                  |  4 ++--\n bundle-uri.c                        |  2 +-\n bundle.c                            |  2 +-\n checkout.c                          |  2 +-\n combine-diff.c                      |  2 +-\n commit-graph.c                      |  2 +-\n commit-reach.c                      |  2 +-\n config.c                            |  2 +-\n connect.c                           |  2 +-\n delta-islands.c                     |  2 +-\n diff-lib.c                          |  2 +-\n dir.c                               |  2 +-\n environment.c                       |  2 +-\n fetch-pack.c                        |  2 +-\n fmt-merge-msg.c                     |  2 +-\n help.c                              |  2 +-\n http-backend.c                      |  2 +-\n log-tree.c                          |  4 ++--\n merge-ort.c                         |  2 +-\n meson.build                         | 16 +++++++--------\n midx-write.c                        |  2 +-\n negotiator/default.c                |  2 +-\n negotiator/skipping.c               |  2 +-\n notes-cache.c                       |  2 +-\n notes-merge.c                       |  2 +-\n notes-utils.c                       |  2 +-\n notes.c                             |  2 +-\n odb/commit.c                        |  2 +-\n odb/fsck.c                          |  2 +-\n odb/object-name.c                   |  2 +-\n odb/replace-object.c                |  2 +-\n pack-bitmap-write.c                 |  2 +-\n pack-bitmap.h                       |  2 +-\n path.c                              |  2 +-\n pretty.c                            |  2 +-\n pseudo-merge.c                      |  2 +-\n reachable.c                         |  4 ++--\n read-cache.c                        |  2 +-\n refs/files-backend.c                |  4 ++--\n refs/iterator.c                     |  2 +-\n ls-refs.c => refs/ls-refs.c         |  4 ++--\n ls-refs.h => refs/ls-refs.h         |  0\n pack-refs.c => refs/pack-refs.c     |  4 ++--\n pack-refs.h => refs/pack-refs.h     |  0\n refs/packed-backend.c               |  4 ++--\n refs/ref-cache.c                    |  2 +-\n ref-filter.c => refs/ref-filter.c   |  6 +++---\n ref-filter.h => refs/ref-filter.h   |  0\n reflog-walk.c => refs/reflog-walk.c |  4 ++--\n reflog-walk.h => refs/reflog-walk.h |  0\n reflog.c => refs/reflog.c           |  4 ++--\n reflog.h => refs/reflog.h           |  2 +-\n refs/refs-internal.h                |  2 +-\n refs.c => refs/refs.c               |  4 ++--\n refs.h => refs/refs.h               |  0\n refspec.c => refs/refspec.c         |  4 ++--\n refspec.h => refs/refspec.h         |  0\n refs/reftable-backend.c             |  4 ++--\n worktree.c => refs/worktree.c       |  4 ++--\n worktree.h => refs/worktree.h       |  2 +-\n remote.c                            |  4 ++--\n remote.h                            |  2 +-\n repack-midx.c                       |  2 +-\n replay.c                            |  2 +-\n repository.c                        |  2 +-\n reset.c                             |  2 +-\n revision.c                          |  6 +++---\n scalar.c                            |  2 +-\n sequencer.c                         |  2 +-\n serve.c                             |  2 +-\n server-info.c                       |  2 +-\n setup.c                             |  4 ++--\n setup.h                             |  2 +-\n shallow.c                           |  2 +-\n submodule.c                         |  4 ++--\n t/helper/test-reach.c               |  2 +-\n t/helper/test-ref-store.c           |  4 ++--\n transport-helper.c                  |  4 ++--\n transport.c                         |  4 ++--\n unpack-trees.c                      |  2 +-\n upload-pack.c                       |  2 +-\n walker.c                            |  2 +-\n wt-status.c                         |  4 ++--\n 138 files changed, 210 insertions(+), 210 deletions(-)\n rename ls-refs.c => refs/ls-refs.c (99%)\n rename ls-refs.h => refs/ls-refs.h (100%)\n rename pack-refs.c => refs/pack-refs.c (97%)\n rename pack-refs.h => refs/pack-refs.h (100%)\n rename ref-filter.c => refs/ref-filter.c (99%)\n rename ref-filter.h => refs/ref-filter.h (100%)\n rename reflog-walk.c => refs/reflog-walk.c (99%)\n rename reflog-walk.h => refs/reflog-walk.h (100%)\n rename reflog.c => refs/reflog.c (99%)\n rename reflog.h => refs/reflog.h (99%)\n rename refs.c => refs/refs.c (99%)\n rename refs.h => refs/refs.h (100%)\n rename refspec.c => refs/refspec.c (99%)\n rename refspec.h => refs/refspec.h (100%)\n rename worktree.c => refs/worktree.c (99%)\n rename worktree.h => refs/worktree.h (99%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex 5da6d0b2b1..e29497504a 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -201,8 +201,6 @@ lockfile.c component=? role=lib prefix=lockfile includes=setup:1 cochange=refs:1\n lockfile.h component=? role=public prefix=lockfile cochange=index:5,revision:4,diff:3,refs:3,odb:2\n log-tree.c component=revision role=lib prefix=format-patch includes=odb:8,revision:5,diff:3,setup:3,refs:2 cochange=revision:222,diff:112,odb:112,refs:31,transport:16\n log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2\n-ls-refs.c component=refs role=lib prefix=ls-refs includes=setup:3,refs:2,odb:1,transport:1 cochange=refs:26,transport:17,pack:10,revision:5,odb:4\n-ls-refs.h component=refs role=header prefix=ls-refs cochange=transport:11,refs:5,submodule:1\n mailinfo.c component=? role=lib prefix=mailinfo includes=setup:2 cochange=transport:5,index:3,notes:3,odb:3,revision:3\n mailinfo.h component=? role=public prefix=mailinfo\n mailmap.c component=? role=lib prefix=mailmap includes=setup:3,odb:2 cochange=setup:13,transport:11,refs:10,index:8,revision:5\n@@ -290,8 +288,6 @@ pack-mtimes.c component=pack role=lib prefix=pack-mtimes includes=pack:2,odb:1 c\n pack-mtimes.h component=pack role=header prefix=pack-mtimes cochange=pack:4,odb:2,setup:1,transport:1\n pack-objects.c component=pack role=lib prefix=pack-objects includes=pack:3,odb:1,setup:1 cochange=pack:66,diff:17,odb:16,transport:9,index:5\n pack-objects.h component=pack role=header prefix=pack-objects includes=pack:2,odb:1 cochange=pack:44,setup:5,odb:1\n-pack-refs.c component=refs role=lib prefix=pack-refs includes=refs:2,setup:2,revision:1 cochange=refs:12,transport:8,index:2,merge:2,odb:2\n-pack-refs.h component=refs role=header prefix=pack-refs cochange=refs:5\n pack-revindex.c component=pack role=lib prefix=pack-revindex includes=pack:3,odb:1,setup:1 cochange=pack:94,odb:7,index:6,transport:5,setup:4\n pack-revindex.h component=pack role=header prefix=pack-revindex cochange=pack:32,odb:1\n pack-write.c component=pack role=lib prefix=pack-write includes=pack:5,setup:2,odb:1,transport:1 cochange=pack:88,odb:21,transport:21,setup:14,index:10\n@@ -353,16 +349,22 @@ rebase-interactive.c component=? role=lib prefix=rebase-interactive includes=odb\n rebase-interactive.h component=? role=public prefix=rebase-interactive\n rebase.c component=? role=lib prefix=rebase cochange=index:3,pack:3,setup:2,convert:1,diff:1\n rebase.h component=? role=public prefix=pull\n-ref-filter.c component=refs role=lib prefix=ref-filter includes=odb:6,setup:5,refs:3,revision:2,index:1 cochange=refs:112,revision:59,odb:41,transport:40,index:30\n-ref-filter.h component=refs role=header prefix=ref-filter includes=odb:2,revision:1 cochange=refs:62,revision:7,transport:6,diff:5,index:4\n-reflog-walk.c component=refs role=lib prefix=reflog-walk includes=refs:2,diff:1,odb:1,revision:1,setup:1 cochange=refs:34,revision:26,index:13,diff:9,transport:8\n-reflog-walk.h component=refs role=header prefix=reflog-walk cochange=revision:23,refs:19,odb:6,archive:2,index:2\n-reflog.c component=refs role=lib prefix=refs includes=odb:3,refs:2,setup:2,revision:1 cochange=refs:18,transport:13,odb:9,revision:7,diff:4\n-reflog.h component=refs role=header prefix=reflog includes=refs:1 cochange=refs:8,odb:3,index:1,revision:1,transport:1\n-refs.c component=refs role=lib prefix=refs includes=setup:6,odb:5,refs:2,submodule:1 cochange=refs:373,transport:133,setup:116,odb:82,revision:77\n-refs.h component=refs role=header prefix=refs includes=odb:2,setup:2 cochange=refs:352,transport:55,revision:34,setup:25,odb:16\n-refspec.c component=refs role=lib prefix=refspec includes=refs:2,odb:1,transport:1 cochange=refs:27,transport:26,index:2,submodule:2\n-refspec.h component=refs role=header prefix=refspec cochange=transport:31,refs:29,submodule:3,index:2\n+refs/ls-refs.c component=refs role=lib prefix=ls-refs includes=setup:3,refs:2,odb:1,transport:1 cochange=refs:26,transport:17,pack:10,revision:5,odb:4\n+refs/ls-refs.h component=refs role=header prefix=ls-refs cochange=transport:11,refs:5,submodule:1\n+refs/pack-refs.c component=refs role=lib prefix=pack-refs includes=refs:2,setup:2,revision:1 cochange=refs:12,transport:8,index:2,merge:2,odb:2\n+refs/pack-refs.h component=refs role=header prefix=pack-refs cochange=refs:5\n+refs/ref-filter.c component=refs role=lib prefix=ref-filter includes=odb:6,setup:5,refs:3,revision:2,index:1 cochange=refs:112,revision:59,odb:41,transport:40,index:30\n+refs/ref-filter.h component=refs role=header prefix=ref-filter includes=odb:2,revision:1 cochange=refs:62,revision:7,transport:6,diff:5,index:4\n+refs/reflog-walk.c component=refs role=lib prefix=reflog-walk includes=refs:2,diff:1,odb:1,revision:1,setup:1 cochange=refs:34,revision:26,index:13,diff:9,transport:8\n+refs/reflog-walk.h component=refs role=header prefix=reflog-walk cochange=revision:23,refs:19,odb:6,archive:2,index:2\n+refs/reflog.c component=refs role=lib prefix=refs includes=odb:3,refs:2,setup:2,revision:1 cochange=refs:18,transport:13,odb:9,revision:7,diff:4\n+refs/reflog.h component=refs role=header prefix=reflog includes=refs:1 cochange=refs:8,odb:3,index:1,revision:1,transport:1\n+refs/refs.c component=refs role=lib prefix=refs includes=setup:6,odb:5,refs:2,submodule:1 cochange=refs:373,transport:133,setup:116,odb:82,revision:77\n+refs/refs.h component=refs role=header prefix=refs includes=odb:2,setup:2 cochange=refs:352,transport:55,revision:34,setup:25,odb:16\n+refs/refspec.c component=refs role=lib prefix=refspec includes=refs:2,odb:1,transport:1 cochange=refs:27,transport:26,index:2,submodule:2\n+refs/refspec.h component=refs role=header prefix=refspec cochange=transport:31,refs:29,submodule:3,index:2\n+refs/worktree.c component=refs role=lib prefix=worktree includes=setup:4,index:2,refs:2 cochange=refs:73,setup:53,index:22,submodule:13,pack:11\n+refs/worktree.h component=refs role=header prefix=worktree includes=refs:1 cochange=refs:61,revision:10,pack:5,setup:5,odb:4\n remote-curl.c component=transport role=lib prefix=remote-curl includes=transport:9,setup:3,odb:1 cochange=transport:226,diff:9,revision:6,setup:5,archive:4\n remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,transport:3,refs:2,revision:2 cochange=transport:272,refs:91,revision:56,index:51,odb:30\n remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2\n@@ -480,8 +482,6 @@ walker.c component=transport role=lib prefix=refs includes=odb:6,refs:1,setup:1,\n walker.h component=transport role=header prefix=walker includes=transport:1 cochange=transport:19\n wildmatch.c component=? role=lib prefix=hex cochange=index:4,refs:3,diff:1,odb:1,revision:1\n wildmatch.h component=? role=public prefix=? cochange=index:3,refs:2,diff:1,revision:1,setup:1\n-worktree.c component=refs role=lib prefix=worktree includes=setup:4,index:2,refs:2 cochange=refs:73,setup:53,index:22,submodule:13,pack:11\n-worktree.h component=refs role=header prefix=worktree includes=refs:1 cochange=refs:61,revision:10,pack:5,setup:5,odb:4\n wrapper.c component=? role=lib prefix=wrapper cochange=setup:21,index:16,pack:6,transport:5,convert:4\n wrapper.h component=? role=public prefix=wrapper cochange=index:2,revision:1,setup:1\n write-or-die.c component=? role=lib prefix=write-or-die cochange=pack:6,setup:6,index:4,transport:2,convert:1\ndiff --git a/Makefile b/Makefile\nindex a95b87d970..f733ccfee0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1201,7 +1201,7 @@ LIB_OBJS += list-objects.o\n LIB_OBJS += lockfile.o\n LIB_OBJS += log-tree.o\n LIB_OBJS += odb/loose.o\n-LIB_OBJS += ls-refs.o\n+LIB_OBJS += refs/ls-refs.o\n LIB_OBJS += mailinfo.o\n LIB_OBJS += mailmap.o\n LIB_OBJS += odb/match-trees.o\n@@ -1246,7 +1246,7 @@ LIB_OBJS += pack-bitmap.o\n LIB_OBJS += pack-check.o\n LIB_OBJS += pack-mtimes.o\n LIB_OBJS += pack-objects.o\n-LIB_OBJS += pack-refs.o\n+LIB_OBJS += refs/pack-refs.o\n LIB_OBJS += pack-revindex.o\n LIB_OBJS += pack-write.o\n LIB_OBJS += packfile.o\n@@ -1278,17 +1278,17 @@ LIB_OBJS += reachable.o\n LIB_OBJS += read-cache.o\n LIB_OBJS += rebase-interactive.o\n LIB_OBJS += rebase.o\n-LIB_OBJS += ref-filter.o\n-LIB_OBJS += reflog-walk.o\n-LIB_OBJS += reflog.o\n-LIB_OBJS += refs.o\n+LIB_OBJS += refs/ref-filter.o\n+LIB_OBJS += refs/reflog-walk.o\n+LIB_OBJS += refs/reflog.o\n+LIB_OBJS += refs/refs.o\n LIB_OBJS += refs/debug.o\n LIB_OBJS += refs/files-backend.o\n LIB_OBJS += refs/reftable-backend.o\n LIB_OBJS += refs/iterator.o\n LIB_OBJS += refs/packed-backend.o\n LIB_OBJS += refs/ref-cache.o\n-LIB_OBJS += refspec.o\n+LIB_OBJS += refs/refspec.o\n LIB_OBJS += reftable/basics.o\n LIB_OBJS += reftable/block.o\n LIB_OBJS += reftable/blocksource.o\n@@ -1377,7 +1377,7 @@ LIB_OBJS += version.o\n LIB_OBJS += versioncmp.o\n LIB_OBJS += walker.o\n LIB_OBJS += wildmatch.o\n-LIB_OBJS += worktree.o\n+LIB_OBJS += refs/worktree.o\n LIB_OBJS += wrapper.o\n LIB_OBJS += write-or-die.o\n LIB_OBJS += ws.o\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 51ddcc4e87..67ee53f5cc 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -11,7 +11,7 @@\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"string-list.h\"\n #include \"lockfile.h\"\n #include \"dir.h\"\ndiff --git a/archive.c b/archive.c\nindex c0d2e0c44b..53820bd859 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -13,7 +13,7 @@\n #include \"path.h\"\n #include \"pretty.h\"\n #include \"setup.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\n #include \"odb/tree.h\"\ndiff --git a/attr.c b/attr.c\nindex e829149cb4..e7c6562bee 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -20,7 +20,7 @@\n #include \"utf8.h\"\n #include \"quote.h\"\n #include \"read-cache-ll.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"odb/odb.h\"\n #include \"setup.h\"\ndiff --git a/bisect.c b/bisect.c\nindex 2dea7139ad..85c5a12ed2 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -9,7 +9,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"list-objects.h\"\n #include \"quote.h\"\n #include \"run-command.h\"\ndiff --git a/blame.c b/blame.c\nindex d1cba8811f..a594dc5f0e 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/odb.h\"\n #include \"cache-tree.h\"\n #include \"mergesort.h\"\ndiff --git a/branch.c b/branch.c\nindex 7593a499a9..d752e55b88 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -9,13 +9,13 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"remote.h\"\n #include \"repository.h\"\n #include \"sequencer.h\"\n #include \"odb/commit.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"submodule-config.h\"\n #include \"run-command.h\"\n #include \"strmap.h\"\ndiff --git a/builtin/am.c b/builtin/am.c\nindex f138a8fe3d..d7e4e125d2 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -22,7 +22,7 @@\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n #include \"cache-tree.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"unpack-trees.h\"\ndiff --git a/builtin/bisect.c b/builtin/bisect.c\nindex a1b7fc9407..51e2e949cc 100644\n--- a/builtin/bisect.c\n+++ b/builtin/bisect.c\n@@ -9,7 +9,7 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"bisect.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex c88fc489f7..1662bd487d 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -30,7 +30,7 @@\n #include \"odb/odb.h\"\n #include \"pager.h\"\n #include \"blame.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"setup.h\"\n #include \"odb/tag.h\"\n #include \"write-or-die.h\"\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex c50c28c720..7909f250aa 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -12,7 +12,7 @@\n #include \"color.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n@@ -24,8 +24,8 @@\n #include \"strmap.h\"\n #include \"column.h\"\n #include \"utf8.h\"\n-#include \"ref-filter.h\"\n-#include \"worktree.h\"\n+#include \"refs/ref-filter.h\"\n+#include \"refs/worktree.h\"\n #include \"help.h\"\n #include \"advice.h\"\n #include \"commit-reach.h\"\ndiff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c\nindex fd1c9c0e0c..5de8c0e6f5 100644\n--- a/builtin/check-ref-format.c\n+++ b/builtin/check-ref-format.c\n@@ -5,7 +5,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n \ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 2dcebb2cb2..87c1f087b8 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -24,7 +24,7 @@\n #include \"path.h\"\n #include \"preload-index.h\"\n #include \"read-cache.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"repo-settings.h\"\n #include \"resolve-undo.h\"\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 6d6a756a12..12170ae8f4 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -22,8 +22,8 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"parse-options.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 0882899c3f..15782dfe64 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -15,7 +15,7 @@\n #include \"quote.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n \n static const char *const builtin_config_usage[] = {\n \tN_(\"git config list [<file-option>] [<display-option>] [--includes]\"),\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 75961c5945..c16a1da092 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -9,7 +9,7 @@\n #include \"lockfile.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"read-cache-ll.h\"\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 472877f0e5..4a98f14d39 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -12,8 +12,8 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 1d560d4e71..43bc72f05f 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -16,7 +16,7 @@\n #include \"pack.h\"\n #include \"path.h\"\n #include \"read-cache-ll.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"csum-file.h\"\n #include \"quote.h\"\n #include \"dir.h\"\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 2089e7823e..ce46a709a6 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -11,8 +11,8 @@\n #include \"gettext.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"odb/oidset.h\"\ndiff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c\nindex d3399455ef..9b3f277cb8 100644\n--- a/builtin/for-each-ref.c\n+++ b/builtin/for-each-ref.c\n@@ -6,7 +6,7 @@\n #include \"gettext.h\"\n #include \"odb/object.h\"\n #include \"parse-options.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n #include \"strbuf.h\"\n #include \"strvec.h\"\n \ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 3176941c1d..430cf28bd8 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -6,7 +6,7 @@\n #include \"odb/tree.h\"\n #include \"odb/blob.h\"\n #include \"odb/tag.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"pack.h\"\n #include \"cache-tree.h\"\n #include \"odb/fsck.h\"\n@@ -23,7 +23,7 @@\n #include \"resolve-undo.h\"\n #include \"run-command.h\"\n #include \"sparse-index.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"pack-revindex.h\"\n #include \"pack-bitmap.h\"\n \ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex f2fdc2c69d..1a71e6f908 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -32,17 +32,17 @@\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"reflog.h\"\n+#include \"refs/reflog.h\"\n #include \"rerere.h\"\n #include \"revision.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"hook.h\"\n #include \"setup.h\"\n #include \"trace2.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n \n #define FAILED_RUN \"failed to run %s\"\n \ndiff --git a/builtin/history.c b/builtin/history.c\nindex a2aa224bd1..56b5015bc0 100644\n--- a/builtin/history.c\n+++ b/builtin/history.c\n@@ -15,7 +15,7 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"read-cache.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"replay.h\"\n #include \"reset.h\"\n #include \"revision.h\"\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex e96b1283b7..f459635129 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -10,7 +10,7 @@\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n \ndiff --git a/builtin/log.c b/builtin/log.c\nindex ab381e529e..7099f5fcc5 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -13,7 +13,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n@@ -28,7 +28,7 @@\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n #include \"odb/tag.h\"\n-#include \"reflog-walk.h\"\n+#include \"refs/reflog-walk.h\"\n #include \"patch-ids.h\"\n #include \"path.h\"\n #include \"shortlog.h\"\ndiff --git a/builtin/ls-remote.c b/builtin/ls-remote.c\nindex fe77829557..1b12d6e6ec 100644\n--- a/builtin/ls-remote.c\n+++ b/builtin/ls-remote.c\n@@ -4,7 +4,7 @@\n #include \"hex.h\"\n #include \"transport.h\"\n #include \"pkt-line.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n #include \"remote.h\"\n #include \"parse-options.h\"\n #include \"wildmatch.h\"\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 56f89b2944..2369c3b6f9 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -26,8 +26,8 @@\n #include \"hook.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"odb/commit.h\"\n #include \"diffcore.h\"\n #include \"path.h\"\ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex d2870bd37c..4e0254d70e 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -8,7 +8,7 @@\n #include \"config.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"pager.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 2cf1437346..6ebb5db39c 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -20,14 +20,14 @@\n #include \"path.h\"\n \n #include \"pretty.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"exec-cmd.h\"\n #include \"run-command.h\"\n #include \"parse-options.h\"\n #include \"string-list.h\"\n #include \"notes-merge.h\"\n #include \"notes-utils.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"write-or-die.h\"\n \n static const char *separator = \"\\n\";\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 3e4c5442dc..69f35a727b 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -21,7 +21,7 @@\n #include \"list-objects-filter-options.h\"\n #include \"pack-objects.h\"\n #include \"progress.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"thread-utils.h\"\n #include \"pack-bitmap.h\"\n #include \"delta-islands.h\"\ndiff --git a/builtin/pack-refs.c b/builtin/pack-refs.c\nindex 3446b84cda..235ae2cc5a 100644\n--- a/builtin/pack-refs.c\n+++ b/builtin/pack-refs.c\n@@ -1,6 +1,6 @@\n #include \"builtin.h\"\n #include \"gettext.h\"\n-#include \"pack-refs.h\"\n+#include \"refs/pack-refs.h\"\n \n int cmd_pack_refs(int argc,\n \t\t  const char **argv,\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex cb3d76cb16..bc8dcde318 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -24,8 +24,8 @@\n #include \"path.h\"\n #include \"read-cache-ll.h\"\n #include \"rebase.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n #include \"wt-status.h\"\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 2377b5af55..39b6ff4b8b 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -12,7 +12,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refspec.h\"\n+#include \"refs/refspec.h\"\n #include \"run-command.h\"\n #include \"remote.h\"\n #include \"transport.h\"\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 7b8366e5cd..983dbb7ce5 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -16,7 +16,7 @@\n #include \"run-command.h\"\n #include \"strvec.h\"\n #include \"dir.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"config.h\"\n #include \"unpack-trees.h\"\n #include \"lockfile.h\"\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 5ec79a4595..88cbaed133 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -27,7 +27,7 @@\n #include \"parse-options.h\"\n #include \"pkt-line.h\"\n #include \"protocol.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"run-command.h\"\n #include \"server-info.h\"\n@@ -40,7 +40,7 @@\n #include \"trace.h\"\n #include \"trace2.h\"\n #include \"version.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n \n static const char * const receive_pack_usage[] = {\n \tN_(\"git receive-pack <git-dir>\"),\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex b709cb0e3c..fc0b74ed95 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -8,9 +8,9 @@\n #include \"revision.h\"\n #include \"reachable.h\"\n #include \"wildmatch.h\"\n-#include \"worktree.h\"\n-#include \"reflog.h\"\n-#include \"refs.h\"\n+#include \"refs/worktree.h\"\n+#include \"refs/reflog.h\"\n+#include \"refs/refs.h\"\n #include \"parse-options.h\"\n \n #define BUILTIN_REFLOG_SHOW_USAGE \\\ndiff --git a/builtin/refs.c b/builtin/refs.c\nindex 37936353be..abfc0acdd2 100644\n--- a/builtin/refs.c\n+++ b/builtin/refs.c\n@@ -1,11 +1,11 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"odb/fsck.h\"\n-#include \"pack-refs.h\"\n+#include \"refs/pack-refs.h\"\n #include \"parse-options.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"strbuf.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"for-each-ref.h\"\n #include \"refs/refs-internal.h\"\n \ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex b5b54ded27..9a5df99c11 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -14,8 +14,8 @@\n #include \"strbuf.h\"\n #include \"run-command.h\"\n #include \"rebase.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"odb/odb.h\"\n #include \"strvec.h\"\n #include \"commit-reach.h\"\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 793226006c..83497cd974 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -14,7 +14,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/replay.c b/builtin/replay.c\nindex 4ea7c42215..83b136a13e 100644\n--- a/builtin/replay.c\n+++ b/builtin/replay.c\n@@ -9,7 +9,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"replay.h\"\n #include \"revision.h\"\n \ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex 473072b44d..e052e6c0ba 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -11,8 +11,8 @@\n #include \"path-walk.h\"\n #include \"progress.h\"\n #include \"quote.h\"\n-#include \"ref-filter.h\"\n-#include \"refs.h\"\n+#include \"refs/ref-filter.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 55539f565c..c3bfbab7d5 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -20,7 +20,7 @@\n #include \"lockfile.h\"\n #include \"odb/object.h\"\n #include \"pretty.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 0c55dc5b96..466a0a515d 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -21,7 +21,7 @@\n #include \"graph.h\"\n #include \"bisect.h\"\n #include \"progress.h\"\n-#include \"reflog-walk.h\"\n+#include \"refs/reflog-walk.h\"\n #include \"odb/oidset.h\"\n #include \"odb/oidmap.h\"\n #include \"packfile.h\"\ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex f3bf7831b7..2fb682d5a2 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -17,7 +17,7 @@\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"quote.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex c58abc872f..4da3330a26 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -8,7 +8,7 @@\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"pretty.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"color.h\"\n #include \"strvec.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c\nindex e2186fdd33..9b4cad87a5 100644\n--- a/builtin/sparse-checkout.c\n+++ b/builtin/sparse-checkout.c\n@@ -19,7 +19,7 @@\n #include \"quote.h\"\n #include \"setup.h\"\n #include \"sparse-index.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n \n static const char *empty_base = \"\";\n \ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 2af975aaff..62fec2f17f 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -9,7 +9,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"lockfile.h\"\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n@@ -27,8 +27,8 @@\n #include \"sparse-index.h\"\n #include \"log-tree.h\"\n #include \"diffcore.h\"\n-#include \"reflog.h\"\n-#include \"reflog-walk.h\"\n+#include \"refs/reflog.h\"\n+#include \"refs/reflog-walk.h\"\n #include \"add-interactive.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/commit.h\"\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 96c83476df..bf8b20247f 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -21,8 +21,8 @@\n #include \"string-list.h\"\n #include \"run-command.h\"\n #include \"remote.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"revision.h\"\n #include \"diffcore.h\"\n #include \"diff.h\"\ndiff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c\nindex 231e41e715..9ea9ca6500 100644\n--- a/builtin/symbolic-ref.c\n+++ b/builtin/symbolic-ref.c\n@@ -3,7 +3,7 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"parse-options.h\"\n #include \"strbuf.h\"\n \ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex e3eee35e88..d554ae8f81 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -16,7 +16,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n@@ -28,7 +28,7 @@\n #include \"gpg-interface.h\"\n #include \"odb/oid-array.h\"\n #include \"column.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n #include \"date.h\"\n #include \"write-or-die.h\"\n #include \"odb/object-file-convert.h\"\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex 992f496efd..54741c3241 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -20,7 +20,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"resolve-undo.h\"\n #include \"parse-options.h\"\n #include \"pathspec.h\"\ndiff --git a/builtin/update-ref.c b/builtin/update-ref.c\nindex e7ac68f495..5bcd100e52 100644\n--- a/builtin/update-ref.c\n+++ b/builtin/update-ref.c\n@@ -7,7 +7,7 @@\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\ndiff --git a/builtin/var.c b/builtin/var.c\nindex cc3a43cde2..d01c87dfa2 100644\n--- a/builtin/var.c\n+++ b/builtin/var.c\n@@ -14,7 +14,7 @@\n #include \"environment.h\"\n #include \"ident.h\"\n #include \"pager.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"path.h\"\n #include \"strbuf.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/verify-tag.c b/builtin/verify-tag.c\nindex 791679a4d8..460244f25b 100644\n--- a/builtin/verify-tag.c\n+++ b/builtin/verify-tag.c\n@@ -13,7 +13,7 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"gpg-interface.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n \n static const char * const verify_tag_usage[] = {\n \t\tN_(\"git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>...\"),\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 7c2ed274f9..90af2193c1 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -18,14 +18,14 @@\n #include \"strvec.h\"\n #include \"branch.h\"\n #include \"read-cache-ll.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"run-command.h\"\n #include \"hook.h\"\n #include \"sigchain.h\"\n #include \"submodule.h\"\n #include \"utf8.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"quote.h\"\n \n #define BUILTIN_WORKTREE_ADD_USAGE \\\ndiff --git a/bundle-uri.c b/bundle-uri.c\nindex 948265330b..96ddf92347 100644\n--- a/bundle-uri.c\n+++ b/bundle-uri.c\n@@ -6,7 +6,7 @@\n #include \"bundle.h\"\n #include \"copy.h\"\n #include \"gettext.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"run-command.h\"\n #include \"hashmap.h\"\n #include \"pkt-line.h\"\ndiff --git a/bundle.c b/bundle.c\nindex 81d241e6d0..c64b14a05a 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -15,7 +15,7 @@\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"run-command.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"strvec.h\"\n #include \"list-objects-filter-options.h\"\n #include \"connected.h\"\ndiff --git a/checkout.c b/checkout.c\nindex 966a70c267..e3b4d341da 100644\n--- a/checkout.c\n+++ b/checkout.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"odb/object-name.h\"\n #include \"remote.h\"\n-#include \"refspec.h\"\n+#include \"refs/refspec.h\"\n #include \"repository.h\"\n #include \"checkout.h\"\n #include \"config.h\"\ndiff --git a/combine-diff.c b/combine-diff.c\nindex 1c33937f21..6f16e9ea38 100644\n--- a/combine-diff.c\n+++ b/combine-diff.c\n@@ -14,7 +14,7 @@\n #include \"xdiff-interface.h\"\n #include \"xdiff/xmacros.h\"\n #include \"log-tree.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/tree.h\"\n #include \"userdiff.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/commit-graph.c b/commit-graph.c\nindex abf7c404b3..7c22588c46 100644\n--- a/commit-graph.c\n+++ b/commit-graph.c\n@@ -10,7 +10,7 @@\n #include \"packfile.h\"\n #include \"odb/commit.h\"\n #include \"odb/object.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/hash-lookup.h\"\n #include \"commit-graph.h\"\n #include \"odb/odb.h\"\ndiff --git a/commit-reach.c b/commit-reach.c\nindex 9b4715fd65..9636b5b37f 100644\n--- a/commit-reach.c\n+++ b/commit-reach.c\n@@ -6,7 +6,7 @@\n #include \"decorate.h\"\n #include \"hex.h\"\n #include \"prio-queue.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n #include \"revision.h\"\n #include \"odb/tag.h\"\n #include \"commit-reach.h\"\ndiff --git a/config.c b/config.c\nindex eacc6847a2..3f335dbec1 100644\n--- a/config.c\n+++ b/config.c\n@@ -30,7 +30,7 @@\n #include \"path.h\"\n #include \"utf8.h\"\n #include \"color.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"trace2.h\"\ndiff --git a/connect.c b/connect.c\nindex e54c88f5e2..a24b019b2c 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"pkt-line.h\"\n #include \"quote.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"run-command.h\"\n #include \"remote.h\"\n #include \"connect.h\"\ndiff --git a/delta-islands.c b/delta-islands.c\nindex 0c0d222ab3..1c92cdf37c 100644\n--- a/delta-islands.c\n+++ b/delta-islands.c\n@@ -11,7 +11,7 @@\n #include \"odb/tree-walk.h\"\n #include \"diff.h\"\n #include \"progress.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"khash.h\"\n #include \"pack-bitmap.h\"\n #include \"pack-objects.h\"\ndiff --git a/diff-lib.c b/diff-lib.c\nindex 313b6136b1..a5072c5f6d 100644\n--- a/diff-lib.c\n+++ b/diff-lib.c\n@@ -17,7 +17,7 @@\n #include \"revision.h\"\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"submodule.h\"\n #include \"symlinks.h\"\ndiff --git a/dir.c b/dir.c\nindex c9005a0ac1..d230ecdec1 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -19,7 +19,7 @@\n #include \"name-hash.h\"\n #include \"odb/object-file.h\"\n #include \"path.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"wildmatch.h\"\n #include \"pathspec.h\"\ndiff --git a/environment.c b/environment.c\nindex 40b993ec90..6066417b62 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -26,7 +26,7 @@\n #include \"odb/object-name.h\"\n #include \"repository.h\"\n #include \"config.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"fmt-merge-msg.h\"\n #include \"odb/commit.h\"\n #include \"strvec.h\"\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex b172114879..434b57e5b0 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -9,7 +9,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"pkt-line.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex 6e11ad0fa9..7fa8c4cd79 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -4,7 +4,7 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n #include \"environment.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"diff.h\"\ndiff --git a/help.c b/help.c\nindex ccc42f09e0..96f98ec621 100644\n--- a/help.c\n+++ b/help.c\n@@ -15,7 +15,7 @@\n #include \"string-list.h\"\n #include \"column.h\"\n #include \"version.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"parse-options.h\"\n #include \"prompt.h\"\n #include \"fsmonitor-ipc.h\"\ndiff --git a/http-backend.c b/http-backend.c\nindex 9b7ae96579..90624c3348 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -8,7 +8,7 @@\n #include \"hex.h\"\n #include \"path.h\"\n #include \"repository.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"pkt-line.h\"\n #include \"odb/object.h\"\n #include \"odb/tag.h\"\ndiff --git a/log-tree.c b/log-tree.c\nindex c9fde242a1..116bb7ea68 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -18,8 +18,8 @@\n #include \"graph.h\"\n #include \"log-tree.h\"\n #include \"merge-ort.h\"\n-#include \"reflog-walk.h\"\n-#include \"refs.h\"\n+#include \"refs/reflog-walk.h\"\n+#include \"refs/refs.h\"\n #include \"odb/replace-object.h\"\n #include \"revision.h\"\n #include \"string-list.h\"\ndiff --git a/merge-ort.c b/merge-ort.c\nindex 35d30dcf06..a12bf62a3d 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -44,7 +44,7 @@\n #include \"path.h\"\n #include \"promisor-remote.h\"\n #include \"read-cache-ll.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"sparse-index.h\"\n #include \"strmap.h\"\ndiff --git a/meson.build b/meson.build\nindex 6586f8ae9f..8dd613a8bb 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -406,7 +406,7 @@ libgit_sources = [\n   'lockfile.c',\n   'log-tree.c',\n   'odb/loose.c',\n-  'ls-refs.c',\n+  'refs/ls-refs.c',\n   'mailinfo.c',\n   'mailmap.c',\n   'odb/match-trees.c',\n@@ -451,7 +451,7 @@ libgit_sources = [\n   'pack-check.c',\n   'pack-mtimes.c',\n   'pack-objects.c',\n-  'pack-refs.c',\n+  'refs/pack-refs.c',\n   'pack-revindex.c',\n   'pack-write.c',\n   'packfile.c',\n@@ -483,17 +483,17 @@ libgit_sources = [\n   'read-cache.c',\n   'rebase-interactive.c',\n   'rebase.c',\n-  'ref-filter.c',\n-  'reflog-walk.c',\n-  'reflog.c',\n-  'refs.c',\n+  'refs/ref-filter.c',\n+  'refs/reflog-walk.c',\n+  'refs/reflog.c',\n+  'refs/refs.c',\n   'refs/debug.c',\n   'refs/files-backend.c',\n   'refs/reftable-backend.c',\n   'refs/iterator.c',\n   'refs/packed-backend.c',\n   'refs/ref-cache.c',\n-  'refspec.c',\n+  'refs/refspec.c',\n   'reftable/basics.c',\n   'reftable/error.c',\n   'reftable/block.c',\n@@ -579,7 +579,7 @@ libgit_sources = [\n   'versioncmp.c',\n   'walker.c',\n   'wildmatch.c',\n-  'worktree.c',\n+  'refs/worktree.c',\n   'wrapper.c',\n   'write-or-die.c',\n   'ws.c',\ndiff --git a/midx-write.c b/midx-write.c\nindex bb4ceaede7..af4410a0b8 100644\n--- a/midx-write.c\n+++ b/midx-write.c\n@@ -12,7 +12,7 @@\n #include \"run-command.h\"\n #include \"chunk-format.h\"\n #include \"pack-bitmap.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"path.h\"\ndiff --git a/negotiator/default.c b/negotiator/default.c\nindex 404db17785..7d67933e06 100644\n--- a/negotiator/default.c\n+++ b/negotiator/default.c\n@@ -5,7 +5,7 @@\n #include \"odb/commit.h\"\n #include \"../fetch-negotiator.h\"\n #include \"../prio-queue.h\"\n-#include \"../refs.h\"\n+#include \"refs/refs.h\"\n #include \"../repository.h\"\n #include \"odb/tag.h\"\n \ndiff --git a/negotiator/skipping.c b/negotiator/skipping.c\nindex e1218d2a93..9e685f54a1 100644\n--- a/negotiator/skipping.c\n+++ b/negotiator/skipping.c\n@@ -6,7 +6,7 @@\n #include \"../fetch-negotiator.h\"\n #include \"../hex.h\"\n #include \"../prio-queue.h\"\n-#include \"../refs.h\"\n+#include \"refs/refs.h\"\n #include \"../repository.h\"\n #include \"odb/tag.h\"\n \ndiff --git a/notes-cache.c b/notes-cache.c\nindex abe0964bba..02fb418c6f 100644\n--- a/notes-cache.c\n+++ b/notes-cache.c\n@@ -7,7 +7,7 @@\n #include \"pretty.h\"\n #include \"repository.h\"\n #include \"odb/commit.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"strbuf.h\"\n \n static int notes_cache_match_validity(struct repository *r,\ndiff --git a/notes-merge.c b/notes-merge.c\nindex 2b025b6d3d..72a3b9479c 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -5,7 +5,7 @@\n #include \"advice.h\"\n #include \"odb/commit.h\"\n #include \"gettext.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\ndiff --git a/notes-utils.c b/notes-utils.c\nindex b6275dfa26..491de7a7ce 100644\n--- a/notes-utils.c\n+++ b/notes-utils.c\n@@ -5,7 +5,7 @@\n #include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"notes-utils.h\"\n #include \"strbuf.h\"\n \ndiff --git a/notes.c b/notes.c\nindex ef44dae00d..5842226c68 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -13,7 +13,7 @@\n #include \"strbuf.h\"\n #include \"odb/tree-walk.h\"\n #include \"string-list.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n \n /*\n  * Use a non-balancing simple 16-tree structure with struct int_node as\ndiff --git a/odb/commit.c b/odb/commit.c\nindex d0e036876c..dc98000ab2 100644\n--- a/odb/commit.c\n+++ b/odb/commit.c\n@@ -22,7 +22,7 @@\n #include \"odb/hash-lookup.h\"\n #include \"wt-status.h\"\n #include \"advice.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"commit-reach.h\"\n #include \"setup.h\"\n #include \"shallow.h\"\ndiff --git a/odb/fsck.c b/odb/fsck.c\nindex e76779109a..75306dc8a3 100644\n--- a/odb/fsck.c\n+++ b/odb/fsck.c\n@@ -14,7 +14,7 @@\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"odb/fsck.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"url.h\"\n #include \"utf8.h\"\n #include \"odb/oidset.h\"\ndiff --git a/odb/object-name.c b/odb/object-name.c\nindex 98c88e7337..16b6cd8f12 100644\n--- a/odb/object-name.c\n+++ b/odb/object-name.c\n@@ -12,7 +12,7 @@\n #include \"odb/commit.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"dir.h\"\n #include \"odb/odb.h\"\ndiff --git a/odb/replace-object.c b/odb/replace-object.c\nindex 32d778f55e..c69c5aa200 100644\n--- a/odb/replace-object.c\n+++ b/odb/replace-object.c\n@@ -4,7 +4,7 @@\n #include \"odb/oidmap.h\"\n #include \"odb/odb.h\"\n #include \"odb/replace-object.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"odb/commit.h\"\n \ndiff --git a/pack-bitmap-write.c b/pack-bitmap-write.c\nindex 64233d6cd0..b5e14b196f 100644\n--- a/pack-bitmap-write.c\n+++ b/pack-bitmap-write.c\n@@ -23,7 +23,7 @@\n #include \"odb/oid-array.h\"\n #include \"config.h\"\n #include \"odb/alloc.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"strmap.h\"\n #include \"midx.h\"\n #include \"pack-revindex.h\"\ndiff --git a/pack-bitmap.h b/pack-bitmap.h\nindex 1385027c1f..b50ef0b4e4 100644\n--- a/pack-bitmap.h\n+++ b/pack-bitmap.h\n@@ -5,7 +5,7 @@\n #include \"khash.h\"\n #include \"pack.h\"\n #include \"pack-objects.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"string-list.h\"\n \n struct commit;\ndiff --git a/path.c b/path.c\nindex 3a3a66155a..4afd1e3ffa 100644\n--- a/path.c\n+++ b/path.c\n@@ -9,7 +9,7 @@\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"dir.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"setup.h\"\n #include \"submodule-config.h\"\n #include \"path.h\"\ndiff --git a/pretty.c b/pretty.c\nindex 461e8cd527..4575f3fde6 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -17,7 +17,7 @@\n #include \"log-tree.h\"\n #include \"notes.h\"\n #include \"color.h\"\n-#include \"reflog-walk.h\"\n+#include \"refs/reflog-walk.h\"\n #include \"gpg-interface.h\"\n #include \"trailer.h\"\n #include \"run-command.h\"\ndiff --git a/pseudo-merge.c b/pseudo-merge.c\nindex 0809a2bcb3..f87fd46b46 100644\n--- a/pseudo-merge.c\n+++ b/pseudo-merge.c\n@@ -8,7 +8,7 @@\n #include \"strbuf.h\"\n #include \"config.h\"\n #include \"string-list.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"pack-bitmap.h\"\n #include \"odb/commit.h\"\n #include \"odb/alloc.h\"\ndiff --git a/reachable.c b/reachable.c\nindex 2a62adf7f5..a99699c6d8 100644\n--- a/reachable.c\n+++ b/reachable.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/commit.h\"\n #include \"odb/blob.h\"\n #include \"diff.h\"\n@@ -13,7 +13,7 @@\n #include \"progress.h\"\n #include \"list-objects.h\"\n #include \"packfile.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"odb/object-file.h\"\n #include \"pack-bitmap.h\"\n #include \"pack-mtimes.h\"\ndiff --git a/read-cache.c b/read-cache.c\nindex 8f6b812b5f..148a93f10e 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -16,7 +16,7 @@\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n #include \"cache-tree.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"dir.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex ef7532e727..35acc13ccc 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -9,7 +9,7 @@\n #include \"odb/hash.h\"\n #include \"../hex.h\"\n #include \"odb/fsck.h\"\n-#include \"../refs.h\"\n+#include \"refs/refs.h\"\n #include \"../repo-settings.h\"\n #include \"refs-internal.h\"\n #include \"ref-cache.h\"\n@@ -22,7 +22,7 @@\n #include \"../dir.h\"\n #include \"../chdir-notify.h\"\n #include \"../setup.h\"\n-#include \"../worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"../wrapper.h\"\n #include \"../write-or-die.h\"\n #include \"../revision.h\"\ndiff --git a/refs/iterator.c b/refs/iterator.c\nindex d5cacde51b..08c80ee818 100644\n--- a/refs/iterator.c\n+++ b/refs/iterator.c\n@@ -6,7 +6,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"refs/refs-internal.h\"\n #include \"iterator.h\"\n \ndiff --git a/ls-refs.c b/refs/ls-refs.c\nsimilarity index 99%\nrename from ls-refs.c\nrename to refs/ls-refs.c\nindex e29ef0947f..75b9b5e620 100644\n--- a/ls-refs.c\n+++ b/refs/ls-refs.c\n@@ -6,9 +6,9 @@\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"strvec.h\"\n-#include \"ls-refs.h\"\n+#include \"refs/ls-refs.h\"\n #include \"pkt-line.h\"\n #include \"config.h\"\n #include \"string-list.h\"\ndiff --git a/ls-refs.h b/refs/ls-refs.h\nsimilarity index 100%\nrename from ls-refs.h\nrename to refs/ls-refs.h\ndiff --git a/pack-refs.c b/refs/pack-refs.c\nsimilarity index 97%\nrename from pack-refs.c\nrename to refs/pack-refs.c\nindex eb6b2ba2c2..c9f36872cc 100644\n--- a/pack-refs.c\n+++ b/refs/pack-refs.c\n@@ -1,9 +1,9 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"environment.h\"\n-#include \"pack-refs.h\"\n+#include \"refs/pack-refs.h\"\n #include \"parse-options.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n \n int pack_refs_core(int argc,\ndiff --git a/pack-refs.h b/refs/pack-refs.h\nsimilarity index 100%\nrename from pack-refs.h\nrename to refs/pack-refs.h\ndiff --git a/refs/packed-backend.c b/refs/packed-backend.c\nindex c7005a9ecc..afcb800a5f 100644\n--- a/refs/packed-backend.c\n+++ b/refs/packed-backend.c\n@@ -7,14 +7,14 @@\n #include \"../gettext.h\"\n #include \"odb/hash.h\"\n #include \"../hex.h\"\n-#include \"../refs.h\"\n+#include \"refs/refs.h\"\n #include \"refs-internal.h\"\n #include \"packed-backend.h\"\n #include \"../iterator.h\"\n #include \"../lockfile.h\"\n #include \"../chdir-notify.h\"\n #include \"../statinfo.h\"\n-#include \"../worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"../wrapper.h\"\n #include \"../write-or-die.h\"\n #include \"../trace2.h\"\ndiff --git a/refs/ref-cache.c b/refs/ref-cache.c\nindex a4182ea57f..3599199b8e 100644\n--- a/refs/ref-cache.c\n+++ b/refs/ref-cache.c\n@@ -1,6 +1,6 @@\n #include \"../git-compat-util.h\"\n #include \"odb/hash.h\"\n-#include \"../refs.h\"\n+#include \"refs/refs.h\"\n #include \"../repository.h\"\n #include \"refs-internal.h\"\n #include \"ref-cache.h\"\ndiff --git a/ref-filter.c b/refs/ref-filter.c\nsimilarity index 99%\nrename from ref-filter.c\nrename to refs/ref-filter.c\nindex 8a3d056577..e3de16b7a7 100644\n--- a/ref-filter.c\n+++ b/refs/ref-filter.c\n@@ -9,7 +9,7 @@\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"run-command.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"wildmatch.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n@@ -23,7 +23,7 @@\n #include \"color.h\"\n #include \"odb/tag.h\"\n #include \"quote.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n #include \"revision.h\"\n #include \"utf8.h\"\n #include \"versioncmp.h\"\n@@ -31,7 +31,7 @@\n #include \"wt-status.h\"\n #include \"odb/commit-slab.h\"\n #include \"commit-reach.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"hashmap.h\"\n \n static struct ref_msg {\ndiff --git a/ref-filter.h b/refs/ref-filter.h\nsimilarity index 100%\nrename from ref-filter.h\nrename to refs/ref-filter.h\ndiff --git a/reflog-walk.c b/refs/reflog-walk.c\nsimilarity index 99%\nrename from reflog-walk.c\nrename to refs/reflog-walk.c\nindex 4058cfa6df..711b71be66 100644\n--- a/reflog-walk.c\n+++ b/refs/reflog-walk.c\n@@ -2,12 +2,12 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"diff.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n #include \"string-list.h\"\n-#include \"reflog-walk.h\"\n+#include \"refs/reflog-walk.h\"\n \n struct complete_reflogs {\n \tchar *ref;\ndiff --git a/reflog-walk.h b/refs/reflog-walk.h\nsimilarity index 100%\nrename from reflog-walk.h\nrename to refs/reflog-walk.h\ndiff --git a/reflog.c b/refs/reflog.c\nsimilarity index 99%\nrename from reflog.c\nrename to refs/reflog.c\nindex 178ef7fe44..751485f885 100644\n--- a/reflog.c\n+++ b/refs/reflog.c\n@@ -7,8 +7,8 @@\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"odb/odb.h\"\n-#include \"reflog.h\"\n-#include \"refs.h\"\n+#include \"refs/reflog.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\ndiff --git a/reflog.h b/refs/reflog.h\nsimilarity index 99%\nrename from reflog.h\nrename to refs/reflog.h\nindex b996712c00..ef39b0fcc5 100644\n--- a/reflog.h\n+++ b/refs/reflog.h\n@@ -1,6 +1,6 @@\n #ifndef REFLOG_H\n #define REFLOG_H\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n \n #define REFLOG_EXPIRE_TOTAL   (1 << 0)\n #define REFLOG_EXPIRE_UNREACH (1 << 1)\ndiff --git a/refs/refs-internal.h b/refs/refs-internal.h\nindex c3ac7b556f..51be5be0fb 100644\n--- a/refs/refs-internal.h\n+++ b/refs/refs-internal.h\n@@ -1,7 +1,7 @@\n #ifndef REFS_REFS_INTERNAL_H\n #define REFS_REFS_INTERNAL_H\n \n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"iterator.h\"\n #include \"string-list.h\"\n \ndiff --git a/refs.c b/refs/refs.c\nsimilarity index 99%\nrename from refs.c\nrename to refs/refs.c\nindex e01163be2a..2bc9c3cecd 100644\n--- a/refs.c\n+++ b/refs/refs.c\n@@ -12,7 +12,7 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"iterator.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"refs/refs-internal.h\"\n #include \"hook.h\"\n #include \"odb/object-name.h\"\n@@ -20,7 +20,7 @@\n #include \"odb/object.h\"\n #include \"path.h\"\n #include \"submodule.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"strvec.h\"\n #include \"repo-settings.h\"\n #include \"setup.h\"\ndiff --git a/refs.h b/refs/refs.h\nsimilarity index 100%\nrename from refs.h\nrename to refs/refs.h\ndiff --git a/refspec.c b/refs/refspec.c\nsimilarity index 99%\nrename from refspec.c\nrename to refs/refspec.c\nindex f3cb1b0748..324c274bff 100644\n--- a/refspec.c\n+++ b/refs/refspec.c\n@@ -6,8 +6,8 @@\n #include \"hex.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"remote.h\"\n #include \"strbuf.h\"\n \ndiff --git a/refspec.h b/refs/refspec.h\nsimilarity index 100%\nrename from refspec.h\nrename to refs/refspec.h\ndiff --git a/refs/reftable-backend.c b/refs/reftable-backend.c\nindex 9d6194c4e6..120f9c947f 100644\n--- a/refs/reftable-backend.c\n+++ b/refs/reftable-backend.c\n@@ -12,7 +12,7 @@\n #include \"../iterator.h\"\n #include \"../parse.h\"\n #include \"../path.h\"\n-#include \"../refs.h\"\n+#include \"refs/refs.h\"\n #include \"../reftable/reftable-basics.h\"\n #include \"../reftable/reftable-error.h\"\n #include \"../reftable/reftable-fsck.h\"\n@@ -23,7 +23,7 @@\n #include \"../setup.h\"\n #include \"../strmap.h\"\n #include \"../trace2.h\"\n-#include \"../worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"../write-or-die.h\"\n #include \"refs-internal.h\"\n \ndiff --git a/worktree.c b/refs/worktree.c\nsimilarity index 99%\nrename from worktree.c\nrename to refs/worktree.c\nindex cbf95328a3..3578229534 100644\n--- a/worktree.c\n+++ b/refs/worktree.c\n@@ -6,10 +6,10 @@\n #include \"gettext.h\"\n #include \"path.h\"\n #include \"repository.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"dir.h\"\n #include \"wt-status.h\"\n #include \"config.h\"\ndiff --git a/worktree.h b/refs/worktree.h\nsimilarity index 99%\nrename from worktree.h\nrename to refs/worktree.h\nindex fbb2757f5b..11cdc5f7fc 100644\n--- a/worktree.h\n+++ b/refs/worktree.h\n@@ -1,7 +1,7 @@\n #ifndef WORKTREE_H\n #define WORKTREE_H\n \n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n \n struct strbuf;\n \ndiff --git a/remote.c b/remote.c\nindex 89dc91429a..39e9f58cba 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -10,8 +10,8 @@\n #include \"remote.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\ndiff --git a/remote.h b/remote.h\nindex fbf552cc2f..e094082e03 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -3,7 +3,7 @@\n \n #include \"odb/hash.h\"\n #include \"hashmap.h\"\n-#include \"refspec.h\"\n+#include \"refs/refspec.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n \ndiff --git a/repack-midx.c b/repack-midx.c\nindex a9df431952..342deb798c 100644\n--- a/repack-midx.c\n+++ b/repack-midx.c\n@@ -8,7 +8,7 @@\n #include \"odb/oidset.h\"\n #include \"pack-bitmap.h\"\n #include \"path.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"run-command.h\"\n #include \"tempfile.h\"\n #include \"trace2.h\"\ndiff --git a/replay.c b/replay.c\nindex 9e29f29ff6..8dd7b99502 100644\n--- a/replay.c\n+++ b/replay.c\n@@ -5,7 +5,7 @@\n #include \"hex.h\"\n #include \"merge-ort.h\"\n #include \"odb/object-name.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"replay.h\"\n #include \"revision.h\"\n #include \"sequencer.h\"\ndiff --git a/repository.c b/repository.c\nindex 72434e3a50..b5e442f9f3 100644\n--- a/repository.c\n+++ b/repository.c\n@@ -17,7 +17,7 @@\n #include \"sparse-index.h\"\n #include \"trace2.h\"\n #include \"promisor-remote.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n \n /*\n  * We do not define `USE_THE_REPOSITORY_VARIABLE` in this file because we do\ndiff --git a/reset.c b/reset.c\nindex 950d45d07d..29bbeaa9d4 100644\n--- a/reset.c\n+++ b/reset.c\n@@ -4,7 +4,7 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"odb/object-name.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"reset.h\"\n #include \"odb/tree-walk.h\"\n #include \"odb/tree.h\"\ndiff --git a/revision.c b/revision.c\nindex 9e90f909da..35a1893436 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -16,12 +16,12 @@\n #include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"repository.h\"\n #include \"graph.h\"\n #include \"grep.h\"\n-#include \"reflog-walk.h\"\n+#include \"refs/reflog-walk.h\"\n #include \"patch-ids.h\"\n #include \"decorate.h\"\n #include \"string-list.h\"\n@@ -32,7 +32,7 @@\n #include \"cache-tree.h\"\n #include \"bisect.h\"\n #include \"packfile.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"path.h\"\n #include \"read-cache.h\"\n #include \"setup.h\"\ndiff --git a/scalar.c b/scalar.c\nindex a80d8ee3ff..af3456b5d0 100644\n--- a/scalar.c\n+++ b/scalar.c\n@@ -13,7 +13,7 @@\n #include \"simple-ipc.h\"\n #include \"fsmonitor-ipc.h\"\n #include \"fsmonitor-settings.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"dir.h\"\n #include \"packfile.h\"\n #include \"help.h\"\ndiff --git a/sequencer.c b/sequencer.c\nindex 67ab3cdf0d..d13721ab1f 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -29,7 +29,7 @@\n #include \"merge.h\"\n #include \"merge-ort.h\"\n #include \"merge-ort-wrappers.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"sparse-index.h\"\n #include \"strvec.h\"\n #include \"quote.h\"\ndiff --git a/serve.c b/serve.c\nindex 95cf3d8ea4..df3086fb3a 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -4,7 +4,7 @@\n #include \"odb/hash.h\"\n #include \"pkt-line.h\"\n #include \"version.h\"\n-#include \"ls-refs.h\"\n+#include \"refs/ls-refs.h\"\n #include \"protocol-caps.h\"\n #include \"serve.h\"\n #include \"upload-pack.h\"\ndiff --git a/server-info.c b/server-info.c\nindex 75ead482e1..3021ee8926 100644\n--- a/server-info.c\n+++ b/server-info.c\n@@ -4,7 +4,7 @@\n #include \"dir.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\ndiff --git a/setup.c b/setup.c\nindex fe8e9ffdc5..925a600dba 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -9,7 +9,7 @@\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"config.h\"\n #include \"dir.h\"\n@@ -22,7 +22,7 @@\n #include \"quote.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n \n enum allowed_bare_repo {\n \tALLOWED_BARE_REPO_EXPLICIT = 0,\ndiff --git a/setup.h b/setup.h\nindex 763fd384e8..7bfc5ce068 100644\n--- a/setup.h\n+++ b/setup.h\n@@ -1,7 +1,7 @@\n #ifndef SETUP_H\n #define SETUP_H\n \n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"string-list.h\"\n \n int is_inside_git_dir(struct repository *repo);\ndiff --git a/shallow.c b/shallow.c\nindex 25116d7a6e..daa6db8e0d 100644\n--- a/shallow.c\n+++ b/shallow.c\n@@ -9,7 +9,7 @@\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"pkt-line.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"diff.h\"\ndiff --git a/submodule.c b/submodule.c\nindex d091b484a4..32af65e6b8 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -16,14 +16,14 @@\n #include \"revision.h\"\n #include \"run-command.h\"\n #include \"diffcore.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"string-list.h\"\n #include \"odb/oid-array.h\"\n #include \"strvec.h\"\n #include \"thread-utils.h\"\n #include \"path.h\"\n #include \"remote.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"parse-options.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\ndiff --git a/t/helper/test-reach.c b/t/helper/test-reach.c\nindex 4151cfbe25..df1c677b9f 100644\n--- a/t/helper/test-reach.c\n+++ b/t/helper/test-reach.c\n@@ -6,7 +6,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n-#include \"ref-filter.h\"\n+#include \"refs/ref-filter.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n #include \"odb/tag.h\"\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex 1fbdc52fc5..8c2fb0aad7 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -2,9 +2,9 @@\n \n #include \"test-tool.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"setup.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\n #include \"repository.h\"\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 59f61f23c6..55bd9291db 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -15,8 +15,8 @@\n #include \"thread-utils.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"transport-internal.h\"\n #include \"protocol.h\"\n #include \"packfile.h\"\ndiff --git a/transport.c b/transport.c\nindex 5b83cf9e73..38915e5466 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -15,8 +15,8 @@\n #include \"send-pack.h\"\n #include \"bundle.h\"\n #include \"gettext.h\"\n-#include \"refs.h\"\n-#include \"refspec.h\"\n+#include \"refs/refs.h\"\n+#include \"refs/refspec.h\"\n #include \"branch.h\"\n #include \"url.h\"\n #include \"submodule.h\"\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex d6e05207a8..b911700d74 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -16,7 +16,7 @@\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n #include \"progress.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"attr.h\"\n #include \"read-cache.h\"\n #include \"split-index.h\"\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 5c12af2219..80d2c95c9b 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -6,7 +6,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"pkt-line.h\"\n #include \"sideband.h\"\n #include \"repository.h\"\ndiff --git a/walker.c b/walker.c\nindex 876865d20a..83f980c1f3 100644\n--- a/walker.c\n+++ b/walker.c\n@@ -12,7 +12,7 @@\n #include \"odb/tree-walk.h\"\n #include \"odb/tag.h\"\n #include \"odb/blob.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"progress.h\"\n #include \"prio-queue.h\"\n \ndiff --git a/wt-status.c b/wt-status.c\nindex 950ebc3418..708366b973 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -21,7 +21,7 @@\n #include \"run-command.h\"\n #include \"strvec.h\"\n #include \"remote.h\"\n-#include \"refs.h\"\n+#include \"refs/refs.h\"\n #include \"submodule.h\"\n #include \"column.h\"\n #include \"read-cache.h\"\n@@ -31,7 +31,7 @@\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n #include \"utf8.h\"\n-#include \"worktree.h\"\n+#include \"refs/worktree.h\"\n #include \"lockfile.h\"\n #include \"sequencer.h\"\n #include \"fsmonitor-settings.h\"\n-- \n2.54.0\n\n"},{"id":"551093","messageId":"20260823171915.2662373-8-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 07/14] odb: gather the odb sources under odb/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:51Z","receivedAt":"2026-08-23T17:19:32Z","isPatch":true,"body":"Move the 23 odb C sources and 26 headers into odb/ as renames. Repoint\nevery reference to their old paths to the new ones: the #include lines\nacross the tree, the Makefile and meson.build build entries, the\nDocumentation/Makefile argument, and the tutorial #include examples.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                  | 98 +++++++++----------\n Documentation/Makefile                        |  4 +-\n Documentation/MyFirstContribution.adoc        |  2 +-\n Documentation/MyFirstObjectWalk.adoc          |  2 +-\n Makefile                                      | 46 ++++-----\n add-interactive.c                             |  4 +-\n add-patch.c                                   |  4 +-\n apply.c                                       |  6 +-\n apply.h                                       |  2 +-\n archive-tar.c                                 |  2 +-\n archive-zip.c                                 |  2 +-\n archive.c                                     | 10 +-\n attr.c                                        |  6 +-\n bisect.c                                      | 10 +-\n blame.c                                       | 10 +-\n blame.h                                       |  2 +-\n bloom.c                                       |  8 +-\n branch.c                                      |  4 +-\n builtin/add.c                                 |  4 +-\n builtin/am.c                                  |  4 +-\n builtin/apply.c                               |  2 +-\n builtin/backfill.c                            | 14 +--\n builtin/bisect.c                              |  4 +-\n builtin/blame.c                               |  8 +-\n builtin/branch.c                              |  4 +-\n builtin/cat-file.c                            | 10 +-\n builtin/check-attr.c                          |  2 +-\n builtin/checkout.c                            | 12 +--\n builtin/clone.c                               |  8 +-\n builtin/commit-graph.c                        |  8 +-\n builtin/commit-tree.c                         |  6 +-\n builtin/commit.c                              |  4 +-\n builtin/count-objects.c                       |  2 +-\n builtin/describe.c                            | 12 +--\n builtin/diff-files.c                          |  2 +-\n builtin/diff-index.c                          |  2 +-\n builtin/diff-pairs.c                          |  4 +-\n builtin/diff-tree.c                           |  6 +-\n builtin/diff.c                                |  8 +-\n builtin/difftool.c                            |  4 +-\n builtin/fast-export.c                         | 12 +--\n builtin/fast-import.c                         | 14 +--\n builtin/fetch-pack.c                          |  4 +-\n builtin/fetch.c                               | 10 +-\n builtin/for-each-ref.c                        |  4 +-\n builtin/fsck.c                                | 18 ++--\n builtin/gc.c                                  |  6 +-\n builtin/get-tar-commit-id.c                   |  2 +-\n builtin/grep.c                                | 12 +--\n builtin/hash-object.c                         |  6 +-\n builtin/history.c                             |  8 +-\n builtin/index-pack.c                          | 22 ++---\n builtin/last-modified.c                       |  8 +-\n builtin/log.c                                 | 18 ++--\n builtin/ls-files.c                            |  4 +-\n builtin/ls-tree.c                             |  6 +-\n builtin/merge-base.c                          |  4 +-\n builtin/merge-file.c                          |  6 +-\n builtin/merge-recursive.c                     |  4 +-\n builtin/merge-tree.c                          | 12 +--\n builtin/merge.c                               |  6 +-\n builtin/mktag.c                               |  8 +-\n builtin/mktree.c                              |  6 +-\n builtin/multi-pack-index.c                    |  4 +-\n builtin/mv.c                                  |  2 +-\n builtin/name-rev.c                            | 10 +-\n builtin/notes.c                               |  6 +-\n builtin/pack-objects.c                        | 22 ++---\n builtin/pack-redundant.c                      |  2 +-\n builtin/patch-id.c                            |  2 +-\n builtin/prune.c                               | 10 +-\n builtin/pull.c                                |  4 +-\n builtin/range-diff.c                          |  2 +-\n builtin/read-tree.c                           |  8 +-\n builtin/rebase.c                              |  6 +-\n builtin/receive-pack.c                        | 16 +--\n builtin/reflog.c                              |  2 +-\n builtin/refs.c                                |  2 +-\n builtin/remote.c                              |  2 +-\n builtin/replace.c                             | 10 +-\n builtin/replay.c                              |  2 +-\n builtin/repo.c                                | 10 +-\n builtin/reset.c                               |  8 +-\n builtin/rev-list.c                            | 14 +--\n builtin/rev-parse.c                           |  8 +-\n builtin/rm.c                                  |  6 +-\n builtin/send-pack.c                           |  2 +-\n builtin/shortlog.c                            |  2 +-\n builtin/show-branch.c                         |  6 +-\n builtin/show-index.c                          |  2 +-\n builtin/show-ref.c                            |  6 +-\n builtin/sparse-checkout.c                     |  4 +-\n builtin/stash.c                               |  8 +-\n builtin/submodule--helper.c                   |  6 +-\n builtin/tag.c                                 | 12 +--\n builtin/unpack-file.c                         |  6 +-\n builtin/unpack-objects.c                      | 12 +--\n builtin/update-index.c                        |  8 +-\n builtin/update-ref.c                          |  4 +-\n builtin/upload-pack.c                         |  4 +-\n builtin/verify-commit.c                       |  4 +-\n builtin/verify-tag.c                          |  4 +-\n builtin/worktree.c                            |  4 +-\n builtin/write-tree.c                          |  2 +-\n bundle-uri.c                                  |  2 +-\n bundle.c                                      |  6 +-\n cache-tree.c                                  | 10 +-\n cache-tree.h                                  |  4 +-\n checkout.c                                    |  2 +-\n checkout.h                                    |  2 +-\n chunk-format.c                                |  2 +-\n chunk-format.h                                |  2 +-\n combine-diff.c                                | 10 +-\n commit-graph.c                                | 18 ++--\n commit-graph.h                                |  4 +-\n commit-reach.c                                |  4 +-\n commit-reach.h                                |  4 +-\n common-init.c                                 |  4 +-\n compat/mingw.c                                |  2 +-\n compat/sha1-chunked.c                         |  2 +-\n config.c                                      |  4 +-\n connect.c                                     |  2 +-\n connected.c                                   |  2 +-\n convert.c                                     |  2 +-\n convert.h                                     |  2 +-\n csum-file.c                                   |  2 +-\n csum-file.h                                   |  2 +-\n decorate.c                                    |  2 +-\n delta-islands.c                               | 12 +--\n diagnose.c                                    |  2 +-\n diff-lib.c                                    |  6 +-\n diff-no-index.c                               |  2 +-\n diff.c                                        | 10 +-\n diff.h                                        |  2 +-\n diffcore-break.c                              |  4 +-\n diffcore-pickaxe.c                            |  2 +-\n diffcore-rename.c                             |  4 +-\n diffcore.h                                    |  2 +-\n dir.c                                         |  4 +-\n dir.h                                         |  2 +-\n entry.c                                       |  2 +-\n environment.c                                 |  4 +-\n fetch-object-info.c                           |  4 +-\n fetch-pack.c                                  | 14 +--\n fetch-pack.h                                  |  2 +-\n fmt-merge-msg.c                               |  6 +-\n fsmonitor.h                                   |  2 +-\n git.c                                         |  4 +-\n gpg-interface.c                               |  2 +-\n graph.c                                       |  2 +-\n grep.c                                        |  2 +-\n help.c                                        |  2 +-\n hex.c                                         |  2 +-\n hex.h                                         |  2 +-\n http-backend.c                                |  6 +-\n http-push.c                                   | 14 +--\n http-walker.c                                 |  4 +-\n http.c                                        |  4 +-\n khash.h                                       |  2 +-\n line-log.c                                    |  8 +-\n list-objects-filter-options.h                 |  2 +-\n list-objects-filter.c                         | 10 +-\n list-objects.c                                | 12 +--\n log-tree.c                                    | 16 +--\n ls-refs.c                                     |  2 +-\n mailmap.c                                     |  4 +-\n merge-blobs.c                                 |  4 +-\n merge-ort-wrappers.c                          |  8 +-\n merge-ort.c                                   | 16 +--\n merge-ort.h                                   |  2 +-\n merge.c                                       |  8 +-\n meson.build                                   | 46 ++++-----\n midx-write.c                                  |  4 +-\n midx.c                                        |  2 +-\n name-hash.c                                   |  2 +-\n negotiator/default.c                          |  4 +-\n negotiator/skipping.c                         |  4 +-\n notes-cache.c                                 |  6 +-\n notes-merge.c                                 |  8 +-\n notes-utils.c                                 |  2 +-\n notes.c                                       |  8 +-\n alloc.c => odb/alloc.c                        | 12 +--\n alloc.h => odb/alloc.h                        |  0\n blob.c => odb/blob.c                          |  4 +-\n blob.h => odb/blob.h                          |  2 +-\n cbtree.c => odb/cbtree.c                      |  2 +-\n cbtree.h => odb/cbtree.h                      |  0\n commit-slab-decl.h => odb/commit-slab-decl.h  |  0\n commit-slab-impl.h => odb/commit-slab-impl.h  |  0\n commit-slab.h => odb/commit-slab.h            |  4 +-\n commit.c => odb/commit.c                      | 20 ++--\n commit.h => odb/commit.h                      |  2 +-\n fsck.c => odb/fsck.c                          | 18 ++--\n fsck.h => odb/fsck.h                          |  4 +-\n hash-lookup.c => odb/hash-lookup.c            |  4 +-\n hash-lookup.h => odb/hash-lookup.h            |  0\n hash.c => odb/hash.c                          |  2 +-\n hash.h => odb/hash.h                          |  0\n loose.c => odb/loose.c                        | 10 +-\n loose.h => odb/loose.h                        |  0\n match-trees.c => odb/match-trees.c            | 10 +-\n match-trees.h => odb/match-trees.h            |  0\n .../object-file-convert.c                     | 10 +-\n .../object-file-convert.h                     |  2 +-\n object-file.c => odb/object-file.c            | 12 +--\n object-file.h => odb/object-file.h            |  4 +-\n object-name.c => odb/object-name.c            | 16 +--\n object-name.h => odb/object-name.h            |  2 +-\n object.c => odb/object.c                      | 16 +--\n object.h => odb/object.h                      |  2 +-\n odb.c => odb/odb.c                            | 14 +--\n odb.h => odb/odb.h                            |  6 +-\n oid-array.c => odb/oid-array.c                |  4 +-\n oid-array.h => odb/oid-array.h                |  2 +-\n oidmap.c => odb/oidmap.c                      |  4 +-\n oidmap.h => odb/oidmap.h                      |  2 +-\n oidset.c => odb/oidset.c                      |  2 +-\n oidset.h => odb/oidset.h                      |  0\n oidtree.c => odb/oidtree.c                    |  4 +-\n oidtree.h => odb/oidtree.h                    |  4 +-\n replace-object.c => odb/replace-object.c      |  8 +-\n replace-object.h => odb/replace-object.h      |  4 +-\n odb/source-files.c                            |  8 +-\n odb/source-inmemory.c                         |  6 +-\n odb/source-loose.c                            | 10 +-\n odb/source.c                                  |  2 +-\n odb/source.h                                  |  4 +-\n odb/streaming.c                               |  4 +-\n odb/streaming.h                               |  4 +-\n tag.c => odb/tag.c                            | 14 +--\n tag.h => odb/tag.h                            |  2 +-\n tmp-objdir.c => odb/tmp-objdir.c              |  6 +-\n tmp-objdir.h => odb/tmp-objdir.h              |  0\n odb/transaction.h                             |  2 +-\n tree-walk.c => odb/tree-walk.c                |  8 +-\n tree-walk.h => odb/tree-walk.h                |  2 +-\n tree.c => odb/tree.c                          | 12 +--\n tree.h => odb/tree.h                          |  2 +-\n oss-fuzz/fuzz-pack-idx.c                      |  2 +-\n pack-bitmap-write.c                           | 14 +--\n pack-bitmap.c                                 |  6 +-\n pack-check.c                                  |  4 +-\n pack-mtimes.c                                 |  2 +-\n pack-objects.c                                |  2 +-\n pack-objects.h                                |  2 +-\n pack-revindex.c                               |  2 +-\n pack-write.c                                  |  2 +-\n pack.h                                        |  2 +-\n packfile.c                                    | 16 +--\n packfile.h                                    |  6 +-\n parallel-checkout.c                           |  2 +-\n parse-options-cb.c                            |  6 +-\n patch-ids.c                                   |  4 +-\n path-walk.c                                   | 18 ++--\n path-walk.h                                   |  2 +-\n path.c                                        |  2 +-\n pretty.c                                      |  6 +-\n promisor-remote.c                             |  2 +-\n protocol-caps.c                               |  6 +-\n prune-packed.c                                |  2 +-\n pseudo-merge.c                                |  6 +-\n range-diff.c                                  |  4 +-\n reachable.c                                   |  6 +-\n read-cache-ll.h                               |  2 +-\n read-cache.c                                  | 12 +--\n read-cache.h                                  |  2 +-\n rebase-interactive.c                          |  6 +-\n ref-filter.c                                  | 12 +--\n ref-filter.h                                  |  4 +-\n reflog-walk.c                                 |  2 +-\n reflog.c                                      |  6 +-\n refs.c                                        | 10 +-\n refs.h                                        |  4 +-\n refs/files-backend.c                          |  4 +-\n refs/packed-backend.c                         |  4 +-\n refs/ref-cache.c                              |  2 +-\n refs/ref-cache.h                              |  2 +-\n refs/reftable-backend.c                       |  4 +-\n refspec.c                                     |  2 +-\n remote-curl.c                                 |  2 +-\n remote.c                                      |  6 +-\n remote.h                                      |  2 +-\n repack-midx.c                                 |  6 +-\n repack.c                                      |  2 +-\n replay.c                                      |  4 +-\n replay.h                                      |  2 +-\n repository.c                                  |  6 +-\n rerere.c                                      |  4 +-\n reset.c                                       |  6 +-\n reset.h                                       |  2 +-\n resolve-undo.c                                |  2 +-\n resolve-undo.h                                |  2 +-\n revision.c                                    | 18 ++--\n revision.h                                    |  8 +-\n send-pack.c                                   |  6 +-\n sequencer.c                                   | 16 +--\n serve.c                                       |  2 +-\n server-info.c                                 | 10 +-\n setup.c                                       |  4 +-\n shallow.c                                     | 10 +-\n shallow.h                                     |  4 +-\n sparse-index.c                                |  2 +-\n split-index.c                                 |  2 +-\n split-index.h                                 |  2 +-\n submodule-config.c                            |  6 +-\n submodule-config.h                            |  2 +-\n submodule.c                                   | 10 +-\n t/helper/test-bitmap.c                        |  2 +-\n t/helper/test-bloom.c                         |  2 +-\n t/helper/test-cache-tree.c                    |  2 +-\n t/helper/test-dump-cache-tree.c               |  4 +-\n t/helper/test-find-pack.c                     |  4 +-\n t/helper/test-hash-speed.c                    |  2 +-\n t/helper/test-match-trees.c                   |  6 +-\n t/helper/test-pack-deltas.c                   |  2 +-\n t/helper/test-pack-mtimes.c                   |  2 +-\n t/helper/test-partial-clone.c                 |  2 +-\n t/helper/test-path-walk.c                     |  6 +-\n t/helper/test-reach.c                         |  6 +-\n t/helper/test-read-graph.c                    |  2 +-\n t/helper/test-read-midx.c                     |  2 +-\n t/helper/test-ref-store.c                     |  2 +-\n t/helper/test-reftable.c                      |  2 +-\n t/helper/test-repository.c                    |  6 +-\n t/helper/test-revision-walking.c              |  4 +-\n t/helper/test-scrap-cache-tree.c              |  2 +-\n t/helper/test-sha1.c                          |  2 +-\n t/helper/test-sha256.c                        |  2 +-\n t/helper/test-submodule-config.c              |  4 +-\n t/helper/test-synthesize.c                    |  6 +-\n t/unit-tests/lib-oid.h                        |  2 +-\n t/unit-tests/u-example-decorate.c             |  2 +-\n t/unit-tests/u-odb-inmemory.c                 |  4 +-\n t/unit-tests/u-oid-array.c                    |  2 +-\n t/unit-tests/u-oidmap.c                       |  4 +-\n t/unit-tests/u-oidtree.c                      |  4 +-\n trailer.c                                     |  2 +-\n transport-helper.c                            |  4 +-\n transport.c                                   |  4 +-\n tree-diff.c                                   |  6 +-\n unpack-trees.c                                |  6 +-\n unpack-trees.h                                |  2 +-\n upload-pack.c                                 |  8 +-\n walker.c                                      | 12 +--\n wt-status.c                                   | 10 +-\n xdiff-interface.c                             |  2 +-\n xdiff-interface.h                             |  2 +-\n 347 files changed, 1006 insertions(+), 1006 deletions(-)\n rename alloc.c => odb/alloc.c (95%)\n rename alloc.h => odb/alloc.h (100%)\n rename blob.c => odb/blob.c (89%)\n rename blob.h => odb/blob.h (96%)\n rename cbtree.c => odb/cbtree.c (99%)\n rename cbtree.h => odb/cbtree.h (100%)\n rename commit-slab-decl.h => odb/commit-slab-decl.h (100%)\n rename commit-slab-impl.h => odb/commit-slab-impl.h (100%)\n rename commit-slab.h => odb/commit-slab.h (97%)\n rename commit.c => odb/commit.c (99%)\n rename commit.h => odb/commit.h (99%)\n rename fsck.c => odb/fsck.c (99%)\n rename fsck.h => odb/fsck.h (99%)\n rename hash-lookup.c => odb/hash-lookup.c (98%)\n rename hash-lookup.h => odb/hash-lookup.h (100%)\n rename hash.c => odb/hash.c (99%)\n rename hash.h => odb/hash.h (100%)\n rename loose.c => odb/loose.c (98%)\n rename loose.h => odb/loose.h (100%)\n rename match-trees.c => odb/match-trees.c (98%)\n rename match-trees.h => odb/match-trees.h (100%)\n rename object-file-convert.c => odb/object-file-convert.c (98%)\n rename object-file-convert.h => odb/object-file-convert.h (96%)\n rename object-file.c => odb/object-file.c (99%)\n rename object-file.h => odb/object-file.h (99%)\n rename object-name.c => odb/object-name.c (99%)\n rename object-name.h => odb/object-name.h (99%)\n rename object.c => odb/object.c (98%)\n rename object.h => odb/object.h (99%)\n rename odb.c => odb/odb.c (99%)\n rename odb.h => odb/odb.h (99%)\n rename oid-array.c => odb/oid-array.c (97%)\n rename oid-array.h => odb/oid-array.h (99%)\n rename oidmap.c => odb/oidmap.c (97%)\n rename oidmap.h => odb/oidmap.h (99%)\n rename oidset.c => odb/oidset.c (99%)\n rename oidset.h => odb/oidset.h (100%)\n rename oidtree.c => odb/oidtree.c (98%)\n rename oidtree.h => odb/oidtree.h (97%)\n rename replace-object.c => odb/replace-object.c (96%)\n rename replace-object.h => odb/replace-object.h (97%)\n rename tag.c => odb/tag.c (97%)\n rename tag.h => odb/tag.h (96%)\n rename tmp-objdir.c => odb/tmp-objdir.c (99%)\n rename tmp-objdir.h => odb/tmp-objdir.h (100%)\n rename tree-walk.c => odb/tree-walk.c (99%)\n rename tree-walk.h => odb/tree-walk.h (99%)\n rename tree.c => odb/tree.c (97%)\n rename tree.h => odb/tree.h (98%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex 522821522e..5da6d0b2b1 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -30,8 +30,6 @@ advice.c component=? role=lib prefix=advice includes=setup:2 cochange=transport:\n advice.h component=? role=public prefix=advice cochange=transport:14,index:9,odb:6,submodule:4,pack:3\n alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2\n alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1\n-alloc.c component=odb role=lib prefix=alloc includes=odb:6,setup:1 cochange=odb:54,revision:8,diff:6,pack:6,index:3\n-alloc.h component=odb role=header prefix=alloc cochange=odb:16,refs:1,revision:1\n apply.c component=? role=lib prefix=apply includes=index:5,setup:4,odb:3,diff:2,merge:2 cochange=index:93,setup:43,diff:41,odb:26,merge:24\n apply.h component=? role=public prefix=apply includes=odb:1 cochange=diff:2\n archive-tar.c component=archive role=lib prefix=archive-tar includes=archive:1,odb:1,setup:1 cochange=archive:59,index:12,diff:9,odb:9,transport:8\n@@ -47,8 +45,6 @@ bisect.c component=revision role=lib prefix=bisect includes=odb:5,revision:5,set\n bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2\n blame.c component=revision role=lib prefix=blame includes=odb:5,diff:2,index:2,pack:2,revision:2 cochange=diff:68,revision:66,odb:56,index:29,pack:22\n blame.h component=revision role=header prefix=blame includes=diff:1,odb:1 cochange=revision:19,odb:7,diff:4,archive:1,index:1\n-blob.c component=odb role=lib prefix=object includes=odb:2 cochange=odb:131,transport:12,pack:11,revision:10,refs:5\n-blob.h component=odb role=header prefix=blob includes=odb:1 cochange=odb:33,revision:4,pack:3,transport:2\n bloom.c component=pack role=lib prefix=bloom includes=odb:4,diff:2,pack:2,setup:2 cochange=pack:38,revision:25,diff:15,odb:6,index:2\n bloom.h component=pack role=header prefix=bloom cochange=pack:28,revision:12,odb:1\n branch.c component=? role=lib prefix=branch includes=refs:3,setup:3,odb:2,submodule:1,transport:1 cochange=refs:62,transport:41,setup:28,index:19,revision:12\n@@ -60,8 +56,6 @@ bundle.c component=transport role=lib prefix=bundle includes=odb:3,revision:3,se\n bundle.h component=transport role=header prefix=bundle includes=revision:1 cochange=transport:37,revision:5\n cache-tree.c component=index role=lib prefix=cache-tree includes=odb:5,index:2,setup:1,transport:1 cochange=index:94,odb:69,revision:27,transport:21,diff:20\n cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1\n-cbtree.c component=odb role=lib prefix=cbtree includes=odb:1 cochange=odb:9,diff:1,merge:1,pack:1\n-cbtree.h component=odb role=header prefix=cbtree cochange=odb:12,pack:3,setup:1,transport:1\n chdir-notify.c component=? role=lib prefix=chdir-notify includes=revision:1 cochange=index:2,archive:1,merge:1,revision:1\n chdir-notify.h component=? role=public prefix=chdir-notify\n checkout.c component=index role=lib prefix=checkout includes=setup:2,index:1,odb:1,refs:1,transport:1 cochange=transport:16,refs:6,setup:5,index:3,odb:2\n@@ -77,11 +71,6 @@ commit-graph.c component=pack role=lib prefix=commit-graph includes=odb:9,pack:4\n commit-graph.h component=pack role=header prefix=commit-graph includes=odb:2 cochange=pack:92,odb:14,setup:9,revision:8,transport:5\n commit-reach.c component=revision role=lib prefix=commit-reach includes=revision:3,odb:2,pack:1,refs:1 cochange=revision:38,odb:17,pack:15,transport:9,index:5\n commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3\n-commit-slab-decl.h component=odb role=header prefix=commit-slab cochange=odb:6,revision:1\n-commit-slab-impl.h component=odb role=header prefix=commit-slab cochange=odb:7,pack:3,revision:1,setup:1,transport:1\n-commit-slab.h component=odb role=header prefix=commit-slab includes=odb:2 cochange=odb:8,revision:2,transport:2,index:1,merge:1\n-commit.c component=odb role=lib prefix=commit includes=odb:10,setup:4,revision:3,diff:1,index:1 cochange=odb:403,revision:147,transport:87,pack:57,setup:45\n-commit.h component=odb role=header prefix=commit includes=odb:1 cochange=odb:237,revision:205,transport:49,pack:25,notes:22\n common-exit.c component=? role=lib prefix=common-main\n common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1\n common-init.h component=? role=public prefix=common-main\n@@ -146,8 +135,6 @@ fetch-pack.h component=transport role=header prefix=fetch-pack includes=odb:1,re\n fmt-merge-msg.c component=merge role=lib prefix=fmt-merge-msg includes=odb:3,diff:2,revision:2,setup:2,merge:1 cochange=revision:10,odb:7,index:6,diff:4,setup:4\n fmt-merge-msg.h component=merge role=header prefix=fmt-merge-msg cochange=merge:3,setup:2\n for-each-ref.h component=? role=public prefix=?\n-fsck.c component=odb role=lib prefix=fsck includes=odb:9,setup:3,convert:1,index:1,pack:1 cochange=odb:113,revision:46,transport:43,pack:20,setup:15\n-fsck.h component=odb role=header prefix=fsck includes=odb:2 cochange=odb:50,diff:5,revision:5,transport:5,refs:4\n fsmonitor--daemon.h component=index role=header prefix=fsmonitor--daemon includes=index:1 cochange=index:1\n fsmonitor-ipc.c component=index role=lib prefix=fsmonitor includes=index:1,setup:1 cochange=index:6,transport:2,merge:1,notes:1,pack:1\n fsmonitor-ipc.h component=index role=header prefix=fsmonitor cochange=index:2\n@@ -170,10 +157,6 @@ graph.c component=revision role=lib prefix=graph includes=revision:2,odb:1,setup\n graph.h component=revision role=header prefix=graph includes=diff:1 cochange=revision:19,diff:2,odb:1\n grep.c component=? role=lib prefix=grep includes=diff:4,odb:1,revision:1,setup:1 cochange=diff:40,revision:28,transport:10,index:7,refs:7\n grep.h component=? role=public prefix=grep includes=diff:1 cochange=revision:23,diff:10,transport:4,index:2,refs:2\n-hash-lookup.c component=odb role=lib prefix=hash includes=odb:2,index:1 cochange=pack:14,odb:12,diff:1,index:1,merge:1\n-hash-lookup.h component=odb role=header prefix=hash-lookup cochange=odb:10,pack:8,diff:1,merge:1,revision:1\n-hash.c component=odb role=lib prefix=hash includes=odb:1 cochange=odb:15,diff:2,setup:2,index:1,transport:1\n-hash.h component=odb role=header prefix=hash includes=setup:1 cochange=odb:32,pack:11,index:9,diff:7,transport:4\n hashmap.c component=? role=lib prefix=hashmap cochange=diff:33,revision:19,index:17,refs:13,submodule:13\n hashmap.h component=? role=public prefix=hashmap cochange=diff:39,revision:23,index:18,submodule:14,refs:13\n help.c component=? role=lib prefix=help includes=setup:4,index:1,odb:1,refs:1,transport:1 cochange=setup:19,transport:19,diff:9,index:8,odb:7\n@@ -218,16 +201,12 @@ lockfile.c component=? role=lib prefix=lockfile includes=setup:1 cochange=refs:1\n lockfile.h component=? role=public prefix=lockfile cochange=index:5,revision:4,diff:3,refs:3,odb:2\n log-tree.c component=revision role=lib prefix=format-patch includes=odb:8,revision:5,diff:3,setup:3,refs:2 cochange=revision:222,diff:112,odb:112,refs:31,transport:16\n log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2\n-loose.c component=odb role=lib prefix=loose includes=odb:5,setup:1 cochange=odb:31,pack:18,setup:7,transport:6,refs:2\n-loose.h component=odb role=header prefix=loose cochange=odb:8,setup:3\n ls-refs.c component=refs role=lib prefix=ls-refs includes=setup:3,refs:2,odb:1,transport:1 cochange=refs:26,transport:17,pack:10,revision:5,odb:4\n ls-refs.h component=refs role=header prefix=ls-refs cochange=transport:11,refs:5,submodule:1\n mailinfo.c component=? role=lib prefix=mailinfo includes=setup:2 cochange=transport:5,index:3,notes:3,odb:3,revision:3\n mailinfo.h component=? role=public prefix=mailinfo\n mailmap.c component=? role=lib prefix=mailmap includes=setup:3,odb:2 cochange=setup:13,transport:11,refs:10,index:8,revision:5\n mailmap.h component=? role=public prefix=mailmap cochange=setup:8,revision:4,transport:2,diff:1,index:1\n-match-trees.c component=odb role=lib prefix=match-trees includes=odb:5,setup:1 cochange=odb:33,index:15,notes:15,revision:12,pack:10\n-match-trees.h component=odb role=header prefix=match-trees cochange=merge:1,odb:1\n mem-pool.c component=? role=lib prefix=mem-pool cochange=index:6\n mem-pool.h component=? role=public prefix=mem-pool cochange=index:4\n merge-blobs.c component=merge role=lib prefix=object-store includes=merge:2,odb:2 cochange=merge:9,notes:3,diff:2,convert:1,odb:1\n@@ -254,24 +233,55 @@ notes-utils.c component=notes role=lib prefix=commit includes=setup:2,notes:1,od\n notes-utils.h component=notes role=header prefix=notes includes=notes:1 cochange=notes:17,odb:6\n notes.c component=notes role=lib prefix=notes includes=odb:4,setup:2,notes:1,refs:1 cochange=notes:63,odb:58,revision:41,transport:36,index:24\n notes.h component=notes role=header prefix=notes cochange=notes:55,revision:20,setup:9,odb:3,refs:2\n-object-file-convert.c component=odb role=lib prefix=object-file-convert includes=odb:5,setup:1 cochange=odb:8,setup:2,transport:1\n-object-file-convert.h component=odb role=header prefix=object-file-convert includes=odb:1 cochange=odb:4\n-object-file.c component=odb role=lib prefix=object-file includes=odb:6,index:2,pack:2,setup:2,convert:1 cochange=odb:183,pack:96,index:55,setup:30,transport:27\n-object-file.h component=odb role=header prefix=object-file includes=odb:2 cochange=odb:113,pack:30,index:12,notes:5,transport:5\n-object-name.c component=odb role=lib prefix=object-name includes=odb:8,setup:5,index:2,revision:2,pack:1 cochange=odb:46,pack:31,revision:23,setup:19,refs:18\n-object-name.h component=odb role=header prefix=object-name includes=odb:1 cochange=odb:5,revision:3,refs:2,index:1\n-object.c component=odb role=lib prefix=object includes=odb:8,index:1,pack:1 cochange=odb:265,pack:61,revision:55,transport:34,refs:17\n-object.h component=odb role=header prefix=object includes=odb:1 cochange=odb:187,revision:54,transport:41,pack:29,refs:20\n-odb.c component=odb role=lib prefix=odb includes=odb:7,pack:3,setup:3,index:1,submodule:1 cochange=odb:123,pack:64,setup:13,transport:12,index:8\n-odb.h component=odb role=header prefix=odb includes=odb:3 cochange=odb:117,pack:71,transport:16,setup:13,index:10\n-oid-array.c component=odb role=lib prefix=oid-array includes=odb:2 cochange=odb:13,pack:10,merge:2,diff:1,revision:1\n-oid-array.h component=odb role=header prefix=oid-array includes=odb:1 cochange=odb:3,diff:1,index:1,refs:1,revision:1\n-oidmap.c component=odb role=lib prefix=oidmap includes=odb:2 cochange=diff:11,revision:7,odb:6,refs:5,index:4\n-oidmap.h component=odb role=header prefix=oidmap includes=odb:1 cochange=odb:6,revision:4,index:2,transport:2,convert:1\n-oidset.c component=odb role=lib prefix=oidset includes=odb:1 cochange=odb:17,convert:2,diff:2,transport:2,index:1\n-oidset.h component=odb role=header prefix=oidset cochange=odb:17,revision:1,transport:1\n-oidtree.c component=odb role=lib prefix=oidtree includes=odb:2 cochange=odb:14,index:3,setup:2,diff:1,merge:1\n-oidtree.h component=odb role=header prefix=oidtree includes=odb:2 cochange=odb:9\n+odb/alloc.c component=odb role=lib prefix=alloc includes=odb:6,setup:1 cochange=odb:54,revision:8,diff:6,pack:6,index:3\n+odb/alloc.h component=odb role=header prefix=alloc cochange=odb:16,refs:1,revision:1\n+odb/blob.c component=odb role=lib prefix=object includes=odb:2 cochange=odb:131,transport:12,pack:11,revision:10,refs:5\n+odb/blob.h component=odb role=header prefix=blob includes=odb:1 cochange=odb:33,revision:4,pack:3,transport:2\n+odb/cbtree.c component=odb role=lib prefix=cbtree includes=odb:1 cochange=odb:9,diff:1,merge:1,pack:1\n+odb/cbtree.h component=odb role=header prefix=cbtree cochange=odb:12,pack:3,setup:1,transport:1\n+odb/commit-slab-decl.h component=odb role=header prefix=commit-slab cochange=odb:6,revision:1\n+odb/commit-slab-impl.h component=odb role=header prefix=commit-slab cochange=odb:7,pack:3,revision:1,setup:1,transport:1\n+odb/commit-slab.h component=odb role=header prefix=commit-slab includes=odb:2 cochange=odb:8,revision:2,transport:2,index:1,merge:1\n+odb/commit.c component=odb role=lib prefix=commit includes=odb:10,setup:4,revision:3,diff:1,index:1 cochange=odb:403,revision:147,transport:87,pack:57,setup:45\n+odb/commit.h component=odb role=header prefix=commit includes=odb:1 cochange=odb:237,revision:205,transport:49,pack:25,notes:22\n+odb/fsck.c component=odb role=lib prefix=fsck includes=odb:9,setup:3,convert:1,index:1,pack:1 cochange=odb:113,revision:46,transport:43,pack:20,setup:15\n+odb/fsck.h component=odb role=header prefix=fsck includes=odb:2 cochange=odb:50,diff:5,revision:5,transport:5,refs:4\n+odb/hash-lookup.c component=odb role=lib prefix=hash includes=odb:2,index:1 cochange=pack:14,odb:12,diff:1,index:1,merge:1\n+odb/hash-lookup.h component=odb role=header prefix=hash-lookup cochange=odb:10,pack:8,diff:1,merge:1,revision:1\n+odb/hash.c component=odb role=lib prefix=hash includes=odb:1 cochange=odb:15,diff:2,setup:2,index:1,transport:1\n+odb/hash.h component=odb role=header prefix=hash includes=setup:1 cochange=odb:32,pack:11,index:9,diff:7,transport:4\n+odb/loose.c component=odb role=lib prefix=loose includes=odb:5,setup:1 cochange=odb:31,pack:18,setup:7,transport:6,refs:2\n+odb/loose.h component=odb role=header prefix=loose cochange=odb:8,setup:3\n+odb/match-trees.c component=odb role=lib prefix=match-trees includes=odb:5,setup:1 cochange=odb:33,index:15,notes:15,revision:12,pack:10\n+odb/match-trees.h component=odb role=header prefix=match-trees cochange=merge:1,odb:1\n+odb/object-file-convert.c component=odb role=lib prefix=object-file-convert includes=odb:5,setup:1 cochange=odb:8,setup:2,transport:1\n+odb/object-file-convert.h component=odb role=header prefix=object-file-convert includes=odb:1 cochange=odb:4\n+odb/object-file.c component=odb role=lib prefix=object-file includes=odb:6,index:2,pack:2,setup:2,convert:1 cochange=odb:183,pack:96,index:55,setup:30,transport:27\n+odb/object-file.h component=odb role=header prefix=object-file includes=odb:2 cochange=odb:113,pack:30,index:12,notes:5,transport:5\n+odb/object-name.c component=odb role=lib prefix=object-name includes=odb:8,setup:5,index:2,revision:2,pack:1 cochange=odb:46,pack:31,revision:23,setup:19,refs:18\n+odb/object-name.h component=odb role=header prefix=object-name includes=odb:1 cochange=odb:5,revision:3,refs:2,index:1\n+odb/object.c component=odb role=lib prefix=object includes=odb:8,index:1,pack:1 cochange=odb:265,pack:61,revision:55,transport:34,refs:17\n+odb/object.h component=odb role=header prefix=object includes=odb:1 cochange=odb:187,revision:54,transport:41,pack:29,refs:20\n+odb/odb.c component=odb role=lib prefix=odb includes=odb:7,pack:3,setup:3,index:1,submodule:1 cochange=odb:123,pack:64,setup:13,transport:12,index:8\n+odb/odb.h component=odb role=header prefix=odb includes=odb:3 cochange=odb:117,pack:71,transport:16,setup:13,index:10\n+odb/oid-array.c component=odb role=lib prefix=oid-array includes=odb:2 cochange=odb:13,pack:10,merge:2,diff:1,revision:1\n+odb/oid-array.h component=odb role=header prefix=oid-array includes=odb:1 cochange=odb:3,diff:1,index:1,refs:1,revision:1\n+odb/oidmap.c component=odb role=lib prefix=oidmap includes=odb:2 cochange=diff:11,revision:7,odb:6,refs:5,index:4\n+odb/oidmap.h component=odb role=header prefix=oidmap includes=odb:1 cochange=odb:6,revision:4,index:2,transport:2,convert:1\n+odb/oidset.c component=odb role=lib prefix=oidset includes=odb:1 cochange=odb:17,convert:2,diff:2,transport:2,index:1\n+odb/oidset.h component=odb role=header prefix=oidset cochange=odb:17,revision:1,transport:1\n+odb/oidtree.c component=odb role=lib prefix=oidtree includes=odb:2 cochange=odb:14,index:3,setup:2,diff:1,merge:1\n+odb/oidtree.h component=odb role=header prefix=oidtree includes=odb:2 cochange=odb:9\n+odb/replace-object.c component=odb role=lib prefix=refs includes=odb:4,refs:1,setup:1 cochange=odb:8,setup:6,refs:5,pack:3,diff:2\n+odb/replace-object.h component=odb role=header prefix=replace-object includes=odb:2,setup:1 cochange=odb:11,setup:9,pack:4,revision:3,merge:1\n+odb/tag.c component=odb role=lib prefix=tag includes=odb:7,setup:2,pack:1 cochange=odb:189,transport:36,pack:32,revision:29,refs:14\n+odb/tag.h component=odb role=header prefix=tag includes=odb:1 cochange=odb:60,transport:10,revision:8,refs:7,pack:6\n+odb/tmp-objdir.c component=odb role=lib prefix=tmp-objdir includes=odb:3,setup:2,index:1 cochange=pack:24,odb:23,setup:8,transport:5,revision:3\n+odb/tmp-objdir.h component=odb role=header prefix=tmp-objdir cochange=odb:8,revision:3,setup:1\n+odb/tree-walk.c component=odb role=lib prefix=tree-walk includes=odb:4,index:3,setup:1 cochange=odb:70,index:61,diff:31,revision:24,pack:13\n+odb/tree-walk.h component=odb role=header prefix=tree-walk includes=odb:1 cochange=odb:64,diff:23,index:23,revision:21,notes:7\n+odb/tree.c component=odb role=lib prefix=tree includes=odb:6,setup:2 cochange=odb:212,revision:45,index:36,pack:25,transport:21\n+odb/tree.h component=odb role=header prefix=tree includes=odb:1 cochange=odb:75,revision:12,archive:8,index:6,pack:5\n pack-bitmap-write.c component=pack role=lib prefix=pack-bitmap-write includes=odb:7,pack:6,revision:2,setup:2,diff:1 cochange=pack:132,odb:32,revision:27,transport:10,diff:4\n pack-bitmap.c component=pack role=lib prefix=pack-bitmap includes=pack:7,odb:3,revision:3,setup:2,diff:1 cochange=pack:232,revision:30,odb:18,transport:14,refs:7\n pack-bitmap.h component=pack role=header prefix=pack-bitmap includes=pack:2,refs:1 cochange=pack:117,refs:5,odb:2,setup:2,revision:1\n@@ -363,8 +373,6 @@ repack-midx.c component=pack role=lib prefix=repack includes=odb:3,pack:3,refs:1\n repack-promisor.c component=pack role=lib prefix=repack-promisor includes=pack:3,setup:1 cochange=pack:8,odb:3,revision:2\n repack.c component=pack role=lib prefix=repack includes=pack:3,index:1,odb:1,setup:1 cochange=pack:31,transport:2,odb:1\n repack.h component=pack role=header prefix=repack includes=revision:1 cochange=pack:28\n-replace-object.c component=odb role=lib prefix=refs includes=odb:4,refs:1,setup:1 cochange=odb:8,setup:6,refs:5,pack:3,diff:2\n-replace-object.h component=odb role=header prefix=replace-object includes=odb:2,setup:1 cochange=odb:11,setup:9,pack:4,revision:3,merge:1\n replay.c component=? role=lib prefix=replay includes=odb:2,merge:1,refs:1,revision:1,setup:1 cochange=transport:1\n replay.h component=? role=public prefix=replay includes=odb:1\n repo-settings.c component=setup role=lib prefix=repo-settings includes=setup:4,pack:2 cochange=setup:65,pack:17,index:8,transport:8,odb:6\n@@ -428,15 +436,11 @@ submodule.c component=submodule role=lib prefix=submodule includes=odb:5,setup:4\n submodule.h component=submodule role=header prefix=submodule cochange=submodule:128,index:22,diff:21,transport:17,setup:6\n symlinks.c component=index role=lib prefix=symlinks includes=index:1,setup:1 cochange=index:23,diff:3,archive:2,convert:1,revision:1\n symlinks.h component=index role=header prefix=symlinks cochange=index:9,diff:1\n-tag.c component=odb role=lib prefix=tag includes=odb:7,setup:2,pack:1 cochange=odb:189,transport:36,pack:32,revision:29,refs:14\n-tag.h component=odb role=header prefix=tag includes=odb:1 cochange=odb:60,transport:10,revision:8,refs:7,pack:6\n tar.h component=? role=public prefix=tar-tree\n tempfile.c component=? role=lib prefix=tempfile cochange=pack:5,setup:4,index:3,odb:3,revision:3\n tempfile.h component=? role=public prefix=tempfile includes=revision:1 cochange=revision:3,diff:2,index:2,setup:2\n thread-utils.c component=? role=lib prefix=thread-utils cochange=diff:1\n thread-utils.h component=? role=public prefix=thread-utils cochange=transport:1\n-tmp-objdir.c component=odb role=lib prefix=tmp-objdir includes=odb:3,setup:2,index:1 cochange=pack:24,odb:23,setup:8,transport:5,revision:3\n-tmp-objdir.h component=odb role=header prefix=tmp-objdir cochange=odb:8,revision:3,setup:1\n trace.c component=? role=lib prefix=trace includes=setup:2 cochange=setup:26,transport:13,index:11,odb:4,diff:2\n trace.h component=? role=public prefix=trace cochange=transport:6,index:5,odb:4,pack:3,revision:3\n trace2.c component=? role=lib prefix=trace2 includes=setup:2 cochange=setup:2\n@@ -448,10 +452,6 @@ transport-internal.h component=transport role=header prefix=transport includes=t\n transport.c component=transport role=lib prefix=transport includes=transport:12,setup:3,odb:2,refs:2,submodule:1 cochange=transport:482,refs:35,setup:31,submodule:29,revision:21\n transport.h component=transport role=header prefix=transport includes=transport:2,revision:1 cochange=transport:249,submodule:6,odb:4,revision:2,diff:1\n tree-diff.c component=diff role=lib prefix=tree-diff includes=odb:3,diff:2,index:1,setup:1 cochange=diff:115,odb:56,revision:53,index:36,notes:12\n-tree-walk.c component=odb role=lib prefix=tree-walk includes=odb:4,index:3,setup:1 cochange=odb:70,index:61,diff:31,revision:24,pack:13\n-tree-walk.h component=odb role=header prefix=tree-walk includes=odb:1 cochange=odb:64,diff:23,index:23,revision:21,notes:7\n-tree.c component=odb role=lib prefix=tree includes=odb:6,setup:2 cochange=odb:212,revision:45,index:36,pack:25,transport:21\n-tree.h component=odb role=header prefix=tree includes=odb:1 cochange=odb:75,revision:12,archive:8,index:6,pack:5\n unicode-width.h component=? role=public prefix=unicode\n unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2,setup:1\n unix-socket.h component=? role=public prefix=unix-socket\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 2699f0b24a..c5b52b6e7a 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -505,10 +505,10 @@ lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)\n .PHONY: lint-docs-fsck-msgids\n LINT_DOCS_FSCK_MSGIDS = .build/lint-docs/fsck-msgids.ok\n $(LINT_DOCS_FSCK_MSGIDS): lint-fsck-msgids.perl\n-$(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.adoc\n+$(LINT_DOCS_FSCK_MSGIDS): ../odb/fsck.h fsck-msgids.adoc\n \t$(call mkdir_p_parent_template)\n \t$(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \\\n-\t\t../fsck.h fsck-msgids.adoc $@\n+\t\t../odb/fsck.h fsck-msgids.adoc $@\n lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)\n \n ## Lint: delimited sections\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex 34bfa2e3a9..4b50aaa40e 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -428,7 +428,7 @@ require a full format object to be passed.\n Add the following includes:\n \n ----\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"pretty.h\"\n #include \"strbuf.h\"\n ----\ndiff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc\nindex 413a9fdb05..87b2433b2c 100644\n--- a/Documentation/MyFirstObjectWalk.adoc\n+++ b/Documentation/MyFirstObjectWalk.adoc\n@@ -779,7 +779,7 @@ be processed in order to populate that list.\n First, add the `struct oidset` and related items we will use to iterate it:\n \n ----\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n \n ...\n \ndiff --git a/Makefile b/Makefile\nindex 86297e9459..a95b87d970 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1103,7 +1103,7 @@ LIB_OBJS += add-interactive.o\n LIB_OBJS += add-patch.o\n LIB_OBJS += advice.o\n LIB_OBJS += alias.o\n-LIB_OBJS += alloc.o\n+LIB_OBJS += odb/alloc.o\n LIB_OBJS += apply.o\n LIB_OBJS += archive-tar.o\n LIB_OBJS += archive-zip.o\n@@ -1112,13 +1112,13 @@ LIB_OBJS += attr.o\n LIB_OBJS += base85.o\n LIB_OBJS += bisect.o\n LIB_OBJS += blame.o\n-LIB_OBJS += blob.o\n+LIB_OBJS += odb/blob.o\n LIB_OBJS += bloom.o\n LIB_OBJS += branch.o\n LIB_OBJS += bundle-uri.o\n LIB_OBJS += bundle.o\n LIB_OBJS += cache-tree.o\n-LIB_OBJS += cbtree.o\n+LIB_OBJS += odb/cbtree.o\n LIB_OBJS += chdir-notify.o\n LIB_OBJS += checkout.o\n LIB_OBJS += chunk-format.o\n@@ -1127,7 +1127,7 @@ LIB_OBJS += column.o\n LIB_OBJS += combine-diff.o\n LIB_OBJS += commit-graph.o\n LIB_OBJS += commit-reach.o\n-LIB_OBJS += commit.o\n+LIB_OBJS += odb/commit.o\n LIB_OBJS += common-exit.o\n LIB_OBJS += common-init.o\n LIB_OBJS += compat/nonblock.o\n@@ -1172,7 +1172,7 @@ LIB_OBJS += fetch-negotiator.o\n LIB_OBJS += fetch-object-info.o\n LIB_OBJS += fetch-pack.o\n LIB_OBJS += fmt-merge-msg.o\n-LIB_OBJS += fsck.o\n+LIB_OBJS += odb/fsck.o\n LIB_OBJS += fsmonitor.o\n LIB_OBJS += fsmonitor-ipc.o\n LIB_OBJS += fsmonitor-settings.o\n@@ -1181,8 +1181,8 @@ LIB_OBJS += git-zlib.o\n LIB_OBJS += gpg-interface.o\n LIB_OBJS += graph.o\n LIB_OBJS += grep.o\n-LIB_OBJS += hash-lookup.o\n-LIB_OBJS += hash.o\n+LIB_OBJS += odb/hash-lookup.o\n+LIB_OBJS += odb/hash.o\n LIB_OBJS += hashmap.o\n LIB_OBJS += help.o\n LIB_OBJS += hex.o\n@@ -1200,11 +1200,11 @@ LIB_OBJS += list-objects-filter.o\n LIB_OBJS += list-objects.o\n LIB_OBJS += lockfile.o\n LIB_OBJS += log-tree.o\n-LIB_OBJS += loose.o\n+LIB_OBJS += odb/loose.o\n LIB_OBJS += ls-refs.o\n LIB_OBJS += mailinfo.o\n LIB_OBJS += mailmap.o\n-LIB_OBJS += match-trees.o\n+LIB_OBJS += odb/match-trees.o\n LIB_OBJS += mem-pool.o\n LIB_OBJS += merge-blobs.o\n LIB_OBJS += merge-ll.o\n@@ -1221,11 +1221,11 @@ LIB_OBJS += notes-cache.o\n LIB_OBJS += notes-merge.o\n LIB_OBJS += notes-utils.o\n LIB_OBJS += notes.o\n-LIB_OBJS += object-file-convert.o\n-LIB_OBJS += object-file.o\n-LIB_OBJS += object-name.o\n-LIB_OBJS += object.o\n-LIB_OBJS += odb.o\n+LIB_OBJS += odb/object-file-convert.o\n+LIB_OBJS += odb/object-file.o\n+LIB_OBJS += odb/object-name.o\n+LIB_OBJS += odb/object.o\n+LIB_OBJS += odb/odb.o\n LIB_OBJS += odb/source.o\n LIB_OBJS += odb/source-files.o\n LIB_OBJS += odb/source-inmemory.o\n@@ -1233,10 +1233,10 @@ LIB_OBJS += odb/source-loose.o\n LIB_OBJS += odb/source-packed.o\n LIB_OBJS += odb/streaming.o\n LIB_OBJS += odb/transaction.o\n-LIB_OBJS += oid-array.o\n-LIB_OBJS += oidmap.o\n-LIB_OBJS += oidset.o\n-LIB_OBJS += oidtree.o\n+LIB_OBJS += odb/oid-array.o\n+LIB_OBJS += odb/oidmap.o\n+LIB_OBJS += odb/oidset.o\n+LIB_OBJS += odb/oidtree.o\n LIB_OBJS += organize/gitorganize-format.o\n LIB_OBJS += organize/labeler-protocol.o\n LIB_OBJS += organize/organize.o\n@@ -1310,7 +1310,7 @@ LIB_OBJS += repack-filtered.o\n LIB_OBJS += repack-geometry.o\n LIB_OBJS += repack-midx.o\n LIB_OBJS += repack-promisor.o\n-LIB_OBJS += replace-object.o\n+LIB_OBJS += odb/replace-object.o\n LIB_OBJS += replay.o\n LIB_OBJS += repo-settings.o\n LIB_OBJS += repository.o\n@@ -1339,10 +1339,10 @@ LIB_OBJS += sub-process.o\n LIB_OBJS += submodule-config.o\n LIB_OBJS += submodule.o\n LIB_OBJS += symlinks.o\n-LIB_OBJS += tag.o\n+LIB_OBJS += odb/tag.o\n LIB_OBJS += tempfile.o\n LIB_OBJS += thread-utils.o\n-LIB_OBJS += tmp-objdir.o\n+LIB_OBJS += odb/tmp-objdir.o\n LIB_OBJS += trace.o\n LIB_OBJS += trace2.o\n LIB_OBJS += trace2/tr2_cfg.o\n@@ -1361,8 +1361,8 @@ LIB_OBJS += trailer.o\n LIB_OBJS += transport-helper.o\n LIB_OBJS += transport.o\n LIB_OBJS += tree-diff.o\n-LIB_OBJS += tree-walk.o\n-LIB_OBJS += tree.o\n+LIB_OBJS += odb/tree-walk.o\n+LIB_OBJS += odb/tree.o\n LIB_OBJS += unpack-trees.o\n LIB_OBJS += upload-pack.o\n LIB_OBJS += url.o\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 3cf8a1dbf8..51ddcc4e87 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -5,7 +5,7 @@\n #include \"color.h\"\n #include \"diffcore.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"preload-index.h\"\n #include \"read-cache-ll.h\"\n@@ -17,7 +17,7 @@\n #include \"dir.h\"\n #include \"run-command.h\"\n #include \"prompt.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n \n void init_add_i_state(struct add_i_state *s, struct repository *r,\n \t\t      struct interactive_options *opts)\ndiff --git a/add-patch.c b/add-patch.c\nindex f27edcbe8d..1b4c53e4ce 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -4,14 +4,14 @@\n #include \"git-compat-util.h\"\n #include \"add-patch.h\"\n #include \"advice.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"config.h\"\n #include \"diff.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"pager.h\"\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\ndiff --git a/apply.c b/apply.c\nindex f00b7ba4d3..ba486ab51d 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -14,7 +14,7 @@\n #include \"abspath.h\"\n #include \"base85.h\"\n #include \"config.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"delta.h\"\n #include \"diff.h\"\n #include \"dir.h\"\n@@ -25,8 +25,8 @@\n #include \"merge-ll.h\"\n #include \"lockfile.h\"\n #include \"name-hash.h\"\n-#include \"object-name.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/object-file.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"quote.h\"\ndiff --git a/apply.h b/apply.h\nindex 5f2f03d3ed..7c22776d41 100644\n--- a/apply.h\n+++ b/apply.h\n@@ -1,7 +1,7 @@\n #ifndef APPLY_H\n #define APPLY_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"lockfile.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\ndiff --git a/archive-tar.c b/archive-tar.c\nindex 0fc70d13a8..318b9bcc24 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -11,7 +11,7 @@\n #include \"hex.h\"\n #include \"tar.h\"\n #include \"archive.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"strbuf.h\"\n #include \"run-command.h\"\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 97ea8d60d6..53c50ebc44 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -11,7 +11,7 @@\n #include \"git-zlib.h\"\n #include \"hex.h\"\n #include \"utf8.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"strbuf.h\"\n #include \"userdiff.h\"\ndiff --git a/archive.c b/archive.c\nindex 59790be986..c0d2e0c44b 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -9,15 +9,15 @@\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"path.h\"\n #include \"pretty.h\"\n #include \"setup.h\"\n #include \"refs.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"attr.h\"\n #include \"archive.h\"\n #include \"parse-options.h\"\ndiff --git a/attr.c b/attr.c\nindex 0e63f1b6de..e829149cb4 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -22,11 +22,11 @@\n #include \"read-cache-ll.h\"\n #include \"refs.h\"\n #include \"revision.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"setup.h\"\n #include \"thread-utils.h\"\n-#include \"tree-walk.h\"\n-#include \"object-name.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/object-name.h\"\n \n char *git_attr_tree;\n \ndiff --git a/bisect.c b/bisect.c\nindex d426fcd5a9..2dea7139ad 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n@@ -15,12 +15,12 @@\n #include \"run-command.h\"\n #include \"log-tree.h\"\n #include \"bisect.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"strvec.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"commit-reach.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n #include \"dir.h\"\n \ndiff --git a/blame.c b/blame.c\nindex 126e232416..d1cba8811f 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -3,10 +3,10 @@\n \n #include \"git-compat-util.h\"\n #include \"refs.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"cache-tree.h\"\n #include \"mergesort.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"convert.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n@@ -16,11 +16,11 @@\n #include \"read-cache.h\"\n #include \"revision.h\"\n #include \"setup.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"trace2.h\"\n #include \"blame.h\"\n-#include \"alloc.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/alloc.h\"\n+#include \"odb/commit-slab.h\"\n #include \"bloom.h\"\n #include \"commit-graph.h\"\n \ndiff --git a/blame.h b/blame.h\nindex 3b34be0e5c..97137099e3 100644\n--- a/blame.h\n+++ b/blame.h\n@@ -1,7 +1,7 @@\n #ifndef BLAME_H\n #define BLAME_H\n \n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n #include \"xdiff-interface.h\"\n #include \"prio-queue.h\"\n \ndiff --git a/bloom.c b/bloom.c\nindex caf22f9831..e61cb05246 100644\n--- a/bloom.c\n+++ b/bloom.c\n@@ -6,10 +6,10 @@\n #include \"diffcore.h\"\n #include \"hashmap.h\"\n #include \"commit-graph.h\"\n-#include \"commit.h\"\n-#include \"commit-slab.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/commit-slab.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"config.h\"\n #include \"repository.h\"\n \ndiff --git a/branch.c b/branch.c\nindex 22f4f46b96..7593a499a9 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -7,14 +7,14 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"path.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n #include \"remote.h\"\n #include \"repository.h\"\n #include \"sequencer.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"worktree.h\"\n #include \"submodule-config.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/add.c b/builtin/add.c\nindex eab8f03cad..5d6dd91f70 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -14,8 +14,8 @@\n #include \"gettext.h\"\n #include \"pathspec.h\"\n #include \"run-command.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\ndiff --git a/builtin/am.c b/builtin/am.c\nindex e9623b8307..f138a8fe3d 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -23,11 +23,11 @@\n #include \"lockfile.h\"\n #include \"cache-tree.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"unpack-trees.h\"\n #include \"branch.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"preload-index.h\"\n #include \"sequencer.h\"\n #include \"revision.h\"\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex d642a40251..5fb37cb965 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"apply.h\"\n \n static const char * const apply_usage[] = {\ndiff --git a/builtin/backfill.c b/builtin/backfill.c\nindex e71e0f4742..3685713205 100644\n--- a/builtin/backfill.c\n+++ b/builtin/backfill.c\n@@ -6,16 +6,16 @@\n #include \"config.h\"\n #include \"parse-options.h\"\n #include \"repository.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n-#include \"object.h\"\n-#include \"odb.h\"\n-#include \"oid-array.h\"\n-#include \"oidset.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/object.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/oidset.h\"\n #include \"promisor-remote.h\"\n #include \"strmap.h\"\n #include \"string-list.h\"\ndiff --git a/builtin/bisect.c b/builtin/bisect.c\nindex 93420ac0ea..a1b7fc9407 100644\n--- a/builtin/bisect.c\n+++ b/builtin/bisect.c\n@@ -6,13 +6,13 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"bisect.h\"\n #include \"refs.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"prompt.h\"\n #include \"quote.h\"\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 48d5251c6d..c88fc489f7 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -13,7 +13,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"quote.h\"\n@@ -26,13 +26,13 @@\n #include \"line-range.h\"\n #include \"line-log.h\"\n #include \"progress.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"pager.h\"\n #include \"blame.h\"\n #include \"refs.h\"\n #include \"setup.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"write-or-die.h\"\n \n static const char blame_usage[] = N_(\"git blame [<options>] [<rev-opts>] [<rev>] [--] <file>\");\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex a613148fc7..c50c28c720 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -13,9 +13,9 @@\n #include \"editor.h\"\n #include \"environment.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"remote.h\"\n #include \"parse-options.h\"\n #include \"branch.h\"\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex e85e2cfc1b..ccd6b33827 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -18,13 +18,13 @@\n #include \"list-objects-filter-options.h\"\n #include \"parse-options.h\"\n #include \"userdiff.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"promisor-remote.h\"\n #include \"mailmap.h\"\n #include \"write-or-die.h\"\ndiff --git a/builtin/check-attr.c b/builtin/check-attr.c\nindex 217d83ea7d..02ff3b4eb5 100644\n--- a/builtin/check-attr.c\n+++ b/builtin/check-attr.c\n@@ -4,7 +4,7 @@\n #include \"attr.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"quote.h\"\n #include \"setup.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 55e3a89a85..2dcebb2cb2 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -6,7 +6,7 @@\n #include \"branch.h\"\n #include \"cache-tree.h\"\n #include \"checkout.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"config.h\"\n #include \"diff.h\"\n #include \"dir.h\"\n@@ -17,9 +17,9 @@\n #include \"merge-ll.h\"\n #include \"lockfile.h\"\n #include \"mem-pool.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"preload-index.h\"\n@@ -36,8 +36,8 @@\n #include \"submodule.h\"\n #include \"symlinks.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"unpack-trees.h\"\n #include \"wt-status.h\"\n #include \"xdiff-interface.h\"\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 5b25cca510..6d6a756a12 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -24,10 +24,10 @@\n #include \"parse-options.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"unpack-trees.h\"\n #include \"transport.h\"\n #include \"strbuf.h\"\ndiff --git a/builtin/commit-graph.c b/builtin/commit-graph.c\nindex d62005edc0..0758af3b64 100644\n--- a/builtin/commit-graph.c\n+++ b/builtin/commit-graph.c\n@@ -1,17 +1,17 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"commit-graph.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"progress.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"strbuf.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"trace2.h\"\n \n #define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \\\ndiff --git a/builtin/commit-tree.c b/builtin/commit-tree.c\nindex 30535db131..598ef30372 100644\n--- a/builtin/commit-tree.c\n+++ b/builtin/commit-tree.c\n@@ -9,10 +9,10 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n \n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"parse-options.h\"\n \n static const char * const commit_tree_usage[] = {\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 28f6174503..e5a6c0b889 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -18,14 +18,14 @@\n #include \"editor.h\"\n #include \"environment.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"add-interactive.h\"\n #include \"gettext.h\"\n #include \"revision.h\"\n #include \"wt-status.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"preload-index.h\"\ndiff --git a/builtin/count-objects.c b/builtin/count-objects.c\nindex 18f6e33b6f..e256779b1f 100644\n--- a/builtin/count-objects.c\n+++ b/builtin/count-objects.c\n@@ -13,7 +13,7 @@\n #include \"parse-options.h\"\n #include \"quote.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n \n static unsigned long garbage;\n static off_t size_garbage;\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex c0abc931a5..75961c5945 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -7,10 +7,10 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"refs.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"read-cache-ll.h\"\n #include \"revision.h\"\n@@ -19,12 +19,12 @@\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"list-objects.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"wildmatch.h\"\n #include \"prio-queue.h\"\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n \n #define MAX_TAGS\t(FLAG_BITS - 1)\n #define DEFAULT_CANDIDATES 10\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex ea91347ce2..c5b7548e55 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -11,7 +11,7 @@\n #include \"config.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"preload-index.h\"\n #include \"revision.h\"\n \ndiff --git a/builtin/diff-index.c b/builtin/diff-index.c\nindex 3db7cffede..a23f444348 100644\n--- a/builtin/diff-index.c\n+++ b/builtin/diff-index.c\n@@ -5,7 +5,7 @@\n #include \"config.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"preload-index.h\"\n #include \"revision.h\"\n #include \"setup.h\"\ndiff --git a/builtin/diff-pairs.c b/builtin/diff-pairs.c\nindex 71c045331a..315fc7357a 100644\n--- a/builtin/diff-pairs.c\n+++ b/builtin/diff-pairs.c\n@@ -3,9 +3,9 @@\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"parse-options.h\"\n #include \"revision.h\"\n #include \"strbuf.h\"\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex 8b8f8b54e4..a3e1e5e020 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -3,14 +3,14 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"log-tree.h\"\n #include \"read-cache-ll.h\"\n #include \"revision.h\"\n-#include \"tmp-objdir.h\"\n-#include \"tree.h\"\n+#include \"odb/tmp-objdir.h\"\n+#include \"odb/tree.h\"\n \n static struct rev_info log_tree_opt;\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 18b1083e98..c9ccc7e6c5 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -12,9 +12,9 @@\n #include \"ewah/ewok.h\"\n #include \"lockfile.h\"\n #include \"color.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n #include \"diffcore.h\"\n@@ -23,8 +23,8 @@\n #include \"revision.h\"\n #include \"log-tree.h\"\n #include \"setup.h\"\n-#include \"oid-array.h\"\n-#include \"tree.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/tree.h\"\n \n #define DIFF_NO_INDEX_EXPLICIT 1\n #define DIFF_NO_INDEX_IMPLICIT 2\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex bc7b2ea443..075112d344 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -29,8 +29,8 @@\n #include \"strvec.h\"\n #include \"strbuf.h\"\n #include \"lockfile.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"dir.h\"\n #include \"entry.h\"\n #include \"setup.h\"\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 50278bef7a..472877f0e5 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -14,11 +14,11 @@\n #include \"hex.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n-#include \"object.h\"\n-#include \"tag.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/object.h\"\n+#include \"odb/tag.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"log-tree.h\"\n@@ -29,7 +29,7 @@\n #include \"parse-options.h\"\n #include \"quote.h\"\n #include \"remote.h\"\n-#include \"blob.h\"\n+#include \"odb/blob.h\"\n #include \"gpg-interface.h\"\n \n static const char *const fast_export_usage[] = {\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 4bed9edd7d..1d560d4e71 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -8,10 +8,10 @@\n #include \"hex.h\"\n #include \"config.h\"\n #include \"lockfile.h\"\n-#include \"object.h\"\n-#include \"blob.h\"\n-#include \"tree.h\"\n-#include \"commit.h\"\n+#include \"odb/object.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/commit.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n #include \"path.h\"\n@@ -22,9 +22,9 @@\n #include \"dir.h\"\n #include \"run-command.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"mem-pool.h\"\n #include \"commit-reach.h\"\n #include \"khash.h\"\ndiff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c\nindex 316badd969..c6ae0197ab 100644\n--- a/builtin/fetch-pack.c\n+++ b/builtin/fetch-pack.c\n@@ -4,12 +4,12 @@\n #include \"builtin.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"pkt-line.h\"\n #include \"fetch-pack.h\"\n #include \"remote.h\"\n #include \"connect.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"protocol.h\"\n \n static const char fetch_pack_usage[] =\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex ab7db2be06..2089e7823e 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -13,11 +13,11 @@\n #include \"hex.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"oidset.h\"\n-#include \"oid-array.h\"\n-#include \"commit.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/commit.h\"\n #include \"string-list.h\"\n #include \"remote.h\"\n #include \"transport.h\"\ndiff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c\nindex 4a2fc421db..d3399455ef 100644\n--- a/builtin/for-each-ref.c\n+++ b/builtin/for-each-ref.c\n@@ -1,10 +1,10 @@\n #include \"builtin.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"config.h\"\n #include \"environment.h\"\n #include \"for-each-ref.h\"\n #include \"gettext.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"parse-options.h\"\n #include \"ref-filter.h\"\n #include \"strbuf.h\"\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex a6c054e45b..3176941c1d 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -2,24 +2,24 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n-#include \"tree.h\"\n-#include \"blob.h\"\n-#include \"tag.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/tag.h\"\n #include \"refs.h\"\n #include \"pack.h\"\n #include \"cache-tree.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"parse-options.h\"\n #include \"progress.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"path.h\"\n #include \"read-cache-ll.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"resolve-undo.h\"\n #include \"run-command.h\"\n #include \"sparse-index.h\"\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex de2f9e7fed..f2fdc2c69d 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -26,11 +26,11 @@\n #include \"run-command.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-graph.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n #include \"reflog.h\"\n #include \"rerere.h\"\ndiff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c\nindex e4cd1627b4..d78ecd8ab9 100644\n--- a/builtin/get-tar-commit-id.c\n+++ b/builtin/get-tar-commit-id.c\n@@ -2,7 +2,7 @@\n  * Copyright (c) 2005, 2006 Rene Scharfe\n  */\n #include \"builtin.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"tar.h\"\n \n static const char builtin_get_tar_commit_id_usage[] =\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d3d86abe01..d13858caec 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -13,8 +13,8 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"config.h\"\n-#include \"tag.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/tree-walk.h\"\n #include \"parse-options.h\"\n #include \"string-list.h\"\n #include \"run-command.h\"\n@@ -25,11 +25,11 @@\n #include \"setup.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n-#include \"oid-array.h\"\n-#include \"oidset.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/oidset.h\"\n #include \"pager.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\ndiff --git a/builtin/hash-object.c b/builtin/hash-object.c\nindex f306b0643f..335575862c 100644\n--- a/builtin/hash-object.c\n+++ b/builtin/hash-object.c\n@@ -11,9 +11,9 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n-#include \"blob.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/blob.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\n #include \"setup.h\"\ndiff --git a/builtin/history.c b/builtin/history.c\nindex 000155ad9c..a2aa224bd1 100644\n--- a/builtin/history.c\n+++ b/builtin/history.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"cache-tree.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-reach.h\"\n #include \"config.h\"\n #include \"editor.h\"\n@@ -11,7 +11,7 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"merge-ort.h\"\n-#include \"oidmap.h\"\n+#include \"odb/oidmap.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"read-cache.h\"\n@@ -21,8 +21,8 @@\n #include \"revision.h\"\n #include \"sequencer.h\"\n #include \"strvec.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"unpack-trees.h\"\n #include \"wt-status.h\"\n \ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex bc86925ad0..aa0e04eeee 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -9,24 +9,24 @@\n #include \"hex.h\"\n #include \"pack.h\"\n #include \"csum-file.h\"\n-#include \"blob.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n-#include \"tree.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/tree.h\"\n #include \"progress.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"strbuf.h\"\n #include \"thread-utils.h\"\n #include \"packfile.h\"\n #include \"pack-revindex.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n-#include \"oid-array.h\"\n-#include \"oidset.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/oidset.h\"\n #include \"path.h\"\n-#include \"replace-object.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/replace-object.h\"\n+#include \"odb/tree-walk.h\"\n #include \"promisor-remote.h\"\n #include \"run-command.h\"\n #include \"setup.h\"\ndiff --git a/builtin/last-modified.c b/builtin/last-modified.c\nindex 5478182f2e..e8827b5dc6 100644\n--- a/builtin/last-modified.c\n+++ b/builtin/last-modified.c\n@@ -2,8 +2,8 @@\n #include \"bloom.h\"\n #include \"builtin.h\"\n #include \"commit-graph.h\"\n-#include \"commit-slab.h\"\n-#include \"commit.h\"\n+#include \"odb/commit-slab.h\"\n+#include \"odb/commit.h\"\n #include \"config.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n@@ -11,8 +11,8 @@\n #include \"ewah/ewok.h\"\n #include \"hashmap.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n-#include \"object.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/object.h\"\n #include \"parse-options.h\"\n #include \"prio-queue.h\"\n #include \"quote.h\"\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 350b35c556..ab381e529e 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -14,20 +14,20 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"pager.h\"\n #include \"color.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"diff-merges.h\"\n #include \"revision.h\"\n #include \"log-tree.h\"\n-#include \"oid-array.h\"\n-#include \"oidset.h\"\n-#include \"tag.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/tag.h\"\n #include \"reflog-walk.h\"\n #include \"patch-ids.h\"\n #include \"path.h\"\n@@ -40,15 +40,15 @@\n #include \"version.h\"\n #include \"mailmap.h\"\n #include \"progress.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"advice.h\"\n #include \"utf8.h\"\n \n #include \"commit-reach.h\"\n #include \"promisor-remote.h\"\n #include \"range-diff.h\"\n-#include \"tmp-objdir.h\"\n-#include \"tree.h\"\n+#include \"odb/tmp-objdir.h\"\n+#include \"odb/tree.h\"\n #include \"userdiff.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/ls-files.c b/builtin/ls-files.c\nindex b044520f9e..fc3f8f4a72 100644\n--- a/builtin/ls-files.c\n+++ b/builtin/ls-files.c\n@@ -15,7 +15,7 @@\n #include \"quote.h\"\n #include \"dir.h\"\n #include \"gettext.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"strbuf.h\"\n #include \"parse-options.h\"\n #include \"resolve-undo.h\"\n@@ -26,7 +26,7 @@\n #include \"setup.h\"\n #include \"sparse-index.h\"\n #include \"submodule.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"hex.h\"\n \n \ndiff --git a/builtin/ls-tree.c b/builtin/ls-tree.c\nindex 46edaffc2e..4f7d1d2b6d 100644\n--- a/builtin/ls-tree.c\n+++ b/builtin/ls-tree.c\n@@ -10,9 +10,9 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"tree.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/tree.h\"\n #include \"path.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/merge-base.c b/builtin/merge-base.c\nindex a87011c6cd..191e4e7fa0 100644\n--- a/builtin/merge-base.c\n+++ b/builtin/merge-base.c\n@@ -1,11 +1,11 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"commit-reach.h\"\n \ndiff --git a/builtin/merge-file.c b/builtin/merge-file.c\nindex 8fa5765239..22a6862a13 100644\n--- a/builtin/merge-file.c\n+++ b/builtin/merge-file.c\n@@ -5,9 +5,9 @@\n #include \"abspath.h\"\n #include \"diff.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"config.h\"\n #include \"gettext.h\"\n #include \"setup.h\"\ndiff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c\nindex 17aa4db37a..2e7bef9ee4 100644\n--- a/builtin/merge-recursive.c\n+++ b/builtin/merge-recursive.c\n@@ -2,9 +2,9 @@\n #include \"builtin.h\"\n #include \"advice.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"merge-ort-wrappers.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n \n static const char builtin_merge_recursive_usage[] =\n \t\"git %s <base>... -- <head> <remote> ...\";\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 49f41e520f..27f2944ece 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -2,21 +2,21 @@\n \n #include \"builtin.h\"\n #include \"environment.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"xdiff-interface.h\"\n #include \"help.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-reach.h\"\n #include \"merge-ort.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"parse-options.h\"\n-#include \"blob.h\"\n+#include \"odb/blob.h\"\n #include \"merge-blobs.h\"\n #include \"quote.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"config.h\"\n #include \"strvec.h\"\n #include \"write-or-die.h\"\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 5b4eb23a83..56f89b2944 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -18,7 +18,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"lockfile.h\"\n #include \"repository.h\"\n@@ -28,7 +28,7 @@\n #include \"diff-merges.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diffcore.h\"\n #include \"path.h\"\n #include \"revision.h\"\n@@ -45,7 +45,7 @@\n #include \"fmt-merge-msg.h\"\n #include \"sequencer.h\"\n #include \"string-list.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"alias.h\"\n #include \"branch.h\"\n #include \"commit-reach.h\"\ndiff --git a/builtin/mktag.c b/builtin/mktag.c\nindex 37c17e6beb..eb25acc4a5 100644\n--- a/builtin/mktag.c\n+++ b/builtin/mktag.c\n@@ -4,10 +4,10 @@\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"strbuf.h\"\n-#include \"replace-object.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n-#include \"fsck.h\"\n+#include \"odb/replace-object.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/fsck.h\"\n #include \"config.h\"\n \n static char const * const builtin_mktag_usage[] = {\ndiff --git a/builtin/mktree.c b/builtin/mktree.c\nindex 4084e32476..fc414d5b31 100644\n--- a/builtin/mktree.c\n+++ b/builtin/mktree.c\n@@ -8,10 +8,10 @@\n #include \"hex.h\"\n #include \"quote.h\"\n #include \"strbuf.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"parse-options.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n \n static struct treeent {\n \tunsigned mode;\ndiff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c\nindex 6e73c85cde..10af1beb5c 100644\n--- a/builtin/multi-pack-index.c\n+++ b/builtin/multi-pack-index.c\n@@ -8,10 +8,10 @@\n #include \"midx.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"odb/source-files.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"repository.h\"\n \n #define BUILTIN_MIDX_WRITE_USAGE \\\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex 373d4aeba3..e347c100c0 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -14,7 +14,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"name-hash.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"path.h\"\n #include \"pathspec.h\"\n #include \"lockfile.h\"\ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex 60cbbfb4b7..d2870bd37c 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -6,14 +6,14 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"refs.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"pager.h\"\n #include \"parse-options.h\"\n-#include \"hash-lookup.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/hash-lookup.h\"\n+#include \"odb/commit-slab.h\"\n #include \"commit-graph.h\"\n #include \"wildmatch.h\"\n #include \"mem-pool.h\"\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 9f1f0ec840..2cf1437346 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -14,9 +14,9 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"notes.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n \n #include \"pretty.h\"\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 1ec5b6f206..3e4c5442dc 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -7,14 +7,14 @@\n #include \"hex.h\"\n #include \"config.h\"\n #include \"attr.h\"\n-#include \"object.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/object.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n #include \"pack-revindex.h\"\n #include \"csum-file.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n@@ -26,16 +26,16 @@\n #include \"pack-bitmap.h\"\n #include \"delta-islands.h\"\n #include \"reachable.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"strvec.h\"\n #include \"strmap.h\"\n #include \"list.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"object-file-convert.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-file-convert.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"dir.h\"\n #include \"midx.h\"\n #include \"trace2.h\"\n@@ -44,8 +44,8 @@\n #include \"pack-mtimes.h\"\n #include \"parse-options.h\"\n #include \"pkt-line.h\"\n-#include \"blob.h\"\n-#include \"tree.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/tree.h\"\n #include \"path-walk.h\"\n \n /*\ndiff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c\nindex 86749bb7e7..10e1ce6ab5 100644\n--- a/builtin/pack-redundant.c\n+++ b/builtin/pack-redundant.c\n@@ -13,7 +13,7 @@\n #include \"hex.h\"\n \n #include \"packfile.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"strbuf.h\"\n \n #define BLKSIZE 512\ndiff --git a/builtin/patch-id.c b/builtin/patch-id.c\nindex 22f36ecf80..e2c1375b41 100644\n--- a/builtin/patch-id.c\n+++ b/builtin/patch-id.c\n@@ -5,7 +5,7 @@\n #include \"diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"setup.h\"\ndiff --git a/builtin/prune.c b/builtin/prune.c\nindex 55635a891f..301f59e897 100644\n--- a/builtin/prune.c\n+++ b/builtin/prune.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n@@ -13,10 +13,10 @@\n #include \"path.h\"\n #include \"progress.h\"\n #include \"prune-packed.h\"\n-#include \"replace-object.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/replace-object.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"shallow.h\"\n \n static const char * const prune_usage[] = {\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex db3ee0aab3..cb3d76cb16 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -15,10 +15,10 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"merge.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"run-command.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"remote.h\"\n #include \"dir.h\"\n #include \"path.h\"\ndiff --git a/builtin/range-diff.c b/builtin/range-diff.c\nindex e54c0f7fe1..7e37a00d9e 100644\n--- a/builtin/range-diff.c\n+++ b/builtin/range-diff.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"gettext.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"range-diff.h\"\n #include \"config.h\"\ndiff --git a/builtin/read-tree.c b/builtin/read-tree.c\nindex 999a82ecdf..8898354baa 100644\n--- a/builtin/read-tree.c\n+++ b/builtin/read-tree.c\n@@ -10,10 +10,10 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"object.h\"\n-#include \"object-name.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/object.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 10a306310c..7b8366e5cd 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -20,11 +20,11 @@\n #include \"config.h\"\n #include \"unpack-trees.h\"\n #include \"lockfile.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"wt-status.h\"\n #include \"revision.h\"\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 86933d8d7e..5ec79a4595 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -3,25 +3,25 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-reach.h\"\n #include \"config.h\"\n #include \"connect.h\"\n #include \"connected.h\"\n #include \"environment.h\"\n #include \"exec-cmd.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"gettext.h\"\n #include \"gpg-interface.h\"\n #include \"hex.h\"\n #include \"hook.h\"\n #include \"lockfile.h\"\n-#include \"object.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"oid-array.h\"\n-#include \"oidset.h\"\n+#include \"odb/object.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/oidset.h\"\n #include \"pack.h\"\n #include \"packfile.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex 1211c58fa4..b709cb0e3c 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -4,7 +4,7 @@\n #include \"config.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"revision.h\"\n #include \"reachable.h\"\n #include \"wildmatch.h\"\ndiff --git a/builtin/refs.c b/builtin/refs.c\nindex 5cd21c25fe..37936353be 100644\n--- a/builtin/refs.c\n+++ b/builtin/refs.c\n@@ -1,6 +1,6 @@\n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"pack-refs.h\"\n #include \"parse-options.h\"\n #include \"refs.h\"\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex de989ea3ba..b5b54ded27 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -16,7 +16,7 @@\n #include \"rebase.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"strvec.h\"\n #include \"commit-reach.h\"\n #include \"progress.h\"\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex aed6b2c8de..793226006c 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -18,11 +18,11 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"run-command.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"replace-object.h\"\n-#include \"tag.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/replace-object.h\"\n+#include \"odb/tag.h\"\n #include \"wildmatch.h\"\n \n static const char * const git_replace_usage[] = {\ndiff --git a/builtin/replay.c b/builtin/replay.c\nindex 39e3a86f6c..4ea7c42215 100644\n--- a/builtin/replay.c\n+++ b/builtin/replay.c\n@@ -7,7 +7,7 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"refs.h\"\n #include \"replay.h\"\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex 84e012f83f..473072b44d 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -1,11 +1,11 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"path-walk.h\"\n@@ -18,8 +18,8 @@\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"shallow.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"utf8.h\"\n \n #define REPO_INFO_USAGE \\\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 78e69bd84b..55539f565c 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -15,17 +15,17 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"pretty.h\"\n #include \"refs.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"branch.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"repository.h\"\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 02818b81c6..0c55dc5b96 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -3,7 +3,7 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n@@ -11,10 +11,10 @@\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"object.h\"\n-#include \"object-name.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"pack-bitmap.h\"\n #include \"parse-options.h\"\n #include \"log-tree.h\"\n@@ -22,8 +22,8 @@\n #include \"bisect.h\"\n #include \"progress.h\"\n #include \"reflog-walk.h\"\n-#include \"oidset.h\"\n-#include \"oidmap.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/oidmap.h\"\n #include \"packfile.h\"\n #include \"commit-reach.h\"\n #include \"quote.h\"\ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex 43693454d5..f3bf7831b7 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -12,14 +12,14 @@\n #include \"abspath.h\"\n #include \"bisect.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"refs.h\"\n #include \"quote.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"diff.h\"\n@@ -32,7 +32,7 @@\n #include \"submodule.h\"\n #include \"commit-reach.h\"\n #include \"shallow.h\"\n-#include \"object-file-convert.h\"\n+#include \"odb/object-file-convert.h\"\n \n #define DO_REVS\t\t1\n #define DO_NOREV\t2\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex 081d0bc375..c856b88d09 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -13,9 +13,9 @@\n #include \"lockfile.h\"\n #include \"dir.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n-#include \"tree-walk.h\"\n-#include \"object-name.h\"\n+#include \"odb/hash.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"read-cache.h\"\n \ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex d6cdbae472..2597a47bde 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -9,7 +9,7 @@\n #include \"send-pack.h\"\n #include \"quote.h\"\n #include \"transport.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"gettext.h\"\n #include \"protocol.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex 4c78d2e5ba..cbcf2fb637 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 2435e8aeda..c58abc872f 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -5,17 +5,17 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"pretty.h\"\n #include \"refs.h\"\n #include \"color.h\"\n #include \"strvec.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n \n #include \"dir.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"date.h\"\n #include \"wildmatch.h\"\n #include \"prio-queue.h\"\ndiff --git a/builtin/show-index.c b/builtin/show-index.c\nindex 24f0230967..55c3c409ae 100644\n--- a/builtin/show-index.c\n+++ b/builtin/show-index.c\n@@ -3,7 +3,7 @@\n \n #include \"builtin.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"pack.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/show-ref.c b/builtin/show-ref.c\nindex d508441632..e4b186b930 100644\n--- a/builtin/show-ref.c\n+++ b/builtin/show-ref.c\n@@ -5,9 +5,9 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs-internal.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"object.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/object.h\"\n #include \"string-list.h\"\n #include \"parse-options.h\"\n \ndiff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c\nindex cb4a037b77..e2186fdd33 100644\n--- a/builtin/sparse-checkout.c\n+++ b/builtin/sparse-checkout.c\n@@ -7,8 +7,8 @@\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"pathspec.h\"\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 72c52571f8..2af975aaff 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -5,9 +5,9 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"refs.h\"\n #include \"lockfile.h\"\n@@ -30,8 +30,8 @@\n #include \"reflog.h\"\n #include \"reflog-walk.h\"\n #include \"add-interactive.h\"\n-#include \"oid-array.h\"\n-#include \"commit.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/commit.h\"\n \n #define INCLUDE_ALL_FILES 2\n \ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex e7cd3225fa..96c83476df 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -26,9 +26,9 @@\n #include \"revision.h\"\n #include \"diffcore.h\"\n #include \"diff.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"advice.h\"\n #include \"branch.h\"\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 06c125b53c..e3eee35e88 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -17,21 +17,21 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"parse-options.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"gpg-interface.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"column.h\"\n #include \"ref-filter.h\"\n #include \"date.h\"\n #include \"write-or-die.h\"\n-#include \"object-file-convert.h\"\n+#include \"odb/object-file-convert.h\"\n #include \"trailer.h\"\n \n static const char * const git_tag_usage[] = {\ndiff --git a/builtin/unpack-file.c b/builtin/unpack-file.c\nindex 387389ed49..47f43f5a87 100644\n--- a/builtin/unpack-file.c\n+++ b/builtin/unpack-file.c\n@@ -3,9 +3,9 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n \n static char *create_temp_file(struct object_id *oid)\n {\ndiff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c\nindex 4263edfbec..e5891809dd 100644\n--- a/builtin/unpack-objects.c\n+++ b/builtin/unpack-objects.c\n@@ -7,19 +7,19 @@\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"odb/transaction.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"delta.h\"\n #include \"pack.h\"\n-#include \"blob.h\"\n-#include \"replace-object.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/replace-object.h\"\n #include \"strbuf.h\"\n #include \"progress.h\"\n #include \"decorate.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"packfile.h\"\n \n static int dry_run, quiet, recover, has_errors, strict;\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex 241abd4332..992f496efd 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -11,14 +11,14 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"quote.h\"\n #include \"cache-tree.h\"\n-#include \"tree-walk.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n #include \"refs.h\"\n #include \"resolve-undo.h\"\ndiff --git a/builtin/update-ref.c b/builtin/update-ref.c\nindex 6355c3dd3e..e7ac68f495 100644\n--- a/builtin/update-ref.c\n+++ b/builtin/update-ref.c\n@@ -5,10 +5,10 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"refs.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\n \ndiff --git a/builtin/upload-pack.c b/builtin/upload-pack.c\nindex 32831fb879..dc37ffb70c 100644\n--- a/builtin/upload-pack.c\n+++ b/builtin/upload-pack.c\n@@ -6,11 +6,11 @@\n #include \"pkt-line.h\"\n #include \"parse-options.h\"\n #include \"protocol.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"upload-pack.h\"\n #include \"serve.h\"\n #include \"setup.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n \n static const char * const upload_pack_usage[] = {\ndiff --git a/builtin/verify-commit.c b/builtin/verify-commit.c\nindex 62398acd72..3ec03f016c 100644\n--- a/builtin/verify-commit.c\n+++ b/builtin/verify-commit.c\n@@ -9,8 +9,8 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"object-name.h\"\n-#include \"commit.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/commit.h\"\n #include \"parse-options.h\"\n #include \"gpg-interface.h\"\n \ndiff --git a/builtin/verify-tag.c b/builtin/verify-tag.c\nindex 4a261b2369..791679a4d8 100644\n--- a/builtin/verify-tag.c\n+++ b/builtin/verify-tag.c\n@@ -9,8 +9,8 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"tag.h\"\n-#include \"object-name.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"gpg-interface.h\"\n #include \"ref-filter.h\"\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 654d27c3e1..7c2ed274f9 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -11,8 +11,8 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/write-tree.c b/builtin/write-tree.c\nindex e3bd1a40db..2e463ab394 100644\n--- a/builtin/write-tree.c\n+++ b/builtin/write-tree.c\n@@ -9,7 +9,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"cache-tree.h\"\n #include \"parse-options.h\"\n \ndiff --git a/bundle-uri.c b/bundle-uri.c\nindex 2bb2eb99e4..948265330b 100644\n--- a/bundle-uri.c\n+++ b/bundle-uri.c\n@@ -14,7 +14,7 @@\n #include \"fetch-pack.h\"\n #include \"remote.h\"\n #include \"trace2.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n \n static struct {\n \tenum bundle_list_heuristic heuristic;\ndiff --git a/bundle.c b/bundle.c\nindex b64716f252..81d241e6d0 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -7,10 +7,10 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"repository.h\"\n-#include \"object.h\"\n-#include \"commit.h\"\n+#include \"odb/object.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\ndiff --git a/cache-tree.c b/cache-tree.c\nindex d92f513286..1c4295761a 100644\n--- a/cache-tree.c\n+++ b/cache-tree.c\n@@ -5,14 +5,14 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"cache-tree.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n #include \"read-cache-ll.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"repository.h\"\n #include \"promisor-remote.h\"\n #include \"trace.h\"\ndiff --git a/cache-tree.h b/cache-tree.h\nindex f8bddae523..fbfa3691e1 100644\n--- a/cache-tree.h\n+++ b/cache-tree.h\n@@ -1,8 +1,8 @@\n #ifndef CACHE_TREE_H\n #define CACHE_TREE_H\n \n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n \n struct cache_tree;\n struct cache_tree_sub {\ndiff --git a/checkout.c b/checkout.c\nindex 1588b116ee..966a70c267 100644\n--- a/checkout.c\n+++ b/checkout.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"remote.h\"\n #include \"refspec.h\"\n #include \"repository.h\"\ndiff --git a/checkout.h b/checkout.h\nindex 55920e7aeb..718e29080a 100644\n--- a/checkout.h\n+++ b/checkout.h\n@@ -1,7 +1,7 @@\n #ifndef CHECKOUT_H\n #define CHECKOUT_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n /*\n  * Check if the branch name uniquely matches a branch name on a remote\ndiff --git a/chunk-format.c b/chunk-format.c\nindex 51b5a2c959..08b90762d4 100644\n--- a/chunk-format.c\n+++ b/chunk-format.c\n@@ -5,7 +5,7 @@\n #include \"chunk-format.h\"\n #include \"csum-file.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"trace2.h\"\n \n /*\ndiff --git a/chunk-format.h b/chunk-format.h\nindex 212a0a6af1..e10fcdbfcb 100644\n--- a/chunk-format.h\n+++ b/chunk-format.h\n@@ -1,7 +1,7 @@\n #ifndef CHUNK_FORMAT_H\n #define CHUNK_FORMAT_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct hashfile;\n struct chunkfile;\ndiff --git a/combine-diff.c b/combine-diff.c\nindex 717d537688..1c33937f21 100644\n--- a/combine-diff.c\n+++ b/combine-diff.c\n@@ -2,22 +2,22 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n #include \"convert.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"quote.h\"\n #include \"xdiff-interface.h\"\n #include \"xdiff/xmacros.h\"\n #include \"log-tree.h\"\n #include \"refs.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"userdiff.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"revision.h\"\n \n static int compare_paths(const struct combine_diff_path *one,\ndiff --git a/commit-graph.c b/commit-graph.c\nindex 49e8f63930..abf7c404b3 100644\n--- a/commit-graph.c\n+++ b/commit-graph.c\n@@ -8,24 +8,24 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"packfile.h\"\n-#include \"commit.h\"\n-#include \"object.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/object.h\"\n #include \"refs.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/hash-lookup.h\"\n #include \"commit-graph.h\"\n-#include \"odb.h\"\n-#include \"oid-array.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oid-array.h\"\n #include \"path.h\"\n-#include \"alloc.h\"\n+#include \"odb/alloc.h\"\n #include \"hashmap.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"progress.h\"\n #include \"bloom.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"shallow.h\"\n #include \"json-writer.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"chunk-format.h\"\n \n void git_test_write_commit_graph_or_die(struct odb_source *source)\ndiff --git a/commit-graph.h b/commit-graph.h\nindex 13ca4ff010..69ecf99feb 100644\n--- a/commit-graph.h\n+++ b/commit-graph.h\n@@ -1,8 +1,8 @@\n #ifndef COMMIT_GRAPH_H\n #define COMMIT_GRAPH_H\n \n-#include \"odb.h\"\n-#include \"oidset.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oidset.h\"\n \n #define GIT_TEST_COMMIT_GRAPH \"GIT_TEST_COMMIT_GRAPH\"\n #define GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE \"GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE\"\ndiff --git a/commit-reach.c b/commit-reach.c\nindex b53c6b1cdf..9b4715fd65 100644\n--- a/commit-reach.c\n+++ b/commit-reach.c\n@@ -1,14 +1,14 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-graph.h\"\n #include \"decorate.h\"\n #include \"hex.h\"\n #include \"prio-queue.h\"\n #include \"ref-filter.h\"\n #include \"revision.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"commit-reach.h\"\n #include \"ewah/ewok.h\"\n \ndiff --git a/commit-reach.h b/commit-reach.h\nindex f908d305b1..5d27ef9889 100644\n--- a/commit-reach.h\n+++ b/commit-reach.h\n@@ -1,8 +1,8 @@\n #ifndef COMMIT_REACH_H\n #define COMMIT_REACH_H\n \n-#include \"commit.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/commit-slab.h\"\n \n struct commit_list;\n struct ref_filter;\ndiff --git a/common-init.c b/common-init.c\nindex d26c9c1f20..7e6b392800 100644\n--- a/common-init.c\n+++ b/common-init.c\n@@ -5,10 +5,10 @@\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"attr.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"parse.h\"\n #include \"repository.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 4c2f26d454..785de5beb7 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"alloc.h\"\n+#include \"odb/alloc.h\"\n #include \"config.h\"\n #include \"dir.h\"\n #include \"environment.h\"\ndiff --git a/compat/sha1-chunked.c b/compat/sha1-chunked.c\nindex 0446f9983f..30a0d96e92 100644\n--- a/compat/sha1-chunked.c\n+++ b/compat/sha1-chunked.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len)\n {\ndiff --git a/config.c b/config.c\nindex 1bdd702e7a..eacc6847a2 100644\n--- a/config.c\n+++ b/config.c\n@@ -25,8 +25,8 @@\n #include \"quote.h\"\n #include \"hashmap.h\"\n #include \"string-list.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n #include \"utf8.h\"\n #include \"color.h\"\ndiff --git a/connect.c b/connect.c\nindex feb0420b0f..e54c88f5e2 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -13,7 +13,7 @@\n #include \"connect.h\"\n #include \"url.h\"\n #include \"string-list.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"transport.h\"\n #include \"trace2.h\"\ndiff --git a/connected.c b/connected.c\nindex 929b9bd28d..1aafa86101 100644\n--- a/connected.c\n+++ b/connected.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"run-command.h\"\n #include \"sigchain.h\"\n #include \"connected.h\"\ndiff --git a/convert.c b/convert.c\nindex 036506842c..25c800eea2 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -8,7 +8,7 @@\n #include \"copy.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"attr.h\"\n #include \"run-command.h\"\n #include \"quote.h\"\ndiff --git a/convert.h b/convert.h\nindex 0a6e4086b8..dc6a49dc7d 100644\n--- a/convert.h\n+++ b/convert.h\n@@ -4,7 +4,7 @@\n #ifndef CONVERT_H\n #define CONVERT_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"string-list.h\"\n \n struct index_state;\ndiff --git a/csum-file.c b/csum-file.c\nindex fe18ee1de3..483608d1ec 100644\n--- a/csum-file.c\n+++ b/csum-file.c\n@@ -11,7 +11,7 @@\n #include \"git-compat-util.h\"\n #include \"csum-file.h\"\n #include \"git-zlib.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"progress.h\"\n \n static void verify_buffer_or_die(struct hashfile *f,\ndiff --git a/csum-file.h b/csum-file.h\nindex 6ed74d1637..dd7aeb2813 100644\n--- a/csum-file.h\n+++ b/csum-file.h\n@@ -1,7 +1,7 @@\n #ifndef CSUM_FILE_H\n #define CSUM_FILE_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"write-or-die.h\"\n \n struct progress;\ndiff --git a/decorate.c b/decorate.c\nindex 9f24925263..262c9198eb 100644\n--- a/decorate.c\n+++ b/decorate.c\n@@ -4,7 +4,7 @@\n  */\n \n #include \"git-compat-util.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"decorate.h\"\n \n static unsigned int hash_obj(const struct object *obj, unsigned int n)\ndiff --git a/delta-islands.c b/delta-islands.c\nindex e71a7e1c05..0c0d222ab3 100644\n--- a/delta-islands.c\n+++ b/delta-islands.c\n@@ -1,14 +1,14 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"object.h\"\n-#include \"commit.h\"\n+#include \"odb/object.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"tag.h\"\n-#include \"tree.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/tree.h\"\n #include \"pack.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"diff.h\"\n #include \"progress.h\"\n #include \"refs.h\"\n@@ -16,7 +16,7 @@\n #include \"pack-bitmap.h\"\n #include \"pack-objects.h\"\n #include \"delta-islands.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"config.h\"\n \n KHASH_INIT(str, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)\ndiff --git a/diagnose.c b/diagnose.c\nindex 5092bf80d3..6858f39f45 100644\n--- a/diagnose.c\n+++ b/diagnose.c\n@@ -7,7 +7,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"strvec.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n #include \"parse-options.h\"\n #include \"repository.h\"\ndiff --git a/diff-lib.c b/diff-lib.c\nindex 086476bd77..313b6136b1 100644\n--- a/diff-lib.c\n+++ b/diff-lib.c\n@@ -6,13 +6,13 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"read-cache.h\"\n #include \"revision.h\"\n #include \"cache-tree.h\"\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex f320424f05..552cd95679 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -9,7 +9,7 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"color.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"gettext.h\"\ndiff --git a/diff.c b/diff.c\nindex cfe515af4e..22265895a7 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -23,7 +23,7 @@\n #include \"color.h\"\n #include \"run-command.h\"\n #include \"utf8.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"userdiff.h\"\n #include \"submodule.h\"\n #include \"hashmap.h\"\n@@ -31,17 +31,17 @@\n #include \"merge-ll.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n-#include \"tmp-objdir.h\"\n+#include \"odb/tmp-objdir.h\"\n #include \"graph.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"packfile.h\"\n #include \"pager.h\"\n #include \"parse-options.h\"\n #include \"help.h\"\n #include \"promisor-remote.h\"\n #include \"dir.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n #include \"read-cache-ll.h\"\n #include \"setup.h\"\n #include \"strmap.h\"\ndiff --git a/diff.h b/diff.h\nindex bb5cddaf34..502bf24432 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -4,7 +4,7 @@\n #ifndef DIFF_H\n #define DIFF_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"pathspec.h\"\n #include \"strbuf.h\"\n #include \"color.h\"\ndiff --git a/diffcore-break.c b/diffcore-break.c\nindex b5bcc956cc..70860c8abc 100644\n--- a/diffcore-break.c\n+++ b/diffcore-break.c\n@@ -6,8 +6,8 @@\n \n #include \"git-compat-util.h\"\n #include \"diffcore.h\"\n-#include \"hash.h\"\n-#include \"object.h\"\n+#include \"odb/hash.h\"\n+#include \"odb/object.h\"\n #include \"promisor-remote.h\"\n \n static int should_break(struct repository *r,\ndiff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c\nindex b0915be86f..f7a745fb49 100644\n--- a/diffcore-pickaxe.c\n+++ b/diffcore-pickaxe.c\n@@ -10,7 +10,7 @@\n #include \"diffcore.h\"\n #include \"xdiff-interface.h\"\n #include \"kwset.h\"\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n #include \"pretty.h\"\n #include \"quote.h\"\n \ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex c797d8ed2f..68abf77c4d 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -8,10 +8,10 @@\n #include \"git-compat-util.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"hashmap.h\"\n #include \"mem-pool.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"progress.h\"\n #include \"promisor-remote.h\"\n #include \"string-list.h\"\ndiff --git a/diffcore.h b/diffcore.h\nindex d75038d1b3..fa6125d0bf 100644\n--- a/diffcore.h\n+++ b/diffcore.h\n@@ -4,7 +4,7 @@\n #ifndef DIFFCORE_H\n #define DIFFCORE_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct diff_options;\n struct mem_pool;\ndiff --git a/dir.c b/dir.c\nindex 95d8a1cce9..c9005a0ac1 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -17,7 +17,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"name-hash.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"path.h\"\n #include \"refs.h\"\n #include \"repository.h\"\n@@ -34,7 +34,7 @@\n #include \"submodule-config.h\"\n #include \"symlinks.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"hex.h\"\n \n  /*\ndiff --git a/dir.h b/dir.h\nindex 83e0f648a8..239c7efb1e 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -1,7 +1,7 @@\n #ifndef DIR_H\n #define DIR_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hashmap.h\"\n #include \"pathspec.h\"\n #include \"statinfo.h\"\ndiff --git a/entry.c b/entry.c\nindex 1c4f0f4407..823a433539 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"dir.h\"\n #include \"environment.h\"\ndiff --git a/environment.c b/environment.c\nindex 76ee65e62b..40b993ec90 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -23,12 +23,12 @@\n #include \"ident.h\"\n #include \"lockfile.h\"\n #include \"mailmap.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"repository.h\"\n #include \"config.h\"\n #include \"refs.h\"\n #include \"fmt-merge-msg.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"strvec.h\"\n #include \"pager.h\"\n #include \"path.h\"\ndiff --git a/fetch-object-info.c b/fetch-object-info.c\nindex ba7e179c44..30cf131aed 100644\n--- a/fetch-object-info.c\n+++ b/fetch-object-info.c\n@@ -3,8 +3,8 @@\n #include \"hex.h\"\n #include \"pkt-line.h\"\n #include \"connect.h\"\n-#include \"oid-array.h\"\n-#include \"odb.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/odb.h\"\n #include \"fetch-object-info.h\"\n #include \"string-list.h\"\n \ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex 626f799712..b172114879 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -11,8 +11,8 @@\n #include \"lockfile.h\"\n #include \"refs.h\"\n #include \"pkt-line.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"pack.h\"\n #include \"sideband.h\"\n #include \"fetch-pack.h\"\n@@ -21,15 +21,15 @@\n #include \"connect.h\"\n #include \"trace2.h\"\n #include \"version.h\"\n-#include \"oid-array.h\"\n-#include \"oidset.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/oidset.h\"\n #include \"packfile.h\"\n-#include \"odb.h\"\n-#include \"object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/object-name.h\"\n #include \"path.h\"\n #include \"connected.h\"\n #include \"fetch-negotiator.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"shallow.h\"\n #include \"commit-reach.h\"\n #include \"commit-graph.h\"\ndiff --git a/fetch-pack.h b/fetch-pack.h\nindex 6d0dec7f41..14e4ba1079 100644\n--- a/fetch-pack.h\n+++ b/fetch-pack.h\n@@ -4,7 +4,7 @@\n #include \"string-list.h\"\n #include \"protocol.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n \n struct oid_array;\n \ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex 14441f23ae..6e11ad0fa9 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -5,13 +5,13 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"refs.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n #include \"hex.h\"\n #include \"revision.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"string-list.h\"\n #include \"branch.h\"\n #include \"fmt-merge-msg.h\"\ndiff --git a/fsmonitor.h b/fsmonitor.h\nindex 5195a8624d..59591ee49e 100644\n--- a/fsmonitor.h\n+++ b/fsmonitor.h\n@@ -4,7 +4,7 @@\n #include \"fsmonitor-ll.h\"\n #include \"dir.h\"\n #include \"fsmonitor-settings.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"read-cache-ll.h\"\n #include \"trace.h\"\n \ndiff --git a/git.c b/git.c\nindex cd2d325585..619219afef 100644\n--- a/git.c\n+++ b/git.c\n@@ -6,12 +6,12 @@\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"help.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"pager.h\"\n #include \"read-cache-ll.h\"\n #include \"run-command.h\"\n #include \"alias.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"setup.h\"\n #include \"attr.h\"\n #include \"shallow.h\"\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 95abf1ef4e..034bed7aaa 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"config.h\"\n #include \"date.h\"\n #include \"gettext.h\"\ndiff --git a/graph.c b/graph.c\nindex 28bef1b88f..66c2be423e 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"color.h\"\n #include \"graph.h\"\n #include \"revision.h\"\ndiff --git a/grep.c b/grep.c\nindex 1d75d31421..5041c388b9 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -5,7 +5,7 @@\n #include \"gettext.h\"\n #include \"grep.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"pretty.h\"\n #include \"userdiff.h\"\n #include \"xdiff-interface.h\"\ndiff --git a/help.c b/help.c\nindex 46241492ce..ccc42f09e0 100644\n--- a/help.c\n+++ b/help.c\n@@ -9,7 +9,7 @@\n #include \"run-command.h\"\n #include \"levenshtein.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"help.h\"\n #include \"command-list.h\"\n #include \"string-list.h\"\ndiff --git a/hex.c b/hex.c\nindex f02832140d..6aabaf45e7 100644\n--- a/hex.c\n+++ b/hex.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"strbuf.h\"\n \ndiff --git a/hex.h b/hex.h\nindex f15c7e2220..e6dd268faf 100644\n--- a/hex.h\n+++ b/hex.h\n@@ -1,7 +1,7 @@\n #ifndef HEX_H\n #define HEX_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex-ll.h\"\n \n /*\ndiff --git a/http-backend.c b/http-backend.c\nindex c7566b1d12..9b7ae96579 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -10,8 +10,8 @@\n #include \"repository.h\"\n #include \"refs.h\"\n #include \"pkt-line.h\"\n-#include \"object.h\"\n-#include \"tag.h\"\n+#include \"odb/object.h\"\n+#include \"odb/tag.h\"\n #include \"exec-cmd.h\"\n #include \"run-command.h\"\n #include \"string-list.h\"\n@@ -19,7 +19,7 @@\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"packfile.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"protocol.h\"\n #include \"date.h\"\n #include \"write-or-die.h\"\ndiff --git a/http-push.c b/http-push.c\nindex 786a2e9c0d..858aa9db33 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -4,9 +4,9 @@\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n-#include \"blob.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/blob.h\"\n #include \"http.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n@@ -15,12 +15,12 @@\n #include \"setup.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"url.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"commit-reach.h\"\n \n #ifdef EXPAT_NEEDS_XMLPARSE_H\ndiff --git a/http-walker.c b/http-walker.c\nindex abafca84d6..dba84c0ef5 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -9,8 +9,8 @@\n #include \"list.h\"\n #include \"transport.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n \n struct alt_base {\n \tchar *base;\ndiff --git a/http.c b/http.c\nindex a0d399b274..81b58bd8d2 100644\n--- a/http.c\n+++ b/http.c\n@@ -19,8 +19,8 @@\n #include \"transport.h\"\n #include \"packfile.h\"\n #include \"string-list.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"tempfile.h\"\n #include \"date.h\"\n #include \"trace2.h\"\ndiff --git a/khash.h b/khash.h\nindex ff88163177..665ade151f 100644\n--- a/khash.h\n+++ b/khash.h\n@@ -26,7 +26,7 @@\n #ifndef __AC_KHASH_H\n #define __AC_KHASH_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n #define AC_VERSION_KHASH_H \"0.2.8\"\n \ndiff --git a/line-log.c b/line-log.c\nindex 0179f138f7..2c9c11e5d3 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -4,10 +4,10 @@\n #include \"diffcore.h\"\n #include \"line-range.h\"\n #include \"hex.h\"\n-#include \"tag.h\"\n-#include \"tree.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/tree.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"decorate.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n@@ -17,7 +17,7 @@\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"bloom.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n \n static void range_set_grow(struct range_set *rs, size_t extra)\n {\ndiff --git a/list-objects-filter-options.h b/list-objects-filter-options.h\nindex 77d7bbc846..96cbe9c89b 100644\n--- a/list-objects-filter-options.h\n+++ b/list-objects-filter-options.h\n@@ -2,7 +2,7 @@\n #define LIST_OBJECTS_FILTER_OPTIONS_H\n \n #include \"gettext.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"strbuf.h\"\n \n struct option;\ndiff --git a/list-objects-filter.c b/list-objects-filter.c\nindex c912ff3079..a34e07c061 100644\n--- a/list-objects-filter.c\n+++ b/list-objects-filter.c\n@@ -4,15 +4,15 @@\n #include \"dir.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects-filter.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"oidmap.h\"\n-#include \"oidset.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/oidmap.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n \n /* Remember to update object flag allocation in object.h */\n /*\ndiff --git a/list-objects.c b/list-objects.c\nindex 724d723c48..b8a673ed69 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -1,20 +1,20 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"tag.h\"\n-#include \"commit.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"tree.h\"\n-#include \"blob.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/blob.h\"\n #include \"diff.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter.h\"\n #include \"list-objects-filter-options.h\"\n #include \"packfile.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"trace.h\"\n #include \"environment.h\"\n \ndiff --git a/log-tree.c b/log-tree.c\nindex 83a3c4bf9b..c9fde242a1 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -3,24 +3,24 @@\n \n #include \"git-compat-util.h\"\n #include \"commit-reach.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"config.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/object-file.h\"\n #include \"repository.h\"\n-#include \"tmp-objdir.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/tmp-objdir.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"graph.h\"\n #include \"log-tree.h\"\n #include \"merge-ort.h\"\n #include \"reflog-walk.h\"\n #include \"refs.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"revision.h\"\n #include \"string-list.h\"\n #include \"color.h\"\n@@ -30,7 +30,7 @@\n #include \"help.h\"\n #include \"range-diff.h\"\n #include \"strmap.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"wildmatch.h\"\n #include \"write-or-die.h\"\n #include \"pager.h\"\ndiff --git a/ls-refs.c b/ls-refs.c\nindex 9759826ca7..e29ef0947f 100644\n--- a/ls-refs.c\n+++ b/ls-refs.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n #include \"refs.h\"\ndiff --git a/mailmap.c b/mailmap.c\nindex 1386ab208c..558b1972f8 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -2,8 +2,8 @@\n #include \"environment.h\"\n #include \"string-list.h\"\n #include \"mailmap.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"setup.h\"\n #include \"config.h\"\n \ndiff --git a/merge-blobs.c b/merge-blobs.c\nindex 16a75bd1e3..96210edd16 100644\n--- a/merge-blobs.c\n+++ b/merge-blobs.c\n@@ -2,9 +2,9 @@\n \n #include \"git-compat-util.h\"\n #include \"merge-ll.h\"\n-#include \"blob.h\"\n+#include \"odb/blob.h\"\n #include \"merge-blobs.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n \n static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)\n {\ndiff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c\nindex 2110844f53..846753abdf 100644\n--- a/merge-ort-wrappers.c\n+++ b/merge-ort-wrappers.c\n@@ -1,16 +1,16 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"merge-ort.h\"\n #include \"merge-ort-wrappers.h\"\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\n-#include \"tag.h\"\n-#include \"tree.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/tree.h\"\n \n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n \n static int unclean(struct merge_options *opt, struct tree *head)\n {\ndiff --git a/merge-ort.c b/merge-ort.c\nindex c410a5d353..35d30dcf06 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -20,11 +20,11 @@\n #include \"git-compat-util.h\"\n #include \"merge-ort.h\"\n \n-#include \"alloc.h\"\n+#include \"odb/alloc.h\"\n #include \"advice.h\"\n #include \"attr.h\"\n #include \"cache-tree.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-reach.h\"\n #include \"config.h\"\n #include \"diff.h\"\n@@ -35,12 +35,12 @@\n #include \"hex.h\"\n #include \"entry.h\"\n #include \"merge-ll.h\"\n-#include \"match-trees.h\"\n+#include \"odb/match-trees.h\"\n #include \"mem-pool.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"oid-array.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\n #include \"read-cache-ll.h\"\n@@ -49,7 +49,7 @@\n #include \"sparse-index.h\"\n #include \"strmap.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"unpack-trees.h\"\n #include \"xdiff-interface.h\"\n \ndiff --git a/merge-ort.h b/merge-ort.h\nindex 6045579825..da1d63131a 100644\n--- a/merge-ort.h\n+++ b/merge-ort.h\n@@ -1,7 +1,7 @@\n #ifndef MERGE_ORT_H\n #define MERGE_ORT_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"strbuf.h\"\n \n struct commit;\ndiff --git a/merge.c b/merge.c\nindex 0f5e823e63..f46d968b70 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -2,16 +2,16 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"merge.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"resolve-undo.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"unpack-trees.h\"\n \n static const char *merge_argument(struct commit *commit)\ndiff --git a/meson.build b/meson.build\nindex 38ec7d4f40..6586f8ae9f 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -312,7 +312,7 @@ libgit_sources = [\n   'add-patch.c',\n   'advice.c',\n   'alias.c',\n-  'alloc.c',\n+  'odb/alloc.c',\n   'apply.c',\n   'archive-tar.c',\n   'archive-zip.c',\n@@ -321,13 +321,13 @@ libgit_sources = [\n   'base85.c',\n   'bisect.c',\n   'blame.c',\n-  'blob.c',\n+  'odb/blob.c',\n   'bloom.c',\n   'branch.c',\n   'bundle-uri.c',\n   'bundle.c',\n   'cache-tree.c',\n-  'cbtree.c',\n+  'odb/cbtree.c',\n   'chdir-notify.c',\n   'checkout.c',\n   'chunk-format.c',\n@@ -336,7 +336,7 @@ libgit_sources = [\n   'combine-diff.c',\n   'commit-graph.c',\n   'commit-reach.c',\n-  'commit.c',\n+  'odb/commit.c',\n   'common-exit.c',\n   'common-init.c',\n   'compiler-tricks/not-constant.c',\n@@ -377,7 +377,7 @@ libgit_sources = [\n   'fetch-object-info.c',\n   'fetch-pack.c',\n   'fmt-merge-msg.c',\n-  'fsck.c',\n+  'odb/fsck.c',\n   'fsmonitor.c',\n   'fsmonitor-ipc.c',\n   'fsmonitor-settings.c',\n@@ -386,8 +386,8 @@ libgit_sources = [\n   'gpg-interface.c',\n   'graph.c',\n   'grep.c',\n-  'hash-lookup.c',\n-  'hash.c',\n+  'odb/hash-lookup.c',\n+  'odb/hash.c',\n   'hashmap.c',\n   'help.c',\n   'hex.c',\n@@ -405,11 +405,11 @@ libgit_sources = [\n   'list-objects.c',\n   'lockfile.c',\n   'log-tree.c',\n-  'loose.c',\n+  'odb/loose.c',\n   'ls-refs.c',\n   'mailinfo.c',\n   'mailmap.c',\n-  'match-trees.c',\n+  'odb/match-trees.c',\n   'mem-pool.c',\n   'merge-blobs.c',\n   'merge-ll.c',\n@@ -426,11 +426,11 @@ libgit_sources = [\n   'notes-merge.c',\n   'notes-utils.c',\n   'notes.c',\n-  'object-file-convert.c',\n-  'object-file.c',\n-  'object-name.c',\n-  'object.c',\n-  'odb.c',\n+  'odb/object-file-convert.c',\n+  'odb/object-file.c',\n+  'odb/object-name.c',\n+  'odb/object.c',\n+  'odb/odb.c',\n   'odb/source.c',\n   'odb/source-files.c',\n   'odb/source-inmemory.c',\n@@ -438,10 +438,10 @@ libgit_sources = [\n   'odb/source-packed.c',\n   'odb/streaming.c',\n   'odb/transaction.c',\n-  'oid-array.c',\n-  'oidmap.c',\n-  'oidset.c',\n-  'oidtree.c',\n+  'odb/oid-array.c',\n+  'odb/oidmap.c',\n+  'odb/oidset.c',\n+  'odb/oidtree.c',\n   'organize/gitorganize-format.c',\n   'organize/labeler-protocol.c',\n   'organize/organize.c',\n@@ -515,7 +515,7 @@ libgit_sources = [\n   'repack-geometry.c',\n   'repack-midx.c',\n   'repack-promisor.c',\n-  'replace-object.c',\n+  'odb/replace-object.c',\n   'replay.c',\n   'repo-settings.c',\n   'repository.c',\n@@ -544,10 +544,10 @@ libgit_sources = [\n   'submodule-config.c',\n   'submodule.c',\n   'symlinks.c',\n-  'tag.c',\n+  'odb/tag.c',\n   'tempfile.c',\n   'thread-utils.c',\n-  'tmp-objdir.c',\n+  'odb/tmp-objdir.c',\n   'trace.c',\n   'trace2.c',\n   'trace2/tr2_cfg.c',\n@@ -566,8 +566,8 @@ libgit_sources = [\n   'transport-helper.c',\n   'transport.c',\n   'tree-diff.c',\n-  'tree-walk.c',\n-  'tree.c',\n+  'odb/tree-walk.c',\n+  'odb/tree.c',\n   'unpack-trees.c',\n   'upload-pack.c',\n   'url.c',\ndiff --git a/midx-write.c b/midx-write.c\nindex 580724d21a..bb4ceaede7 100644\n--- a/midx-write.c\n+++ b/midx-write.c\n@@ -4,8 +4,8 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/hash-lookup.h\"\n #include \"midx.h\"\n #include \"progress.h\"\n #include \"trace2.h\"\ndiff --git a/midx.c b/midx.c\nindex 76c3f92cc3..47f67c4295 100644\n--- a/midx.c\n+++ b/midx.c\n@@ -5,7 +5,7 @@\n #include \"dir.h\"\n #include \"hex.h\"\n #include \"packfile.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/hash-lookup.h\"\n #include \"midx.h\"\n #include \"progress.h\"\n #include \"trace2.h\"\ndiff --git a/name-hash.c b/name-hash.c\nindex 83757db874..1464b6d066 100644\n--- a/name-hash.c\n+++ b/name-hash.c\n@@ -13,7 +13,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"name-hash.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"read-cache-ll.h\"\n #include \"thread-utils.h\"\n #include \"trace.h\"\ndiff --git a/negotiator/default.c b/negotiator/default.c\nindex 19cdf3808c..404db17785 100644\n--- a/negotiator/default.c\n+++ b/negotiator/default.c\n@@ -2,12 +2,12 @@\n \n #include \"git-compat-util.h\"\n #include \"default.h\"\n-#include \"../commit.h\"\n+#include \"odb/commit.h\"\n #include \"../fetch-negotiator.h\"\n #include \"../prio-queue.h\"\n #include \"../refs.h\"\n #include \"../repository.h\"\n-#include \"../tag.h\"\n+#include \"odb/tag.h\"\n \n /* Remember to update object flag allocation in object.h */\n #define COMMON\t\t(1U << 2)\ndiff --git a/negotiator/skipping.c b/negotiator/skipping.c\nindex db90fa77b5..e1218d2a93 100644\n--- a/negotiator/skipping.c\n+++ b/negotiator/skipping.c\n@@ -2,13 +2,13 @@\n \n #include \"git-compat-util.h\"\n #include \"skipping.h\"\n-#include \"../commit.h\"\n+#include \"odb/commit.h\"\n #include \"../fetch-negotiator.h\"\n #include \"../hex.h\"\n #include \"../prio-queue.h\"\n #include \"../refs.h\"\n #include \"../repository.h\"\n-#include \"../tag.h\"\n+#include \"odb/tag.h\"\n \n /* Remember to update object flag allocation in object.h */\n /*\ndiff --git a/notes-cache.c b/notes-cache.c\nindex 74cef802bd..abe0964bba 100644\n--- a/notes-cache.c\n+++ b/notes-cache.c\n@@ -2,11 +2,11 @@\n \n #include \"git-compat-util.h\"\n #include \"notes-cache.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"pretty.h\"\n #include \"repository.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"refs.h\"\n #include \"strbuf.h\"\n \ndiff --git a/notes-merge.c b/notes-merge.c\nindex 118cad2518..2b025b6d3d 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -3,12 +3,12 @@\n \n #include \"git-compat-util.h\"\n #include \"advice.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"refs.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n #include \"repository.h\"\n #include \"diff.h\"\ndiff --git a/notes-utils.c b/notes-utils.c\nindex 5c1c75d5b8..b6275dfa26 100644\n--- a/notes-utils.c\n+++ b/notes-utils.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"refs.h\"\ndiff --git a/notes.c b/notes.c\nindex ec9c2cb150..ef44dae00d 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -6,12 +6,12 @@\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"notes.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"utf8.h\"\n #include \"strbuf.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"string-list.h\"\n #include \"refs.h\"\n \ndiff --git a/alloc.c b/odb/alloc.c\nsimilarity index 95%\nrename from alloc.c\nrename to odb/alloc.c\nindex 533a045c2a..e0f0146bf8 100644\n--- a/alloc.c\n+++ b/odb/alloc.c\n@@ -9,13 +9,13 @@\n  * for the new allocation is.\n  */\n #include \"git-compat-util.h\"\n-#include \"object.h\"\n-#include \"blob.h\"\n-#include \"tree.h\"\n-#include \"commit.h\"\n+#include \"odb/object.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/commit.h\"\n #include \"repository.h\"\n-#include \"tag.h\"\n-#include \"alloc.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/alloc.h\"\n \n #define BLOCKING 1024\n \ndiff --git a/alloc.h b/odb/alloc.h\nsimilarity index 100%\nrename from alloc.h\nrename to odb/alloc.h\ndiff --git a/blob.c b/odb/blob.c\nsimilarity index 89%\nrename from blob.c\nrename to odb/blob.c\nindex 3fb2922b1a..cd4b34a2b3 100644\n--- a/blob.c\n+++ b/odb/blob.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"blob.h\"\n-#include \"alloc.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/alloc.h\"\n \n const char *blob_type = \"blob\";\n \ndiff --git a/blob.h b/odb/blob.h\nsimilarity index 96%\nrename from blob.h\nrename to odb/blob.h\nindex 74555c90c4..cebe385c9b 100644\n--- a/blob.h\n+++ b/odb/blob.h\n@@ -1,7 +1,7 @@\n #ifndef BLOB_H\n #define BLOB_H\n \n-#include \"object.h\"\n+#include \"odb/object.h\"\n \n extern const char *blob_type;\n \ndiff --git a/cbtree.c b/odb/cbtree.c\nsimilarity index 99%\nrename from cbtree.c\nrename to odb/cbtree.c\nindex 8f5edbb80a..6f1699385e 100644\n--- a/cbtree.c\n+++ b/odb/cbtree.c\n@@ -5,7 +5,7 @@\n  * git clone https://github.com/agl/critbit.git\n  */\n #include \"git-compat-util.h\"\n-#include \"cbtree.h\"\n+#include \"odb/cbtree.h\"\n \n static inline uint8_t *cb_node_key(struct cb_tree *t, struct cb_node *node)\n {\ndiff --git a/cbtree.h b/odb/cbtree.h\nsimilarity index 100%\nrename from cbtree.h\nrename to odb/cbtree.h\ndiff --git a/commit-slab-decl.h b/odb/commit-slab-decl.h\nsimilarity index 100%\nrename from commit-slab-decl.h\nrename to odb/commit-slab-decl.h\ndiff --git a/commit-slab-impl.h b/odb/commit-slab-impl.h\nsimilarity index 100%\nrename from commit-slab-impl.h\nrename to odb/commit-slab-impl.h\ndiff --git a/commit-slab.h b/odb/commit-slab.h\nsimilarity index 97%\nrename from commit-slab.h\nrename to odb/commit-slab.h\nindex 8e72a30536..8a736bdf72 100644\n--- a/commit-slab.h\n+++ b/odb/commit-slab.h\n@@ -1,8 +1,8 @@\n #ifndef COMMIT_SLAB_H\n #define COMMIT_SLAB_H\n \n-#include \"commit-slab-decl.h\"\n-#include \"commit-slab-impl.h\"\n+#include \"odb/commit-slab-decl.h\"\n+#include \"odb/commit-slab-impl.h\"\n \n /*\n  * define_commit_slab(slabname, elemtype) creates boilerplate code to define\ndiff --git a/commit.c b/odb/commit.c\nsimilarity index 99%\nrename from commit.c\nrename to odb/commit.c\nindex ad26f0b40a..d0e036876c 100644\n--- a/commit.c\n+++ b/odb/commit.c\n@@ -1,36 +1,36 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"tag.h\"\n-#include \"commit.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/commit.h\"\n #include \"commit-graph.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"utf8.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"notes.h\"\n-#include \"alloc.h\"\n+#include \"odb/alloc.h\"\n #include \"gpg-interface.h\"\n #include \"mergesort.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"prio-queue.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/hash-lookup.h\"\n #include \"wt-status.h\"\n #include \"advice.h\"\n #include \"refs.h\"\n #include \"commit-reach.h\"\n #include \"setup.h\"\n #include \"shallow.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"hook.h\"\n #include \"parse.h\"\n-#include \"object-file.h\"\n-#include \"object-file-convert.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-file-convert.h\"\n \n static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);\n \ndiff --git a/commit.h b/odb/commit.h\nsimilarity index 99%\nrename from commit.h\nrename to odb/commit.h\nindex 1061ed791b..a93c0f8d65 100644\n--- a/commit.h\n+++ b/odb/commit.h\n@@ -1,7 +1,7 @@\n #ifndef COMMIT_H\n #define COMMIT_H\n \n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"add-interactive.h\"\n \n struct signature_check;\ndiff --git a/fsck.c b/odb/fsck.c\nsimilarity index 99%\nrename from fsck.c\nrename to odb/fsck.c\nindex 94c8651c7d..e76779109a 100644\n--- a/fsck.c\n+++ b/odb/fsck.c\n@@ -3,21 +3,21 @@\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n #include \"repository.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"attr.h\"\n-#include \"blob.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n-#include \"fsck.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/fsck.h\"\n #include \"refs.h\"\n #include \"url.h\"\n #include \"utf8.h\"\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n #include \"packfile.h\"\n #include \"submodule-config.h\"\n #include \"config.h\"\ndiff --git a/fsck.h b/odb/fsck.h\nsimilarity index 99%\nrename from fsck.h\nrename to odb/fsck.h\nindex e77935c8a9..1e3fc862de 100644\n--- a/fsck.h\n+++ b/odb/fsck.h\n@@ -1,8 +1,8 @@\n #ifndef GIT_FSCK_H\n #define GIT_FSCK_H\n \n-#include \"object.h\"\n-#include \"oidset.h\"\n+#include \"odb/object.h\"\n+#include \"odb/oidset.h\"\n \n enum fsck_msg_type {\n \t/* for internal use only */\ndiff --git a/hash-lookup.c b/odb/hash-lookup.c\nsimilarity index 98%\nrename from hash-lookup.c\nrename to odb/hash-lookup.c\nindex 5f808caa51..cf2d4a0245 100644\n--- a/hash-lookup.c\n+++ b/odb/hash-lookup.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/hash.h\"\n+#include \"odb/hash-lookup.h\"\n #include \"read-cache-ll.h\"\n \n static uint32_t take2(const struct object_id *oid, size_t ofs)\ndiff --git a/hash-lookup.h b/odb/hash-lookup.h\nsimilarity index 100%\nrename from hash-lookup.h\nrename to odb/hash-lookup.h\ndiff --git a/hash.c b/odb/hash.c\nsimilarity index 99%\nrename from hash.c\nrename to odb/hash.c\nindex 82f7e24404..e02dcea558 100644\n--- a/hash.c\n+++ b/odb/hash.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n \n static const struct object_id empty_tree_oid = {\ndiff --git a/hash.h b/odb/hash.h\nsimilarity index 100%\nrename from hash.h\nrename to odb/hash.h\ndiff --git a/loose.c b/odb/loose.c\nsimilarity index 98%\nrename from loose.c\nrename to odb/loose.c\nindex aa3cb1b4fc..58af1f7910 100644\n--- a/loose.c\n+++ b/odb/loose.c\n@@ -1,16 +1,16 @@\n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"path.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source-files.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n #include \"wrapper.h\"\n #include \"gettext.h\"\n-#include \"loose.h\"\n+#include \"odb/loose.h\"\n #include \"lockfile.h\"\n-#include \"oidtree.h\"\n+#include \"odb/oidtree.h\"\n \n static const char *loose_object_header = \"# loose-object-idx\\n\";\n \ndiff --git a/loose.h b/odb/loose.h\nsimilarity index 100%\nrename from loose.h\nrename to odb/loose.h\ndiff --git a/match-trees.c b/odb/match-trees.c\nsimilarity index 98%\nrename from match-trees.c\nrename to odb/match-trees.c\nindex 2a43c0fa1a..4062373e11 100644\n--- a/match-trees.c\n+++ b/odb/match-trees.c\n@@ -2,12 +2,12 @@\n \n #include \"git-compat-util.h\"\n #include \"hex.h\"\n-#include \"match-trees.h\"\n+#include \"odb/match-trees.h\"\n #include \"strbuf.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"repository.h\"\n \n static int score_missing(unsigned mode)\ndiff --git a/match-trees.h b/odb/match-trees.h\nsimilarity index 100%\nrename from match-trees.h\nrename to odb/match-trees.h\ndiff --git a/object-file-convert.c b/odb/object-file-convert.c\nsimilarity index 98%\nrename from object-file-convert.c\nrename to odb/object-file-convert.c\nindex 63ee18630b..cad75963f7 100644\n--- a/object-file-convert.c\n+++ b/odb/object-file-convert.c\n@@ -5,12 +5,12 @@\n #include \"strbuf.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"hash.h\"\n-#include \"object.h\"\n-#include \"loose.h\"\n-#include \"commit.h\"\n+#include \"odb/hash.h\"\n+#include \"odb/object.h\"\n+#include \"odb/loose.h\"\n+#include \"odb/commit.h\"\n #include \"gpg-interface.h\"\n-#include \"object-file-convert.h\"\n+#include \"odb/object-file-convert.h\"\n \n int repo_oid_to_algop(struct repository *repo, const struct object_id *srcoid,\n \t\t      const struct git_hash_algo *to, struct object_id *dest)\ndiff --git a/object-file-convert.h b/odb/object-file-convert.h\nsimilarity index 96%\nrename from object-file-convert.h\nrename to odb/object-file-convert.h\nindex 9b3cc5e533..a9c454e76e 100644\n--- a/object-file-convert.h\n+++ b/odb/object-file-convert.h\n@@ -5,7 +5,7 @@ struct repository;\n struct object_id;\n struct git_hash_algo;\n struct strbuf;\n-#include \"object.h\"\n+#include \"odb/object.h\"\n \n int repo_oid_to_algop(struct repository *repo, const struct object_id *src,\n \t\t      const struct git_hash_algo *to, struct object_id *dest);\ndiff --git a/object-file.c b/odb/object-file.c\nsimilarity index 99%\nrename from object-file.c\nrename to odb/object-file.c\nindex ec35c318bc..c4841cc289 100644\n--- a/object-file.c\n+++ b/odb/object-file.c\n@@ -13,13 +13,13 @@\n #include \"convert.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"loose.h\"\n-#include \"object-file-convert.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/loose.h\"\n+#include \"odb/object-file-convert.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"odb/transaction.h\"\n #include \"pack.h\"\n@@ -29,7 +29,7 @@\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"tempfile.h\"\n-#include \"tmp-objdir.h\"\n+#include \"odb/tmp-objdir.h\"\n \n static int get_conv_flags(unsigned flags)\n {\ndiff --git a/object-file.h b/odb/object-file.h\nsimilarity index 99%\nrename from object-file.h\nrename to odb/object-file.h\nindex 805f2cfa28..5e9b61fe17 100644\n--- a/object-file.h\n+++ b/odb/object-file.h\n@@ -2,8 +2,8 @@\n #define OBJECT_FILE_H\n \n #include \"git-zlib.h\"\n-#include \"object.h\"\n-#include \"odb.h\"\n+#include \"odb/object.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source-loose.h\"\n #include \"odb/transaction.h\"\n \ndiff --git a/object-name.c b/odb/object-name.c\nsimilarity index 99%\nrename from object-name.c\nrename to odb/object-name.c\nindex 83efba0ba6..98c88e7337 100644\n--- a/object-name.c\n+++ b/odb/object-name.c\n@@ -2,21 +2,21 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"advice.h\"\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"tag.h\"\n-#include \"commit.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"refs.h\"\n #include \"remote.h\"\n #include \"dir.h\"\n-#include \"odb.h\"\n-#include \"oid-array.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oid-array.h\"\n #include \"pretty.h\"\n #include \"read-cache-ll.h\"\n #include \"repo-settings.h\"\n@@ -25,7 +25,7 @@\n #include \"midx.h\"\n #include \"commit-reach.h\"\n #include \"date.h\"\n-#include \"object-file-convert.h\"\n+#include \"odb/object-file-convert.h\"\n #include \"prio-queue.h\"\n \n static int get_oid_oneline(struct repository *r, const char *, struct object_id *,\ndiff --git a/object-name.h b/odb/object-name.h\nsimilarity index 99%\nrename from object-name.h\nrename to odb/object-name.h\nindex 167a9154ea..ecc161a086 100644\n--- a/object-name.h\n+++ b/odb/object-name.h\n@@ -1,7 +1,7 @@\n #ifndef OBJECT_NAME_H\n #define OBJECT_NAME_H\n \n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"strbuf.h\"\n \n struct object_id;\ndiff --git a/object.c b/odb/object.c\nsimilarity index 98%\nrename from object.c\nrename to odb/object.c\nindex 23b84aa7e2..8a34e52eca 100644\n--- a/object.c\n+++ b/odb/object.c\n@@ -3,16 +3,16 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object.h\"\n-#include \"replace-object.h\"\n-#include \"object-file.h\"\n+#include \"odb/object.h\"\n+#include \"odb/replace-object.h\"\n+#include \"odb/object-file.h\"\n #include \"odb/streaming.h\"\n-#include \"blob.h\"\n+#include \"odb/blob.h\"\n #include \"statinfo.h\"\n-#include \"tree.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n-#include \"alloc.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/alloc.h\"\n #include \"commit-graph.h\"\n \n unsigned int get_max_object_index(const struct repository *repo)\ndiff --git a/object.h b/odb/object.h\nsimilarity index 99%\nrename from object.h\nrename to odb/object.h\nindex 8fb03ff90a..8070b40b5e 100644\n--- a/object.h\n+++ b/odb/object.h\n@@ -1,7 +1,7 @@\n #ifndef OBJECT_H\n #define OBJECT_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct buffer_slab;\n struct repository;\ndiff --git a/odb.c b/odb/odb.c\nsimilarity index 99%\nrename from odb.c\nrename to odb/odb.c\nindex bd02d8ad54..ffa2881e9f 100644\n--- a/odb.c\n+++ b/odb/odb.c\n@@ -8,24 +8,24 @@\n #include \"hex.h\"\n #include \"khash.h\"\n #include \"lockfile.h\"\n-#include \"loose.h\"\n+#include \"odb/loose.h\"\n #include \"midx.h\"\n-#include \"object-file-convert.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file-convert.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source-inmemory.h\"\n #include \"packfile.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\n #include \"quote.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n #include \"run-command.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\n-#include \"tmp-objdir.h\"\n+#include \"odb/tmp-objdir.h\"\n #include \"trace2.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/odb.h b/odb/odb.h\nsimilarity index 99%\nrename from odb.h\nrename to odb/odb.h\nindex 8eb4e85d64..476660a706 100644\n--- a/odb.h\n+++ b/odb/odb.h\n@@ -1,9 +1,9 @@\n #ifndef ODB_H\n #define ODB_H\n \n-#include \"object.h\"\n-#include \"oidset.h\"\n-#include \"oidmap.h\"\n+#include \"odb/object.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/oidmap.h\"\n #include \"string-list.h\"\n #include \"thread-utils.h\"\n \ndiff --git a/oid-array.c b/odb/oid-array.c\nsimilarity index 97%\nrename from oid-array.c\nrename to odb/oid-array.c\nindex 9cac974395..15425abc3f 100644\n--- a/oid-array.c\n+++ b/odb/oid-array.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"oid-array.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/hash-lookup.h\"\n \n void oid_array_append(struct oid_array *array, const struct object_id *oid)\n {\ndiff --git a/oid-array.h b/odb/oid-array.h\nsimilarity index 99%\nrename from oid-array.h\nrename to odb/oid-array.h\nindex f60f9af674..fdde085587 100644\n--- a/oid-array.h\n+++ b/odb/oid-array.h\n@@ -1,7 +1,7 @@\n #ifndef OID_ARRAY_H\n #define OID_ARRAY_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n /**\n  * The API provides storage and manipulation of sets of object identifiers.\ndiff --git a/oidmap.c b/odb/oidmap.c\nsimilarity index 97%\nrename from oidmap.c\nrename to odb/oidmap.c\nindex a1ef53577f..80c5605bb6 100644\n--- a/oidmap.c\n+++ b/odb/oidmap.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n-#include \"oidmap.h\"\n+#include \"odb/hash.h\"\n+#include \"odb/oidmap.h\"\n \n static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,\n \t\t      const struct hashmap_entry *e1,\ndiff --git a/oidmap.h b/odb/oidmap.h\nsimilarity index 99%\nrename from oidmap.h\nrename to odb/oidmap.h\nindex acddcaecdd..f0cdebf688 100644\n--- a/oidmap.h\n+++ b/odb/oidmap.h\n@@ -1,7 +1,7 @@\n #ifndef OIDMAP_H\n #define OIDMAP_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hashmap.h\"\n \n /*\ndiff --git a/oidset.c b/odb/oidset.c\nsimilarity index 99%\nrename from oidset.c\nrename to odb/oidset.c\nindex c8ff0b385c..c37bb183eb 100644\n--- a/oidset.c\n+++ b/odb/oidset.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n #include \"hex.h\"\n #include \"strbuf.h\"\n \ndiff --git a/oidset.h b/odb/oidset.h\nsimilarity index 100%\nrename from oidset.h\nrename to odb/oidset.h\ndiff --git a/oidtree.c b/odb/oidtree.c\nsimilarity index 98%\nrename from oidtree.c\nrename to odb/oidtree.c\nindex e43f18026e..b1f4c1d232 100644\n--- a/oidtree.c\n+++ b/odb/oidtree.c\n@@ -3,8 +3,8 @@\n  * May be used to replace oid-array for prefix (abbreviation) matches\n  */\n #include \"git-compat-util.h\"\n-#include \"oidtree.h\"\n-#include \"hash.h\"\n+#include \"odb/oidtree.h\"\n+#include \"odb/hash.h\"\n \n struct oidtree_node {\n \tstruct cb_node base;\ndiff --git a/oidtree.h b/odb/oidtree.h\nsimilarity index 97%\nrename from oidtree.h\nrename to odb/oidtree.h\nindex baa5a436ea..41d241a5de 100644\n--- a/oidtree.h\n+++ b/odb/oidtree.h\n@@ -1,8 +1,8 @@\n #ifndef OIDTREE_H\n #define OIDTREE_H\n \n-#include \"cbtree.h\"\n-#include \"hash.h\"\n+#include \"odb/cbtree.h\"\n+#include \"odb/hash.h\"\n #include \"mem-pool.h\"\n \n /*\ndiff --git a/replace-object.c b/odb/replace-object.c\nsimilarity index 96%\nrename from replace-object.c\nrename to odb/replace-object.c\nindex 03d0f1f083..32d778f55e 100644\n--- a/replace-object.c\n+++ b/odb/replace-object.c\n@@ -1,12 +1,12 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"oidmap.h\"\n-#include \"odb.h\"\n-#include \"replace-object.h\"\n+#include \"odb/oidmap.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/replace-object.h\"\n #include \"refs.h\"\n #include \"repository.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n \n static int register_replace_ref(const struct reference *ref, void *cb_data)\n {\ndiff --git a/replace-object.h b/odb/replace-object.h\nsimilarity index 97%\nrename from replace-object.h\nrename to odb/replace-object.h\nindex 4c9f2a2383..d7139028a3 100644\n--- a/replace-object.h\n+++ b/odb/replace-object.h\n@@ -1,9 +1,9 @@\n #ifndef REPLACE_OBJECT_H\n #define REPLACE_OBJECT_H\n \n-#include \"oidmap.h\"\n+#include \"odb/oidmap.h\"\n #include \"repository.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n \n struct replace_object {\n \tstruct oidmap_entry original;\ndiff --git a/odb/source-files.c b/odb/source-files.c\nindex 4f8e7ad7e3..279a2ccab6 100644\n--- a/odb/source-files.c\n+++ b/odb/source-files.c\n@@ -1,12 +1,12 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"blob.h\"\n+#include \"odb/blob.h\"\n #include \"chdir-notify.h\"\n #include \"config.h\"\n #include \"gettext.h\"\n #include \"lockfile.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"odb/source-files.h\"\n #include \"odb/source-loose.h\"\n@@ -19,7 +19,7 @@\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"write-or-die.h\"\n \n static void odb_source_files_reparent(const char *name UNUSED,\ndiff --git a/odb/source-inmemory.c b/odb/source-inmemory.c\nindex 3e71611b8e..288b51848e 100644\n--- a/odb/source-inmemory.c\n+++ b/odb/source-inmemory.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source-inmemory.h\"\n #include \"odb/streaming.h\"\n-#include \"oidtree.h\"\n+#include \"odb/oidtree.h\"\n #include \"repository.h\"\n \n struct inmemory_object {\ndiff --git a/odb/source-loose.c b/odb/source-loose.c\nindex a292eb7efc..2b073d2a22 100644\n--- a/odb/source-loose.c\n+++ b/odb/source-loose.c\n@@ -3,14 +3,14 @@\n #include \"chdir-notify.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"loose.h\"\n-#include \"object-file.h\"\n-#include \"object-file-convert.h\"\n-#include \"odb.h\"\n+#include \"odb/loose.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-file-convert.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source-files.h\"\n #include \"odb/source-loose.h\"\n #include \"odb/streaming.h\"\n-#include \"oidtree.h\"\n+#include \"odb/oidtree.h\"\n #include \"path.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\ndiff --git a/odb/source.c b/odb/source.c\nindex 30188b806d..2a2e1d0060 100644\n--- a/odb/source.c\n+++ b/odb/source.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"odb/source-files.h\"\n #include \"odb/source.h\"\n #include \"packfile.h\"\ndiff --git a/odb/source.h b/odb/source.h\nindex 4bc037b8d6..8f063363cb 100644\n--- a/odb/source.h\n+++ b/odb/source.h\n@@ -1,8 +1,8 @@\n #ifndef ODB_SOURCE_H\n #define ODB_SOURCE_H\n \n-#include \"object.h\"\n-#include \"odb.h\"\n+#include \"odb/object.h\"\n+#include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n \n enum odb_source_type {\ndiff --git a/odb/streaming.c b/odb/streaming.c\nindex 20531e864c..c3a06f5622 100644\n--- a/odb/streaming.c\n+++ b/odb/streaming.c\n@@ -6,10 +6,10 @@\n #include \"convert.h\"\n #include \"environment.h\"\n #include \"repository.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"odb/streaming.h\"\n-#include \"replace-object.h\"\n+#include \"odb/replace-object.h\"\n \n #define FILTER_BUFFER (1024*16)\n \ndiff --git a/odb/streaming.h b/odb/streaming.h\nindex c023671780..552239e80e 100644\n--- a/odb/streaming.h\n+++ b/odb/streaming.h\n@@ -4,8 +4,8 @@\n #ifndef STREAMING_H\n #define STREAMING_H 1\n \n-#include \"object.h\"\n-#include \"odb.h\"\n+#include \"odb/object.h\"\n+#include \"odb/odb.h\"\n \n struct object_database;\n struct odb_read_stream;\ndiff --git a/tag.c b/odb/tag.c\nsimilarity index 97%\nrename from tag.c\nrename to odb/tag.c\nindex 1a00ded6eb..7be23b04c1 100644\n--- a/tag.c\n+++ b/odb/tag.c\n@@ -2,13 +2,13 @@\n \n #include \"git-compat-util.h\"\n #include \"environment.h\"\n-#include \"tag.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n-#include \"tree.h\"\n-#include \"blob.h\"\n-#include \"alloc.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/alloc.h\"\n #include \"gpg-interface.h\"\n #include \"hex.h\"\n #include \"packfile.h\"\ndiff --git a/tag.h b/odb/tag.h\nsimilarity index 96%\nrename from tag.h\nrename to odb/tag.h\nindex 534687c4ca..bfac5aa506 100644\n--- a/tag.h\n+++ b/odb/tag.h\n@@ -1,7 +1,7 @@\n #ifndef TAG_H\n #define TAG_H\n \n-#include \"object.h\"\n+#include \"odb/object.h\"\n \n extern const char *tag_type;\n \ndiff --git a/tmp-objdir.c b/odb/tmp-objdir.c\nsimilarity index 99%\nrename from tmp-objdir.c\nrename to odb/tmp-objdir.c\nindex d199d39e7c..b9ba5c4cd3 100644\n--- a/tmp-objdir.c\n+++ b/odb/tmp-objdir.c\n@@ -1,16 +1,16 @@\n #include \"git-compat-util.h\"\n-#include \"tmp-objdir.h\"\n+#include \"odb/tmp-objdir.h\"\n #include \"abspath.h\"\n #include \"chdir-notify.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"path.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\n #include \"strvec.h\"\n #include \"quote.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"repository.h\"\n \ndiff --git a/tmp-objdir.h b/odb/tmp-objdir.h\nsimilarity index 100%\nrename from tmp-objdir.h\nrename to odb/tmp-objdir.h\ndiff --git a/odb/transaction.h b/odb/transaction.h\nindex 4cb2eafcbf..56c8bec5f9 100644\n--- a/odb/transaction.h\n+++ b/odb/transaction.h\n@@ -2,7 +2,7 @@\n #define ODB_TRANSACTION_H\n \n #include \"gettext.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n \n /*\n  * A transaction may be started for an object database prior to writing new\ndiff --git a/tree-walk.c b/odb/tree-walk.c\nsimilarity index 99%\nrename from tree-walk.c\nrename to odb/tree-walk.c\nindex a67f06b9eb..51e8037ef5 100644\n--- a/tree-walk.c\n+++ b/odb/tree-walk.c\n@@ -1,14 +1,14 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"dir.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"pathspec.h\"\n #include \"json-writer.h\"\n #include \"environment.h\"\ndiff --git a/tree-walk.h b/odb/tree-walk.h\nsimilarity index 99%\nrename from tree-walk.h\nrename to odb/tree-walk.h\nindex 9646c47ac5..cada7e93c6 100644\n--- a/tree-walk.h\n+++ b/odb/tree-walk.h\n@@ -1,7 +1,7 @@\n #ifndef TREE_WALK_H\n #define TREE_WALK_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct index_state;\n struct repository;\ndiff --git a/tree.c b/odb/tree.c\nsimilarity index 97%\nrename from tree.c\nrename to odb/tree.c\nindex 53f7395e9f..f1a9779d1a 100644\n--- a/tree.c\n+++ b/odb/tree.c\n@@ -1,11 +1,11 @@\n #include \"git-compat-util.h\"\n #include \"hex.h\"\n-#include \"tree.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n-#include \"alloc.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/alloc.h\"\n+#include \"odb/tree-walk.h\"\n #include \"repository.h\"\n #include \"environment.h\"\n \ndiff --git a/tree.h b/odb/tree.h\nsimilarity index 98%\nrename from tree.h\nrename to odb/tree.h\nindex 677382eed8..cebfcfe80e 100644\n--- a/tree.h\n+++ b/odb/tree.h\n@@ -1,7 +1,7 @@\n #ifndef TREE_H\n #define TREE_H\n \n-#include \"object.h\"\n+#include \"odb/object.h\"\n \n struct pathspec;\n struct repository;\ndiff --git a/oss-fuzz/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c\nindex d2a92f34d9..5b033dbd93 100644\n--- a/oss-fuzz/fuzz-pack-idx.c\n+++ b/oss-fuzz/fuzz-pack-idx.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n \n int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\ndiff --git a/pack-bitmap-write.c b/pack-bitmap-write.c\nindex acbea89031..64233d6cd0 100644\n--- a/pack-bitmap-write.c\n+++ b/pack-bitmap-write.c\n@@ -4,25 +4,25 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"progress.h\"\n #include \"pack.h\"\n #include \"pack-bitmap.h\"\n-#include \"hash-lookup.h\"\n+#include \"odb/hash-lookup.h\"\n #include \"pack-objects.h\"\n #include \"path.h\"\n #include \"commit-reach.h\"\n #include \"prio-queue.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"pseudo-merge.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"config.h\"\n-#include \"alloc.h\"\n+#include \"odb/alloc.h\"\n #include \"refs.h\"\n #include \"strmap.h\"\n #include \"midx.h\"\ndiff --git a/pack-bitmap.c b/pack-bitmap.c\nindex e85bd69ba4..908a00ec0c 100644\n--- a/pack-bitmap.c\n+++ b/pack-bitmap.c\n@@ -1,11 +1,11 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"strbuf.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"progress.h\"\n@@ -17,7 +17,7 @@\n #include \"packfile.h\"\n #include \"repository.h\"\n #include \"trace2.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"list-objects-filter-options.h\"\n #include \"midx.h\"\n #include \"config.h\"\ndiff --git a/pack-check.c b/pack-check.c\nindex c3b8db7c5c..358c68ef11 100644\n--- a/pack-check.c\n+++ b/pack-check.c\n@@ -7,8 +7,8 @@\n #include \"pack.h\"\n #include \"progress.h\"\n #include \"packfile.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n \n struct idx_entry {\ndiff --git a/pack-mtimes.c b/pack-mtimes.c\nindex 8e1f2dec0e..903c1039c8 100644\n--- a/pack-mtimes.c\n+++ b/pack-mtimes.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"pack-mtimes.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n #include \"strbuf.h\"\n \ndiff --git a/pack-objects.c b/pack-objects.c\nindex 48510dd343..35ecc8831e 100644\n--- a/pack-objects.c\n+++ b/pack-objects.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"pack.h\"\n #include \"pack-objects.h\"\n #include \"packfile.h\"\ndiff --git a/pack-objects.h b/pack-objects.h\nindex e97e84ddcb..8b9fc2e36b 100644\n--- a/pack-objects.h\n+++ b/pack-objects.h\n@@ -1,7 +1,7 @@\n #ifndef PACK_OBJECTS_H\n #define PACK_OBJECTS_H\n \n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"thread-utils.h\"\n #include \"pack.h\"\n #include \"packfile.h\"\ndiff --git a/pack-revindex.c b/pack-revindex.c\nindex 62387ae632..613d1bb897 100644\n--- a/pack-revindex.c\n+++ b/pack-revindex.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"pack-revindex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\ndiff --git a/pack-write.c b/pack-write.c\nindex 24033a9101..86af0ac730 100644\n--- a/pack-write.c\n+++ b/pack-write.c\n@@ -6,7 +6,7 @@\n #include \"csum-file.h\"\n #include \"remote.h\"\n #include \"chunk-format.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"pack-mtimes.h\"\n #include \"pack-objects.h\"\n #include \"pack-revindex.h\"\ndiff --git a/pack.h b/pack.h\nindex 1cde92082b..2b0be52ded 100644\n--- a/pack.h\n+++ b/pack.h\n@@ -1,7 +1,7 @@\n #ifndef PACK_H\n #define PACK_H\n \n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"csum-file.h\"\n \n struct packed_git;\ndiff --git a/packfile.c b/packfile.c\nindex 0eee45055f..2936cbf3fa 100644\n--- a/packfile.c\n+++ b/packfile.c\n@@ -10,15 +10,15 @@\n #include \"dir.h\"\n #include \"packfile.h\"\n #include \"delta.h\"\n-#include \"hash-lookup.h\"\n-#include \"commit.h\"\n-#include \"object.h\"\n-#include \"tag.h\"\n+#include \"odb/hash-lookup.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/object.h\"\n+#include \"odb/tag.h\"\n #include \"trace.h\"\n-#include \"tree-walk.h\"\n-#include \"tree.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"midx.h\"\n #include \"commit-graph.h\"\ndiff --git a/packfile.h b/packfile.h\nindex e1f77152b5..9859bfb5e0 100644\n--- a/packfile.h\n+++ b/packfile.h\n@@ -2,11 +2,11 @@\n #define PACKFILE_H\n \n #include \"list.h\"\n-#include \"object.h\"\n-#include \"odb.h\"\n+#include \"odb/object.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source-files.h\"\n #include \"odb/source-packed.h\"\n-#include \"oidset.h\"\n+#include \"odb/oidset.h\"\n #include \"packfile-list.h\"\n #include \"repository.h\"\n \ndiff --git a/parallel-checkout.c b/parallel-checkout.c\nindex 0bf4bd6d4a..85d1c25a81 100644\n--- a/parallel-checkout.c\n+++ b/parallel-checkout.c\n@@ -5,7 +5,7 @@\n #include \"config.h\"\n #include \"entry.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"parallel-checkout.h\"\n #include \"pkt-line.h\"\ndiff --git a/parse-options-cb.c b/parse-options-cb.c\nindex 976cc86385..7826b8ad43 100644\n--- a/parse-options-cb.c\n+++ b/parse-options-cb.c\n@@ -3,16 +3,16 @@\n #include \"git-compat-util.h\"\n #include \"parse-options.h\"\n #include \"branch.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"color.h\"\n #include \"date.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n \n /*----- some often used options -----*/\n \ndiff --git a/patch-ids.c b/patch-ids.c\nindex 1fbc88cbec..946744e7d9 100644\n--- a/patch-ids.c\n+++ b/patch-ids.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n-#include \"hash.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"patch-ids.h\"\n \ndiff --git a/path-walk.c b/path-walk.c\nindex 9ca3248ea8..ed4d3211d2 100644\n--- a/path-walk.c\n+++ b/path-walk.c\n@@ -3,27 +3,27 @@\n  */\n #include \"git-compat-util.h\"\n #include \"path-walk.h\"\n-#include \"blob.h\"\n-#include \"commit.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/commit.h\"\n #include \"dir.h\"\n #include \"hashmap.h\"\n #include \"hex.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"object.h\"\n-#include \"oid-array.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/object.h\"\n+#include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"prio-queue.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"trace2.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n \n static const char *root_path = \"\";\n \ndiff --git a/path-walk.h b/path-walk.h\nindex a2652b2d46..f094610500 100644\n--- a/path-walk.h\n+++ b/path-walk.h\n@@ -2,7 +2,7 @@\n  * path-walk.h : Methods and structures for walking the object graph in batches\n  * by the paths that can reach those objects.\n  */\n-#include \"object.h\" /* Required for 'enum object_type'. */\n+#include \"odb/object.h\" /* Required for 'enum object_type'. */\n \n struct rev_info;\n struct oid_array;\ndiff --git a/path.c b/path.c\nindex c3a709a928..3a3a66155a 100644\n--- a/path.c\n+++ b/path.c\n@@ -14,7 +14,7 @@\n #include \"submodule-config.h\"\n #include \"path.h\"\n #include \"packfile.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"lockfile.h\"\n #include \"exec-cmd.h\"\n \ndiff --git a/pretty.c b/pretty.c\nindex d8a9f370f6..461e8cd527 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -3,10 +3,10 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"utf8.h\"\n #include \"diff.h\"\n@@ -21,7 +21,7 @@\n #include \"gpg-interface.h\"\n #include \"trailer.h\"\n #include \"run-command.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n \n /*\n  * The limit for formatting directives, which enable the caller to append\ndiff --git a/promisor-remote.c b/promisor-remote.c\nindex 43505d1e1a..b2188d34c7 100644\n--- a/promisor-remote.c\n+++ b/promisor-remote.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"promisor-remote.h\"\n #include \"config.h\"\n #include \"trace2.h\"\ndiff --git a/protocol-caps.c b/protocol-caps.c\nindex 02261be14d..edac5dbd05 100644\n--- a/protocol-caps.c\n+++ b/protocol-caps.c\n@@ -3,9 +3,9 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"pkt-line.h\"\n-#include \"hash.h\"\n-#include \"object.h\"\n-#include \"odb.h\"\n+#include \"odb/hash.h\"\n+#include \"odb/object.h\"\n+#include \"odb/odb.h\"\n #include \"repository.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\ndiff --git a/prune-packed.c b/prune-packed.c\nindex d49dc11957..f536ef1eaf 100644\n--- a/prune-packed.c\n+++ b/prune-packed.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"packfile.h\"\n #include \"progress.h\"\n #include \"prune-packed.h\"\ndiff --git a/pseudo-merge.c b/pseudo-merge.c\nindex 22b8600d68..0809a2bcb3 100644\n--- a/pseudo-merge.c\n+++ b/pseudo-merge.c\n@@ -4,14 +4,14 @@\n #include \"git-compat-util.h\"\n #include \"pseudo-merge.h\"\n #include \"date.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"strbuf.h\"\n #include \"config.h\"\n #include \"string-list.h\"\n #include \"refs.h\"\n #include \"pack-bitmap.h\"\n-#include \"commit.h\"\n-#include \"alloc.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/alloc.h\"\n #include \"progress.h\"\n #include \"hex.h\"\n \ndiff --git a/range-diff.c b/range-diff.c\nindex 8e2dd2eb19..be9f872396 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -5,7 +5,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"range-diff.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"string-list.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n@@ -13,7 +13,7 @@\n #include \"xdiff-interface.h\"\n #include \"linear-assignment.h\"\n #include \"diffcore.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"pager.h\"\n #include \"pretty.h\"\n #include \"repository.h\"\ndiff --git a/reachable.c b/reachable.c\nindex 3079d2c5f4..2a62adf7f5 100644\n--- a/reachable.c\n+++ b/reachable.c\n@@ -4,8 +4,8 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs.h\"\n-#include \"commit.h\"\n-#include \"blob.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/blob.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"reachable.h\"\n@@ -14,7 +14,7 @@\n #include \"list-objects.h\"\n #include \"packfile.h\"\n #include \"worktree.h\"\n-#include \"object-file.h\"\n+#include \"odb/object-file.h\"\n #include \"pack-bitmap.h\"\n #include \"pack-mtimes.h\"\n #include \"config.h\"\ndiff --git a/read-cache-ll.h b/read-cache-ll.h\nindex 8eb266cfd1..312e65ff3c 100644\n--- a/read-cache-ll.h\n+++ b/read-cache-ll.h\n@@ -1,7 +1,7 @@\n #ifndef READ_CACHE_LL_H\n #define READ_CACHE_LL_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hashmap.h\"\n #include \"statinfo.h\"\n \ndiff --git a/read-cache.c b/read-cache.c\nindex c076984858..8f6b812b5f 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -18,17 +18,17 @@\n #include \"cache-tree.h\"\n #include \"refs.h\"\n #include \"dir.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n-#include \"oid-array.h\"\n-#include \"tree.h\"\n-#include \"commit.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"mem-pool.h\"\n #include \"name-hash.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"path.h\"\n #include \"preload-index.h\"\n #include \"read-cache.h\"\ndiff --git a/read-cache.h b/read-cache.h\nindex ab9d40aa81..69a7118a66 100644\n--- a/read-cache.h\n+++ b/read-cache.h\n@@ -2,7 +2,7 @@\n #define READ_CACHE_H\n \n #include \"read-cache-ll.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"pathspec.h\"\n #include \"environment.h\"\n \ndiff --git a/rebase-interactive.c b/rebase-interactive.c\nindex 809f76a87b..df9c2d1275 100644\n--- a/rebase-interactive.c\n+++ b/rebase-interactive.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n@@ -9,10 +9,10 @@\n #include \"rebase-interactive.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"config.h\"\n #include \"dir.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n \n static const char edit_todo_list_advice[] =\n N_(\"You can fix this with 'git rebase --edit-todo' \"\ndiff --git a/ref-filter.c b/ref-filter.c\nindex bdf54f6f59..8a3d056577 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -11,17 +11,17 @@\n #include \"run-command.h\"\n #include \"refs.h\"\n #include \"wildmatch.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"oid-array.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oid-array.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"mailmap.h\"\n #include \"ident.h\"\n #include \"remote.h\"\n #include \"color.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n #include \"quote.h\"\n #include \"ref-filter.h\"\n #include \"revision.h\"\n@@ -29,7 +29,7 @@\n #include \"versioncmp.h\"\n #include \"trailer.h\"\n #include \"wt-status.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"commit-reach.h\"\n #include \"worktree.h\"\n #include \"hashmap.h\"\ndiff --git a/ref-filter.h b/ref-filter.h\nindex 9361296e2a..11180f9570 100644\n--- a/ref-filter.h\n+++ b/ref-filter.h\n@@ -2,8 +2,8 @@\n #define REF_FILTER_H\n \n #include \"gettext.h\"\n-#include \"oid-array.h\"\n-#include \"commit.h\"\n+#include \"odb/oid-array.h\"\n+#include \"odb/commit.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"commit-reach.h\"\ndiff --git a/reflog-walk.c b/reflog-walk.c\nindex 4dbeaa93a7..4058cfa6df 100644\n--- a/reflog-walk.c\n+++ b/reflog-walk.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"refs.h\"\n #include \"diff.h\"\n #include \"repository.h\"\ndiff --git a/reflog.c b/reflog.c\nindex 04edbe5670..178ef7fe44 100644\n--- a/reflog.c\n+++ b/reflog.c\n@@ -6,12 +6,12 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"reflog.h\"\n #include \"refs.h\"\n #include \"revision.h\"\n-#include \"tree.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/tree-walk.h\"\n #include \"wildmatch.h\"\n \n static struct reflog_expire_entry_option *find_cfg_ent(struct reflog_expire_options *opts,\ndiff --git a/refs.c b/refs.c\nindex 92d5df5b71..e01163be2a 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -15,9 +15,9 @@\n #include \"refs.h\"\n #include \"refs/refs-internal.h\"\n #include \"hook.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"object.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/object.h\"\n #include \"path.h\"\n #include \"submodule.h\"\n #include \"worktree.h\"\n@@ -25,10 +25,10 @@\n #include \"repo-settings.h\"\n #include \"setup.h\"\n #include \"date.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"wildmatch.h\"\n #include \"ident.h\"\n-#include \"fsck.h\"\n+#include \"odb/fsck.h\"\n \n /*\n  * List of all available backends\ndiff --git a/refs.h b/refs.h\nindex 9979446d15..1746d1035c 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -1,8 +1,8 @@\n #ifndef REFS_H\n #define REFS_H\n \n-#include \"object-name.h\"\n-#include \"commit.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/commit.h\"\n #include \"repository.h\"\n #include \"repo-settings.h\"\n \ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 1cc20aa486..ef7532e727 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -6,9 +6,9 @@\n #include \"../copy.h\"\n #include \"../environment.h\"\n #include \"../gettext.h\"\n-#include \"../hash.h\"\n+#include \"odb/hash.h\"\n #include \"../hex.h\"\n-#include \"../fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"../refs.h\"\n #include \"../repo-settings.h\"\n #include \"refs-internal.h\"\ndiff --git a/refs/packed-backend.c b/refs/packed-backend.c\nindex b9b04b7010..c7005a9ecc 100644\n--- a/refs/packed-backend.c\n+++ b/refs/packed-backend.c\n@@ -3,9 +3,9 @@\n #include \"../git-compat-util.h\"\n #include \"../config.h\"\n #include \"../dir.h\"\n-#include \"../fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"../gettext.h\"\n-#include \"../hash.h\"\n+#include \"odb/hash.h\"\n #include \"../hex.h\"\n #include \"../refs.h\"\n #include \"refs-internal.h\"\ndiff --git a/refs/ref-cache.c b/refs/ref-cache.c\nindex ffef01a597..a4182ea57f 100644\n--- a/refs/ref-cache.c\n+++ b/refs/ref-cache.c\n@@ -1,5 +1,5 @@\n #include \"../git-compat-util.h\"\n-#include \"../hash.h\"\n+#include \"odb/hash.h\"\n #include \"../refs.h\"\n #include \"../repository.h\"\n #include \"refs-internal.h\"\ndiff --git a/refs/ref-cache.h b/refs/ref-cache.h\nindex f635d2d824..7a4fe77a41 100644\n--- a/refs/ref-cache.h\n+++ b/refs/ref-cache.h\n@@ -1,7 +1,7 @@\n #ifndef REFS_REF_CACHE_H\n #define REFS_REF_CACHE_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct ref_dir;\n struct ref_store;\ndiff --git a/refs/reftable-backend.c b/refs/reftable-backend.c\nindex 028f0211af..9d6194c4e6 100644\n--- a/refs/reftable-backend.c\n+++ b/refs/reftable-backend.c\n@@ -4,9 +4,9 @@\n #include \"../config.h\"\n #include \"../dir.h\"\n #include \"../environment.h\"\n-#include \"../fsck.h\"\n+#include \"odb/fsck.h\"\n #include \"../gettext.h\"\n-#include \"../hash.h\"\n+#include \"odb/hash.h\"\n #include \"../hex.h\"\n #include \"../ident.h\"\n #include \"../iterator.h\"\ndiff --git a/refspec.c b/refspec.c\nindex 7cb479983b..f3cb1b0748 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 2c35dd5240..a6a145c046 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -17,7 +17,7 @@\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"credential.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"send-pack.h\"\n #include \"setup.h\"\n #include \"protocol.h\"\ndiff --git a/remote.c b/remote.c\nindex fe62068463..89dc91429a 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -12,10 +12,10 @@\n #include \"urlmatch.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"dir.h\"\ndiff --git a/remote.h b/remote.h\nindex cca02033b9..fbf552cc2f 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -1,7 +1,7 @@\n #ifndef REMOTE_H\n #define REMOTE_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hashmap.h\"\n #include \"refspec.h\"\n #include \"string-list.h\"\ndiff --git a/repack-midx.c b/repack-midx.c\nindex 64c7f8d0f4..a9df431952 100644\n--- a/repack-midx.c\n+++ b/repack-midx.c\n@@ -1,11 +1,11 @@\n #include \"git-compat-util.h\"\n #include \"repack.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"midx.h\"\n-#include \"odb.h\"\n-#include \"oidset.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oidset.h\"\n #include \"pack-bitmap.h\"\n #include \"path.h\"\n #include \"refs.h\"\ndiff --git a/repack.c b/repack.c\nindex d2aa58e134..16da2e35cb 100644\n--- a/repack.c\n+++ b/repack.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"dir.h\"\n #include \"midx.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n #include \"path.h\"\n #include \"repack.h\"\ndiff --git a/replay.c b/replay.c\nindex 463c900d6c..9e29f29ff6 100644\n--- a/replay.c\n+++ b/replay.c\n@@ -4,13 +4,13 @@\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"merge-ort.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"refs.h\"\n #include \"replay.h\"\n #include \"revision.h\"\n #include \"sequencer.h\"\n #include \"strmap.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n \n /*\n  * We technically need USE_THE_REPOSITORY_VARIABLE for DEFAULT_ABBREV, but\ndiff --git a/replay.h b/replay.h\nindex 491db145e3..7ec371d6a5 100644\n--- a/replay.h\n+++ b/replay.h\n@@ -1,7 +1,7 @@\n #ifndef REPLAY_H\n #define REPLAY_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct repository;\n struct rev_info;\ndiff --git a/repository.c b/repository.c\nindex db4f9d006e..72434e3a50 100644\n--- a/repository.c\n+++ b/repository.c\n@@ -2,17 +2,17 @@\n #include \"abspath.h\"\n #include \"repository.h\"\n #include \"hook.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"config.h\"\n #include \"gettext.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"lockfile.h\"\n #include \"path.h\"\n #include \"read-cache-ll.h\"\n #include \"remote.h\"\n #include \"setup.h\"\n-#include \"loose.h\"\n+#include \"odb/loose.h\"\n #include \"submodule-config.h\"\n #include \"sparse-index.h\"\n #include \"trace2.h\"\ndiff --git a/rerere.c b/rerere.c\nindex 3d3bd0db16..6ff20d0692 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -18,8 +18,8 @@\n #include \"merge-ll.h\"\n #include \"path.h\"\n #include \"pathspec.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"strmap.h\"\n \n #define RESOLVED 0\ndiff --git a/reset.c b/reset.c\nindex 71254bde93..950d45d07d 100644\n--- a/reset.c\n+++ b/reset.c\n@@ -3,11 +3,11 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"refs.h\"\n #include \"reset.h\"\n-#include \"tree-walk.h\"\n-#include \"tree.h\"\n+#include \"odb/tree-walk.h\"\n+#include \"odb/tree.h\"\n #include \"unpack-trees.h\"\n #include \"hook.h\"\n \ndiff --git a/reset.h b/reset.h\nindex 4c992ba671..52055ad68d 100644\n--- a/reset.h\n+++ b/reset.h\n@@ -1,7 +1,7 @@\n #ifndef RESET_H\n #define RESET_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"repository.h\"\n \n #define GIT_REFLOG_ACTION_ENVIRONMENT \"GIT_REFLOG_ACTION\"\ndiff --git a/resolve-undo.c b/resolve-undo.c\nindex 52c45e5a49..a54b6c0f79 100644\n--- a/resolve-undo.c\n+++ b/resolve-undo.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"dir.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"read-cache.h\"\n #include \"resolve-undo.h\"\n #include \"sparse-index.h\"\ndiff --git a/resolve-undo.h b/resolve-undo.h\nindex 7ed11a1c59..b10c197cf0 100644\n--- a/resolve-undo.h\n+++ b/resolve-undo.h\n@@ -6,7 +6,7 @@ struct index_state;\n struct pathspec;\n struct string_list;\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct resolve_undo_info {\n \tunsigned int mode[3];\ndiff --git a/revision.c b/revision.c\nindex 50dc8b1991..9e90f909da 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -6,14 +6,14 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n-#include \"oidset.h\"\n-#include \"tag.h\"\n-#include \"blob.h\"\n-#include \"tree.h\"\n-#include \"commit.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/tag.h\"\n+#include \"odb/blob.h\"\n+#include \"odb/tree.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"diff-merges.h\"\n #include \"refs.h\"\n@@ -28,7 +28,7 @@\n #include \"line-log.h\"\n #include \"log-tree.h\"\n #include \"mailmap.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"cache-tree.h\"\n #include \"bisect.h\"\n #include \"packfile.h\"\ndiff --git a/revision.h b/revision.h\nindex acf6d06b24..e0ff7aa0f2 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -1,14 +1,14 @@\n #ifndef REVISION_H\n #define REVISION_H\n \n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"grep.h\"\n #include \"notes.h\"\n-#include \"object-name.h\"\n-#include \"oidset.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/oidset.h\"\n #include \"pretty.h\"\n #include \"diff.h\"\n-#include \"commit-slab-decl.h\"\n+#include \"odb/commit-slab-decl.h\"\n #include \"decorate.h\"\n #include \"ident.h\"\n #include \"list-objects-filter-options.h\"\ndiff --git a/send-pack.c b/send-pack.c\nindex 3bb5afc687..97dcfac586 100644\n--- a/send-pack.c\n+++ b/send-pack.c\n@@ -1,10 +1,10 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"date.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"pkt-line.h\"\n #include \"sideband.h\"\n #include \"run-command.h\"\n@@ -13,7 +13,7 @@\n #include \"send-pack.h\"\n #include \"transport.h\"\n #include \"version.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"gpg-interface.h\"\n #include \"shallow.h\"\n #include \"parse-options.h\"\ndiff --git a/sequencer.c b/sequencer.c\nindex 83c3849205..67ab3cdf0d 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -11,12 +11,12 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"dir.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n-#include \"object.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/object.h\"\n #include \"pager.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"sequencer.h\"\n #include \"run-command.h\"\n #include \"hook.h\"\n@@ -40,9 +40,9 @@\n #include \"notes-utils.h\"\n #include \"sigchain.h\"\n #include \"unpack-trees.h\"\n-#include \"oidmap.h\"\n-#include \"oidset.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/oidmap.h\"\n+#include \"odb/oidset.h\"\n+#include \"odb/commit-slab.h\"\n #include \"alias.h\"\n #include \"commit-reach.h\"\n #include \"rebase-interactive.h\"\ndiff --git a/serve.c b/serve.c\nindex 2b07d922b3..95cf3d8ea4 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"repository.h\"\n #include \"config.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"pkt-line.h\"\n #include \"version.h\"\n #include \"ls-refs.h\"\ndiff --git a/server-info.c b/server-info.c\nindex 4243e24edc..75ead482e1 100644\n--- a/server-info.c\n+++ b/server-info.c\n@@ -5,13 +5,13 @@\n #include \"hex.h\"\n #include \"repository.h\"\n #include \"refs.h\"\n-#include \"object.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/object.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"packfile.h\"\n #include \"path.h\"\n-#include \"object-file.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/odb.h\"\n #include \"server-info.h\"\n #include \"strbuf.h\"\n #include \"tempfile.h\"\ndiff --git a/setup.c b/setup.c\nindex 20d29f31f4..fe8e9ffdc5 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -7,8 +7,8 @@\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n #include \"refs.h\"\n #include \"repository.h\"\n #include \"config.h\"\ndiff --git a/shallow.c b/shallow.c\nindex 8e244a5669..25116d7a6e 100644\n--- a/shallow.c\n+++ b/shallow.c\n@@ -5,16 +5,16 @@\n #include \"repository.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n-#include \"odb.h\"\n-#include \"commit.h\"\n-#include \"tag.h\"\n+#include \"odb/odb.h\"\n+#include \"odb/commit.h\"\n+#include \"odb/tag.h\"\n #include \"pkt-line.h\"\n #include \"refs.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n-#include \"commit-slab.h\"\n+#include \"odb/commit-slab.h\"\n #include \"list-objects.h\"\n #include \"commit-reach.h\"\n #include \"shallow.h\"\ndiff --git a/shallow.h b/shallow.h\nindex 6a64db42c9..0cb1d5ba70 100644\n--- a/shallow.h\n+++ b/shallow.h\n@@ -1,9 +1,9 @@\n #ifndef SHALLOW_H\n #define SHALLOW_H\n \n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"lockfile.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\n \ndiff --git a/sparse-index.c b/sparse-index.c\nindex c1fa231a89..8e00862442 100644\n--- a/sparse-index.c\n+++ b/sparse-index.c\n@@ -9,7 +9,7 @@\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\n #include \"sparse-index.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"pathspec.h\"\n #include \"trace2.h\"\n #include \"cache-tree.h\"\ndiff --git a/split-index.c b/split-index.c\nindex 6ba210738c..2737cc6118 100644\n--- a/split-index.c\n+++ b/split-index.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"mem-pool.h\"\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\ndiff --git a/split-index.h b/split-index.h\nindex 1a153f47ba..6bfab742aa 100644\n--- a/split-index.h\n+++ b/split-index.h\n@@ -1,7 +1,7 @@\n #ifndef SPLIT_INDEX_H\n #define SPLIT_INDEX_H\n \n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n struct index_state;\n struct strbuf;\ndiff --git a/submodule-config.c b/submodule-config.c\nindex f75997402a..094e64d8fd 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -12,12 +12,12 @@\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n #include \"strbuf.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"parse-options.h\"\n #include \"thread-utils.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\n \ndiff --git a/submodule-config.h b/submodule-config.h\nindex f55d4e3b61..3f4f0bf454 100644\n--- a/submodule-config.h\n+++ b/submodule-config.h\n@@ -3,7 +3,7 @@\n \n #include \"config.h\"\n #include \"submodule.h\"\n-#include \"tree-walk.h\"\n+#include \"odb/tree-walk.h\"\n \n /**\n  * The submodule config cache API allows to read submodule\ndiff --git a/submodule.c b/submodule.c\nindex 5c92575888..d091b484a4 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -9,7 +9,7 @@\n #include \"submodule.h\"\n #include \"dir.h\"\n #include \"diff.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n@@ -18,16 +18,16 @@\n #include \"diffcore.h\"\n #include \"refs.h\"\n #include \"string-list.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n #include \"strvec.h\"\n #include \"thread-utils.h\"\n #include \"path.h\"\n #include \"remote.h\"\n #include \"worktree.h\"\n #include \"parse-options.h\"\n-#include \"object-file.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-file.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"commit-reach.h\"\n #include \"read-cache-ll.h\"\n #include \"setup.h\"\ndiff --git a/t/helper/test-bitmap.c b/t/helper/test-bitmap.c\nindex 8547ef67e2..f1f48e973d 100644\n--- a/t/helper/test-bitmap.c\n+++ b/t/helper/test-bitmap.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"git-compat-util.h\"\n #include \"hex.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"pack-bitmap.h\"\n #include \"pseudo-merge.h\"\n #include \"setup.h\"\ndiff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c\nindex 0c65befbf0..48ff2c6024 100644\n--- a/t/helper/test-bloom.c\n+++ b/t/helper/test-bloom.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"bloom.h\"\n #include \"hex.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c\nindex d42e260092..9f613d2911 100644\n--- a/t/helper/test-cache-tree.c\n+++ b/t/helper/test-cache-tree.c\n@@ -4,7 +4,7 @@\n #include \"test-tool.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"cache-tree.h\"\n #include \"parse-options.h\"\n #include \"read-cache-ll.h\"\ndiff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\nindex ccb41a4239..849727d69b 100644\n--- a/t/helper/test-dump-cache-tree.c\n+++ b/t/helper/test-dump-cache-tree.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"cache-tree.h\"\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\ndiff --git a/t/helper/test-find-pack.c b/t/helper/test-find-pack.c\nindex 28d5b1fe09..c7475ed4d9 100644\n--- a/t/helper/test-find-pack.c\n+++ b/t/helper/test-find-pack.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"object-name.h\"\n-#include \"odb.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n #include \"parse-options.h\"\n #include \"setup.h\"\ndiff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c\nindex 89b0268011..4c71b04c57 100644\n--- a/t/helper/test-hash-speed.c\n+++ b/t/helper/test-hash-speed.c\n@@ -1,5 +1,5 @@\n #include \"test-tool.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n \n #define NUM_SECONDS 3\n \ndiff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c\nindex 006ce5278e..b6122af08f 100644\n--- a/t/helper/test-match-trees.c\n+++ b/t/helper/test-match-trees.c\n@@ -2,11 +2,11 @@\n \n #include \"test-tool.h\"\n #include \"hex.h\"\n-#include \"match-trees.h\"\n-#include \"object-name.h\"\n+#include \"odb/match-trees.h\"\n+#include \"odb/object-name.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n \n int cmd__match_trees(int ac UNUSED, const char **av)\n {\ndiff --git a/t/helper/test-pack-deltas.c b/t/helper/test-pack-deltas.c\nindex 840797cf0d..7e5791c7ab 100644\n--- a/t/helper/test-pack-deltas.c\n+++ b/t/helper/test-pack-deltas.c\n@@ -4,7 +4,7 @@\n #include \"git-compat-util.h\"\n #include \"delta.h\"\n #include \"git-zlib.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"pack.h\"\n #include \"pack-objects.h\"\ndiff --git a/t/helper/test-pack-mtimes.c b/t/helper/test-pack-mtimes.c\nindex b774056799..b915059322 100644\n--- a/t/helper/test-pack-mtimes.c\n+++ b/t/helper/test-pack-mtimes.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"hex.h\"\n #include \"strbuf.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"packfile.h\"\n #include \"pack-mtimes.h\"\n #include \"setup.h\"\ndiff --git a/t/helper/test-partial-clone.c b/t/helper/test-partial-clone.c\nindex 87c59108e0..76fc0329fc 100644\n--- a/t/helper/test-partial-clone.c\n+++ b/t/helper/test-partial-clone.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"setup.h\"\n \n /*\ndiff --git a/t/helper/test-path-walk.c b/t/helper/test-path-walk.c\nindex 4233badb58..f41c6be2c6 100644\n--- a/t/helper/test-path-walk.c\n+++ b/t/helper/test-path-walk.c\n@@ -5,15 +5,15 @@\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"object-name.h\"\n-#include \"object.h\"\n+#include \"odb/object-name.h\"\n+#include \"odb/object.h\"\n #include \"pretty.h\"\n #include \"revision.h\"\n #include \"setup.h\"\n #include \"parse-options.h\"\n #include \"strbuf.h\"\n #include \"path-walk.h\"\n-#include \"oid-array.h\"\n+#include \"odb/oid-array.h\"\n \n static const char * const path_walk_usage[] = {\n \tN_(\"test-tool path-walk <options> -- <revision-options>\"),\ndiff --git a/t/helper/test-reach.c b/t/helper/test-reach.c\nindex 5d86a96c17..4151cfbe25 100644\n--- a/t/helper/test-reach.c\n+++ b/t/helper/test-reach.c\n@@ -1,15 +1,15 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"commit-reach.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"ref-filter.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n-#include \"tag.h\"\n+#include \"odb/tag.h\"\n \n static void print_sorted_commit_ids(struct commit_list *list)\n {\ndiff --git a/t/helper/test-read-graph.c b/t/helper/test-read-graph.c\nindex 9f07b9c25a..965700a698 100644\n--- a/t/helper/test-read-graph.c\n+++ b/t/helper/test-read-graph.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"commit-graph.h\"\n #include \"repository.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"bloom.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c\nindex fb16ec0176..9be143ee6c 100644\n--- a/t/helper/test-read-midx.c\n+++ b/t/helper/test-read-midx.c\n@@ -4,7 +4,7 @@\n #include \"hex.h\"\n #include \"midx.h\"\n #include \"repository.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"pack-bitmap.h\"\n #include \"packfile.h\"\n #include \"setup.h\"\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex 5a9a3053d9..1fbdc52fc5 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -5,7 +5,7 @@\n #include \"refs.h\"\n #include \"setup.h\"\n #include \"worktree.h\"\n-#include \"odb.h\"\n+#include \"odb/odb.h\"\n #include \"path.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\ndiff --git a/t/helper/test-reftable.c b/t/helper/test-reftable.c\nindex fc49fafc34..e469f850ce 100644\n--- a/t/helper/test-reftable.c\n+++ b/t/helper/test-reftable.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"hash.h\"\n+#include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"reftable/system.h\"\n #include \"reftable/reftable-constants.h\"\ndiff --git a/t/helper/test-repository.c b/t/helper/test-repository.c\nindex 9ba94cdffa..530e37b01d 100644\n--- a/t/helper/test-repository.c\n+++ b/t/helper/test-repository.c\n@@ -2,13 +2,13 @@\n \n #include \"test-tool.h\"\n #include \"commit-graph.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"object.h\"\n+#include \"odb/object.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n \n static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,\n \t\t\t\t       const struct object_id *commit_oid)\ndiff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c\nindex 24d7f29417..1b7f569f01 100644\n--- a/t/helper/test-revision-walking.c\n+++ b/t/helper/test-revision-walking.c\n@@ -11,10 +11,10 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"commit.h\"\n+#include \"odb/commit.h\"\n #include \"diff.h\"\n #include \"line-log.h\"\n-#include \"object-name.h\"\n+#include \"odb/object-name.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n #include \"setup.h\"\ndiff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\nindex 7b5ce501d9..f4f7df067d 100644\n--- a/t/helper/test-scrap-cache-tree.c\n+++ b/t/helper/test-scrap-cache-tree.c\n@@ -5,7 +5,7 @@\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n-#include \"tree.h\"\n+#include \"odb/tree.h\"\n #include \"cache-tree.h\"\n \n int cmd__scrap_cache_tree(int ac UNUSED, const char **av UNUSED)\ndiff --git a/t/helper/test-sha1.c b/t/helper/test-sha1.c\nindex 349540c4df..c45e56c23f 100644\n--- a/t/helper/test-sha1.c\n+++ b/t/helper/test-sha1.c\n@@ -1,5 +1,5 @@\n #include \"test-tool.h\"\n-#include \""},{"id":"551091","messageId":"20260823171915.2662373-10-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 09/14] pack: gather the pack sources under pack/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:53Z","receivedAt":"2026-08-23T17:19:35Z","isPatch":true,"body":"Move the 27 pack C sources and 18 headers into pack/ as renames. Repoint\nevery reference to their old paths to the new ones: the #include lines\nacross the tree, the Makefile and meson.build build entries.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                  | 90 +++++++++----------\n Makefile                                      | 56 ++++++------\n apply.c                                       |  2 +-\n blame.c                                       |  4 +-\n builtin/backfill.c                            |  2 +-\n builtin/cat-file.c                            |  2 +-\n builtin/clone.c                               |  2 +-\n builtin/commit-graph.c                        |  2 +-\n builtin/commit.c                              |  2 +-\n builtin/count-objects.c                       |  2 +-\n builtin/fast-import.c                         |  6 +-\n builtin/fetch.c                               |  2 +-\n builtin/fsck.c                                |  8 +-\n builtin/gc.c                                  |  4 +-\n builtin/index-pack.c                          |  8 +-\n builtin/last-modified.c                       |  4 +-\n builtin/merge.c                               |  2 +-\n builtin/multi-pack-index.c                    |  2 +-\n builtin/name-rev.c                            |  2 +-\n builtin/pack-objects.c                        | 20 ++---\n builtin/pack-redundant.c                      |  2 +-\n builtin/prune-packed.c                        |  2 +-\n builtin/prune.c                               |  4 +-\n builtin/receive-pack.c                        |  6 +-\n builtin/reflog.c                              |  2 +-\n builtin/repack.c                              | 10 +--\n builtin/rev-list.c                            |  4 +-\n builtin/show-index.c                          |  2 +-\n builtin/unpack-objects.c                      |  6 +-\n builtin/update-server-info.c                  |  2 +-\n commit-reach.c                                |  2 +-\n connected.c                                   |  2 +-\n diagnose.c                                    |  2 +-\n diff.c                                        |  4 +-\n fetch-pack.c                                  |  6 +-\n http-backend.c                                |  2 +-\n http-push.c                                   |  2 +-\n http-walker.c                                 |  2 +-\n http.c                                        |  4 +-\n line-log.c                                    |  2 +-\n list-objects.c                                |  2 +-\n meson.build                                   | 54 +++++------\n odb/commit.c                                  |  2 +-\n odb/fsck.c                                    |  2 +-\n odb/object-file.c                             |  4 +-\n odb/object-name.c                             |  2 +-\n odb/object.c                                  |  2 +-\n odb/odb.c                                     |  6 +-\n odb/source-files.c                            |  6 +-\n odb/source-packed.c                           |  6 +-\n odb/source-packed.h                           |  2 +-\n odb/source.c                                  |  2 +-\n odb/tag.c                                     |  2 +-\n oss-fuzz/fuzz-commit-graph.c                  |  2 +-\n oss-fuzz/fuzz-pack-headers.c                  |  2 +-\n oss-fuzz/fuzz-pack-idx.c                      |  2 +-\n bloom.c => pack/bloom.c                       |  4 +-\n bloom.h => pack/bloom.h                       |  0\n chunk-format.c => pack/chunk-format.c         |  2 +-\n chunk-format.h => pack/chunk-format.h         |  0\n commit-graph.c => pack/commit-graph.c         |  8 +-\n commit-graph.h => pack/commit-graph.h         |  0\n delta-islands.c => pack/delta-islands.c       |  8 +-\n delta-islands.h => pack/delta-islands.h       |  0\n delta.h => pack/delta.h                       |  0\n diff-delta.c => pack/diff-delta.c             |  2 +-\n midx-write.c => pack/midx-write.c             | 10 +--\n midx.c => pack/midx.c                         | 10 +--\n midx.h => pack/midx.h                         |  0\n .../pack-bitmap-write.c                       | 12 +--\n pack-bitmap.c => pack/pack-bitmap.c           | 14 +--\n pack-bitmap.h => pack/pack-bitmap.h           |  4 +-\n pack-check.c => pack/pack-check.c             |  4 +-\n pack-mtimes.c => pack/pack-mtimes.c           |  4 +-\n pack-mtimes.h => pack/pack-mtimes.h           |  0\n pack-objects.c => pack/pack-objects.c         |  6 +-\n pack-objects.h => pack/pack-objects.h         |  4 +-\n pack-revindex.c => pack/pack-revindex.c       |  6 +-\n pack-revindex.h => pack/pack-revindex.h       |  0\n pack-write.c => pack/pack-write.c             | 10 +--\n pack.h => pack/pack.h                         |  0\n packfile-list.c => pack/packfile-list.c       |  4 +-\n packfile-list.h => pack/packfile-list.h       |  0\n packfile.c => pack/packfile.c                 | 14 +--\n packfile.h => pack/packfile.h                 |  2 +-\n patch-delta.c => pack/patch-delta.c           |  2 +-\n prune-packed.c => pack/prune-packed.c         |  4 +-\n prune-packed.h => pack/prune-packed.h         |  0\n pseudo-merge.c => pack/pseudo-merge.c         |  4 +-\n pseudo-merge.h => pack/pseudo-merge.h         |  0\n reachable.c => pack/reachable.c               |  8 +-\n reachable.h => pack/reachable.h               |  0\n repack-cruft.c => pack/repack-cruft.c         |  4 +-\n repack-filtered.c => pack/repack-filtered.c   |  2 +-\n repack-geometry.c => pack/repack-geometry.c   |  6 +-\n repack-midx.c => pack/repack-midx.c           |  6 +-\n repack-promisor.c => pack/repack-promisor.c   |  6 +-\n repack.c => pack/repack.c                     |  6 +-\n repack.h => pack/repack.h                     |  0\n server-info.c => pack/server-info.c           |  4 +-\n server-info.h => pack/server-info.h           |  0\n path.c                                        |  2 +-\n promisor-remote.c                             |  2 +-\n repo-settings.c                               |  4 +-\n revision.c                                    |  6 +-\n run-command.c                                 |  2 +-\n scalar.c                                      |  2 +-\n t/helper/test-bitmap.c                        |  4 +-\n t/helper/test-bloom.c                         |  2 +-\n t/helper/test-delta.c                         |  2 +-\n t/helper/test-find-pack.c                     |  2 +-\n t/helper/test-name-hash.c                     |  2 +-\n t/helper/test-pack-deltas.c                   |  6 +-\n t/helper/test-pack-mtimes.c                   |  4 +-\n t/helper/test-read-graph.c                    |  4 +-\n t/helper/test-read-midx.c                     |  8 +-\n t/helper/test-repository.c                    |  2 +-\n t/helper/test-synthesize.c                    |  2 +-\n transport-helper.c                            |  2 +-\n upload-pack.c                                 |  2 +-\n 120 files changed, 314 insertions(+), 314 deletions(-)\n rename bloom.c => pack/bloom.c (99%)\n rename bloom.h => pack/bloom.h (100%)\n rename chunk-format.c => pack/chunk-format.c (99%)\n rename chunk-format.h => pack/chunk-format.h (100%)\n rename commit-graph.c => pack/commit-graph.c (99%)\n rename commit-graph.h => pack/commit-graph.h (100%)\n rename delta-islands.c => pack/delta-islands.c (99%)\n rename delta-islands.h => pack/delta-islands.h (100%)\n rename delta.h => pack/delta.h (100%)\n rename diff-delta.c => pack/diff-delta.c (99%)\n rename midx-write.c => pack/midx-write.c (99%)\n rename midx.c => pack/midx.c (99%)\n rename midx.h => pack/midx.h (100%)\n rename pack-bitmap-write.c => pack/pack-bitmap-write.c (99%)\n rename pack-bitmap.c => pack/pack-bitmap.c (99%)\n rename pack-bitmap.h => pack/pack-bitmap.h (99%)\n rename pack-check.c => pack/pack-check.c (99%)\n rename pack-mtimes.c => pack/pack-mtimes.c (98%)\n rename pack-mtimes.h => pack/pack-mtimes.h (100%)\n rename pack-objects.c => pack/pack-objects.c (98%)\n rename pack-objects.h => pack/pack-objects.h (99%)\n rename pack-revindex.c => pack/pack-revindex.c (99%)\n rename pack-revindex.h => pack/pack-revindex.h (100%)\n rename pack-write.c => pack/pack-write.c (99%)\n rename pack.h => pack/pack.h (100%)\n rename packfile-list.c => pack/packfile-list.c (96%)\n rename packfile-list.h => pack/packfile-list.h (100%)\n rename packfile.c => pack/packfile.c (99%)\n rename packfile.h => pack/packfile.h (99%)\n rename patch-delta.c => pack/patch-delta.c (98%)\n rename prune-packed.c => pack/prune-packed.c (94%)\n rename prune-packed.h => pack/prune-packed.h (100%)\n rename pseudo-merge.c => pack/pseudo-merge.c (99%)\n rename pseudo-merge.h => pack/pseudo-merge.h (100%)\n rename reachable.c => pack/reachable.c (98%)\n rename reachable.h => pack/reachable.h (100%)\n rename repack-cruft.c => pack/repack-cruft.c (98%)\n rename repack-filtered.c => pack/repack-filtered.c (98%)\n rename repack-geometry.c => pack/repack-geometry.c (99%)\n rename repack-midx.c => pack/repack-midx.c (99%)\n rename repack-promisor.c => pack/repack-promisor.c (98%)\n rename repack.c => pack/repack.c (99%)\n rename repack.h => pack/repack.h (100%)\n rename server-info.c => pack/server-info.c (99%)\n rename server-info.h => pack/server-info.h (100%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex e29497504a..533d50ed89 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -45,8 +45,6 @@ bisect.c component=revision role=lib prefix=bisect includes=odb:5,revision:5,set\n bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2\n blame.c component=revision role=lib prefix=blame includes=odb:5,diff:2,index:2,pack:2,revision:2 cochange=diff:68,revision:66,odb:56,index:29,pack:22\n blame.h component=revision role=header prefix=blame includes=diff:1,odb:1 cochange=revision:19,odb:7,diff:4,archive:1,index:1\n-bloom.c component=pack role=lib prefix=bloom includes=odb:4,diff:2,pack:2,setup:2 cochange=pack:38,revision:25,diff:15,odb:6,index:2\n-bloom.h component=pack role=header prefix=bloom cochange=pack:28,revision:12,odb:1\n branch.c component=? role=lib prefix=branch includes=refs:3,setup:3,odb:2,submodule:1,transport:1 cochange=refs:62,transport:41,setup:28,index:19,revision:12\n branch.h component=? role=public prefix=branch cochange=setup:8,refs:4,submodule:4\n builtin.h component=? role=public prefix=builtin includes=setup:1 cochange=diff:15,index:15,transport:12,odb:6,notes:5\n@@ -60,15 +58,11 @@ chdir-notify.c component=? role=lib prefix=chdir-notify includes=revision:1 coch\n chdir-notify.h component=? role=public prefix=chdir-notify\n checkout.c component=index role=lib prefix=checkout includes=setup:2,index:1,odb:1,refs:1,transport:1 cochange=transport:16,refs:6,setup:5,index:3,odb:2\n checkout.h component=index role=header prefix=checkout includes=odb:1 cochange=index:4,diff:1,odb:1,refs:1,revision:1\n-chunk-format.c component=pack role=lib prefix=chunk-format includes=odb:1,pack:1 cochange=pack:20,odb:1,transport:1\n-chunk-format.h component=pack role=header prefix=chunk-format includes=odb:1 cochange=pack:15,odb:2,setup:1,transport:1\n color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,index:14,revision:13,setup:7,transport:7\n color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1\n column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2\n column.h component=? role=public prefix=column\n combine-diff.c component=diff role=lib prefix=combine-diff includes=odb:5,diff:4,revision:2,convert:1,refs:1 cochange=diff:198,revision:67,index:35,odb:16,transport:16\n-commit-graph.c component=pack role=lib prefix=commit-graph includes=odb:9,pack:4,setup:2,refs:1,revision:1 cochange=pack:206,odb:125,revision:47,transport:34,setup:22\n-commit-graph.h component=pack role=header prefix=commit-graph includes=odb:2 cochange=pack:92,odb:14,setup:9,revision:8,transport:5\n commit-reach.c component=revision role=lib prefix=commit-reach includes=revision:3,odb:2,pack:1,refs:1 cochange=revision:38,odb:17,pack:15,transport:9,index:5\n commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3\n common-exit.c component=? role=lib prefix=common-main\n@@ -95,12 +89,8 @@ date.c component=? role=lib prefix=date cochange=revision:17,odb:16,refs:14,setu\n date.h component=? role=public prefix=date cochange=refs:7,revision:4,setup:2,archive:1,odb:1\n decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1 cochange=diff:6,odb:5,revision:5,pack:2,transport:2\n decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1\n-delta-islands.c component=pack role=lib prefix=delta-islands includes=odb:6,pack:4,diff:1,refs:1,setup:1 cochange=pack:20,odb:17,revision:7,transport:7,diff:5\n-delta-islands.h component=pack role=header prefix=delta-islands cochange=pack:6\n-delta.h component=pack role=header prefix=diff-delta cochange=pack:27,odb:19,diff:5,transport:3,convert:1\n diagnose.c component=? role=lib prefix=diagnose includes=archive:1,index:1,odb:1,pack:1,setup:1 cochange=index:4,revision:4,odb:3,pack:3,transport:3\n diagnose.h component=? role=public prefix=diagnose cochange=revision:2,refs:1,transport:1\n-diff-delta.c component=pack role=lib prefix=diff-delta includes=pack:1 cochange=pack:24,diff:7,index:2,odb:2,transport:2\n diff-lib.c component=diff role=lib prefix=diff includes=index:6,odb:3,diff:2,revision:2,refs:1 cochange=diff:150,index:124,revision:47,submodule:18,odb:8\n diff-merges.c component=diff role=lib prefix=diff-merges includes=diff:1,revision:1 cochange=revision:18,diff:17,odb:4,refs:3,index:2\n diff-merges.h component=diff role=header prefix=diff-merges cochange=diff:11,revision:4,merge:1\n@@ -218,9 +208,6 @@ merge-ort.h component=merge role=header prefix=merge-ort includes=odb:1 cochange\n merge.c component=merge role=lib prefix=merge includes=odb:4,index:2,merge:1,setup:1 cochange=index:22,merge:6,setup:4,diff:2,odb:2\n merge.h component=merge role=header prefix=merge cochange=merge:1\n mergesort.h component=? role=public prefix=mergesort cochange=odb:1\n-midx-write.c component=pack role=lib prefix=midx-write includes=pack:5,odb:2,revision:2,refs:1,setup:1 cochange=pack:100,odb:20,refs:7,transport:6,setup:4\n-midx.c component=pack role=lib prefix=midx includes=pack:5,index:1,odb:1,setup:1 cochange=pack:220,odb:34,transport:11,index:6,setup:4\n-midx.h component=pack role=header prefix=midx cochange=pack:134,odb:5,setup:2,transport:2,refs:1\n name-hash.c component=index role=lib prefix=name-hash includes=index:3,odb:1,setup:1 cochange=diff:43,index:39,revision:18,setup:14,refs:12\n name-hash.h component=index role=header prefix=name-hash cochange=index:7\n notes-cache.c component=notes role=lib prefix=notes includes=odb:3,notes:1,refs:1,revision:1,setup:1 cochange=notes:37,odb:29,diff:10,index:10,revision:9\n@@ -280,22 +267,51 @@ odb/tree-walk.c component=odb role=lib prefix=tree-walk includes=odb:4,index:3,s\n odb/tree-walk.h component=odb role=header prefix=tree-walk includes=odb:1 cochange=odb:64,diff:23,index:23,revision:21,notes:7\n odb/tree.c component=odb role=lib prefix=tree includes=odb:6,setup:2 cochange=odb:212,revision:45,index:36,pack:25,transport:21\n odb/tree.h component=odb role=header prefix=tree includes=odb:1 cochange=odb:75,revision:12,archive:8,index:6,pack:5\n-pack-bitmap-write.c component=pack role=lib prefix=pack-bitmap-write includes=odb:7,pack:6,revision:2,setup:2,diff:1 cochange=pack:132,odb:32,revision:27,transport:10,diff:4\n-pack-bitmap.c component=pack role=lib prefix=pack-bitmap includes=pack:7,odb:3,revision:3,setup:2,diff:1 cochange=pack:232,revision:30,odb:18,transport:14,refs:7\n-pack-bitmap.h component=pack role=header prefix=pack-bitmap includes=pack:2,refs:1 cochange=pack:117,refs:5,odb:2,setup:2,revision:1\n-pack-check.c component=pack role=lib prefix=pack-check includes=odb:2,pack:2,setup:2 cochange=pack:59,odb:26,transport:23,diff:11,index:10\n-pack-mtimes.c component=pack role=lib prefix=pack-mtimes includes=pack:2,odb:1 cochange=pack:10,odb:3,transport:2,notes:1\n-pack-mtimes.h component=pack role=header prefix=pack-mtimes cochange=pack:4,odb:2,setup:1,transport:1\n-pack-objects.c component=pack role=lib prefix=pack-objects includes=pack:3,odb:1,setup:1 cochange=pack:66,diff:17,odb:16,transport:9,index:5\n-pack-objects.h component=pack role=header prefix=pack-objects includes=pack:2,odb:1 cochange=pack:44,setup:5,odb:1\n-pack-revindex.c component=pack role=lib prefix=pack-revindex includes=pack:3,odb:1,setup:1 cochange=pack:94,odb:7,index:6,transport:5,setup:4\n-pack-revindex.h component=pack role=header prefix=pack-revindex cochange=pack:32,odb:1\n-pack-write.c component=pack role=lib prefix=pack-write includes=pack:5,setup:2,odb:1,transport:1 cochange=pack:88,odb:21,transport:21,setup:14,index:10\n-pack.h component=pack role=header prefix=pack-write includes=odb:1 cochange=pack:72,odb:13,transport:9,setup:5,revision:1\n-packfile-list.c component=pack role=lib prefix=packfile includes=pack:2 cochange=pack:3\n-packfile-list.h component=pack role=header prefix=packfile cochange=pack:3\n-packfile.c component=pack role=lib prefix=packfile includes=odb:8,pack:7,setup:2,index:1,revision:1 cochange=pack:317,odb:134,transport:52,revision:36,index:27\n-packfile.h component=pack role=header prefix=packfile includes=odb:3,pack:1,revision:1,setup:1 cochange=pack:234,odb:66,transport:32,revision:9,setup:7\n+pack/bloom.c component=pack role=lib prefix=bloom includes=odb:4,diff:2,pack:2,setup:2 cochange=pack:38,revision:25,diff:15,odb:6,index:2\n+pack/bloom.h component=pack role=header prefix=bloom cochange=pack:28,revision:12,odb:1\n+pack/chunk-format.c component=pack role=lib prefix=chunk-format includes=odb:1,pack:1 cochange=pack:20,odb:1,transport:1\n+pack/chunk-format.h component=pack role=header prefix=chunk-format includes=odb:1 cochange=pack:15,odb:2,setup:1,transport:1\n+pack/commit-graph.c component=pack role=lib prefix=commit-graph includes=odb:9,pack:4,setup:2,refs:1,revision:1 cochange=pack:206,odb:125,revision:47,transport:34,setup:22\n+pack/commit-graph.h component=pack role=header prefix=commit-graph includes=odb:2 cochange=pack:92,odb:14,setup:9,revision:8,transport:5\n+pack/delta-islands.c component=pack role=lib prefix=delta-islands includes=odb:6,pack:4,diff:1,refs:1,setup:1 cochange=pack:20,odb:17,revision:7,transport:7,diff:5\n+pack/delta-islands.h component=pack role=header prefix=delta-islands cochange=pack:6\n+pack/delta.h component=pack role=header prefix=diff-delta cochange=pack:27,odb:19,diff:5,transport:3,convert:1\n+pack/diff-delta.c component=pack role=lib prefix=diff-delta includes=pack:1 cochange=pack:24,diff:7,index:2,odb:2,transport:2\n+pack/midx-write.c component=pack role=lib prefix=midx-write includes=pack:5,odb:2,revision:2,refs:1,setup:1 cochange=pack:100,odb:20,refs:7,transport:6,setup:4\n+pack/midx.c component=pack role=lib prefix=midx includes=pack:5,index:1,odb:1,setup:1 cochange=pack:220,odb:34,transport:11,index:6,setup:4\n+pack/midx.h component=pack role=header prefix=midx cochange=pack:134,odb:5,setup:2,transport:2,refs:1\n+pack/pack-bitmap-write.c component=pack role=lib prefix=pack-bitmap-write includes=odb:7,pack:6,revision:2,setup:2,diff:1 cochange=pack:132,odb:32,revision:27,transport:10,diff:4\n+pack/pack-bitmap.c component=pack role=lib prefix=pack-bitmap includes=pack:7,odb:3,revision:3,setup:2,diff:1 cochange=pack:232,revision:30,odb:18,transport:14,refs:7\n+pack/pack-bitmap.h component=pack role=header prefix=pack-bitmap includes=pack:2,refs:1 cochange=pack:117,refs:5,odb:2,setup:2,revision:1\n+pack/pack-check.c component=pack role=lib prefix=pack-check includes=odb:2,pack:2,setup:2 cochange=pack:59,odb:26,transport:23,diff:11,index:10\n+pack/pack-mtimes.c component=pack role=lib prefix=pack-mtimes includes=pack:2,odb:1 cochange=pack:10,odb:3,transport:2,notes:1\n+pack/pack-mtimes.h component=pack role=header prefix=pack-mtimes cochange=pack:4,odb:2,setup:1,transport:1\n+pack/pack-objects.c component=pack role=lib prefix=pack-objects includes=pack:3,odb:1,setup:1 cochange=pack:66,diff:17,odb:16,transport:9,index:5\n+pack/pack-objects.h component=pack role=header prefix=pack-objects includes=pack:2,odb:1 cochange=pack:44,setup:5,odb:1\n+pack/pack-revindex.c component=pack role=lib prefix=pack-revindex includes=pack:3,odb:1,setup:1 cochange=pack:94,odb:7,index:6,transport:5,setup:4\n+pack/pack-revindex.h component=pack role=header prefix=pack-revindex cochange=pack:32,odb:1\n+pack/pack-write.c component=pack role=lib prefix=pack-write includes=pack:5,setup:2,odb:1,transport:1 cochange=pack:88,odb:21,transport:21,setup:14,index:10\n+pack/pack.h component=pack role=header prefix=pack-write includes=odb:1 cochange=pack:72,odb:13,transport:9,setup:5,revision:1\n+pack/packfile-list.c component=pack role=lib prefix=packfile includes=pack:2 cochange=pack:3\n+pack/packfile-list.h component=pack role=header prefix=packfile cochange=pack:3\n+pack/packfile.c component=pack role=lib prefix=packfile includes=odb:8,pack:7,setup:2,index:1,revision:1 cochange=pack:317,odb:134,transport:52,revision:36,index:27\n+pack/packfile.h component=pack role=header prefix=packfile includes=odb:3,pack:1,revision:1,setup:1 cochange=pack:234,odb:66,transport:32,revision:9,setup:7\n+pack/patch-delta.c component=pack role=lib prefix=patch-delta includes=pack:1 cochange=pack:23,diff:2,odb:2,transport:2,convert:1\n+pack/prune-packed.c component=pack role=lib prefix=environment includes=pack:2,odb:1,setup:1 cochange=pack:13,odb:7,setup:5,diff:3,revision:3\n+pack/prune-packed.h component=pack role=header prefix=? cochange=pack:1\n+pack/pseudo-merge.c component=pack role=lib prefix=pseudo-merge includes=odb:3,pack:2,refs:1,setup:1 cochange=pack:21,refs:3\n+pack/pseudo-merge.h component=pack role=header prefix=pseudo-merge cochange=pack:17\n+pack/reachable.c component=pack role=lib prefix=reachable includes=pack:4,odb:3,refs:2,revision:2,diff:1 cochange=odb:60,pack:57,revision:47,transport:17,refs:14\n+pack/reachable.h component=pack role=header prefix=prune cochange=pack:5\n+pack/repack-cruft.c component=pack role=lib prefix=repack includes=pack:2,setup:1 cochange=pack:8,transport:2,odb:1\n+pack/repack-filtered.c component=pack role=lib prefix=repack includes=pack:1,setup:1 cochange=pack:1\n+pack/repack-geometry.c component=pack role=lib prefix=repack includes=pack:3,setup:1 cochange=pack:25,transport:2,odb:1\n+pack/repack-midx.c component=pack role=lib prefix=repack includes=odb:3,pack:3,refs:1 cochange=pack:23,refs:3,setup:2,merge:1,odb:1\n+pack/repack-promisor.c component=pack role=lib prefix=repack-promisor includes=pack:3,setup:1 cochange=pack:8,odb:3,revision:2\n+pack/repack.c component=pack role=lib prefix=repack includes=pack:3,index:1,odb:1,setup:1 cochange=pack:31,transport:2,odb:1\n+pack/repack.h component=pack role=header prefix=repack includes=revision:1 cochange=pack:28\n+pack/server-info.c component=pack role=lib prefix=server-info includes=odb:5,pack:2,index:1,refs:1,setup:1 cochange=pack:40,transport:34,odb:33,setup:13,refs:10\n+pack/server-info.h component=pack role=header prefix=server-info cochange=pack:2\n pager.c component=? role=lib prefix=pager includes=setup:4 cochange=setup:23,diff:9,transport:7,revision:3,submodule:3\n pager.h component=? role=public prefix=pager cochange=diff:3,setup:2,revision:1\n parallel-checkout.c component=index role=lib prefix=parallel-checkout includes=index:4,odb:1,setup:1,transport:1 cochange=index:26,transport:7,odb:6,diff:3,merge:3\n@@ -305,7 +321,6 @@ parse-options.c component=? role=lib prefix=parse-options cochange=index:14,diff\n parse-options.h component=? role=public prefix=parse-options cochange=diff:7,merge:4,archive:3,index:3,refs:3\n parse.c component=? role=lib prefix=parse cochange=setup:6,index:3,pack:2,convert:1\n parse.h component=? role=public prefix=config cochange=setup:6,index:3,pack:2,convert:1\n-patch-delta.c component=pack role=lib prefix=patch-delta includes=pack:1 cochange=pack:23,diff:2,odb:2,transport:2,convert:1\n patch-ids.c component=diff role=lib prefix=patch-ids includes=diff:2,odb:2 cochange=diff:73,revision:34,index:14,odb:13,refs:12\n patch-ids.h component=diff role=header prefix=patch-ids includes=diff:1 cochange=diff:15,revision:3,index:1\n path-walk.c component=? role=lib prefix=path-walk includes=odb:9,revision:3,index:1,setup:1 cochange=index:2,revision:2,transport:2,odb:1,pack:1\n@@ -332,16 +347,10 @@ protocol-caps.c component=transport role=lib prefix=protocol-caps includes=odb:3\n protocol-caps.h component=transport role=header prefix=protocol-caps cochange=transport:6,refs:2\n protocol.c component=transport role=lib prefix=protocol includes=setup:2,transport:1 cochange=transport:21,index:4,setup:4,refs:2,diff:1\n protocol.h component=transport role=header prefix=protocol cochange=transport:5\n-prune-packed.c component=pack role=lib prefix=environment includes=pack:2,odb:1,setup:1 cochange=pack:13,odb:7,setup:5,diff:3,revision:3\n-prune-packed.h component=pack role=header prefix=? cochange=pack:1\n-pseudo-merge.c component=pack role=lib prefix=pseudo-merge includes=odb:3,pack:2,refs:1,setup:1 cochange=pack:21,refs:3\n-pseudo-merge.h component=pack role=header prefix=pseudo-merge cochange=pack:17\n quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6\n quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5\n range-diff.c component=diff role=lib prefix=range-diff includes=diff:4,odb:2,revision:2,setup:2 cochange=diff:49,revision:26,index:9,submodule:8,setup:7\n range-diff.h component=diff role=header prefix=range-diff includes=diff:1 cochange=diff:13,revision:4\n-reachable.c component=pack role=lib prefix=reachable includes=pack:4,odb:3,refs:2,revision:2,diff:1 cochange=odb:60,pack:57,revision:47,transport:17,refs:14\n-reachable.h component=pack role=header prefix=prune cochange=pack:5\n read-cache-ll.h component=index role=header prefix=read-cache includes=index:1,odb:1 cochange=index:8,diff:1,odb:1,revision:1\n read-cache.c component=index role=lib prefix=read-cache includes=index:10,odb:6,setup:4,diff:2,submodule:2 cochange=index:240,odb:81,setup:79,diff:67,pack:46\n read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2\n@@ -368,13 +377,6 @@ refs/worktree.h component=refs role=header prefix=worktree includes=refs:1 cocha\n remote-curl.c component=transport role=lib prefix=remote-curl includes=transport:9,setup:3,odb:1 cochange=transport:226,diff:9,revision:6,setup:5,archive:4\n remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,transport:3,refs:2,revision:2 cochange=transport:272,refs:91,revision:56,index:51,odb:30\n remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2\n-repack-cruft.c component=pack role=lib prefix=repack includes=pack:2,setup:1 cochange=pack:8,transport:2,odb:1\n-repack-filtered.c component=pack role=lib prefix=repack includes=pack:1,setup:1 cochange=pack:1\n-repack-geometry.c component=pack role=lib prefix=repack includes=pack:3,setup:1 cochange=pack:25,transport:2,odb:1\n-repack-midx.c component=pack role=lib prefix=repack includes=odb:3,pack:3,refs:1 cochange=pack:23,refs:3,setup:2,merge:1,odb:1\n-repack-promisor.c component=pack role=lib prefix=repack-promisor includes=pack:3,setup:1 cochange=pack:8,odb:3,revision:2\n-repack.c component=pack role=lib prefix=repack includes=pack:3,index:1,odb:1,setup:1 cochange=pack:31,transport:2,odb:1\n-repack.h component=pack role=header prefix=repack includes=revision:1 cochange=pack:28\n replay.c component=? role=lib prefix=replay includes=odb:2,merge:1,refs:1,revision:1,setup:1 cochange=transport:1\n replay.h component=? role=public prefix=replay includes=odb:1\n repo-settings.c component=setup role=lib prefix=repo-settings includes=setup:4,pack:2 cochange=setup:65,pack:17,index:8,transport:8,odb:6\n@@ -399,8 +401,6 @@ sequencer.c component=? role=lib prefix=sequencer includes=odb:8,index:5,merge:4\n sequencer.h component=? role=public prefix=sequencer includes=index:1 cochange=revision:5,index:4,notes:3,odb:3,transport:3\n serve.c component=transport role=lib prefix=serve includes=transport:6,setup:3,odb:1,refs:1 cochange=transport:53,refs:7,odb:4,setup:3,index:1\n serve.h component=transport role=header prefix=serve cochange=transport:9,refs:3,submodule:1\n-server-info.c component=pack role=lib prefix=server-info includes=odb:5,pack:2,index:1,refs:1,setup:1 cochange=pack:40,transport:34,odb:33,setup:13,refs:10\n-server-info.h component=pack role=header prefix=server-info cochange=pack:2\n setup.c component=setup role=lib prefix=setup includes=setup:4,odb:2,refs:2,index:1,revision:1 cochange=setup:177,refs:47,transport:44,index:39,odb:24\n setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:70,refs:8,index:5,revision:4,submodule:4\n sh-i18n--envsubst.c component=? role=program prefix=sh-i18n--envsubst cochange=index:3,diff:1,transport:1\ndiff --git a/Makefile b/Makefile\nindex f733ccfee0..85d2a620a7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1113,7 +1113,7 @@ LIB_OBJS += base85.o\n LIB_OBJS += bisect.o\n LIB_OBJS += blame.o\n LIB_OBJS += odb/blob.o\n-LIB_OBJS += bloom.o\n+LIB_OBJS += pack/bloom.o\n LIB_OBJS += branch.o\n LIB_OBJS += bundle-uri.o\n LIB_OBJS += bundle.o\n@@ -1121,11 +1121,11 @@ LIB_OBJS += cache-tree.o\n LIB_OBJS += odb/cbtree.o\n LIB_OBJS += chdir-notify.o\n LIB_OBJS += checkout.o\n-LIB_OBJS += chunk-format.o\n+LIB_OBJS += pack/chunk-format.o\n LIB_OBJS += color.o\n LIB_OBJS += column.o\n LIB_OBJS += combine-diff.o\n-LIB_OBJS += commit-graph.o\n+LIB_OBJS += pack/commit-graph.o\n LIB_OBJS += commit-reach.o\n LIB_OBJS += odb/commit.o\n LIB_OBJS += common-exit.o\n@@ -1145,9 +1145,9 @@ LIB_OBJS += csum-file.o\n LIB_OBJS += ctype.o\n LIB_OBJS += date.o\n LIB_OBJS += decorate.o\n-LIB_OBJS += delta-islands.o\n+LIB_OBJS += pack/delta-islands.o\n LIB_OBJS += diagnose.o\n-LIB_OBJS += diff-delta.o\n+LIB_OBJS += pack/diff-delta.o\n LIB_OBJS += diff-merges.o\n LIB_OBJS += diff-lib.o\n LIB_OBJS += diff-no-index.o\n@@ -1211,8 +1211,8 @@ LIB_OBJS += merge-ll.o\n LIB_OBJS += merge-ort.o\n LIB_OBJS += merge-ort-wrappers.o\n LIB_OBJS += merge.o\n-LIB_OBJS += midx.o\n-LIB_OBJS += midx-write.o\n+LIB_OBJS += pack/midx.o\n+LIB_OBJS += pack/midx-write.o\n LIB_OBJS += name-hash.o\n LIB_OBJS += negotiator/default.o\n LIB_OBJS += negotiator/noop.o\n@@ -1241,22 +1241,22 @@ LIB_OBJS += organize/gitorganize-format.o\n LIB_OBJS += organize/labeler-protocol.o\n LIB_OBJS += organize/organize.o\n LIB_OBJS += organize/organizer-protocol.o\n-LIB_OBJS += pack-bitmap-write.o\n-LIB_OBJS += pack-bitmap.o\n-LIB_OBJS += pack-check.o\n-LIB_OBJS += pack-mtimes.o\n-LIB_OBJS += pack-objects.o\n+LIB_OBJS += pack/pack-bitmap-write.o\n+LIB_OBJS += pack/pack-bitmap.o\n+LIB_OBJS += pack/pack-check.o\n+LIB_OBJS += pack/pack-mtimes.o\n+LIB_OBJS += pack/pack-objects.o\n LIB_OBJS += refs/pack-refs.o\n-LIB_OBJS += pack-revindex.o\n-LIB_OBJS += pack-write.o\n-LIB_OBJS += packfile.o\n-LIB_OBJS += packfile-list.o\n+LIB_OBJS += pack/pack-revindex.o\n+LIB_OBJS += pack/pack-write.o\n+LIB_OBJS += pack/packfile.o\n+LIB_OBJS += pack/packfile-list.o\n LIB_OBJS += pager.o\n LIB_OBJS += parallel-checkout.o\n LIB_OBJS += parse.o\n LIB_OBJS += parse-options-cb.o\n LIB_OBJS += parse-options.o\n-LIB_OBJS += patch-delta.o\n+LIB_OBJS += pack/patch-delta.o\n LIB_OBJS += patch-ids.o\n LIB_OBJS += path.o\n LIB_OBJS += path-walk.o\n@@ -1270,11 +1270,11 @@ LIB_OBJS += promisor-remote.o\n LIB_OBJS += prompt.o\n LIB_OBJS += protocol.o\n LIB_OBJS += protocol-caps.o\n-LIB_OBJS += prune-packed.o\n-LIB_OBJS += pseudo-merge.o\n+LIB_OBJS += pack/prune-packed.o\n+LIB_OBJS += pack/pseudo-merge.o\n LIB_OBJS += quote.o\n LIB_OBJS += range-diff.o\n-LIB_OBJS += reachable.o\n+LIB_OBJS += pack/reachable.o\n LIB_OBJS += read-cache.o\n LIB_OBJS += rebase-interactive.o\n LIB_OBJS += rebase.o\n@@ -1304,12 +1304,12 @@ LIB_OBJS += reftable/table.o\n LIB_OBJS += reftable/tree.o\n LIB_OBJS += reftable/writer.o\n LIB_OBJS += remote.o\n-LIB_OBJS += repack.o\n-LIB_OBJS += repack-cruft.o\n-LIB_OBJS += repack-filtered.o\n-LIB_OBJS += repack-geometry.o\n-LIB_OBJS += repack-midx.o\n-LIB_OBJS += repack-promisor.o\n+LIB_OBJS += pack/repack.o\n+LIB_OBJS += pack/repack-cruft.o\n+LIB_OBJS += pack/repack-filtered.o\n+LIB_OBJS += pack/repack-geometry.o\n+LIB_OBJS += pack/repack-midx.o\n+LIB_OBJS += pack/repack-promisor.o\n LIB_OBJS += odb/replace-object.o\n LIB_OBJS += replay.o\n LIB_OBJS += repo-settings.o\n@@ -1322,7 +1322,7 @@ LIB_OBJS += run-command.o\n LIB_OBJS += send-pack.o\n LIB_OBJS += sequencer.o\n LIB_OBJS += serve.o\n-LIB_OBJS += server-info.o\n+LIB_OBJS += pack/server-info.o\n LIB_OBJS += setup.o\n LIB_OBJS += shallow.o\n LIB_OBJS += sideband.o\n@@ -2992,7 +2992,7 @@ gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \\\n http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \\\n \t-DCURL_DISABLE_TYPECHECK\n \n-pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count\n+pack/pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count\n \n ifdef NO_EXPAT\n http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT\ndiff --git a/apply.c b/apply.c\nindex ba486ab51d..dbfb891b4c 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -15,7 +15,7 @@\n #include \"base85.h\"\n #include \"config.h\"\n #include \"odb/odb.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n #include \"diff.h\"\n #include \"dir.h\"\n #include \"environment.h\"\ndiff --git a/blame.c b/blame.c\nindex a594dc5f0e..cd18c09a3c 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -21,8 +21,8 @@\n #include \"blame.h\"\n #include \"odb/alloc.h\"\n #include \"odb/commit-slab.h\"\n-#include \"bloom.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/bloom.h\"\n+#include \"pack/commit-graph.h\"\n \n define_commit_slab(blame_suspects, struct blame_origin *);\n static struct blame_suspects blame_suspects;\ndiff --git a/builtin/backfill.c b/builtin/backfill.c\nindex 3685713205..c42226d3e8 100644\n--- a/builtin/backfill.c\n+++ b/builtin/backfill.c\n@@ -22,7 +22,7 @@\n #include \"revision.h\"\n #include \"trace2.h\"\n #include \"progress.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"path-walk.h\"\n \n static const char * const builtin_backfill_usage[] = {\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex ccd6b33827..a59aa00cea 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -19,7 +19,7 @@\n #include \"parse-options.h\"\n #include \"userdiff.h\"\n #include \"odb/oid-array.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 12170ae8f4..7b5274e884 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -40,7 +40,7 @@\n #include \"run-command.h\"\n #include \"setup.h\"\n #include \"connected.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"pkt-line.h\"\n #include \"list-objects-filter-options.h\"\ndiff --git a/builtin/commit-graph.c b/builtin/commit-graph.c\nindex 0758af3b64..2de897402e 100644\n--- a/builtin/commit-graph.c\n+++ b/builtin/commit-graph.c\n@@ -6,7 +6,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"odb/odb.h\"\n #include \"progress.h\"\n #include \"odb/replace-object.h\"\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex e5a6c0b889..39271d720e 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -40,7 +40,7 @@\n #include \"mailmap.h\"\n #include \"help.h\"\n #include \"commit-reach.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"pretty.h\"\n #include \"trailer.h\"\n \ndiff --git a/builtin/count-objects.c b/builtin/count-objects.c\nindex e256779b1f..45a7a61cd3 100644\n--- a/builtin/count-objects.c\n+++ b/builtin/count-objects.c\n@@ -12,7 +12,7 @@\n #include \"path.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n \n static unsigned long garbage;\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 43bc72f05f..3b7d650e24 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -12,8 +12,8 @@\n #include \"odb/blob.h\"\n #include \"odb/tree.h\"\n #include \"odb/commit.h\"\n-#include \"delta.h\"\n-#include \"pack.h\"\n+#include \"pack/delta.h\"\n+#include \"pack/pack.h\"\n #include \"path.h\"\n #include \"read-cache-ll.h\"\n #include \"refs/refs.h\"\n@@ -21,7 +21,7 @@\n #include \"quote.h\"\n #include \"dir.h\"\n #include \"run-command.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex ce46a709a6..b14b96ce5c 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -36,7 +36,7 @@\n #include \"commit-reach.h\"\n #include \"branch.h\"\n #include \"promisor-remote.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"shallow.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 430cf28bd8..a00ca35703 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -7,12 +7,12 @@\n #include \"odb/blob.h\"\n #include \"odb/tag.h\"\n #include \"refs/refs.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"cache-tree.h\"\n #include \"odb/fsck.h\"\n #include \"parse-options.h\"\n #include \"progress.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n@@ -24,8 +24,8 @@\n #include \"run-command.h\"\n #include \"sparse-index.h\"\n #include \"refs/worktree.h\"\n-#include \"pack-revindex.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/pack-revindex.h\"\n+#include \"pack/pack-bitmap.h\"\n \n #define REACHABLE 0x0001\n #define SEEN      0x0002\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 1a71e6f908..bdf3d43108 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -27,8 +27,8 @@\n #include \"sigchain.h\"\n #include \"strvec.h\"\n #include \"odb/commit.h\"\n-#include \"commit-graph.h\"\n-#include \"packfile.h\"\n+#include \"pack/commit-graph.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex aa0e04eeee..23d7e68020 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -3,11 +3,11 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"csum-file.h\"\n #include \"odb/blob.h\"\n #include \"odb/commit.h\"\n@@ -17,8 +17,8 @@\n #include \"odb/fsck.h\"\n #include \"strbuf.h\"\n #include \"thread-utils.h\"\n-#include \"packfile.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/packfile.h\"\n+#include \"pack/pack-revindex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\ndiff --git a/builtin/last-modified.c b/builtin/last-modified.c\nindex e8827b5dc6..83c5d66f36 100644\n--- a/builtin/last-modified.c\n+++ b/builtin/last-modified.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"builtin.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"odb/commit-slab.h\"\n #include \"odb/commit.h\"\n #include \"config.h\"\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 2369c3b6f9..ad0c984d4b 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -50,7 +50,7 @@\n #include \"branch.h\"\n #include \"commit-reach.h\"\n #include \"wt-status.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n \n #define DEFAULT_TWOHEAD (1<<0)\n #define DEFAULT_OCTOPUS (1<<1)\ndiff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c\nindex 10af1beb5c..81401e37d5 100644\n--- a/builtin/multi-pack-index.c\n+++ b/builtin/multi-pack-index.c\n@@ -5,7 +5,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex 4e0254d70e..f3f4714c1d 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -14,7 +14,7 @@\n #include \"parse-options.h\"\n #include \"odb/hash-lookup.h\"\n #include \"odb/commit-slab.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"wildmatch.h\"\n #include \"mem-pool.h\"\n #include \"pretty.h\"\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 69f35a727b..37c379d3d8 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -10,38 +10,38 @@\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"delta.h\"\n-#include \"pack.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/delta.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/pack-revindex.h\"\n #include \"csum-file.h\"\n #include \"odb/tree-walk.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"pack-objects.h\"\n+#include \"pack/pack-objects.h\"\n #include \"progress.h\"\n #include \"refs/refs.h\"\n #include \"thread-utils.h\"\n-#include \"pack-bitmap.h\"\n-#include \"delta-islands.h\"\n-#include \"reachable.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/delta-islands.h\"\n+#include \"pack/reachable.h\"\n #include \"odb/oid-array.h\"\n #include \"strvec.h\"\n #include \"strmap.h\"\n #include \"list.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-file-convert.h\"\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"odb/replace-object.h\"\n #include \"dir.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"trace2.h\"\n #include \"shallow.h\"\n #include \"promisor-remote.h\"\n-#include \"pack-mtimes.h\"\n+#include \"pack/pack-mtimes.h\"\n #include \"parse-options.h\"\n #include \"pkt-line.h\"\n #include \"odb/blob.h\"\ndiff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c\nindex 10e1ce6ab5..5396e2bc10 100644\n--- a/builtin/pack-redundant.c\n+++ b/builtin/pack-redundant.c\n@@ -12,7 +12,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n \n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"strbuf.h\"\n \ndiff --git a/builtin/prune-packed.c b/builtin/prune-packed.c\nindex 4d63f26b0a..5d4a72abb4 100644\n--- a/builtin/prune-packed.c\n+++ b/builtin/prune-packed.c\n@@ -1,7 +1,7 @@\n #include \"builtin.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"prune-packed.h\"\n+#include \"pack/prune-packed.h\"\n \n static const char * const prune_packed_usage[] = {\n \t\"git prune-packed [-n | --dry-run] [-q | --quiet]\",\ndiff --git a/builtin/prune.c b/builtin/prune.c\nindex 301f59e897..ae3505c5e5 100644\n--- a/builtin/prune.c\n+++ b/builtin/prune.c\n@@ -8,11 +8,11 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision.h\"\n-#include \"reachable.h\"\n+#include \"pack/reachable.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"progress.h\"\n-#include \"prune-packed.h\"\n+#include \"pack/prune-packed.h\"\n #include \"odb/replace-object.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 88cbaed133..f01cc1a188 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -22,15 +22,15 @@\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n-#include \"pack.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/packfile.h\"\n #include \"parse-options.h\"\n #include \"pkt-line.h\"\n #include \"protocol.h\"\n #include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"run-command.h\"\n-#include \"server-info.h\"\n+#include \"pack/server-info.h\"\n #include \"setup.h\"\n #include \"shallow.h\"\n #include \"sideband.h\"\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex fc0b74ed95..d227104063 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -6,7 +6,7 @@\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"revision.h\"\n-#include \"reachable.h\"\n+#include \"pack/reachable.h\"\n #include \"wildmatch.h\"\n #include \"refs/worktree.h\"\n #include \"refs/reflog.h\"\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex db504d673f..5927a0dfdb 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -6,13 +6,13 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"run-command.h\"\n-#include \"server-info.h\"\n+#include \"pack/server-info.h\"\n #include \"string-list.h\"\n-#include \"midx.h\"\n-#include \"packfile.h\"\n-#include \"prune-packed.h\"\n+#include \"pack/midx.h\"\n+#include \"pack/packfile.h\"\n+#include \"pack/prune-packed.h\"\n #include \"promisor-remote.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"shallow.h\"\n \n #define ALL_INTO_ONE 1\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 466a0a515d..d6bddda9d4 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -15,7 +15,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/pack-bitmap.h\"\n #include \"parse-options.h\"\n #include \"log-tree.h\"\n #include \"graph.h\"\n@@ -24,7 +24,7 @@\n #include \"refs/reflog-walk.h\"\n #include \"odb/oidset.h\"\n #include \"odb/oidmap.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"commit-reach.h\"\n #include \"quote.h\"\n #include \"strbuf.h\"\ndiff --git a/builtin/show-index.c b/builtin/show-index.c\nindex 55c3c409ae..86dacb1a1e 100644\n--- a/builtin/show-index.c\n+++ b/builtin/show-index.c\n@@ -5,7 +5,7 @@\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"parse-options.h\"\n \n static const char *const show_index_usage[] = {\ndiff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c\nindex e5891809dd..93caca20ef 100644\n--- a/builtin/unpack-objects.c\n+++ b/builtin/unpack-objects.c\n@@ -12,15 +12,15 @@\n #include \"odb/streaming.h\"\n #include \"odb/transaction.h\"\n #include \"odb/object.h\"\n-#include \"delta.h\"\n-#include \"pack.h\"\n+#include \"pack/delta.h\"\n+#include \"pack/pack.h\"\n #include \"odb/blob.h\"\n #include \"odb/replace-object.h\"\n #include \"strbuf.h\"\n #include \"progress.h\"\n #include \"decorate.h\"\n #include \"odb/fsck.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n \n static int dry_run, quiet, recover, has_errors, strict;\n static const char unpack_usage[] = \"git unpack-objects [-n] [-q] [-r] [--strict]\";\ndiff --git a/builtin/update-server-info.c b/builtin/update-server-info.c\nindex 4c12968a83..41bbd0114f 100644\n--- a/builtin/update-server-info.c\n+++ b/builtin/update-server-info.c\n@@ -3,7 +3,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"server-info.h\"\n+#include \"pack/server-info.h\"\n \n static const char * const update_server_info_usage[] = {\n \t\"git update-server-info [-f | --force]\",\ndiff --git a/commit-reach.c b/commit-reach.c\nindex 9636b5b37f..0b59c9ba29 100644\n--- a/commit-reach.c\n+++ b/commit-reach.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"decorate.h\"\n #include \"hex.h\"\n #include \"prio-queue.h\"\ndiff --git a/connected.c b/connected.c\nindex 1aafa86101..1884614b80 100644\n--- a/connected.c\n+++ b/connected.c\n@@ -8,7 +8,7 @@\n #include \"sigchain.h\"\n #include \"connected.h\"\n #include \"transport.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"promisor-remote.h\"\n \n static int promised_object_cb(const struct object_id *oid UNUSED,\ndiff --git a/diagnose.c b/diagnose.c\nindex 6858f39f45..716dabf05c 100644\n--- a/diagnose.c\n+++ b/diagnose.c\n@@ -8,7 +8,7 @@\n #include \"hex.h\"\n #include \"strvec.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"parse-options.h\"\n #include \"repository.h\"\n #include \"write-or-die.h\"\ndiff --git a/diff.c b/diff.c\nindex 22265895a7..91addcdab7 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -17,7 +17,7 @@\n #include \"quote.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n #include \"hex.h\"\n #include \"xdiff-interface.h\"\n #include \"color.h\"\n@@ -34,7 +34,7 @@\n #include \"odb/tmp-objdir.h\"\n #include \"graph.h\"\n #include \"odb/oid-array.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"pager.h\"\n #include \"parse-options.h\"\n #include \"help.h\"\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex 434b57e5b0..b19cb3239e 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -13,7 +13,7 @@\n #include \"pkt-line.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"sideband.h\"\n #include \"fetch-pack.h\"\n #include \"remote.h\"\n@@ -23,7 +23,7 @@\n #include \"version.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n@@ -32,7 +32,7 @@\n #include \"odb/fsck.h\"\n #include \"shallow.h\"\n #include \"commit-reach.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"sigchain.h\"\n #include \"mergesort.h\"\n #include \"prio-queue.h\"\ndiff --git a/http-backend.c b/http-backend.c\nindex 90624c3348..57589cc127 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -18,7 +18,7 @@\n #include \"url.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"protocol.h\"\n #include \"date.h\"\ndiff --git a/http-push.c b/http-push.c\nindex 858aa9db33..88a8417ea4 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -18,7 +18,7 @@\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"url.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"commit-reach.h\"\ndiff --git a/http-walker.c b/http-walker.c\nindex dba84c0ef5..e73c3677d1 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -8,7 +8,7 @@\n #include \"http.h\"\n #include \"list.h\"\n #include \"transport.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n \ndiff --git a/http.c b/http.c\nindex 81b58bd8d2..24a6b30ab3 100644\n--- a/http.c\n+++ b/http.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"http.h\"\n #include \"config.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"run-command.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\n@@ -17,7 +17,7 @@\n #include \"gettext.h\"\n #include \"trace.h\"\n #include \"transport.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"string-list.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\ndiff --git a/line-log.c b/line-log.c\nindex 2c9c11e5d3..343159d90a 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -16,7 +16,7 @@\n #include \"line-log.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"odb/tree-walk.h\"\n \n static void range_set_grow(struct range_set *rs, size_t extra)\ndiff --git a/list-objects.c b/list-objects.c\nindex b8a673ed69..1db5ba29b5 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -13,7 +13,7 @@\n #include \"list-objects.h\"\n #include \"list-objects-filter.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"trace.h\"\n #include \"environment.h\"\ndiff --git a/meson.build b/meson.build\nindex 8dd613a8bb..238beb0dfd 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -322,7 +322,7 @@ libgit_sources = [\n   'bisect.c',\n   'blame.c',\n   'odb/blob.c',\n-  'bloom.c',\n+  'pack/bloom.c',\n   'branch.c',\n   'bundle-uri.c',\n   'bundle.c',\n@@ -330,11 +330,11 @@ libgit_sources = [\n   'odb/cbtree.c',\n   'chdir-notify.c',\n   'checkout.c',\n-  'chunk-format.c',\n+  'pack/chunk-format.c',\n   'color.c',\n   'column.c',\n   'combine-diff.c',\n-  'commit-graph.c',\n+  'pack/commit-graph.c',\n   'commit-reach.c',\n   'odb/commit.c',\n   'common-exit.c',\n@@ -350,9 +350,9 @@ libgit_sources = [\n   'ctype.c',\n   'date.c',\n   'decorate.c',\n-  'delta-islands.c',\n+  'pack/delta-islands.c',\n   'diagnose.c',\n-  'diff-delta.c',\n+  'pack/diff-delta.c',\n   'diff-merges.c',\n   'diff-lib.c',\n   'diff-no-index.c',\n@@ -416,8 +416,8 @@ libgit_sources = [\n   'merge-ort.c',\n   'merge-ort-wrappers.c',\n   'merge.c',\n-  'midx.c',\n-  'midx-write.c',\n+  'pack/midx.c',\n+  'pack/midx-write.c',\n   'name-hash.c',\n   'negotiator/default.c',\n   'negotiator/noop.c',\n@@ -446,22 +446,22 @@ libgit_sources = [\n   'organize/labeler-protocol.c',\n   'organize/organize.c',\n   'organize/organizer-protocol.c',\n-  'pack-bitmap-write.c',\n-  'pack-bitmap.c',\n-  'pack-check.c',\n-  'pack-mtimes.c',\n-  'pack-objects.c',\n+  'pack/pack-bitmap-write.c',\n+  'pack/pack-bitmap.c',\n+  'pack/pack-check.c',\n+  'pack/pack-mtimes.c',\n+  'pack/pack-objects.c',\n   'refs/pack-refs.c',\n-  'pack-revindex.c',\n-  'pack-write.c',\n-  'packfile.c',\n-  'packfile-list.c',\n+  'pack/pack-revindex.c',\n+  'pack/pack-write.c',\n+  'pack/packfile.c',\n+  'pack/packfile-list.c',\n   'pager.c',\n   'parallel-checkout.c',\n   'parse.c',\n   'parse-options-cb.c',\n   'parse-options.c',\n-  'patch-delta.c',\n+  'pack/patch-delta.c',\n   'patch-ids.c',\n   'path.c',\n   'path-walk.c',\n@@ -475,11 +475,11 @@ libgit_sources = [\n   'prompt.c',\n   'protocol.c',\n   'protocol-caps.c',\n-  'prune-packed.c',\n-  'pseudo-merge.c',\n+  'pack/prune-packed.c',\n+  'pack/pseudo-merge.c',\n   'quote.c',\n   'range-diff.c',\n-  'reachable.c',\n+  'pack/reachable.c',\n   'read-cache.c',\n   'rebase-interactive.c',\n   'rebase.c',\n@@ -509,12 +509,12 @@ libgit_sources = [\n   'reftable/tree.c',\n   'reftable/writer.c',\n   'remote.c',\n-  'repack.c',\n-  'repack-cruft.c',\n-  'repack-filtered.c',\n-  'repack-geometry.c',\n-  'repack-midx.c',\n-  'repack-promisor.c',\n+  'pack/repack.c',\n+  'pack/repack-cruft.c',\n+  'pack/repack-filtered.c',\n+  'pack/repack-geometry.c',\n+  'pack/repack-midx.c',\n+  'pack/repack-promisor.c',\n   'odb/replace-object.c',\n   'replay.c',\n   'repo-settings.c',\n@@ -527,7 +527,7 @@ libgit_sources = [\n   'send-pack.c',\n   'sequencer.c',\n   'serve.c',\n-  'server-info.c',\n+  'pack/server-info.c',\n   'setup.c',\n   'shallow.c',\n   'sideband.c',\ndiff --git a/odb/commit.c b/odb/commit.c\nindex dc98000ab2..06daa8c6a0 100644\n--- a/odb/commit.c\n+++ b/odb/commit.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"odb/tag.h\"\n #include \"odb/commit.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/odb/fsck.c b/odb/fsck.c\nindex 75306dc8a3..8c953f61a4 100644\n--- a/odb/fsck.c\n+++ b/odb/fsck.c\n@@ -18,7 +18,7 @@\n #include \"url.h\"\n #include \"utf8.h\"\n #include \"odb/oidset.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"submodule-config.h\"\n #include \"config.h\"\n #include \"help.h\"\ndiff --git a/odb/object-file.c b/odb/object-file.c\nindex c4841cc289..41ee67abb6 100644\n--- a/odb/object-file.c\n+++ b/odb/object-file.c\n@@ -22,8 +22,8 @@\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"odb/transaction.h\"\n-#include \"pack.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"read-cache-ll.h\"\n #include \"setup.h\"\ndiff --git a/odb/object-name.c b/odb/object-name.c\nindex 16b6cd8f12..ff61d55590 100644\n--- a/odb/object-name.c\n+++ b/odb/object-name.c\n@@ -22,7 +22,7 @@\n #include \"repo-settings.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"commit-reach.h\"\n #include \"date.h\"\n #include \"odb/object-file-convert.h\"\ndiff --git a/odb/object.c b/odb/object.c\nindex 8a34e52eca..7c2f920d3f 100644\n--- a/odb/object.c\n+++ b/odb/object.c\n@@ -13,7 +13,7 @@\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"odb/alloc.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n \n unsigned int get_max_object_index(const struct repository *repo)\n {\ndiff --git a/odb/odb.c b/odb/odb.c\nindex ffa2881e9f..e942149d91 100644\n--- a/odb/odb.c\n+++ b/odb/odb.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"config.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n@@ -9,13 +9,13 @@\n #include \"khash.h\"\n #include \"lockfile.h\"\n #include \"odb/loose.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"odb/object-file-convert.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"odb/source-inmemory.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\n #include \"quote.h\"\ndiff --git a/odb/source-files.c b/odb/source-files.c\nindex 279a2ccab6..b526e5c219 100644\n--- a/odb/source-files.c\n+++ b/odb/source-files.c\n@@ -10,11 +10,11 @@\n #include \"odb/source.h\"\n #include \"odb/source-files.h\"\n #include \"odb/source-loose.h\"\n-#include \"pack-objects.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack-objects.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\ndiff --git a/odb/source-packed.c b/odb/source-packed.c\nindex 0890704e76..0e391f6fcf 100644\n--- a/odb/source-packed.c\n+++ b/odb/source-packed.c\n@@ -5,11 +5,11 @@\n #include \"git-zlib.h\"\n #include \"list-objects-filter-options.h\"\n #include \"mergesort.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"odb/source-packed.h\"\n #include \"odb/streaming.h\"\n-#include \"packfile.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/packfile.h\"\n+#include \"pack/pack-bitmap.h\"\n \n static int find_pack_entry(struct odb_source_packed *store,\n \t\t\t   const struct object_id *oid,\ndiff --git a/odb/source-packed.h b/odb/source-packed.h\nindex a0f6b5096d..619e28179e 100644\n--- a/odb/source-packed.h\n+++ b/odb/source-packed.h\n@@ -2,7 +2,7 @@\n #define ODB_SOURCE_PACKED_H\n \n #include \"odb/source.h\"\n-#include \"packfile-list.h\"\n+#include \"pack/packfile-list.h\"\n #include \"strmap.h\"\n \n /*\ndiff --git a/odb/source.c b/odb/source.c\nindex 2a2e1d0060..95f4362327 100644\n--- a/odb/source.c\n+++ b/odb/source.c\n@@ -2,7 +2,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/source-files.h\"\n #include \"odb/source.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n \n static const char * const odb_source_names_by_type[] = {\n \t[ODB_SOURCE_UNKNOWN] = \"unknown\",\ndiff --git a/odb/tag.c b/odb/tag.c\nindex 7be23b04c1..36cb7732a8 100644\n--- a/odb/tag.c\n+++ b/odb/tag.c\n@@ -11,7 +11,7 @@\n #include \"odb/alloc.h\"\n #include \"gpg-interface.h\"\n #include \"hex.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"repository.h\"\n \n const char *tag_type = \"tag\";\ndiff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c\nindex 59bbb849d1..e0ef2ef871 100644\n--- a/oss-fuzz/fuzz-commit-graph.c\n+++ b/oss-fuzz/fuzz-commit-graph.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"repository.h\"\n \n int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\ndiff --git a/oss-fuzz/fuzz-pack-headers.c b/oss-fuzz/fuzz-pack-headers.c\nindex ef61ab577c..81dc1d556b 100644\n--- a/oss-fuzz/fuzz-pack-headers.c\n+++ b/oss-fuzz/fuzz-pack-headers.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n \n int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n \ndiff --git a/oss-fuzz/fuzz-pack-idx.c b/oss-fuzz/fuzz-pack-idx.c\nindex 5b033dbd93..599b12b9bf 100644\n--- a/oss-fuzz/fuzz-pack-idx.c\n+++ b/oss-fuzz/fuzz-pack-idx.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n \n int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n \ndiff --git a/bloom.c b/pack/bloom.c\nsimilarity index 99%\nrename from bloom.c\nrename to pack/bloom.c\nindex e61cb05246..874e011530 100644\n--- a/bloom.c\n+++ b/pack/bloom.c\n@@ -1,11 +1,11 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"hashmap.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"odb/commit.h\"\n #include \"odb/commit-slab.h\"\n #include \"odb/tree.h\"\ndiff --git a/bloom.h b/pack/bloom.h\nsimilarity index 100%\nrename from bloom.h\nrename to pack/bloom.h\ndiff --git a/chunk-format.c b/pack/chunk-format.c\nsimilarity index 99%\nrename from chunk-format.c\nrename to pack/chunk-format.c\nindex 08b90762d4..31468dcc6e 100644\n--- a/chunk-format.c\n+++ b/pack/chunk-format.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"chunk-format.h\"\n+#include \"pack/chunk-format.h\"\n #include \"csum-file.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\ndiff --git a/chunk-format.h b/pack/chunk-format.h\nsimilarity index 100%\nrename from chunk-format.h\nrename to pack/chunk-format.h\ndiff --git a/commit-graph.c b/pack/commit-graph.c\nsimilarity index 99%\nrename from commit-graph.c\nrename to pack/commit-graph.c\nindex 7c22588c46..afc04d74a5 100644\n--- a/commit-graph.c\n+++ b/pack/commit-graph.c\n@@ -7,12 +7,12 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/commit.h\"\n #include \"odb/object.h\"\n #include \"refs/refs.h\"\n #include \"odb/hash-lookup.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n@@ -20,13 +20,13 @@\n #include \"hashmap.h\"\n #include \"odb/replace-object.h\"\n #include \"progress.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"odb/commit-slab.h\"\n #include \"shallow.h\"\n #include \"json-writer.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n-#include \"chunk-format.h\"\n+#include \"pack/chunk-format.h\"\n \n void git_test_write_commit_graph_or_die(struct odb_source *source)\n {\ndiff --git a/commit-graph.h b/pack/commit-graph.h\nsimilarity index 100%\nrename from commit-graph.h\nrename to pack/commit-graph.h\ndiff --git a/delta-islands.c b/pack/delta-islands.c\nsimilarity index 99%\nrename from delta-islands.c\nrename to pack/delta-islands.c\nindex 1c92cdf37c..3d015719a5 100644\n--- a/delta-islands.c\n+++ b/pack/delta-islands.c\n@@ -7,15 +7,15 @@\n #include \"hex.h\"\n #include \"odb/tag.h\"\n #include \"odb/tree.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"odb/tree-walk.h\"\n #include \"diff.h\"\n #include \"progress.h\"\n #include \"refs/refs.h\"\n #include \"khash.h\"\n-#include \"pack-bitmap.h\"\n-#include \"pack-objects.h\"\n-#include \"delta-islands.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/pack-objects.h\"\n+#include \"pack/delta-islands.h\"\n #include \"odb/oid-array.h\"\n #include \"config.h\"\n \ndiff --git a/delta-islands.h b/pack/delta-islands.h\nsimilarity index 100%\nrename from delta-islands.h\nrename to pack/delta-islands.h\ndiff --git a/delta.h b/pack/delta.h\nsimilarity index 100%\nrename from delta.h\nrename to pack/delta.h\ndiff --git a/diff-delta.c b/pack/diff-delta.c\nsimilarity index 99%\nrename from diff-delta.c\nrename to pack/diff-delta.c\nindex 43c339f010..0800ce4607 100644\n--- a/diff-delta.c\n+++ b/pack/diff-delta.c\n@@ -14,7 +14,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n \n /* maximum hash entry list for the same hash bucket */\n #define HASH_LIMIT 64\ndiff --git a/midx-write.c b/pack/midx-write.c\nsimilarity index 99%\nrename from midx-write.c\nrename to pack/midx-write.c\nindex af4410a0b8..1f8f24410a 100644\n--- a/midx-write.c\n+++ b/pack/midx-write.c\n@@ -3,20 +3,20 @@\n #include \"config.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/hash-lookup.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"progress.h\"\n #include \"trace2.h\"\n #include \"run-command.h\"\n-#include \"chunk-format.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/chunk-format.h\"\n+#include \"pack/pack-bitmap.h\"\n #include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"path.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/pack-revindex.h\"\n \n #define PACK_EXPIRED UINT_MAX\n #define BITMAP_POS_UNKNOWN (~((uint32_t)0))\ndiff --git a/midx.c b/pack/midx.c\nsimilarity index 99%\nrename from midx.c\nrename to pack/midx.c\nindex 47f67c4295..2608e99468 100644\n--- a/midx.c\n+++ b/pack/midx.c\n@@ -4,14 +4,14 @@\n #include \"config.h\"\n #include \"dir.h\"\n #include \"hex.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/hash-lookup.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"progress.h\"\n #include \"trace2.h\"\n-#include \"chunk-format.h\"\n-#include \"pack-bitmap.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/chunk-format.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/pack-revindex.h\"\n #include \"strvec.h\"\n \n #define MIDX_PACK_ERROR ((void *)(intptr_t)-1)\ndiff --git a/midx.h b/pack/midx.h\nsimilarity index 100%\nrename from midx.h\nrename to pack/midx.h\ndiff --git a/pack-bitmap-write.c b/pack/pack-bitmap-write.c\nsimilarity index 99%\nrename from pack-bitmap-write.c\nrename to pack/pack-bitmap-write.c\nindex b5e14b196f..6ef5fb4629 100644\n--- a/pack-bitmap-write.c\n+++ b/pack/pack-bitmap-write.c\n@@ -9,24 +9,24 @@\n #include \"diff.h\"\n #include \"revision.h\"\n #include \"progress.h\"\n-#include \"pack.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/pack-bitmap.h\"\n #include \"odb/hash-lookup.h\"\n-#include \"pack-objects.h\"\n+#include \"pack/pack-objects.h\"\n #include \"path.h\"\n #include \"commit-reach.h\"\n #include \"prio-queue.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"pseudo-merge.h\"\n+#include \"pack/pseudo-merge.h\"\n #include \"odb/oid-array.h\"\n #include \"config.h\"\n #include \"odb/alloc.h\"\n #include \"refs/refs.h\"\n #include \"strmap.h\"\n-#include \"midx.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/midx.h\"\n+#include \"pack/pack-revindex.h\"\n \n struct bitmapped_commit {\n \tstruct commit *commit;\ndiff --git a/pack-bitmap.c b/pack/pack-bitmap.c\nsimilarity index 99%\nrename from pack-bitmap.c\nrename to pack/pack-bitmap.c\nindex 908a00ec0c..80f853f355 100644\n--- a/pack-bitmap.c\n+++ b/pack/pack-bitmap.c\n@@ -10,18 +10,18 @@\n #include \"revision.h\"\n #include \"progress.h\"\n #include \"list-objects.h\"\n-#include \"pack.h\"\n-#include \"pack-bitmap.h\"\n-#include \"pack-revindex.h\"\n-#include \"pack-objects.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/pack-revindex.h\"\n+#include \"pack/pack-objects.h\"\n+#include \"pack/packfile.h\"\n #include \"repository.h\"\n #include \"trace2.h\"\n #include \"odb/odb.h\"\n #include \"list-objects-filter-options.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"config.h\"\n-#include \"pseudo-merge.h\"\n+#include \"pack/pseudo-merge.h\"\n \n /*\n  * An entry on the bitmap index, representing the bitmap for a given\ndiff --git a/pack-bitmap.h b/pack/pack-bitmap.h\nsimilarity index 99%\nrename from pack-bitmap.h\nrename to pack/pack-bitmap.h\nindex b50ef0b4e4..6f6fc1cb50 100644\n--- a/pack-bitmap.h\n+++ b/pack/pack-bitmap.h\n@@ -3,8 +3,8 @@\n \n #include \"ewah/ewok.h\"\n #include \"khash.h\"\n-#include \"pack.h\"\n-#include \"pack-objects.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/pack-objects.h\"\n #include \"refs/refs.h\"\n #include \"string-list.h\"\n \ndiff --git a/pack-check.c b/pack/pack-check.c\nsimilarity index 99%\nrename from pack-check.c\nrename to pack/pack-check.c\nindex 358c68ef11..e66ef8f1b7 100644\n--- a/pack-check.c\n+++ b/pack/pack-check.c\n@@ -4,9 +4,9 @@\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"progress.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\ndiff --git a/pack-mtimes.c b/pack/pack-mtimes.c\nsimilarity index 98%\nrename from pack-mtimes.c\nrename to pack/pack-mtimes.c\nindex 903c1039c8..1dbc072bb0 100644\n--- a/pack-mtimes.c\n+++ b/pack/pack-mtimes.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"pack-mtimes.h\"\n+#include \"pack/pack-mtimes.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"strbuf.h\"\n \n static char *pack_mtimes_filename(struct packed_git *p)\ndiff --git a/pack-mtimes.h b/pack/pack-mtimes.h\nsimilarity index 100%\nrename from pack-mtimes.h\nrename to pack/pack-mtimes.h\ndiff --git a/pack-objects.c b/pack/pack-objects.c\nsimilarity index 98%\nrename from pack-objects.c\nrename to pack/pack-objects.c\nindex 35ecc8831e..aa1d5bb1c9 100644\n--- a/pack-objects.c\n+++ b/pack/pack-objects.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"odb/object.h\"\n-#include \"pack.h\"\n-#include \"pack-objects.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/pack-objects.h\"\n+#include \"pack/packfile.h\"\n #include \"parse.h\"\n #include \"repository.h\"\n \ndiff --git a/pack-objects.h b/pack/pack-objects.h\nsimilarity index 99%\nrename from pack-objects.h\nrename to pack/pack-objects.h\nindex 8b9fc2e36b..dbd07d3913 100644\n--- a/pack-objects.h\n+++ b/pack/pack-objects.h\n@@ -3,8 +3,8 @@\n \n #include \"odb/odb.h\"\n #include \"thread-utils.h\"\n-#include \"pack.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/packfile.h\"\n \n struct repository;\n \ndiff --git a/pack-revindex.c b/pack/pack-revindex.c\nsimilarity index 99%\nrename from pack-revindex.c\nrename to pack/pack-revindex.c\nindex 613d1bb897..51cf1f82c6 100644\n--- a/pack-revindex.c\n+++ b/pack/pack-revindex.c\n@@ -1,13 +1,13 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/pack-revindex.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\n #include \"parse.h\"\n #include \"repository.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"csum-file.h\"\n \n struct revindex_entry {\ndiff --git a/pack-revindex.h b/pack/pack-revindex.h\nsimilarity index 100%\nrename from pack-revindex.h\nrename to pack/pack-revindex.h\ndiff --git a/pack-write.c b/pack/pack-write.c\nsimilarity index 99%\nrename from pack-write.c\nrename to pack/pack-write.c\nindex 86af0ac730..3ced89d932 100644\n--- a/pack-write.c\n+++ b/pack/pack-write.c\n@@ -2,14 +2,14 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"csum-file.h\"\n #include \"remote.h\"\n-#include \"chunk-format.h\"\n+#include \"pack/chunk-format.h\"\n #include \"odb/object-file.h\"\n-#include \"pack-mtimes.h\"\n-#include \"pack-objects.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/pack-mtimes.h\"\n+#include \"pack/pack-objects.h\"\n+#include \"pack/pack-revindex.h\"\n #include \"path.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\ndiff --git a/pack.h b/pack/pack.h\nsimilarity index 100%\nrename from pack.h\nrename to pack/pack.h\ndiff --git a/packfile-list.c b/pack/packfile-list.c\nsimilarity index 96%\nrename from packfile-list.c\nrename to pack/packfile-list.c\nindex 01fb913abf..4e041d4fed 100644\n--- a/packfile-list.c\n+++ b/pack/packfile-list.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"packfile.h\"\n-#include \"packfile-list.h\"\n+#include \"pack/packfile.h\"\n+#include \"pack/packfile-list.h\"\n \n void packfile_list_clear(struct packfile_list *list)\n {\ndiff --git a/packfile-list.h b/pack/packfile-list.h\nsimilarity index 100%\nrename from packfile-list.h\nrename to pack/packfile-list.h\ndiff --git a/packfile.c b/pack/packfile.c\nsimilarity index 99%\nrename from packfile.c\nrename to pack/packfile.c\nindex 2936cbf3fa..0426bee827 100644\n--- a/packfile.c\n+++ b/pack/packfile.c\n@@ -5,11 +5,11 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"list.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"repository.h\"\n #include \"dir.h\"\n-#include \"packfile.h\"\n-#include \"delta.h\"\n+#include \"pack/packfile.h\"\n+#include \"pack/delta.h\"\n #include \"odb/hash-lookup.h\"\n #include \"odb/commit.h\"\n #include \"odb/object.h\"\n@@ -20,11 +20,11 @@\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n-#include \"midx.h\"\n-#include \"commit-graph.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/midx.h\"\n+#include \"pack/commit-graph.h\"\n+#include \"pack/pack-revindex.h\"\n #include \"promisor-remote.h\"\n-#include \"pack-mtimes.h\"\n+#include \"pack/pack-mtimes.h\"\n \n char *odb_pack_name(struct repository *r, struct strbuf *buf,\n \t\t    const unsigned char *hash, const char *ext)\ndiff --git a/packfile.h b/pack/packfile.h\nsimilarity index 99%\nrename from packfile.h\nrename to pack/packfile.h\nindex 9859bfb5e0..55dc02539b 100644\n--- a/packfile.h\n+++ b/pack/packfile.h\n@@ -7,7 +7,7 @@\n #include \"odb/source-files.h\"\n #include \"odb/source-packed.h\"\n #include \"odb/oidset.h\"\n-#include \"packfile-list.h\"\n+#include \"pack/packfile-list.h\"\n #include \"repository.h\"\n \n /* in odb.h */\ndiff --git a/patch-delta.c b/pack/patch-delta.c\nsimilarity index 98%\nrename from patch-delta.c\nrename to pack/patch-delta.c\nindex 42199fa956..77c1e278b7 100644\n--- a/patch-delta.c\n+++ b/pack/patch-delta.c\n@@ -10,7 +10,7 @@\n  */\n \n #include \"git-compat-util.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n \n void *patch_delta(const void *src_buf, size_t src_size,\n \t\t  const void *delta_buf, size_t delta_size,\ndiff --git a/prune-packed.c b/pack/prune-packed.c\nsimilarity index 94%\nrename from prune-packed.c\nrename to pack/prune-packed.c\nindex f536ef1eaf..52473c6bf9 100644\n--- a/prune-packed.c\n+++ b/pack/prune-packed.c\n@@ -3,9 +3,9 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"odb/object-file.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"progress.h\"\n-#include \"prune-packed.h\"\n+#include \"pack/prune-packed.h\"\n #include \"repository.h\"\n \n static struct progress *progress;\ndiff --git a/prune-packed.h b/pack/prune-packed.h\nsimilarity index 100%\nrename from prune-packed.h\nrename to pack/prune-packed.h\ndiff --git a/pseudo-merge.c b/pack/pseudo-merge.c\nsimilarity index 99%\nrename from pseudo-merge.c\nrename to pack/pseudo-merge.c\nindex f87fd46b46..07c6ebea05 100644\n--- a/pseudo-merge.c\n+++ b/pack/pseudo-merge.c\n@@ -2,14 +2,14 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"pseudo-merge.h\"\n+#include \"pack/pseudo-merge.h\"\n #include \"date.h\"\n #include \"odb/oid-array.h\"\n #include \"strbuf.h\"\n #include \"config.h\"\n #include \"string-list.h\"\n #include \"refs/refs.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/pack-bitmap.h\"\n #include \"odb/commit.h\"\n #include \"odb/alloc.h\"\n #include \"progress.h\"\ndiff --git a/pseudo-merge.h b/pack/pseudo-merge.h\nsimilarity index 100%\nrename from pseudo-merge.h\nrename to pack/pseudo-merge.h\ndiff --git a/reachable.c b/pack/reachable.c\nsimilarity index 98%\nrename from reachable.c\nrename to pack/reachable.c\nindex a99699c6d8..51c13b552f 100644\n--- a/reachable.c\n+++ b/pack/reachable.c\n@@ -8,15 +8,15 @@\n #include \"odb/blob.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n-#include \"reachable.h\"\n+#include \"pack/reachable.h\"\n #include \"cache-tree.h\"\n #include \"progress.h\"\n #include \"list-objects.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"refs/worktree.h\"\n #include \"odb/object-file.h\"\n-#include \"pack-bitmap.h\"\n-#include \"pack-mtimes.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/pack-mtimes.h\"\n #include \"config.h\"\n #include \"run-command.h\"\n #include \"sequencer.h\"\ndiff --git a/reachable.h b/pack/reachable.h\nsimilarity index 100%\nrename from reachable.h\nrename to pack/reachable.h\ndiff --git a/repack-cruft.c b/pack/repack-cruft.c\nsimilarity index 98%\nrename from repack-cruft.c\nrename to pack/repack-cruft.c\nindex 0653e88792..0f49a59ca7 100644\n--- a/repack-cruft.c\n+++ b/pack/repack-cruft.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"repack.h\"\n-#include \"packfile.h\"\n+#include \"pack/repack.h\"\n+#include \"pack/packfile.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n \ndiff --git a/repack-filtered.c b/pack/repack-filtered.c\nsimilarity index 98%\nrename from repack-filtered.c\nrename to pack/repack-filtered.c\nindex edcf7667c5..2a77018951 100644\n--- a/repack-filtered.c\n+++ b/pack/repack-filtered.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"string-list.h\"\ndiff --git a/repack-geometry.c b/pack/repack-geometry.c\nsimilarity index 99%\nrename from repack-geometry.c\nrename to pack/repack-geometry.c\nindex 15b3412950..1ae2e8be9f 100644\n--- a/repack-geometry.c\n+++ b/pack/repack-geometry.c\n@@ -1,11 +1,11 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"repository.h\"\n #include \"hex.h\"\n-#include \"midx.h\"\n-#include \"packfile.h\"\n+#include \"pack/midx.h\"\n+#include \"pack/packfile.h\"\n \n static uint32_t pack_geometry_weight(struct packed_git *p)\n {\ndiff --git a/repack-midx.c b/pack/repack-midx.c\nsimilarity index 99%\nrename from repack-midx.c\nrename to pack/repack-midx.c\nindex 342deb798c..d1b563e90c 100644\n--- a/repack-midx.c\n+++ b/pack/repack-midx.c\n@@ -1,12 +1,12 @@\n #include \"git-compat-util.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"odb/odb.h\"\n #include \"odb/oidset.h\"\n-#include \"pack-bitmap.h\"\n+#include \"pack/pack-bitmap.h\"\n #include \"path.h\"\n #include \"refs/refs.h\"\n #include \"run-command.h\"\ndiff --git a/repack-promisor.c b/pack/repack-promisor.c\nsimilarity index 98%\nrename from repack-promisor.c\nrename to pack/repack-promisor.c\nindex 90318ce150..628903244c 100644\n--- a/repack-promisor.c\n+++ b/pack/repack-promisor.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"hex.h\"\n-#include \"pack.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\ndiff --git a/repack.c b/pack/repack.c\nsimilarity index 99%\nrename from repack.c\nrename to pack/repack.c\nindex 16da2e35cb..91dde13b29 100644\n--- a/repack.c\n+++ b/pack/repack.c\n@@ -1,10 +1,10 @@\n #include \"git-compat-util.h\"\n #include \"dir.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n-#include \"repack.h\"\n+#include \"pack/repack.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"tempfile.h\"\ndiff --git a/repack.h b/pack/repack.h\nsimilarity index 100%\nrename from repack.h\nrename to pack/repack.h\ndiff --git a/server-info.c b/pack/server-info.c\nsimilarity index 99%\nrename from server-info.c\nrename to pack/server-info.c\nindex 3021ee8926..627d2e3c98 100644\n--- a/server-info.c\n+++ b/pack/server-info.c\n@@ -8,11 +8,11 @@\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n-#include \"server-info.h\"\n+#include \"pack/server-info.h\"\n #include \"strbuf.h\"\n #include \"tempfile.h\"\n \ndiff --git a/server-info.h b/pack/server-info.h\nsimilarity index 100%\nrename from server-info.h\nrename to pack/server-info.h\ndiff --git a/path.c b/path.c\nindex 4afd1e3ffa..516abb3f82 100644\n--- a/path.c\n+++ b/path.c\n@@ -13,7 +13,7 @@\n #include \"setup.h\"\n #include \"submodule-config.h\"\n #include \"path.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"lockfile.h\"\n #include \"exec-cmd.h\"\ndiff --git a/promisor-remote.c b/promisor-remote.c\nindex b2188d34c7..da6b1225dd 100644\n--- a/promisor-remote.c\n+++ b/promisor-remote.c\n@@ -9,7 +9,7 @@\n #include \"trace2.h\"\n #include \"transport.h\"\n #include \"strvec.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"environment.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\ndiff --git a/repo-settings.c b/repo-settings.c\nindex f3be3b8c5a..f40d1436a9 100644\n--- a/repo-settings.c\n+++ b/repo-settings.c\n@@ -2,8 +2,8 @@\n #include \"config.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\n-#include \"midx.h\"\n-#include \"pack-objects.h\"\n+#include \"pack/midx.h\"\n+#include \"pack/pack-objects.h\"\n #include \"setup.h\"\n \n static void repo_cfg_bool(struct repository *r, const char *key, int *dest,\ndiff --git a/revision.c b/revision.c\nindex 35a1893436..f92a6482f1 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -31,7 +31,7 @@\n #include \"odb/commit-slab.h\"\n #include \"cache-tree.h\"\n #include \"bisect.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"refs/worktree.h\"\n #include \"path.h\"\n #include \"read-cache.h\"\n@@ -40,11 +40,11 @@\n #include \"strvec.h\"\n #include \"trace2.h\"\n #include \"commit-reach.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"prio-queue.h\"\n #include \"hashmap.h\"\n #include \"utf8.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"json-writer.h\"\n #include \"list-objects-filter-options.h\"\n #include \"resolve-undo.h\"\ndiff --git a/run-command.c b/run-command.c\nindex ce84db8782..e0c4325900 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -15,7 +15,7 @@\n #include \"trace2.h\"\n #include \"quote.h\"\n #include \"config.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"compat/nonblock.h\"\n \n void child_process_init(struct child_process *child)\ndiff --git a/scalar.c b/scalar.c\nindex af3456b5d0..2cb09af1a5 100644\n--- a/scalar.c\n+++ b/scalar.c\n@@ -15,7 +15,7 @@\n #include \"fsmonitor-settings.h\"\n #include \"refs/refs.h\"\n #include \"dir.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"help.h\"\n #include \"setup.h\"\n #include \"trace2.h\"\ndiff --git a/t/helper/test-bitmap.c b/t/helper/test-bitmap.c\nindex f1f48e973d..59beba76d2 100644\n--- a/t/helper/test-bitmap.c\n+++ b/t/helper/test-bitmap.c\n@@ -4,8 +4,8 @@\n #include \"git-compat-util.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n-#include \"pack-bitmap.h\"\n-#include \"pseudo-merge.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/pseudo-merge.h\"\n #include \"setup.h\"\n \n static int bitmap_list_commits(void)\ndiff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c\nindex 48ff2c6024..5c469af08d 100644\n--- a/t/helper/test-bloom.c\n+++ b/t/helper/test-bloom.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\n #include \"repository.h\"\ndiff --git a/t/helper/test-delta.c b/t/helper/test-delta.c\nindex 8223a60229..291c2eb291 100644\n--- a/t/helper/test-delta.c\n+++ b/t/helper/test-delta.c\n@@ -10,7 +10,7 @@\n \n #include \"test-tool.h\"\n #include \"git-compat-util.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n #include \"strbuf.h\"\n \n static const char usage_str[] =\ndiff --git a/t/helper/test-find-pack.c b/t/helper/test-find-pack.c\nindex c7475ed4d9..216e7abb9a 100644\n--- a/t/helper/test-find-pack.c\n+++ b/t/helper/test-find-pack.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n #include \"parse-options.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-name-hash.c b/t/helper/test-name-hash.c\nindex af1d52de10..13e8996b66 100644\n--- a/t/helper/test-name-hash.c\n+++ b/t/helper/test-name-hash.c\n@@ -5,7 +5,7 @@\n \n #include \"test-tool.h\"\n #include \"git-compat-util.h\"\n-#include \"pack-objects.h\"\n+#include \"pack/pack-objects.h\"\n #include \"strbuf.h\"\n \n int cmd__name_hash(int argc UNUSED, const char **argv UNUSED)\ndiff --git a/t/helper/test-pack-deltas.c b/t/helper/test-pack-deltas.c\nindex 7e5791c7ab..a3117ca6fc 100644\n--- a/t/helper/test-pack-deltas.c\n+++ b/t/helper/test-pack-deltas.c\n@@ -2,12 +2,12 @@\n \n #include \"test-tool.h\"\n #include \"git-compat-util.h\"\n-#include \"delta.h\"\n+#include \"pack/delta.h\"\n #include \"git-zlib.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"pack.h\"\n-#include \"pack-objects.h\"\n+#include \"pack/pack.h\"\n+#include \"pack/pack-objects.h\"\n #include \"parse-options.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\ndiff --git a/t/helper/test-pack-mtimes.c b/t/helper/test-pack-mtimes.c\nindex b915059322..4750a33140 100644\n--- a/t/helper/test-pack-mtimes.c\n+++ b/t/helper/test-pack-mtimes.c\n@@ -4,8 +4,8 @@\n #include \"hex.h\"\n #include \"strbuf.h\"\n #include \"odb/odb.h\"\n-#include \"packfile.h\"\n-#include \"pack-mtimes.h\"\n+#include \"pack/packfile.h\"\n+#include \"pack/pack-mtimes.h\"\n #include \"setup.h\"\n \n static void dump_mtimes(struct packed_git *p)\ndiff --git a/t/helper/test-read-graph.c b/t/helper/test-read-graph.c\nindex 965700a698..c80df07586 100644\n--- a/t/helper/test-read-graph.c\n+++ b/t/helper/test-read-graph.c\n@@ -1,10 +1,10 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"repository.h\"\n #include \"odb/odb.h\"\n-#include \"bloom.h\"\n+#include \"pack/bloom.h\"\n #include \"setup.h\"\n \n static void dump_graph_info(struct commit_graph *graph)\ndiff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c\nindex 9be143ee6c..1e3db8cd81 100644\n--- a/t/helper/test-read-midx.c\n+++ b/t/helper/test-read-midx.c\n@@ -2,14 +2,14 @@\n \n #include \"test-tool.h\"\n #include \"hex.h\"\n-#include \"midx.h\"\n+#include \"pack/midx.h\"\n #include \"repository.h\"\n #include \"odb/odb.h\"\n-#include \"pack-bitmap.h\"\n-#include \"packfile.h\"\n+#include \"pack/pack-bitmap.h\"\n+#include \"pack/packfile.h\"\n #include \"setup.h\"\n #include \"gettext.h\"\n-#include \"pack-revindex.h\"\n+#include \"pack/pack-revindex.h\"\n \n static struct multi_pack_index *setup_midx(const char *object_dir)\n {\ndiff --git a/t/helper/test-repository.c b/t/helper/test-repository.c\nindex 530e37b01d..58f486a471 100644\n--- a/t/helper/test-repository.c\n+++ b/t/helper/test-repository.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"hex.h\"\ndiff --git a/t/helper/test-synthesize.c b/t/helper/test-synthesize.c\nindex 57013566cc..1997141691 100644\n--- a/t/helper/test-synthesize.c\n+++ b/t/helper/test-synthesize.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object.h\"\n-#include \"pack.h\"\n+#include \"pack/pack.h\"\n #include \"parse-options.h\"\n #include \"parse.h\"\n #include \"repository.h\"\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 55bd9291db..6721209d46 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -19,7 +19,7 @@\n #include \"refs/refspec.h\"\n #include \"transport-internal.h\"\n #include \"protocol.h\"\n-#include \"packfile.h\"\n+#include \"pack/packfile.h\"\n \n static int debug;\n \ndiff --git a/upload-pack.c b/upload-pack.c\nindex 80d2c95c9b..d145a89c7b 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -26,7 +26,7 @@\n #include \"trace2.h\"\n #include \"protocol.h\"\n #include \"upload-pack.h\"\n-#include \"commit-graph.h\"\n+#include \"pack/commit-graph.h\"\n #include \"commit-reach.h\"\n #include \"shallow.h\"\n #include \"trace.h\"\n-- \n2.54.0\n\n"},{"id":"551090","messageId":"20260823171915.2662373-11-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 10/14] diff: gather the diff sources under diff/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:54Z","receivedAt":"2026-08-23T17:19:36Z","isPatch":true,"body":"Move the 16 diff C sources and 7 headers into diff/ as renames. Repoint\nevery reference to their old paths to the new ones: the #include lines\nacross the tree, the Makefile and meson.build build entries.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                  | 46 +++++++++----------\n Makefile                                      | 32 ++++++-------\n add-interactive.c                             |  2 +-\n add-patch.c                                   |  2 +-\n apply.c                                       |  4 +-\n archive-zip.c                                 |  4 +-\n bisect.c                                      |  2 +-\n blame.c                                       |  4 +-\n blame.h                                       |  2 +-\n builtin/add.c                                 |  2 +-\n builtin/am.c                                  |  2 +-\n builtin/blame.c                               |  4 +-\n builtin/cat-file.c                            |  4 +-\n builtin/checkout.c                            |  4 +-\n builtin/commit.c                              |  2 +-\n builtin/describe.c                            |  2 +-\n builtin/diff-files.c                          |  4 +-\n builtin/diff-index.c                          |  4 +-\n builtin/diff-pairs.c                          |  4 +-\n builtin/diff-tree.c                           |  2 +-\n builtin/diff.c                                |  6 +--\n builtin/fast-export.c                         |  4 +-\n builtin/last-modified.c                       |  4 +-\n builtin/log.c                                 | 12 ++---\n builtin/merge-file.c                          |  4 +-\n builtin/merge-ours.c                          |  2 +-\n builtin/merge-tree.c                          |  2 +-\n builtin/merge.c                               |  6 +--\n builtin/pack-objects.c                        |  2 +-\n builtin/patch-id.c                            |  2 +-\n builtin/prune.c                               |  2 +-\n builtin/range-diff.c                          |  2 +-\n builtin/rebase.c                              |  2 +-\n builtin/rerere.c                              |  2 +-\n builtin/reset.c                               |  4 +-\n builtin/rev-list.c                            |  2 +-\n builtin/rev-parse.c                           |  2 +-\n builtin/revert.c                              |  2 +-\n builtin/shortlog.c                            |  2 +-\n builtin/stash.c                               |  2 +-\n builtin/submodule--helper.c                   |  4 +-\n builtin/tag.c                                 |  2 +-\n bundle.c                                      |  2 +-\n combine-diff.c => diff/combine-diff.c         |  8 ++--\n diff-lib.c => diff/diff-lib.c                 |  4 +-\n diff-merges.c => diff/diff-merges.c           |  2 +-\n diff-merges.h => diff/diff-merges.h           |  0\n diff-no-index.c => diff/diff-no-index.c       |  4 +-\n diff.c => diff/diff.c                         |  8 ++--\n diff.h => diff/diff.h                         |  0\n diffcore-break.c => diff/diffcore-break.c     |  2 +-\n diffcore-delta.c => diff/diffcore-delta.c     |  2 +-\n diffcore-order.c => diff/diffcore-order.c     |  4 +-\n diffcore-pickaxe.c => diff/diffcore-pickaxe.c |  6 +--\n diffcore-rename.c => diff/diffcore-rename.c   |  4 +-\n diffcore-rotate.c => diff/diffcore-rotate.c   |  4 +-\n diffcore.h => diff/diffcore.h                 |  0\n patch-ids.c => diff/patch-ids.c               |  4 +-\n patch-ids.h => diff/patch-ids.h               |  2 +-\n range-diff.c => diff/range-diff.c             |  8 ++--\n range-diff.h => diff/range-diff.h             |  2 +-\n tree-diff.c => diff/tree-diff.c               |  4 +-\n userdiff.c => diff/userdiff.c                 |  2 +-\n userdiff.h => diff/userdiff.h                 |  0\n xdiff-interface.c => diff/xdiff-interface.c   |  2 +-\n xdiff-interface.h => diff/xdiff-interface.h   |  0\n fmt-merge-msg.c                               |  4 +-\n graph.h                                       |  2 +-\n grep.c                                        |  8 ++--\n grep.h                                        |  2 +-\n http-push.c                                   |  2 +-\n line-log.c                                    |  6 +--\n line-log.h                                    |  2 +-\n line-range.c                                  |  4 +-\n list-objects-filter.c                         |  2 +-\n list-objects.c                                |  2 +-\n log-tree.c                                    |  6 +--\n merge-ll.c                                    |  2 +-\n merge-ort.c                                   |  6 +--\n meson.build                                   | 32 ++++++-------\n notes-merge.c                                 |  6 +--\n odb/commit.c                                  |  2 +-\n pack/bloom.c                                  |  4 +-\n pack/delta-islands.c                          |  2 +-\n pack/pack-bitmap-write.c                      |  2 +-\n pack/pack-bitmap.c                            |  2 +-\n pack/reachable.c                              |  2 +-\n pretty.c                                      |  2 +-\n read-cache.c                                  |  4 +-\n refs/reflog-walk.c                            |  2 +-\n remote.c                                      |  2 +-\n rerere.c                                      |  2 +-\n revision.c                                    |  6 +--\n revision.h                                    |  2 +-\n sequencer.c                                   |  2 +-\n shallow.c                                     |  2 +-\n submodule.c                                   |  4 +-\n t/helper/test-revision-walking.c              |  2 +-\n t/helper/test-userdiff.c                      |  2 +-\n upload-pack.c                                 |  2 +-\n wt-status.c                                   |  4 +-\n 101 files changed, 208 insertions(+), 208 deletions(-)\n rename combine-diff.c => diff/combine-diff.c (99%)\n rename diff-lib.c => diff/diff-lib.c (99%)\n rename diff-merges.c => diff/diff-merges.c (99%)\n rename diff-merges.h => diff/diff-merges.h (100%)\n rename diff-no-index.c => diff/diff-no-index.c (99%)\n rename diff.c => diff/diff.c (99%)\n rename diff.h => diff/diff.h (100%)\n rename diffcore-break.c => diff/diffcore-break.c (99%)\n rename diffcore-delta.c => diff/diffcore-delta.c (99%)\n rename diffcore-order.c => diff/diffcore-order.c (97%)\n rename diffcore-pickaxe.c => diff/diffcore-pickaxe.c (98%)\n rename diffcore-rename.c => diff/diffcore-rename.c (99%)\n rename diffcore-rotate.c => diff/diffcore-rotate.c (95%)\n rename diffcore.h => diff/diffcore.h (100%)\n rename patch-ids.c => diff/patch-ids.c (98%)\n rename patch-ids.h => diff/patch-ids.h (98%)\n rename range-diff.c => diff/range-diff.c (99%)\n rename range-diff.h => diff/range-diff.h (98%)\n rename tree-diff.c => diff/tree-diff.c (99%)\n rename userdiff.c => diff/userdiff.c (99%)\n rename userdiff.h => diff/userdiff.h (100%)\n rename xdiff-interface.c => diff/xdiff-interface.c (99%)\n rename xdiff-interface.h => diff/xdiff-interface.h (100%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex 533d50ed89..160365fbca 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -62,7 +62,6 @@ color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,inde\n color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1\n column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2\n column.h component=? role=public prefix=column\n-combine-diff.c component=diff role=lib prefix=combine-diff includes=odb:5,diff:4,revision:2,convert:1,refs:1 cochange=diff:198,revision:67,index:35,odb:16,transport:16\n commit-reach.c component=revision role=lib prefix=commit-reach includes=revision:3,odb:2,pack:1,refs:1 cochange=revision:38,odb:17,pack:15,transport:9,index:5\n commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3\n common-exit.c component=? role=lib prefix=common-main\n@@ -91,19 +90,29 @@ decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1\n decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1\n diagnose.c component=? role=lib prefix=diagnose includes=archive:1,index:1,odb:1,pack:1,setup:1 cochange=index:4,revision:4,odb:3,pack:3,transport:3\n diagnose.h component=? role=public prefix=diagnose cochange=revision:2,refs:1,transport:1\n-diff-lib.c component=diff role=lib prefix=diff includes=index:6,odb:3,diff:2,revision:2,refs:1 cochange=diff:150,index:124,revision:47,submodule:18,odb:8\n-diff-merges.c component=diff role=lib prefix=diff-merges includes=diff:1,revision:1 cochange=revision:18,diff:17,odb:4,refs:3,index:2\n-diff-merges.h component=diff role=header prefix=diff-merges cochange=diff:11,revision:4,merge:1\n-diff-no-index.c component=diff role=lib prefix=diff includes=diff:2,index:2,odb:1,revision:1 cochange=diff:76,revision:21,index:19,refs:8,notes:7\n-diff.c component=diff role=lib prefix=diff includes=odb:5,diff:4,setup:3,convert:2,index:2 cochange=diff:610,revision:121,index:100,transport:71,setup:69\n-diff.h component=diff role=header prefix=diff includes=index:1,odb:1 cochange=diff:471,revision:83,index:29,submodule:18,odb:14\n-diffcore-break.c component=diff role=lib prefix=diffcore-break includes=odb:2,diff:1,transport:1 cochange=diff:71,pack:8,revision:7,index:5,merge:3\n-diffcore-delta.c component=diff role=lib prefix=diffcore-delta includes=diff:1 cochange=diff:26,revision:7,odb:4,index:2,refs:2\n-diffcore-order.c component=diff role=lib prefix=diffcore-order includes=diff:2 cochange=diff:19,index:8,refs:7,revision:7,pack:5\n-diffcore-pickaxe.c component=diff role=lib prefix=pickaxe includes=diff:3,odb:1,revision:1 cochange=diff:97,revision:15,notes:3,odb:3,merge:2\n-diffcore-rename.c component=diff role=lib prefix=diffcore-rename includes=diff:2,odb:2,transport:1 cochange=diff:188,index:38,revision:37,odb:21,pack:17\n-diffcore-rotate.c component=diff role=lib prefix=diff includes=diff:2 cochange=diff:14,revision:5,pack:2,merge:1,refs:1\n-diffcore.h component=diff role=header prefix=diff includes=odb:1 cochange=diff:175,revision:11,merge:10,submodule:4,odb:2\n+diff/combine-diff.c component=diff role=lib prefix=combine-diff includes=odb:5,diff:4,revision:2,convert:1,refs:1 cochange=diff:198,revision:67,index:35,odb:16,transport:16\n+diff/diff-lib.c component=diff role=lib prefix=diff includes=index:6,odb:3,diff:2,revision:2,refs:1 cochange=diff:150,index:124,revision:47,submodule:18,odb:8\n+diff/diff-merges.c component=diff role=lib prefix=diff-merges includes=diff:1,revision:1 cochange=revision:18,diff:17,odb:4,refs:3,index:2\n+diff/diff-merges.h component=diff role=header prefix=diff-merges cochange=diff:11,revision:4,merge:1\n+diff/diff-no-index.c component=diff role=lib prefix=diff includes=diff:2,index:2,odb:1,revision:1 cochange=diff:76,revision:21,index:19,refs:8,notes:7\n+diff/diff.c component=diff role=lib prefix=diff includes=odb:5,diff:4,setup:3,convert:2,index:2 cochange=diff:610,revision:121,index:100,transport:71,setup:69\n+diff/diff.h component=diff role=header prefix=diff includes=index:1,odb:1 cochange=diff:471,revision:83,index:29,submodule:18,odb:14\n+diff/diffcore-break.c component=diff role=lib prefix=diffcore-break includes=odb:2,diff:1,transport:1 cochange=diff:71,pack:8,revision:7,index:5,merge:3\n+diff/diffcore-delta.c component=diff role=lib prefix=diffcore-delta includes=diff:1 cochange=diff:26,revision:7,odb:4,index:2,refs:2\n+diff/diffcore-order.c component=diff role=lib prefix=diffcore-order includes=diff:2 cochange=diff:19,index:8,refs:7,revision:7,pack:5\n+diff/diffcore-pickaxe.c component=diff role=lib prefix=pickaxe includes=diff:3,odb:1,revision:1 cochange=diff:97,revision:15,notes:3,odb:3,merge:2\n+diff/diffcore-rename.c component=diff role=lib prefix=diffcore-rename includes=diff:2,odb:2,transport:1 cochange=diff:188,index:38,revision:37,odb:21,pack:17\n+diff/diffcore-rotate.c component=diff role=lib prefix=diff includes=diff:2 cochange=diff:14,revision:5,pack:2,merge:1,refs:1\n+diff/diffcore.h component=diff role=header prefix=diff includes=odb:1 cochange=diff:175,revision:11,merge:10,submodule:4,odb:2\n+diff/patch-ids.c component=diff role=lib prefix=patch-ids includes=diff:2,odb:2 cochange=diff:73,revision:34,index:14,odb:13,refs:12\n+diff/patch-ids.h component=diff role=header prefix=patch-ids includes=diff:1 cochange=diff:15,revision:3,index:1\n+diff/range-diff.c component=diff role=lib prefix=range-diff includes=diff:4,odb:2,revision:2,setup:2 cochange=diff:49,revision:26,index:9,submodule:8,setup:7\n+diff/range-diff.h component=diff role=header prefix=range-diff includes=diff:1 cochange=diff:13,revision:4\n+diff/tree-diff.c component=diff role=lib prefix=tree-diff includes=odb:3,diff:2,index:1,setup:1 cochange=diff:115,odb:56,revision:53,index:36,notes:12\n+diff/userdiff.c component=diff role=lib prefix=userdiff includes=setup:2,convert:1,diff:1 cochange=diff:41,convert:34,archive:11,index:7,transport:6\n+diff/userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1\n+diff/xdiff-interface.c component=diff role=lib prefix=xdiff-interface includes=setup:2,diff:1,odb:1 cochange=diff:73,index:5,merge:3,notes:3,refs:3\n+diff/xdiff-interface.h component=diff role=header prefix=xdiff-interface includes=odb:1 cochange=diff:62,index:2,notes:2,merge:1,odb:1\n dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1\n dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1\n dir.c component=index role=lib prefix=dir includes=index:7,setup:4,odb:2,convert:1,refs:1 cochange=index:343,diff:61,setup:49,odb:37,convert:29\n@@ -321,8 +330,6 @@ parse-options.c component=? role=lib prefix=parse-options cochange=index:14,diff\n parse-options.h component=? role=public prefix=parse-options cochange=diff:7,merge:4,archive:3,index:3,refs:3\n parse.c component=? role=lib prefix=parse cochange=setup:6,index:3,pack:2,convert:1\n parse.h component=? role=public prefix=config cochange=setup:6,index:3,pack:2,convert:1\n-patch-ids.c component=diff role=lib prefix=patch-ids includes=diff:2,odb:2 cochange=diff:73,revision:34,index:14,odb:13,refs:12\n-patch-ids.h component=diff role=header prefix=patch-ids includes=diff:1 cochange=diff:15,revision:3,index:1\n path-walk.c component=? role=lib prefix=path-walk includes=odb:9,revision:3,index:1,setup:1 cochange=index:2,revision:2,transport:2,odb:1,pack:1\n path-walk.h component=? role=public prefix=path-walk includes=odb:1 cochange=index:2\n path.c component=? role=lib prefix=path includes=setup:2,index:1,odb:1,pack:1,refs:1 cochange=setup:78,refs:29,index:26,transport:15,odb:12\n@@ -349,8 +356,6 @@ protocol.c component=transport role=lib prefix=protocol includes=setup:2,transpo\n protocol.h component=transport role=header prefix=protocol cochange=transport:5\n quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6\n quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5\n-range-diff.c component=diff role=lib prefix=range-diff includes=diff:4,odb:2,revision:2,setup:2 cochange=diff:49,revision:26,index:9,submodule:8,setup:7\n-range-diff.h component=diff role=header prefix=range-diff includes=diff:1 cochange=diff:13,revision:4\n read-cache-ll.h component=index role=header prefix=read-cache includes=index:1,odb:1 cochange=index:8,diff:1,odb:1,revision:1\n read-cache.c component=index role=lib prefix=read-cache includes=index:10,odb:6,setup:4,diff:2,submodule:2 cochange=index:240,odb:81,setup:79,diff:67,pack:46\n read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2\n@@ -453,7 +458,6 @@ transport-helper.c component=transport role=lib prefix=transport-helper includes\n transport-internal.h component=transport role=header prefix=transport includes=transport:1 cochange=transport:42,refs:3,odb:1,submodule:1\n transport.c component=transport role=lib prefix=transport includes=transport:12,setup:3,odb:2,refs:2,submodule:1 cochange=transport:482,refs:35,setup:31,submodule:29,revision:21\n transport.h component=transport role=header prefix=transport includes=transport:2,revision:1 cochange=transport:249,submodule:6,odb:4,revision:2,diff:1\n-tree-diff.c component=diff role=lib prefix=tree-diff includes=odb:3,diff:2,index:1,setup:1 cochange=diff:115,odb:56,revision:53,index:36,notes:12\n unicode-width.h component=? role=public prefix=unicode\n unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2,setup:1\n unix-socket.h component=? role=public prefix=unix-socket\n@@ -468,8 +472,6 @@ url.h component=? role=public prefix=url cochange=transport:9,revision:4,submodu\n urlmatch.c component=? role=lib prefix=urlmatch cochange=diff:3,odb:2,revision:2,setup:2,transport:2\n urlmatch.h component=? role=public prefix=urlmatch includes=setup:1 cochange=transport:1\n usage.c component=? role=lib prefix=usage cochange=index:3,odb:2,diff:1,revision:1,setup:1\n-userdiff.c component=diff role=lib prefix=userdiff includes=setup:2,convert:1,diff:1 cochange=diff:41,convert:34,archive:11,index:7,transport:6\n-userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1\n utf8.c component=? role=lib prefix=utf8 cochange=revision:6,index:3,setup:3,transport:2,convert:1\n utf8.h component=? role=public prefix=utf8 cochange=revision:6,index:2,setup:2,transport:2,convert:1\n varint.c component=? role=lib prefix=varint cochange=index:2,transport:1\n@@ -490,5 +492,3 @@ ws.c component=convert role=lib prefix=whitespace includes=convert:2 cochange=co\n ws.h component=convert role=header prefix=whitespace cochange=diff:5,convert:2,setup:2\n wt-status.c component=index role=lib prefix=wt-status includes=odb:5,index:4,setup:3,diff:2,refs:2 cochange=index:149,diff:83,transport:55,refs:45,revision:45\n wt-status.h component=index role=header prefix=wt-status includes=index:1,transport:1 cochange=index:89,diff:10,refs:9,revision:4,transport:4\n-xdiff-interface.c component=diff role=lib prefix=xdiff-interface includes=setup:2,diff:1,odb:1 cochange=diff:73,index:5,merge:3,notes:3,refs:3\n-xdiff-interface.h component=diff role=header prefix=xdiff-interface includes=odb:1 cochange=diff:62,index:2,notes:2,merge:1,odb:1\ndiff --git a/Makefile b/Makefile\nindex 85d2a620a7..b96345ba0c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1124,7 +1124,7 @@ LIB_OBJS += checkout.o\n LIB_OBJS += pack/chunk-format.o\n LIB_OBJS += color.o\n LIB_OBJS += column.o\n-LIB_OBJS += combine-diff.o\n+LIB_OBJS += diff/combine-diff.o\n LIB_OBJS += pack/commit-graph.o\n LIB_OBJS += commit-reach.o\n LIB_OBJS += odb/commit.o\n@@ -1148,16 +1148,16 @@ LIB_OBJS += decorate.o\n LIB_OBJS += pack/delta-islands.o\n LIB_OBJS += diagnose.o\n LIB_OBJS += pack/diff-delta.o\n-LIB_OBJS += diff-merges.o\n-LIB_OBJS += diff-lib.o\n-LIB_OBJS += diff-no-index.o\n-LIB_OBJS += diff.o\n-LIB_OBJS += diffcore-break.o\n-LIB_OBJS += diffcore-delta.o\n-LIB_OBJS += diffcore-order.o\n-LIB_OBJS += diffcore-pickaxe.o\n-LIB_OBJS += diffcore-rename.o\n-LIB_OBJS += diffcore-rotate.o\n+LIB_OBJS += diff/diff-merges.o\n+LIB_OBJS += diff/diff-lib.o\n+LIB_OBJS += diff/diff-no-index.o\n+LIB_OBJS += diff/diff.o\n+LIB_OBJS += diff/diffcore-break.o\n+LIB_OBJS += diff/diffcore-delta.o\n+LIB_OBJS += diff/diffcore-order.o\n+LIB_OBJS += diff/diffcore-pickaxe.o\n+LIB_OBJS += diff/diffcore-rename.o\n+LIB_OBJS += diff/diffcore-rotate.o\n LIB_OBJS += dir-iterator.o\n LIB_OBJS += dir.o\n LIB_OBJS += editor.o\n@@ -1257,7 +1257,7 @@ LIB_OBJS += parse.o\n LIB_OBJS += parse-options-cb.o\n LIB_OBJS += parse-options.o\n LIB_OBJS += pack/patch-delta.o\n-LIB_OBJS += patch-ids.o\n+LIB_OBJS += diff/patch-ids.o\n LIB_OBJS += path.o\n LIB_OBJS += path-walk.o\n LIB_OBJS += pathspec.o\n@@ -1273,7 +1273,7 @@ LIB_OBJS += protocol-caps.o\n LIB_OBJS += pack/prune-packed.o\n LIB_OBJS += pack/pseudo-merge.o\n LIB_OBJS += quote.o\n-LIB_OBJS += range-diff.o\n+LIB_OBJS += diff/range-diff.o\n LIB_OBJS += pack/reachable.o\n LIB_OBJS += read-cache.o\n LIB_OBJS += rebase-interactive.o\n@@ -1360,7 +1360,7 @@ LIB_OBJS += trace2/tr2_tmr.o\n LIB_OBJS += trailer.o\n LIB_OBJS += transport-helper.o\n LIB_OBJS += transport.o\n-LIB_OBJS += tree-diff.o\n+LIB_OBJS += diff/tree-diff.o\n LIB_OBJS += odb/tree-walk.o\n LIB_OBJS += odb/tree.o\n LIB_OBJS += unpack-trees.o\n@@ -1368,7 +1368,7 @@ LIB_OBJS += upload-pack.o\n LIB_OBJS += url.o\n LIB_OBJS += urlmatch.o\n LIB_OBJS += usage.o\n-LIB_OBJS += userdiff.o\n+LIB_OBJS += diff/userdiff.o\n LIB_OBJS += utf8.o\n ifdef NO_RUST\n LIB_OBJS += varint.o\n@@ -1382,7 +1382,7 @@ LIB_OBJS += wrapper.o\n LIB_OBJS += write-or-die.o\n LIB_OBJS += ws.o\n LIB_OBJS += wt-status.o\n-LIB_OBJS += xdiff-interface.o\n+LIB_OBJS += diff/xdiff-interface.o\n LIB_OBJS += xdiff/xdiffi.o\n LIB_OBJS += xdiff/xemit.o\n LIB_OBJS += xdiff/xhistogram.o\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 67ee53f5cc..f656db231c 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"add-interactive.h\"\n #include \"color.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\ndiff --git a/add-patch.c b/add-patch.c\nindex 1b4c53e4ce..c6860310c1 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -6,7 +6,7 @@\n #include \"advice.h\"\n #include \"odb/commit.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\ndiff --git a/apply.c b/apply.c\nindex dbfb891b4c..b8d97d140d 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -16,12 +16,12 @@\n #include \"config.h\"\n #include \"odb/odb.h\"\n #include \"pack/delta.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"merge-ll.h\"\n #include \"lockfile.h\"\n #include \"name-hash.h\"\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 53c50ebc44..df1edadd33 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -14,9 +14,9 @@\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"strbuf.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"write-or-die.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"date.h\"\n \n static int zip_date;\ndiff --git a/bisect.c b/bisect.c\nindex 85c5a12ed2..1f8d81b894 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -4,7 +4,7 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/blame.c b/blame.c\nindex cd18c09a3c..c736441f18 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -8,8 +8,8 @@\n #include \"mergesort.h\"\n #include \"odb/commit.h\"\n #include \"convert.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"path.h\"\ndiff --git a/blame.h b/blame.h\nindex 97137099e3..30aeae2d4e 100644\n--- a/blame.h\n+++ b/blame.h\n@@ -2,7 +2,7 @@\n #define BLAME_H\n \n #include \"odb/oidset.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"prio-queue.h\"\n \n #define PICKAXE_BLAME_MOVE\t\t01\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 5d6dd91f70..dd5e33c7b0 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -20,7 +20,7 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"preload-index.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"read-cache.h\"\n #include \"revision.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/am.c b/builtin/am.c\nindex d7e4e125d2..7bd7fde14b 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -24,7 +24,7 @@\n #include \"cache-tree.h\"\n #include \"refs/refs.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"unpack-trees.h\"\n #include \"branch.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 1662bd487d..cb9f8b4ff0 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -14,7 +14,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"quote.h\"\n #include \"string-list.h\"\n@@ -22,7 +22,7 @@\n #include \"parse-options.h\"\n #include \"prio-queue.h\"\n #include \"utf8.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"line-range.h\"\n #include \"line-log.h\"\n #include \"progress.h\"\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex a59aa00cea..4fd1999f80 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -10,14 +10,14 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"convert.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"ident.h\"\n #include \"list-objects-filter-options.h\"\n #include \"parse-options.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"odb/oid-array.h\"\n #include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 87c1f087b8..c35c3d92d1 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -8,7 +8,7 @@\n #include \"checkout.h\"\n #include \"odb/commit.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n@@ -40,7 +40,7 @@\n #include \"odb/tree-walk.h\"\n #include \"unpack-trees.h\"\n #include \"wt-status.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"entry.h\"\n #include \"parallel-checkout.h\"\n #include \"add-interactive.h\"\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 39271d720e..d2b4ecbd40 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -17,7 +17,7 @@\n #include \"dir.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"add-interactive.h\"\n #include \"gettext.h\"\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex c16a1da092..ff44b55e9e 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -14,7 +14,7 @@\n #include \"parse-options.h\"\n #include \"read-cache-ll.h\"\n #include \"revision.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"hashmap.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex c5b7548e55..39eaf9cfce 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -9,8 +9,8 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n #include \"preload-index.h\"\n #include \"revision.h\"\ndiff --git a/builtin/diff-index.c b/builtin/diff-index.c\nindex a23f444348..799f5533ad 100644\n--- a/builtin/diff-index.c\n+++ b/builtin/diff-index.c\n@@ -3,8 +3,8 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n #include \"preload-index.h\"\n #include \"revision.h\"\ndiff --git a/builtin/diff-pairs.c b/builtin/diff-pairs.c\nindex 315fc7357a..e3350b2915 100644\n--- a/builtin/diff-pairs.c\n+++ b/builtin/diff-pairs.c\n@@ -1,7 +1,7 @@\n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex a3e1e5e020..8f2103013c 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex c9ccc7e6c5..774c12cea6 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -15,9 +15,9 @@\n #include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"odb/tag.h\"\n-#include \"diff.h\"\n-#include \"diff-merges.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diff-merges.h\"\n+#include \"diff/diffcore.h\"\n #include \"preload-index.h\"\n #include \"read-cache-ll.h\"\n #include \"revision.h\"\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 4a98f14d39..6683d49660 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -19,8 +19,8 @@\n #include \"odb/commit.h\"\n #include \"odb/object.h\"\n #include \"odb/tag.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"log-tree.h\"\n #include \"revision.h\"\n #include \"decorate.h\"\ndiff --git a/builtin/last-modified.c b/builtin/last-modified.c\nindex 83c5d66f36..911441a321 100644\n--- a/builtin/last-modified.c\n+++ b/builtin/last-modified.c\n@@ -5,8 +5,8 @@\n #include \"odb/commit-slab.h\"\n #include \"odb/commit.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"environment.h\"\n #include \"ewah/ewok.h\"\n #include \"hashmap.h\"\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 7099f5fcc5..a93b97858b 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -20,16 +20,16 @@\n #include \"pager.h\"\n #include \"color.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n+#include \"diff/diff-merges.h\"\n #include \"revision.h\"\n #include \"log-tree.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n #include \"odb/tag.h\"\n #include \"refs/reflog-walk.h\"\n-#include \"patch-ids.h\"\n+#include \"diff/patch-ids.h\"\n #include \"path.h\"\n #include \"shortlog.h\"\n #include \"remote.h\"\n@@ -46,10 +46,10 @@\n \n #include \"commit-reach.h\"\n #include \"promisor-remote.h\"\n-#include \"range-diff.h\"\n+#include \"diff/range-diff.h\"\n #include \"odb/tmp-objdir.h\"\n #include \"odb/tree.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"write-or-die.h\"\n \n #define MAIL_DEFAULT_WRAP 72\ndiff --git a/builtin/merge-file.c b/builtin/merge-file.c\nindex 22a6862a13..12701b1d81 100644\n--- a/builtin/merge-file.c\n+++ b/builtin/merge-file.c\n@@ -3,7 +3,7 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n@@ -12,7 +12,7 @@\n #include \"gettext.h\"\n #include \"setup.h\"\n #include \"xdiff/xdiff.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"parse-options.h\"\n \n static const char *const merge_file_usage[] = {\ndiff --git a/builtin/merge-ours.c b/builtin/merge-ours.c\nindex 405b2989f7..c33e176c65 100644\n--- a/builtin/merge-ours.c\n+++ b/builtin/merge-ours.c\n@@ -12,7 +12,7 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"environment.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n \n static const char builtin_merge_ours_usage[] =\n \t\"git merge-ours <base>... -- HEAD <remote>...\";\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 27f2944ece..8217938d86 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -3,7 +3,7 @@\n #include \"builtin.h\"\n #include \"environment.h\"\n #include \"odb/tree-walk.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"help.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex ad0c984d4b..7ec4554b0b 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -24,12 +24,12 @@\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"hook.h\"\n-#include \"diff.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diff-merges.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n #include \"odb/commit.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"path.h\"\n #include \"revision.h\"\n #include \"unpack-trees.h\"\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 37c379d3d8..17721f13ac 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -15,7 +15,7 @@\n #include \"pack/pack-revindex.h\"\n #include \"csum-file.h\"\n #include \"odb/tree-walk.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter-options.h\"\ndiff --git a/builtin/patch-id.c b/builtin/patch-id.c\nindex e2c1375b41..7207279cef 100644\n--- a/builtin/patch-id.c\n+++ b/builtin/patch-id.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\ndiff --git a/builtin/prune.c b/builtin/prune.c\nindex ae3505c5e5..0adf0f02d1 100644\n--- a/builtin/prune.c\n+++ b/builtin/prune.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\ndiff --git a/builtin/range-diff.c b/builtin/range-diff.c\nindex 7e37a00d9e..323046c696 100644\n--- a/builtin/range-diff.c\n+++ b/builtin/range-diff.c\n@@ -4,7 +4,7 @@\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"range-diff.h\"\n+#include \"diff/range-diff.h\"\n #include \"config.h\"\n #include \"parse.h\"\n #include \"color.h\"\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 983dbb7ce5..8f9fdcc79b 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -25,7 +25,7 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"wt-status.h\"\n #include \"revision.h\"\n #include \"commit-reach.h\"\ndiff --git a/builtin/rerere.c b/builtin/rerere.c\nindex a056cb791b..545ffe2715 100644\n--- a/builtin/rerere.c\n+++ b/builtin/rerere.c\n@@ -8,7 +8,7 @@\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"xdiff/xdiff.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"pathspec.h\"\n \n static const char * const rerere_usage[] = {\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex c3bfbab7d5..f843bab823 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -21,8 +21,8 @@\n #include \"odb/object.h\"\n #include \"pretty.h\"\n #include \"refs/refs.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"odb/tree.h\"\n #include \"branch.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex d6bddda9d4..c0e0769aab 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -4,7 +4,7 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex 2fb682d5a2..b95cdac85e 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -22,7 +22,7 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"read-cache-ll.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex bedc40f368..a939c590fb 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"builtin.h\"\n #include \"parse-options.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"revision.h\"\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex cbcf2fb637..59be73a372 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -3,7 +3,7 @@\n #include \"builtin.h\"\n #include \"config.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"string-list.h\"\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 62fec2f17f..c5e100746d 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -26,7 +26,7 @@\n #include \"setup.h\"\n #include \"sparse-index.h\"\n #include \"log-tree.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"refs/reflog.h\"\n #include \"refs/reflog-walk.h\"\n #include \"add-interactive.h\"\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex bf8b20247f..5711a79428 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -24,8 +24,8 @@\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n #include \"revision.h\"\n-#include \"diffcore.h\"\n-#include \"diff.h\"\n+#include \"diff/diffcore.h\"\n+#include \"diff/diff.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex d554ae8f81..c04c2cc207 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -23,7 +23,7 @@\n #include \"path.h\"\n #include \"odb/tag.h\"\n #include \"parse-options.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"gpg-interface.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/bundle.c b/bundle.c\nindex c64b14a05a..54ec76866b 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -11,7 +11,7 @@\n #include \"repository.h\"\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\n #include \"run-command.h\"\ndiff --git a/combine-diff.c b/diff/combine-diff.c\nsimilarity index 99%\nrename from combine-diff.c\nrename to diff/combine-diff.c\nindex 6f16e9ea38..44f0eb5442 100644\n--- a/combine-diff.c\n+++ b/diff/combine-diff.c\n@@ -5,18 +5,18 @@\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\n #include \"convert.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"quote.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"xdiff/xmacros.h\"\n #include \"log-tree.h\"\n #include \"refs/refs.h\"\n #include \"odb/tree.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"odb/oid-array.h\"\n #include \"revision.h\"\n \ndiff --git a/diff-lib.c b/diff/diff-lib.c\nsimilarity index 99%\nrename from diff-lib.c\nrename to diff/diff-lib.c\nindex a5072c5f6d..fb0514dcb0 100644\n--- a/diff-lib.c\n+++ b/diff/diff-lib.c\n@@ -7,8 +7,8 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\ndiff --git a/diff-merges.c b/diff/diff-merges.c\nsimilarity index 99%\nrename from diff-merges.c\nrename to diff/diff-merges.c\nindex 45507588a2..ca3cbf7767 100644\n--- a/diff-merges.c\n+++ b/diff/diff-merges.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff-merges.h\"\n \n #include \"gettext.h\"\n #include \"revision.h\"\ndiff --git a/diff-merges.h b/diff/diff-merges.h\nsimilarity index 100%\nrename from diff-merges.h\nrename to diff/diff-merges.h\ndiff --git a/diff-no-index.c b/diff/diff-no-index.c\nsimilarity index 99%\nrename from diff-no-index.c\nrename to diff/diff-no-index.c\nindex 552cd95679..5712e5474d 100644\n--- a/diff-no-index.c\n+++ b/diff/diff-no-index.c\n@@ -10,8 +10,8 @@\n #include \"abspath.h\"\n #include \"color.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"gettext.h\"\n #include \"revision.h\"\n #include \"parse-options.h\"\ndiff --git a/diff.c b/diff/diff.c\nsimilarity index 99%\nrename from diff.c\nrename to diff/diff.c\nindex 91addcdab7..9062f96b7b 100644\n--- a/diff.c\n+++ b/diff/diff.c\n@@ -15,16 +15,16 @@\n #include \"tempfile.h\"\n #include \"revision.h\"\n #include \"quote.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"pack/delta.h\"\n #include \"hex.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"color.h\"\n #include \"run-command.h\"\n #include \"utf8.h\"\n #include \"odb/odb.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"submodule.h\"\n #include \"hashmap.h\"\n #include \"mem-pool.h\"\ndiff --git a/diff.h b/diff/diff.h\nsimilarity index 100%\nrename from diff.h\nrename to diff/diff.h\ndiff --git a/diffcore-break.c b/diff/diffcore-break.c\nsimilarity index 99%\nrename from diffcore-break.c\nrename to diff/diffcore-break.c\nindex 70860c8abc..c822a0d56d 100644\n--- a/diffcore-break.c\n+++ b/diff/diffcore-break.c\n@@ -5,7 +5,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"odb/hash.h\"\n #include \"odb/object.h\"\n #include \"promisor-remote.h\"\ndiff --git a/diffcore-delta.c b/diff/diffcore-delta.c\nsimilarity index 99%\nrename from diffcore-delta.c\nrename to diff/diffcore-delta.c\nindex 2b7db39983..4291662274 100644\n--- a/diffcore-delta.c\n+++ b/diff/diffcore-delta.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n \n /*\n  * Idea here is very simple.\ndiff --git a/diffcore-order.c b/diff/diffcore-order.c\nsimilarity index 97%\nrename from diffcore-order.c\nrename to diff/diffcore-order.c\nindex f91ef22471..e6a6a23aca 100644\n--- a/diffcore-order.c\n+++ b/diff/diffcore-order.c\n@@ -4,8 +4,8 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"wildmatch.h\"\n \n static char **order;\ndiff --git a/diffcore-pickaxe.c b/diff/diffcore-pickaxe.c\nsimilarity index 98%\nrename from diffcore-pickaxe.c\nrename to diff/diffcore-pickaxe.c\nindex f7a745fb49..e7289d9a26 100644\n--- a/diffcore-pickaxe.c\n+++ b/diff/diffcore-pickaxe.c\n@@ -6,9 +6,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"kwset.h\"\n #include \"odb/oidset.h\"\n #include \"pretty.h\"\ndiff --git a/diffcore-rename.c b/diff/diffcore-rename.c\nsimilarity index 99%\nrename from diffcore-rename.c\nrename to diff/diffcore-rename.c\nindex 68abf77c4d..16746444d8 100644\n--- a/diffcore-rename.c\n+++ b/diff/diffcore-rename.c\n@@ -6,8 +6,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"odb/object-file.h\"\n #include \"hashmap.h\"\n #include \"mem-pool.h\"\ndiff --git a/diffcore-rotate.c b/diff/diffcore-rotate.c\nsimilarity index 95%\nrename from diffcore-rotate.c\nrename to diff/diffcore-rotate.c\nindex 67b591261a..a55d954092 100644\n--- a/diffcore-rotate.c\n+++ b/diff/diffcore-rotate.c\n@@ -5,8 +5,8 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n \n void diffcore_rotate(struct diff_options *opt)\n {\ndiff --git a/diffcore.h b/diff/diffcore.h\nsimilarity index 100%\nrename from diffcore.h\nrename to diff/diffcore.h\ndiff --git a/patch-ids.c b/diff/patch-ids.c\nsimilarity index 98%\nrename from patch-ids.c\nrename to diff/patch-ids.c\nindex 946744e7d9..de4e5702ed 100644\n--- a/patch-ids.c\n+++ b/diff/patch-ids.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"patch-ids.h\"\n+#include \"diff/patch-ids.h\"\n \n static int patch_id_defined(struct commit *commit)\n {\ndiff --git a/patch-ids.h b/diff/patch-ids.h\nsimilarity index 98%\nrename from patch-ids.h\nrename to diff/patch-ids.h\nindex 57534ee722..47291160ec 100644\n--- a/patch-ids.h\n+++ b/diff/patch-ids.h\n@@ -1,7 +1,7 @@\n #ifndef PATCH_IDS_H\n #define PATCH_IDS_H\n \n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"hashmap.h\"\n \n struct commit;\ndiff --git a/range-diff.c b/diff/range-diff.c\nsimilarity index 99%\nrename from range-diff.c\nrename to diff/range-diff.c\nindex be9f872396..2177b8ba2d 100644\n--- a/range-diff.c\n+++ b/diff/range-diff.c\n@@ -4,20 +4,20 @@\n #include \"git-compat-util.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"range-diff.h\"\n+#include \"diff/range-diff.h\"\n #include \"odb/object-name.h\"\n #include \"string-list.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n #include \"hashmap.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"linear-assignment.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"odb/commit.h\"\n #include \"pager.h\"\n #include \"pretty.h\"\n #include \"repository.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"apply.h\"\n #include \"revision.h\"\n \ndiff --git a/range-diff.h b/diff/range-diff.h\nsimilarity index 98%\nrename from range-diff.h\nrename to diff/range-diff.h\nindex 9b70a80009..23aae59192 100644\n--- a/range-diff.h\n+++ b/diff/range-diff.h\n@@ -1,7 +1,7 @@\n #ifndef RANGE_DIFF_H\n #define RANGE_DIFF_H\n \n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"strvec.h\"\n \n #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60\ndiff --git a/tree-diff.c b/diff/tree-diff.c\nsimilarity index 99%\nrename from tree-diff.c\nrename to diff/tree-diff.c\nindex b33c45b696..4b7c90f6db 100644\n--- a/tree-diff.c\n+++ b/diff/tree-diff.c\n@@ -5,8 +5,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"odb/hash.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\ndiff --git a/userdiff.c b/diff/userdiff.c\nsimilarity index 99%\nrename from userdiff.c\nrename to diff/userdiff.c\nindex 7129bf1482..8993b622c1 100644\n--- a/userdiff.c\n+++ b/diff/userdiff.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"attr.h\"\n #include \"strbuf.h\"\n #include \"environment.h\"\ndiff --git a/userdiff.h b/diff/userdiff.h\nsimilarity index 100%\nrename from userdiff.h\nrename to diff/userdiff.h\ndiff --git a/xdiff-interface.c b/diff/xdiff-interface.c\nsimilarity index 99%\nrename from xdiff-interface.c\nrename to diff/xdiff-interface.c\nindex af18a34ba0..2c87316caa 100644\n--- a/xdiff-interface.c\n+++ b/diff/xdiff-interface.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"strbuf.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"xdiff/xtypes.h\"\n #include \"xdiff/xdiffi.h\"\n #include \"xdiff/xutils.h\"\ndiff --git a/xdiff-interface.h b/diff/xdiff-interface.h\nsimilarity index 100%\nrename from xdiff-interface.h\nrename to diff/xdiff-interface.h\ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex 7fa8c4cd79..34f769ae9f 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -7,8 +7,8 @@\n #include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n-#include \"diff.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diff-merges.h\"\n #include \"hex.h\"\n #include \"revision.h\"\n #include \"odb/tag.h\"\ndiff --git a/graph.h b/graph.h\nindex 1193711fb8..84a5a4b822 100644\n--- a/graph.h\n+++ b/graph.h\n@@ -1,6 +1,6 @@\n #ifndef GRAPH_H\n #define GRAPH_H\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n \n /**\n  * The graph API is used to draw a text-based representation of the commit\ndiff --git a/grep.c b/grep.c\nindex 5041c388b9..88c87ba1c9 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -7,10 +7,10 @@\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"pretty.h\"\n-#include \"userdiff.h\"\n-#include \"xdiff-interface.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/userdiff.h\"\n+#include \"diff/xdiff-interface.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"quote.h\"\n #include \"help.h\"\n \ndiff --git a/grep.h b/grep.h\nindex 13e26a9318..7881f28587 100644\n--- a/grep.h\n+++ b/grep.h\n@@ -24,7 +24,7 @@ typedef int pcre2_general_context;\n #define PCRE2_MATCH_INVALID_UTF 0\n #endif\n #include \"thread-utils.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n \n struct repository;\n \ndiff --git a/http-push.c b/http-push.c\nindex 88a8417ea4..6d38410ccb 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -8,7 +8,7 @@\n #include \"odb/tag.h\"\n #include \"odb/blob.h\"\n #include \"http.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"remote.h\"\n #include \"list-objects.h\"\ndiff --git a/line-log.c b/line-log.c\nindex 343159d90a..78697cb377 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -1,17 +1,17 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"line-range.h\"\n #include \"hex.h\"\n #include \"odb/tag.h\"\n #include \"odb/tree.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"decorate.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"strbuf.h\"\n #include \"line-log.h\"\n #include \"setup.h\"\ndiff --git a/line-log.h b/line-log.h\nindex 99e1755ce3..3a72d84698 100644\n--- a/line-log.h\n+++ b/line-log.h\n@@ -1,7 +1,7 @@\n #ifndef LINE_LOG_H\n #define LINE_LOG_H\n \n-#include \"diffcore.h\" /* struct range, struct range_set */\n+#include \"diff/diffcore.h\" /* struct range, struct range_set */\n \n struct rev_info;\n struct commit;\ndiff --git a/line-range.c b/line-range.c\nindex b99f0d9895..1dbf761ecc 100644\n--- a/line-range.c\n+++ b/line-range.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"line-range.h\"\n-#include \"xdiff-interface.h\"\n-#include \"userdiff.h\"\n+#include \"diff/xdiff-interface.h\"\n+#include \"diff/userdiff.h\"\n \n /*\n  * Parse one item in the -L option\ndiff --git a/list-objects-filter.c b/list-objects-filter.c\nindex a34e07c061..a011cef0b5 100644\n--- a/list-objects-filter.c\n+++ b/list-objects-filter.c\n@@ -5,7 +5,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"list-objects-filter.h\"\n #include \"list-objects-filter-options.h\"\ndiff --git a/list-objects.c b/list-objects.c\nindex 1db5ba29b5..6b67f0f927 100644\n--- a/list-objects.c\n+++ b/list-objects.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"odb/tree.h\"\n #include \"odb/blob.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/tree-walk.h\"\n #include \"revision.h\"\n #include \"list-objects.h\"\ndiff --git a/log-tree.c b/log-tree.c\nindex 116bb7ea68..ddeafedb45 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -5,8 +5,8 @@\n #include \"commit-reach.h\"\n #include \"odb/commit-slab.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n@@ -28,7 +28,7 @@\n #include \"sequencer.h\"\n #include \"line-log.h\"\n #include \"help.h\"\n-#include \"range-diff.h\"\n+#include \"diff/range-diff.h\"\n #include \"strmap.h\"\n #include \"odb/tree.h\"\n #include \"wildmatch.h\"\ndiff --git a/merge-ll.c b/merge-ll.c\nindex ef5287dee8..2aa45bfa90 100644\n--- a/merge-ll.c\n+++ b/merge-ll.c\n@@ -11,7 +11,7 @@\n #include \"config.h\"\n #include \"convert.h\"\n #include \"attr.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"run-command.h\"\n #include \"merge-ll.h\"\n #include \"quote.h\"\ndiff --git a/merge-ort.c b/merge-ort.c\nindex a12bf62a3d..61fb855500 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -27,8 +27,8 @@\n #include \"odb/commit.h\"\n #include \"commit-reach.h\"\n #include \"config.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n@@ -51,7 +51,7 @@\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n #include \"unpack-trees.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n \n /*\n  * We technically need USE_THE_REPOSITORY_VARIABLE above for DEFAULT_ABBREV,\ndiff --git a/meson.build b/meson.build\nindex 238beb0dfd..87060ff883 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -333,7 +333,7 @@ libgit_sources = [\n   'pack/chunk-format.c',\n   'color.c',\n   'column.c',\n-  'combine-diff.c',\n+  'diff/combine-diff.c',\n   'pack/commit-graph.c',\n   'commit-reach.c',\n   'odb/commit.c',\n@@ -353,16 +353,16 @@ libgit_sources = [\n   'pack/delta-islands.c',\n   'diagnose.c',\n   'pack/diff-delta.c',\n-  'diff-merges.c',\n-  'diff-lib.c',\n-  'diff-no-index.c',\n-  'diff.c',\n-  'diffcore-break.c',\n-  'diffcore-delta.c',\n-  'diffcore-order.c',\n-  'diffcore-pickaxe.c',\n-  'diffcore-rename.c',\n-  'diffcore-rotate.c',\n+  'diff/diff-merges.c',\n+  'diff/diff-lib.c',\n+  'diff/diff-no-index.c',\n+  'diff/diff.c',\n+  'diff/diffcore-break.c',\n+  'diff/diffcore-delta.c',\n+  'diff/diffcore-order.c',\n+  'diff/diffcore-pickaxe.c',\n+  'diff/diffcore-rename.c',\n+  'diff/diffcore-rotate.c',\n   'dir-iterator.c',\n   'dir.c',\n   'editor.c',\n@@ -462,7 +462,7 @@ libgit_sources = [\n   'parse-options-cb.c',\n   'parse-options.c',\n   'pack/patch-delta.c',\n-  'patch-ids.c',\n+  'diff/patch-ids.c',\n   'path.c',\n   'path-walk.c',\n   'pathspec.c',\n@@ -478,7 +478,7 @@ libgit_sources = [\n   'pack/prune-packed.c',\n   'pack/pseudo-merge.c',\n   'quote.c',\n-  'range-diff.c',\n+  'diff/range-diff.c',\n   'pack/reachable.c',\n   'read-cache.c',\n   'rebase-interactive.c',\n@@ -565,7 +565,7 @@ libgit_sources = [\n   'trailer.c',\n   'transport-helper.c',\n   'transport.c',\n-  'tree-diff.c',\n+  'diff/tree-diff.c',\n   'odb/tree-walk.c',\n   'odb/tree.c',\n   'unpack-trees.c',\n@@ -573,7 +573,7 @@ libgit_sources = [\n   'url.c',\n   'urlmatch.c',\n   'usage.c',\n-  'userdiff.c',\n+  'diff/userdiff.c',\n   'utf8.c',\n   'version.c',\n   'versioncmp.c',\n@@ -584,7 +584,7 @@ libgit_sources = [\n   'write-or-die.c',\n   'ws.c',\n   'wt-status.c',\n-  'xdiff-interface.c',\n+  'diff/xdiff-interface.c',\n   'xdiff/xdiffi.c',\n   'xdiff/xemit.c',\n   'xdiff/xhistogram.c',\ndiff --git a/notes-merge.c b/notes-merge.c\nindex 72a3b9479c..ff14b7dfcc 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -11,10 +11,10 @@\n #include \"odb/odb.h\"\n #include \"path.h\"\n #include \"repository.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"hex.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"merge-ll.h\"\n #include \"dir.h\"\n #include \"notes.h\"\ndiff --git a/odb/commit.c b/odb/commit.c\nindex 06daa8c6a0..b78cd28013 100644\n--- a/odb/commit.c\n+++ b/odb/commit.c\n@@ -11,7 +11,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"utf8.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"notes.h\"\n #include \"odb/alloc.h\"\ndiff --git a/pack/bloom.c b/pack/bloom.c\nindex 874e011530..3fdbbf3aba 100644\n--- a/pack/bloom.c\n+++ b/pack/bloom.c\n@@ -2,8 +2,8 @@\n \n #include \"git-compat-util.h\"\n #include \"pack/bloom.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"hashmap.h\"\n #include \"pack/commit-graph.h\"\n #include \"odb/commit.h\"\ndiff --git a/pack/delta-islands.c b/pack/delta-islands.c\nindex 3d015719a5..7c48204384 100644\n--- a/pack/delta-islands.c\n+++ b/pack/delta-islands.c\n@@ -9,7 +9,7 @@\n #include \"odb/tree.h\"\n #include \"pack/pack.h\"\n #include \"odb/tree-walk.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"progress.h\"\n #include \"refs/refs.h\"\n #include \"khash.h\"\ndiff --git a/pack/pack-bitmap-write.c b/pack/pack-bitmap-write.c\nindex 6ef5fb4629..22ee370bde 100644\n--- a/pack/pack-bitmap-write.c\n+++ b/pack/pack-bitmap-write.c\n@@ -6,7 +6,7 @@\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"progress.h\"\n #include \"pack/pack.h\"\ndiff --git a/pack/pack-bitmap.c b/pack/pack-bitmap.c\nindex 80f853f355..3adb5d0563 100644\n--- a/pack/pack-bitmap.c\n+++ b/pack/pack-bitmap.c\n@@ -6,7 +6,7 @@\n #include \"hex.h\"\n #include \"strbuf.h\"\n #include \"odb/tag.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"progress.h\"\n #include \"list-objects.h\"\ndiff --git a/pack/reachable.c b/pack/reachable.c\nindex 51c13b552f..7989f7327a 100644\n--- a/pack/reachable.c\n+++ b/pack/reachable.c\n@@ -6,7 +6,7 @@\n #include \"refs/refs.h\"\n #include \"odb/commit.h\"\n #include \"odb/blob.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"pack/reachable.h\"\n #include \"cache-tree.h\"\ndiff --git a/pretty.c b/pretty.c\nindex 4575f3fde6..3444617506 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -9,7 +9,7 @@\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"utf8.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"pager.h\"\n #include \"revision.h\"\n #include \"string-list.h\"\ndiff --git a/read-cache.c b/read-cache.c\nindex 148a93f10e..5bca3fda12 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -10,8 +10,8 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n #include \"date.h\"\n-#include \"diff.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diffcore.h\"\n #include \"hex.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\ndiff --git a/refs/reflog-walk.c b/refs/reflog-walk.c\nindex 711b71be66..f9eee9a76f 100644\n--- a/refs/reflog-walk.c\n+++ b/refs/reflog-walk.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n #include \"refs/refs.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"repository.h\"\n #include \"revision.h\"\n #include \"string-list.h\"\ndiff --git a/remote.c b/remote.c\nindex 39e9f58cba..c619009d30 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -16,7 +16,7 @@\n #include \"odb/odb.h\"\n #include \"path.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"dir.h\"\n #include \"setup.h\"\ndiff --git a/rerere.c b/rerere.c\nindex 6ff20d0692..3055989a41 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -12,7 +12,7 @@\n #include \"string-list.h\"\n #include \"read-cache-ll.h\"\n #include \"rerere.h\"\n-#include \"xdiff-interface.h\"\n+#include \"diff/xdiff-interface.h\"\n #include \"dir.h\"\n #include \"resolve-undo.h\"\n #include \"merge-ll.h\"\ndiff --git a/revision.c b/revision.c\nindex f92a6482f1..249a1736fd 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -14,15 +14,15 @@\n #include \"odb/blob.h\"\n #include \"odb/tree.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n-#include \"diff-merges.h\"\n+#include \"diff/diff.h\"\n+#include \"diff/diff-merges.h\"\n #include \"refs/refs.h\"\n #include \"revision.h\"\n #include \"repository.h\"\n #include \"graph.h\"\n #include \"grep.h\"\n #include \"refs/reflog-walk.h\"\n-#include \"patch-ids.h\"\n+#include \"diff/patch-ids.h\"\n #include \"decorate.h\"\n #include \"string-list.h\"\n #include \"line-log.h\"\ndiff --git a/revision.h b/revision.h\nindex e0ff7aa0f2..64d9a47091 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -7,7 +7,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/oidset.h\"\n #include \"pretty.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/commit-slab-decl.h\"\n #include \"decorate.h\"\n #include \"ident.h\"\ndiff --git a/sequencer.c b/sequencer.c\nindex d13721ab1f..551e4529c4 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -22,7 +22,7 @@\n #include \"hook.h\"\n #include \"utf8.h\"\n #include \"cache-tree.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"path.h\"\n #include \"revision.h\"\n #include \"rerere.h\"\ndiff --git a/shallow.c b/shallow.c\nindex daa6db8e0d..fa16834aff 100644\n--- a/shallow.c\n+++ b/shallow.c\n@@ -12,7 +12,7 @@\n #include \"refs/refs.h\"\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"odb/commit-slab.h\"\n #include \"list-objects.h\"\ndiff --git a/submodule.c b/submodule.c\nindex 32af65e6b8..a9137aa180 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -8,14 +8,14 @@\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n #include \"dir.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision.h\"\n #include \"run-command.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"refs/refs.h\"\n #include \"string-list.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c\nindex 1b7f569f01..7c66b8566f 100644\n--- a/t/helper/test-revision-walking.c\n+++ b/t/helper/test-revision-walking.c\n@@ -12,7 +12,7 @@\n \n #include \"test-tool.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"line-log.h\"\n #include \"odb/object-name.h\"\n #include \"repository.h\"\ndiff --git a/t/helper/test-userdiff.c b/t/helper/test-userdiff.c\nindex fc34c589b3..ee829e0868 100644\n--- a/t/helper/test-userdiff.c\n+++ b/t/helper/test-userdiff.c\n@@ -2,7 +2,7 @@\n \n #include \"test-tool.h\"\n #include \"setup.h\"\n-#include \"userdiff.h\"\n+#include \"diff/userdiff.h\"\n #include \"config.h\"\n \n static int driver_cb(struct userdiff_driver *driver,\ndiff --git a/upload-pack.c b/upload-pack.c\nindex d145a89c7b..acd381ebf1 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -14,7 +14,7 @@\n #include \"odb/oid-array.h\"\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"revision.h\"\n #include \"list-objects-filter-options.h\"\n #include \"run-command.h\"\ndiff --git a/wt-status.c b/wt-status.c\nindex 708366b973..28a0c72a51 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -7,7 +7,7 @@\n #include \"odb/object.h\"\n #include \"dir.h\"\n #include \"odb/commit.h\"\n-#include \"diff.h\"\n+#include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n@@ -15,7 +15,7 @@\n #include \"odb/object-name.h\"\n #include \"path.h\"\n #include \"revision.h\"\n-#include \"diffcore.h\"\n+#include \"diff/diffcore.h\"\n #include \"quote.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n-- \n2.54.0\n\n"},{"id":"551092","messageId":"20260823171915.2662373-12-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 11/14] revision: gather the revision sources under revision/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:55Z","receivedAt":"2026-08-23T17:19:37Z","isPatch":true,"body":"Move the 14 revision C sources and 15 headers into revision/ as renames.\nRepoint every reference to their old paths to the new ones: the #include\nlines across the tree, the Makefile and meson.build build entries, and\nthe tutorial #include examples.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                  | 58 +++++++++----------\n Documentation/MyFirstContribution.adoc        |  2 +-\n Documentation/MyFirstObjectWalk.adoc          |  6 +-\n Makefile                                      | 28 ++++-----\n add-interactive.c                             |  2 +-\n archive.c                                     |  2 +-\n attr.c                                        |  2 +-\n builtin/add.c                                 |  2 +-\n builtin/am.c                                  |  6 +-\n builtin/backfill.c                            |  2 +-\n builtin/bisect.c                              |  4 +-\n builtin/blame.c                               |  8 +--\n builtin/branch.c                              |  2 +-\n builtin/cat-file.c                            |  2 +-\n builtin/checkout.c                            |  2 +-\n builtin/clone.c                               |  2 +-\n builtin/commit.c                              |  6 +-\n builtin/describe.c                            |  4 +-\n builtin/diff-files.c                          |  2 +-\n builtin/diff-index.c                          |  2 +-\n builtin/diff-pairs.c                          |  2 +-\n builtin/diff-tree.c                           |  4 +-\n builtin/diff.c                                |  4 +-\n builtin/fast-export.c                         |  6 +-\n builtin/fast-import.c                         |  2 +-\n builtin/fetch.c                               |  6 +-\n builtin/gc.c                                  |  2 +-\n builtin/history.c                             |  4 +-\n builtin/last-modified.c                       |  2 +-\n builtin/log.c                                 |  8 +--\n builtin/merge-base.c                          |  2 +-\n builtin/merge-tree.c                          |  2 +-\n builtin/merge.c                               |  4 +-\n builtin/name-rev.c                            |  4 +-\n builtin/notes.c                               |  2 +-\n builtin/pack-objects.c                        | 10 ++--\n builtin/prune.c                               |  4 +-\n builtin/pull.c                                |  2 +-\n builtin/rebase.c                              |  4 +-\n builtin/receive-pack.c                        |  4 +-\n builtin/reflog.c                              |  2 +-\n builtin/remote.c                              |  2 +-\n builtin/repack.c                              |  2 +-\n builtin/replay.c                              |  2 +-\n builtin/repo.c                                |  4 +-\n builtin/reset.c                               |  2 +-\n builtin/rev-list.c                            | 14 ++---\n builtin/rev-parse.c                           |  8 +--\n builtin/revert.c                              |  2 +-\n builtin/shortlog.c                            |  2 +-\n builtin/show-branch.c                         |  2 +-\n builtin/stash.c                               |  4 +-\n builtin/submodule--helper.c                   |  4 +-\n builtin/tag.c                                 |  2 +-\n builtin/unpack-objects.c                      |  2 +-\n bundle.c                                      |  6 +-\n bundle.h                                      |  2 +-\n chdir-notify.c                                |  2 +-\n diff/combine-diff.c                           |  4 +-\n diff/diff-lib.c                               |  4 +-\n diff/diff-merges.c                            |  2 +-\n diff/diff-no-index.c                          |  2 +-\n diff/diff.c                                   |  4 +-\n diff/diffcore-pickaxe.c                       |  2 +-\n diff/range-diff.c                             |  4 +-\n fetch-pack.c                                  |  4 +-\n fetch-pack.h                                  |  2 +-\n fmt-merge-msg.c                               |  4 +-\n git.c                                         |  2 +-\n grep.c                                        |  2 +-\n http-push.c                                   |  6 +-\n http-walker.c                                 |  2 +-\n merge-ort.c                                   |  4 +-\n meson.build                                   | 28 ++++-----\n notes-cache.c                                 |  2 +-\n notes-merge.c                                 |  2 +-\n odb/commit.c                                  |  6 +-\n odb/object-name.c                             |  4 +-\n odb/source-packed.c                           |  2 +-\n pack/commit-graph.c                           |  2 +-\n pack/midx-write.c                             |  4 +-\n pack/pack-bitmap-write.c                      |  4 +-\n pack/pack-bitmap.c                            |  6 +-\n pack/packfile.c                               |  2 +-\n pack/packfile.h                               |  2 +-\n pack/reachable.c                              |  4 +-\n pack/repack.h                                 |  2 +-\n path-walk.c                                   |  6 +-\n read-cache.c                                  |  2 +-\n refs/files-backend.c                          |  2 +-\n refs/pack-refs.c                              |  2 +-\n refs/ref-filter.c                             |  4 +-\n refs/ref-filter.h                             |  2 +-\n refs/reflog-walk.c                            |  2 +-\n refs/reflog.c                                 |  2 +-\n remote.c                                      |  4 +-\n replay.c                                      |  2 +-\n bisect.c => revision/bisect.c                 | 10 ++--\n bisect.h => revision/bisect.h                 |  0\n blame.c => revision/blame.c                   |  4 +-\n blame.h => revision/blame.h                   |  0\n commit-reach.c => revision/commit-reach.c     |  6 +-\n commit-reach.h => revision/commit-reach.h     |  0\n decorate.c => revision/decorate.c             |  2 +-\n decorate.h => revision/decorate.h             |  0\n graph.c => revision/graph.c                   |  4 +-\n graph.h => revision/graph.h                   |  0\n line-log.c => revision/line-log.c             |  8 +--\n line-log.h => revision/line-log.h             |  0\n line-range.c => revision/line-range.c         |  2 +-\n line-range.h => revision/line-range.h         |  0\n .../list-objects-filter-options.c             |  2 +-\n .../list-objects-filter-options.h             |  0\n .../list-objects-filter.c                     |  6 +-\n .../list-objects-filter.h                     |  0\n list-objects.c => revision/list-objects.c     |  8 +--\n list-objects.h => revision/list-objects.h     |  0\n list.h => revision/list.h                     |  0\n log-tree.c => revision/log-tree.c             | 10 ++--\n log-tree.h => revision/log-tree.h             |  0\n pretty.c => revision/pretty.c                 |  4 +-\n pretty.h => revision/pretty.h                 |  0\n revision.c => revision/revision.c             | 16 ++---\n revision.h => revision/revision.h             |  6 +-\n shallow.c => revision/shallow.c               |  8 +--\n shallow.h => revision/shallow.h               |  0\n send-pack.c                                   |  2 +-\n sequencer.c                                   |  6 +-\n setup.c                                       |  2 +-\n submodule.c                                   |  4 +-\n t/helper/test-path-walk.c                     |  6 +-\n t/helper/test-reach.c                         |  2 +-\n t/helper/test-ref-store.c                     |  2 +-\n t/helper/test-revision-walking.c              |  4 +-\n t/unit-tests/u-example-decorate.c             |  2 +-\n t/unit-tests/u-list-objects-filter-options.c  |  2 +-\n tempfile.h                                    |  2 +-\n trailer.c                                     |  2 +-\n trailer.h                                     |  2 +-\n transport.h                                   |  2 +-\n upload-pack.c                                 |  8 +--\n wt-status.c                                   |  2 +-\n 142 files changed, 289 insertions(+), 289 deletions(-)\n rename bisect.c => revision/bisect.c (99%)\n rename bisect.h => revision/bisect.h (100%)\n rename blame.c => revision/blame.c (99%)\n rename blame.h => revision/blame.h (100%)\n rename commit-reach.c => revision/commit-reach.c (99%)\n rename commit-reach.h => revision/commit-reach.h (100%)\n rename decorate.c => revision/decorate.c (98%)\n rename decorate.h => revision/decorate.h (100%)\n rename graph.c => revision/graph.c (99%)\n rename graph.h => revision/graph.h (100%)\n rename line-log.c => revision/line-log.c (99%)\n rename line-log.h => revision/line-log.h (100%)\n rename line-range.c => revision/line-range.c (99%)\n rename line-range.h => revision/line-range.h (100%)\n rename list-objects-filter-options.c => revision/list-objects-filter-options.c (99%)\n rename list-objects-filter-options.h => revision/list-objects-filter-options.h (100%)\n rename list-objects-filter.c => revision/list-objects-filter.c (99%)\n rename list-objects-filter.h => revision/list-objects-filter.h (100%)\n rename list-objects.c => revision/list-objects.c (98%)\n rename list-objects.h => revision/list-objects.h (100%)\n rename list.h => revision/list.h (100%)\n rename log-tree.c => revision/log-tree.c (99%)\n rename log-tree.h => revision/log-tree.h (100%)\n rename pretty.c => revision/pretty.c (99%)\n rename pretty.h => revision/pretty.h (100%)\n rename revision.c => revision/revision.c (99%)\n rename revision.h => revision/revision.h (99%)\n rename shallow.c => revision/shallow.c (99%)\n rename shallow.h => revision/shallow.h (100%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex 160365fbca..d62d0a2240 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -41,10 +41,6 @@ attr.h component=convert role=header prefix=attr cochange=convert:50,index:13,di\n banned.h component=? role=public prefix=banned\n base85.c component=? role=lib prefix=base85 cochange=diff:4,pack:2,convert:1,transport:1\n base85.h component=? role=public prefix=base85 cochange=diff:1\n-bisect.c component=revision role=lib prefix=bisect includes=odb:5,revision:5,setup:2,diff:1,index:1 cochange=revision:61,odb:32,transport:31,refs:13,diff:9\n-bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2\n-blame.c component=revision role=lib prefix=blame includes=odb:5,diff:2,index:2,pack:2,revision:2 cochange=diff:68,revision:66,odb:56,index:29,pack:22\n-blame.h component=revision role=header prefix=blame includes=diff:1,odb:1 cochange=revision:19,odb:7,diff:4,archive:1,index:1\n branch.c component=? role=lib prefix=branch includes=refs:3,setup:3,odb:2,submodule:1,transport:1 cochange=refs:62,transport:41,setup:28,index:19,revision:12\n branch.h component=? role=public prefix=branch cochange=setup:8,refs:4,submodule:4\n builtin.h component=? role=public prefix=builtin includes=setup:1 cochange=diff:15,index:15,transport:12,odb:6,notes:5\n@@ -62,8 +58,6 @@ color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,inde\n color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1\n column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2\n column.h component=? role=public prefix=column\n-commit-reach.c component=revision role=lib prefix=commit-reach includes=revision:3,odb:2,pack:1,refs:1 cochange=revision:38,odb:17,pack:15,transport:9,index:5\n-commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3\n common-exit.c component=? role=lib prefix=common-main\n common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1\n common-init.h component=? role=public prefix=common-main\n@@ -86,8 +80,6 @@ ctype.c component=? role=lib prefix=ctype cochange=setup:3,index:2,odb:1,pack:1,\n daemon.c component=? role=program prefix=daemon includes=setup:3,transport:2 cochange=transport:77,index:14,setup:13,diff:7,refs:5\n date.c component=? role=lib prefix=date cochange=revision:17,odb:16,refs:14,setup:9,diff:7\n date.h component=? role=public prefix=date cochange=refs:7,revision:4,setup:2,archive:1,odb:1\n-decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1 cochange=diff:6,odb:5,revision:5,pack:2,transport:2\n-decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1\n diagnose.c component=? role=lib prefix=diagnose includes=archive:1,index:1,odb:1,pack:1,setup:1 cochange=index:4,revision:4,odb:3,pack:3,transport:3\n diagnose.h component=? role=public prefix=diagnose cochange=revision:2,refs:1,transport:1\n diff/combine-diff.c component=diff role=lib prefix=combine-diff includes=odb:5,diff:4,revision:2,convert:1,refs:1 cochange=diff:198,revision:67,index:35,odb:16,transport:16\n@@ -152,8 +144,6 @@ git-zlib.h component=? role=public prefix=git-zlib cochange=archive:3,setup:2,od\n git.c component=? role=lib prefix=git includes=setup:4,odb:2,convert:1,index:1,revision:1 cochange=setup:70,revision:54,transport:47,index:28,diff:25\n gpg-interface.c component=? role=lib prefix=gpg-interface includes=setup:3,index:1,odb:1 cochange=revision:25,odb:22,setup:13,transport:11,diff:8\n gpg-interface.h component=? role=public prefix=gpg-interface cochange=odb:22,revision:15,merge:4,transport:3,refs:1\n-graph.c component=revision role=lib prefix=graph includes=revision:2,odb:1,setup:1 cochange=revision:38,diff:23,index:4,odb:3,transport:3\n-graph.h component=revision role=header prefix=graph includes=diff:1 cochange=revision:19,diff:2,odb:1\n grep.c component=? role=lib prefix=grep includes=diff:4,odb:1,revision:1,setup:1 cochange=diff:40,revision:28,transport:10,index:7,refs:7\n grep.h component=? role=public prefix=grep includes=diff:1 cochange=revision:23,diff:10,transport:4,index:2,refs:2\n hashmap.c component=? role=lib prefix=hashmap cochange=diff:33,revision:19,index:17,refs:13,submodule:13\n@@ -183,23 +173,10 @@ kwset.c component=? role=lib prefix=kwset cochange=convert:2,diff:1,pack:1,revis\n kwset.h component=? role=public prefix=kwset\n levenshtein.c component=? role=lib prefix=? cochange=diff:2,revision:2,odb:1\n levenshtein.h component=? role=public prefix=? cochange=transport:2,diff:1,refs:1,setup:1\n-line-log.c component=revision role=lib prefix=line-log includes=odb:4,revision:4,diff:3,setup:2,pack:1 cochange=revision:52,diff:48,odb:23,pack:15,notes:8\n-line-log.h component=revision role=header prefix=line-log includes=diff:1 cochange=revision:20,odb:3,diff:2,setup:1,submodule:1\n-line-range.c component=revision role=lib prefix=line-range includes=diff:2,revision:1 cochange=revision:14,diff:8,archive:1,odb:1,pack:1\n-line-range.h component=revision role=header prefix=line-range cochange=revision:13\n linear-assignment.c component=? role=lib prefix=linear-assignment cochange=diff:1,revision:1\n linear-assignment.h component=? role=public prefix=linear-assignment\n-list-objects-filter-options.c component=revision role=lib prefix=list-objects-filter-options includes=revision:1,setup:1,transport:1 cochange=revision:39,transport:21,setup:9,diff:6,index:4\n-list-objects-filter-options.h component=revision role=header prefix=list-objects-filter includes=odb:1 cochange=revision:40,transport:17,odb:4,diff:3,refs:2\n-list-objects-filter.c component=revision role=lib prefix=list-objects-filter includes=odb:5,revision:3,diff:1,index:1 cochange=revision:32,odb:13,index:10,diff:6,pack:3\n-list-objects-filter.h component=revision role=header prefix=list-objects cochange=revision:16,odb:1\n-list-objects.c component=revision role=lib prefix=list-objects includes=odb:6,revision:4,diff:1,pack:1,setup:1 cochange=revision:91,odb:68,pack:40,transport:28,index:15\n-list-objects.h component=revision role=header prefix=list-objects cochange=revision:32,pack:13,transport:4,odb:1\n-list.h component=revision role=header prefix=list cochange=submodule:2,transport:2,index:1,revision:1\n lockfile.c component=? role=lib prefix=lockfile includes=setup:1 cochange=refs:18,index:13,setup:9,diff:8,merge:3\n lockfile.h component=? role=public prefix=lockfile cochange=index:5,revision:4,diff:3,refs:3,odb:2\n-log-tree.c component=revision role=lib prefix=format-patch includes=odb:8,revision:5,diff:3,setup:3,refs:2 cochange=revision:222,diff:112,odb:112,refs:31,transport:16\n-log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2\n mailinfo.c component=? role=lib prefix=mailinfo includes=setup:2 cochange=transport:5,index:3,notes:3,odb:3,revision:3\n mailinfo.h component=? role=public prefix=mailinfo\n mailmap.c component=? role=lib prefix=mailmap includes=setup:3,odb:2 cochange=setup:13,transport:11,refs:10,index:8,revision:5\n@@ -340,8 +317,6 @@ pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 coc\n pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1\n preload-index.c component=index role=lib prefix=preload-index includes=index:6,setup:3 cochange=index:52,setup:15,diff:12,revision:5,merge:3\n preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1\n-pretty.c component=revision role=lib prefix=pretty includes=odb:3,revision:2,setup:2,diff:1,notes:1 cochange=revision:115,odb:72,refs:29,notes:23,transport:19\n-pretty.h component=revision role=header prefix=pretty cochange=revision:26,refs:7,diff:5,odb:5,archive:4\n prio-queue.c component=? role=lib prefix=prio-queue cochange=odb:5,revision:5,diff:2,pack:2,transport:2\n prio-queue.h component=? role=public prefix=prio-queue cochange=odb:3,revision:2,transport:2,pack:1\n progress.c component=? role=lib prefix=progress includes=setup:1 cochange=index:11,diff:6,setup:6,pack:4,revision:2\n@@ -394,8 +369,35 @@ reset.c component=? role=lib prefix=reset includes=odb:3,index:2,refs:1,setup:1\n reset.h component=? role=public prefix=reset includes=odb:1,setup:1\n resolve-undo.c component=index role=lib prefix=resolve-undo includes=index:4,odb:1 cochange=index:33,merge:5,revision:4,diff:3,notes:2\n resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1\n-revision.c component=revision role=lib prefix=revision includes=odb:9,revision:8,index:4,setup:4,diff:3 cochange=revision:379,diff:194,odb:181,refs:109,pack:101\n-revision.h component=revision role=header prefix=revision includes=odb:4,revision:3,diff:1,notes:1,setup:1 cochange=revision:304,odb:48,diff:24,pack:19,refs:15\n+revision/bisect.c component=revision role=lib prefix=bisect includes=odb:5,revision:5,setup:2,diff:1,index:1 cochange=revision:61,odb:32,transport:31,refs:13,diff:9\n+revision/bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2\n+revision/blame.c component=revision role=lib prefix=blame includes=odb:5,diff:2,index:2,pack:2,revision:2 cochange=diff:68,revision:66,odb:56,index:29,pack:22\n+revision/blame.h component=revision role=header prefix=blame includes=diff:1,odb:1 cochange=revision:19,odb:7,diff:4,archive:1,index:1\n+revision/commit-reach.c component=revision role=lib prefix=commit-reach includes=revision:3,odb:2,pack:1,refs:1 cochange=revision:38,odb:17,pack:15,transport:9,index:5\n+revision/commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3\n+revision/decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1 cochange=diff:6,odb:5,revision:5,pack:2,transport:2\n+revision/decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1\n+revision/graph.c component=revision role=lib prefix=graph includes=revision:2,odb:1,setup:1 cochange=revision:38,diff:23,index:4,odb:3,transport:3\n+revision/graph.h component=revision role=header prefix=graph includes=diff:1 cochange=revision:19,diff:2,odb:1\n+revision/line-log.c component=revision role=lib prefix=line-log includes=odb:4,revision:4,diff:3,setup:2,pack:1 cochange=revision:52,diff:48,odb:23,pack:15,notes:8\n+revision/line-log.h component=revision role=header prefix=line-log includes=diff:1 cochange=revision:20,odb:3,diff:2,setup:1,submodule:1\n+revision/line-range.c component=revision role=lib prefix=line-range includes=diff:2,revision:1 cochange=revision:14,diff:8,archive:1,odb:1,pack:1\n+revision/line-range.h component=revision role=header prefix=line-range cochange=revision:13\n+revision/list-objects-filter-options.c component=revision role=lib prefix=list-objects-filter-options includes=revision:1,setup:1,transport:1 cochange=revision:39,transport:21,setup:9,diff:6,index:4\n+revision/list-objects-filter-options.h component=revision role=header prefix=list-objects-filter includes=odb:1 cochange=revision:40,transport:17,odb:4,diff:3,refs:2\n+revision/list-objects-filter.c component=revision role=lib prefix=list-objects-filter includes=odb:5,revision:3,diff:1,index:1 cochange=revision:32,odb:13,index:10,diff:6,pack:3\n+revision/list-objects-filter.h component=revision role=header prefix=list-objects cochange=revision:16,odb:1\n+revision/list-objects.c component=revision role=lib prefix=list-objects includes=odb:6,revision:4,diff:1,pack:1,setup:1 cochange=revision:91,odb:68,pack:40,transport:28,index:15\n+revision/list-objects.h component=revision role=header prefix=list-objects cochange=revision:32,pack:13,transport:4,odb:1\n+revision/list.h component=revision role=header prefix=list cochange=submodule:2,transport:2,index:1,revision:1\n+revision/log-tree.c component=revision role=lib prefix=format-patch includes=odb:8,revision:5,diff:3,setup:3,refs:2 cochange=revision:222,diff:112,odb:112,refs:31,transport:16\n+revision/log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2\n+revision/pretty.c component=revision role=lib prefix=pretty includes=odb:3,revision:2,setup:2,diff:1,notes:1 cochange=revision:115,odb:72,refs:29,notes:23,transport:19\n+revision/pretty.h component=revision role=header prefix=pretty cochange=revision:26,refs:7,diff:5,odb:5,archive:4\n+revision/revision.c component=revision role=lib prefix=revision includes=odb:9,revision:8,index:4,setup:4,diff:3 cochange=revision:379,diff:194,odb:181,refs:109,pack:101\n+revision/revision.h component=revision role=header prefix=revision includes=odb:4,revision:3,diff:1,notes:1,setup:1 cochange=revision:304,odb:48,diff:24,pack:19,refs:15\n+revision/shallow.c component=revision role=lib prefix=shallow includes=odb:5,revision:4,diff:1,index:1,refs:1 cochange=odb:83,transport:73,revision:31,index:20,refs:14\n+revision/shallow.h component=revision role=header prefix=shallow includes=odb:2,setup:1 cochange=revision:10,transport:7,odb:5,diff:3,index:2\n run-command.c component=? role=lib prefix=run-command includes=setup:2,index:1,pack:1 cochange=transport:27,index:21,setup:14,odb:8,submodule:6\n run-command.h component=? role=public prefix=run-command cochange=transport:21,setup:8,odb:6,submodule:5,refs:4\n sane-ctype.h component=? role=public prefix=sane-ctype\n@@ -411,8 +413,6 @@ setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:\n sh-i18n--envsubst.c component=? role=program prefix=sh-i18n--envsubst cochange=index:3,diff:1,transport:1\n sha1dc_git.c component=? role=lib prefix=sha1dc cochange=diff:3,odb:2,revision:2,setup:1\n sha1dc_git.h component=? role=public prefix=sha1dc cochange=odb:2\n-shallow.c component=revision role=lib prefix=shallow includes=odb:5,revision:4,diff:1,index:1,refs:1 cochange=odb:83,transport:73,revision:31,index:20,refs:14\n-shallow.h component=revision role=header prefix=shallow includes=odb:2,setup:1 cochange=revision:10,transport:7,odb:5,diff:3,index:2\n shell.c component=? role=program prefix=shell includes=setup:1 cochange=transport:10,setup:4,revision:2\n shortlog.h component=? role=public prefix=shortlog cochange=revision:2\n sideband.c component=transport role=lib prefix=sideband includes=transport:2,setup:1 cochange=transport:51,revision:6,diff:5,index:5,refs:4\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex 4b50aaa40e..2da56ca8fc 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -429,7 +429,7 @@ Add the following includes:\n \n ----\n #include \"odb/commit.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"strbuf.h\"\n ----\n \ndiff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc\nindex 87b2433b2c..7fb63e6861 100644\n--- a/Documentation/MyFirstObjectWalk.adoc\n+++ b/Documentation/MyFirstObjectWalk.adoc\n@@ -259,7 +259,7 @@ Add the `struct rev_info` and the `repo_init_revisions()` call.\n We'll also need to include the `revision.h` header:\n \n ----\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n ...\n \n@@ -359,7 +359,7 @@ the walk loop below the `prepare_revision_walk()` call within your\n `walken_commit_walk()`:\n \n ----\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n \n ...\n \n@@ -668,7 +668,7 @@ Complete your implementation of `walken_object_walk()`.\n We'll also need to include the `list-objects.h` header.\n \n ----\n-#include \"list-objects.h\"\n+#include \"revision/list-objects.h\"\n \n ...\n \ndiff --git a/Makefile b/Makefile\nindex b96345ba0c..74013e8380 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1110,8 +1110,8 @@ LIB_OBJS += archive-zip.o\n LIB_OBJS += archive.o\n LIB_OBJS += attr.o\n LIB_OBJS += base85.o\n-LIB_OBJS += bisect.o\n-LIB_OBJS += blame.o\n+LIB_OBJS += revision/bisect.o\n+LIB_OBJS += revision/blame.o\n LIB_OBJS += odb/blob.o\n LIB_OBJS += pack/bloom.o\n LIB_OBJS += branch.o\n@@ -1126,7 +1126,7 @@ LIB_OBJS += color.o\n LIB_OBJS += column.o\n LIB_OBJS += diff/combine-diff.o\n LIB_OBJS += pack/commit-graph.o\n-LIB_OBJS += commit-reach.o\n+LIB_OBJS += revision/commit-reach.o\n LIB_OBJS += odb/commit.o\n LIB_OBJS += common-exit.o\n LIB_OBJS += common-init.o\n@@ -1144,7 +1144,7 @@ LIB_OBJS += credential.o\n LIB_OBJS += csum-file.o\n LIB_OBJS += ctype.o\n LIB_OBJS += date.o\n-LIB_OBJS += decorate.o\n+LIB_OBJS += revision/decorate.o\n LIB_OBJS += pack/delta-islands.o\n LIB_OBJS += diagnose.o\n LIB_OBJS += pack/diff-delta.o\n@@ -1179,7 +1179,7 @@ LIB_OBJS += fsmonitor-settings.o\n LIB_OBJS += gettext.o\n LIB_OBJS += git-zlib.o\n LIB_OBJS += gpg-interface.o\n-LIB_OBJS += graph.o\n+LIB_OBJS += revision/graph.o\n LIB_OBJS += grep.o\n LIB_OBJS += odb/hash-lookup.o\n LIB_OBJS += odb/hash.o\n@@ -1192,14 +1192,14 @@ LIB_OBJS += ident.o\n LIB_OBJS += json-writer.o\n LIB_OBJS += kwset.o\n LIB_OBJS += levenshtein.o\n-LIB_OBJS += line-log.o\n-LIB_OBJS += line-range.o\n+LIB_OBJS += revision/line-log.o\n+LIB_OBJS += revision/line-range.o\n LIB_OBJS += linear-assignment.o\n-LIB_OBJS += list-objects-filter-options.o\n-LIB_OBJS += list-objects-filter.o\n-LIB_OBJS += list-objects.o\n+LIB_OBJS += revision/list-objects-filter-options.o\n+LIB_OBJS += revision/list-objects-filter.o\n+LIB_OBJS += revision/list-objects.o\n LIB_OBJS += lockfile.o\n-LIB_OBJS += log-tree.o\n+LIB_OBJS += revision/log-tree.o\n LIB_OBJS += odb/loose.o\n LIB_OBJS += refs/ls-refs.o\n LIB_OBJS += mailinfo.o\n@@ -1263,7 +1263,7 @@ LIB_OBJS += path-walk.o\n LIB_OBJS += pathspec.o\n LIB_OBJS += pkt-line.o\n LIB_OBJS += preload-index.o\n-LIB_OBJS += pretty.o\n+LIB_OBJS += revision/pretty.o\n LIB_OBJS += prio-queue.o\n LIB_OBJS += progress.o\n LIB_OBJS += promisor-remote.o\n@@ -1317,14 +1317,14 @@ LIB_OBJS += repository.o\n LIB_OBJS += rerere.o\n LIB_OBJS += reset.o\n LIB_OBJS += resolve-undo.o\n-LIB_OBJS += revision.o\n+LIB_OBJS += revision/revision.o\n LIB_OBJS += run-command.o\n LIB_OBJS += send-pack.o\n LIB_OBJS += sequencer.o\n LIB_OBJS += serve.o\n LIB_OBJS += pack/server-info.o\n LIB_OBJS += setup.o\n-LIB_OBJS += shallow.o\n+LIB_OBJS += revision/shallow.o\n LIB_OBJS += sideband.o\n LIB_OBJS += sigchain.o\n LIB_OBJS += sparse-index.o\ndiff --git a/add-interactive.c b/add-interactive.c\nindex f656db231c..7bfc410361 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -10,7 +10,7 @@\n #include \"preload-index.h\"\n #include \"read-cache-ll.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"refs/refs.h\"\n #include \"string-list.h\"\n #include \"lockfile.h\"\ndiff --git a/archive.c b/archive.c\nindex 53820bd859..a2402fb7e6 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -11,7 +11,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"setup.h\"\n #include \"refs/refs.h\"\n #include \"odb/odb.h\"\ndiff --git a/attr.c b/attr.c\nindex e7c6562bee..e7d364d490 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -21,7 +21,7 @@\n #include \"quote.h\"\n #include \"read-cache-ll.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"odb/odb.h\"\n #include \"setup.h\"\n #include \"thread-utils.h\"\ndiff --git a/builtin/add.c b/builtin/add.c\nindex dd5e33c7b0..4dbdccd928 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -22,7 +22,7 @@\n #include \"preload-index.h\"\n #include \"diff/diff.h\"\n #include \"read-cache.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\n #include \"add-interactive.h\"\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 7bd7fde14b..5dbe1f171b 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -30,9 +30,9 @@\n #include \"odb/object-name.h\"\n #include \"preload-index.h\"\n #include \"sequencer.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"merge-ort-wrappers.h\"\n-#include \"log-tree.h\"\n+#include \"revision/log-tree.h\"\n #include \"notes-utils.h\"\n #include \"rerere.h\"\n #include \"mailinfo.h\"\n@@ -40,7 +40,7 @@\n #include \"string-list.h\"\n #include \"pager.h\"\n #include \"path.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n \n /**\n  * Returns the length of the first line of msg.\ndiff --git a/builtin/backfill.c b/builtin/backfill.c\nindex c42226d3e8..d2ef39bc58 100644\n--- a/builtin/backfill.c\n+++ b/builtin/backfill.c\n@@ -19,7 +19,7 @@\n #include \"promisor-remote.h\"\n #include \"strmap.h\"\n #include \"string-list.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"trace2.h\"\n #include \"progress.h\"\n #include \"pack/packfile.h\"\ndiff --git a/builtin/bisect.c b/builtin/bisect.c\nindex 51e2e949cc..cfb0741d22 100644\n--- a/builtin/bisect.c\n+++ b/builtin/bisect.c\n@@ -8,7 +8,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"bisect.h\"\n+#include \"revision/bisect.h\"\n #include \"refs/refs.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n@@ -16,7 +16,7 @@\n #include \"path.h\"\n #include \"prompt.h\"\n #include \"quote.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n static GIT_PATH_FUNC(git_path_bisect_terms, \"BISECT_TERMS\")\n static GIT_PATH_FUNC(git_path_bisect_ancestors_ok, \"BISECT_ANCESTORS_OK\")\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex cb9f8b4ff0..9e5776e31b 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -15,7 +15,7 @@\n #include \"hex.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"quote.h\"\n #include \"string-list.h\"\n #include \"mailmap.h\"\n@@ -23,13 +23,13 @@\n #include \"prio-queue.h\"\n #include \"utf8.h\"\n #include \"diff/userdiff.h\"\n-#include \"line-range.h\"\n-#include \"line-log.h\"\n+#include \"revision/line-range.h\"\n+#include \"revision/line-log.h\"\n #include \"progress.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"pager.h\"\n-#include \"blame.h\"\n+#include \"revision/blame.h\"\n #include \"refs/refs.h\"\n #include \"setup.h\"\n #include \"odb/tag.h\"\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 7909f250aa..c80df76d36 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -28,7 +28,7 @@\n #include \"refs/worktree.h\"\n #include \"help.h\"\n #include \"advice.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n \n static const char * const builtin_branch_usage[] = {\n \tN_(\"git branch [<options>] [-r | -a] [--merged] [--no-merged] [(--forked <branch>)...]\"),\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex 4fd1999f80..94979a2683 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -15,7 +15,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"ident.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"parse-options.h\"\n #include \"diff/userdiff.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex c35c3d92d1..286fcdc1ba 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -28,7 +28,7 @@\n #include \"remote.h\"\n #include \"repo-settings.h\"\n #include \"resolve-undo.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"sequencer.h\"\n #include \"setup.h\"\n #include \"sparse-index.h\"\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 7b5274e884..8ed07e1a15 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -43,7 +43,7 @@\n #include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"pkt-line.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"hook.h\"\n #include \"bundle.h\"\n #include \"bundle-uri.h\"\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex d2b4ecbd40..aa89e0dc52 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -21,7 +21,7 @@\n #include \"odb/commit.h\"\n #include \"add-interactive.h\"\n #include \"gettext.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"wt-status.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n@@ -39,9 +39,9 @@\n #include \"sparse-index.h\"\n #include \"mailmap.h\"\n #include \"help.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"pack/commit-graph.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"trailer.h\"\n \n static const char * const builtin_commit_usage[] = {\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex ff44b55e9e..bbeba1e465 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -13,14 +13,14 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"read-cache-ll.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"diff/diff.h\"\n #include \"hashmap.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n #include \"odb/odb.h\"\n-#include \"list-objects.h\"\n+#include \"revision/list-objects.h\"\n #include \"odb/commit-slab.h\"\n #include \"wildmatch.h\"\n #include \"prio-queue.h\"\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex 39eaf9cfce..d1e8d2b462 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -13,7 +13,7 @@\n #include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n #include \"preload-index.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n static const char diff_files_usage[] =\n \"git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]\"\ndiff --git a/builtin/diff-index.c b/builtin/diff-index.c\nindex 799f5533ad..f3b2eadda0 100644\n--- a/builtin/diff-index.c\n+++ b/builtin/diff-index.c\n@@ -7,7 +7,7 @@\n #include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n #include \"preload-index.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n \n static const char diff_cache_usage[] =\ndiff --git a/builtin/diff-pairs.c b/builtin/diff-pairs.c\nindex e3350b2915..df5630be47 100644\n--- a/builtin/diff-pairs.c\n+++ b/builtin/diff-pairs.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"odb/object.h\"\n #include \"parse-options.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"strbuf.h\"\n \n static unsigned parse_mode_or_die(const char *mode, const char **end)\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex 8f2103013c..2bd5ed4004 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -6,9 +6,9 @@\n #include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"log-tree.h\"\n+#include \"revision/log-tree.h\"\n #include \"read-cache-ll.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"odb/tmp-objdir.h\"\n #include \"odb/tree.h\"\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 774c12cea6..e4487901d3 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -20,8 +20,8 @@\n #include \"diff/diffcore.h\"\n #include \"preload-index.h\"\n #include \"read-cache-ll.h\"\n-#include \"revision.h\"\n-#include \"log-tree.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/log-tree.h\"\n #include \"setup.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 6683d49660..565cdccb40 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -21,9 +21,9 @@\n #include \"odb/tag.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n-#include \"log-tree.h\"\n-#include \"revision.h\"\n-#include \"decorate.h\"\n+#include \"revision/log-tree.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/decorate.h\"\n #include \"string-list.h\"\n #include \"utf8.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex 3b7d650e24..f3af94307f 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -26,7 +26,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"mem-pool.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"khash.h\"\n #include \"date.h\"\n #include \"gpg-interface.h\"\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex b14b96ce5c..2f744ac8b8 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -32,12 +32,12 @@\n #include \"pager.h\"\n #include \"path.h\"\n #include \"pkt-line.h\"\n-#include \"list-objects-filter-options.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/list-objects-filter-options.h\"\n+#include \"revision/commit-reach.h\"\n #include \"branch.h\"\n #include \"promisor-remote.h\"\n #include \"pack/commit-graph.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n #include \"bundle-uri.h\"\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex bdf3d43108..c340489c64 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -34,7 +34,7 @@\n #include \"path.h\"\n #include \"refs/reflog.h\"\n #include \"rerere.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"exec-cmd.h\"\ndiff --git a/builtin/history.c b/builtin/history.c\nindex 56b5015bc0..73a31ce152 100644\n--- a/builtin/history.c\n+++ b/builtin/history.c\n@@ -3,7 +3,7 @@\n #include \"builtin.h\"\n #include \"cache-tree.h\"\n #include \"odb/commit.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"config.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n@@ -18,7 +18,7 @@\n #include \"refs/refs.h\"\n #include \"replay.h\"\n #include \"reset.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"sequencer.h\"\n #include \"strvec.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/last-modified.c b/builtin/last-modified.c\nindex 911441a321..88e122db9b 100644\n--- a/builtin/last-modified.c\n+++ b/builtin/last-modified.c\n@@ -17,7 +17,7 @@\n #include \"prio-queue.h\"\n #include \"quote.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n /* Remember to update object flag allocation in object.h */\n #define PARENT1 (1u<<16) /* used instead of SEEN */\ndiff --git a/builtin/log.c b/builtin/log.c\nindex a93b97858b..82144cf2b6 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -23,8 +23,8 @@\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n #include \"diff/diff-merges.h\"\n-#include \"revision.h\"\n-#include \"log-tree.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/log-tree.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n #include \"odb/tag.h\"\n@@ -35,7 +35,7 @@\n #include \"remote.h\"\n #include \"string-list.h\"\n #include \"parse-options.h\"\n-#include \"line-log.h\"\n+#include \"revision/line-log.h\"\n #include \"branch.h\"\n #include \"version.h\"\n #include \"mailmap.h\"\n@@ -44,7 +44,7 @@\n #include \"advice.h\"\n #include \"utf8.h\"\n \n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"promisor-remote.h\"\n #include \"diff/range-diff.h\"\n #include \"odb/tmp-objdir.h\"\ndiff --git a/builtin/merge-base.c b/builtin/merge-base.c\nindex 191e4e7fa0..7eec05ae7b 100644\n--- a/builtin/merge-base.c\n+++ b/builtin/merge-base.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n \n static int show_merge_base(struct commit **rev, size_t rev_nr, int show_all)\n {\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 8217938d86..41d8bbcbc1 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -8,7 +8,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"merge-ort.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 7ec4554b0b..268ffc4855 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -31,7 +31,7 @@\n #include \"odb/commit.h\"\n #include \"diff/diffcore.h\"\n #include \"path.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"unpack-trees.h\"\n #include \"cache-tree.h\"\n #include \"dir.h\"\n@@ -48,7 +48,7 @@\n #include \"odb/tag.h\"\n #include \"alias.h\"\n #include \"branch.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"wt-status.h\"\n #include \"pack/commit-graph.h\"\n \ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex f3f4714c1d..31bc960b34 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -17,8 +17,8 @@\n #include \"pack/commit-graph.h\"\n #include \"wildmatch.h\"\n #include \"mem-pool.h\"\n-#include \"pretty.h\"\n-#include \"revision.h\"\n+#include \"revision/pretty.h\"\n+#include \"revision/revision.h\"\n #include \"notes.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 6ebb5db39c..61087b0fa5 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -19,7 +19,7 @@\n #include \"odb/odb.h\"\n #include \"path.h\"\n \n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"refs/refs.h\"\n #include \"exec-cmd.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 17721f13ac..3b025a08e9 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -16,9 +16,9 @@\n #include \"csum-file.h\"\n #include \"odb/tree-walk.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n-#include \"list-objects.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"pack/pack-objects.h\"\n #include \"progress.h\"\n #include \"refs/refs.h\"\n@@ -29,7 +29,7 @@\n #include \"odb/oid-array.h\"\n #include \"strvec.h\"\n #include \"strmap.h\"\n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-file-convert.h\"\n@@ -39,7 +39,7 @@\n #include \"dir.h\"\n #include \"pack/midx.h\"\n #include \"trace2.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"promisor-remote.h\"\n #include \"pack/pack-mtimes.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/prune.c b/builtin/prune.c\nindex 0adf0f02d1..ba7b1303b3 100644\n--- a/builtin/prune.c\n+++ b/builtin/prune.c\n@@ -7,7 +7,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"pack/reachable.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n@@ -17,7 +17,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n \n static const char * const prune_usage[] = {\n \tN_(\"git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]\"),\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex bc8dcde318..af120a7e1b 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -29,7 +29,7 @@\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n #include \"wt-status.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"sequencer.h\"\n \n /**\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 8f9fdcc79b..a14a31d60e 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -27,8 +27,8 @@\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n #include \"wt-status.h\"\n-#include \"revision.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/commit-reach.h\"\n #include \"rerere.h\"\n #include \"branch.h\"\n #include \"sequencer.h\"\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex f01cc1a188..9a816f1e86 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -4,7 +4,7 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"odb/commit.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"config.h\"\n #include \"connect.h\"\n #include \"connected.h\"\n@@ -32,7 +32,7 @@\n #include \"run-command.h\"\n #include \"pack/server-info.h\"\n #include \"setup.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"sideband.h\"\n #include \"sigchain.h\"\n #include \"string-list.h\"\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex d227104063..d8d1cb2c6a 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -5,7 +5,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"pack/reachable.h\"\n #include \"wildmatch.h\"\n #include \"refs/worktree.h\"\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 9a5df99c11..3f6cee14ff 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -18,7 +18,7 @@\n #include \"refs/refspec.h\"\n #include \"odb/odb.h\"\n #include \"strvec.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"progress.h\"\n \n static const char * const builtin_remote_usage[] = {\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex 5927a0dfdb..aa74f2161a 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -13,7 +13,7 @@\n #include \"pack/prune-packed.h\"\n #include \"promisor-remote.h\"\n #include \"pack/repack.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n \n #define ALL_INTO_ONE 1\n #define LOOSEN_UNREACHABLE 2\ndiff --git a/builtin/replay.c b/builtin/replay.c\nindex 83b136a13e..4f5515a314 100644\n--- a/builtin/replay.c\n+++ b/builtin/replay.c\n@@ -11,7 +11,7 @@\n #include \"parse-options.h\"\n #include \"refs/refs.h\"\n #include \"replay.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n enum ref_action_mode {\n \tREF_ACTION_UPDATE,\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex e052e6c0ba..b296e2cda7 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -13,11 +13,11 @@\n #include \"quote.h\"\n #include \"refs/ref-filter.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"utf8.h\"\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex f843bab823..eed0d0ea0b 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -19,7 +19,7 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"odb/object.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"refs/refs.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex c0e0769aab..21d7b8aa81 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -8,24 +8,24 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"revision.h\"\n-#include \"list-objects.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"odb/object.h\"\n #include \"odb/object-name.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"parse-options.h\"\n-#include \"log-tree.h\"\n-#include \"graph.h\"\n-#include \"bisect.h\"\n+#include \"revision/log-tree.h\"\n+#include \"revision/graph.h\"\n+#include \"revision/bisect.h\"\n #include \"progress.h\"\n #include \"refs/reflog-walk.h\"\n #include \"odb/oidset.h\"\n #include \"odb/oidmap.h\"\n #include \"pack/packfile.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"quote.h\"\n #include \"strbuf.h\"\n \ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex b95cdac85e..ef4b6795dd 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -10,7 +10,7 @@\n #include \"builtin.h\"\n \n #include \"abspath.h\"\n-#include \"bisect.h\"\n+#include \"revision/bisect.h\"\n #include \"config.h\"\n #include \"odb/commit.h\"\n #include \"environment.h\"\n@@ -26,12 +26,12 @@\n #include \"read-cache-ll.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"split-index.h\"\n #include \"submodule.h\"\n-#include \"commit-reach.h\"\n-#include \"shallow.h\"\n+#include \"revision/commit-reach.h\"\n+#include \"revision/shallow.h\"\n #include \"odb/object-file-convert.h\"\n \n #define DO_REVS\t\t1\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex a939c590fb..ae3f186f12 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -6,7 +6,7 @@\n #include \"diff/diff.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"rerere.h\"\n #include \"sequencer.h\"\n #include \"branch.h\"\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex 59be73a372..2fe86d6f46 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -7,7 +7,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"string-list.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"utf8.h\"\n #include \"mailmap.h\"\n #include \"setup.h\"\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 4da3330a26..8db11f6e4c 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -7,7 +7,7 @@\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"refs/refs.h\"\n #include \"color.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex c5e100746d..6458e3a2d6 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -22,10 +22,10 @@\n #include \"read-cache.h\"\n #include \"repository.h\"\n #include \"rerere.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"sparse-index.h\"\n-#include \"log-tree.h\"\n+#include \"revision/log-tree.h\"\n #include \"diff/diffcore.h\"\n #include \"refs/reflog.h\"\n #include \"refs/reflog-walk.h\"\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 5711a79428..0e061827f9 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -23,7 +23,7 @@\n #include \"remote.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"diff/diffcore.h\"\n #include \"diff/diff.h\"\n #include \"odb/object-file.h\"\n@@ -32,7 +32,7 @@\n #include \"odb/source.h\"\n #include \"advice.h\"\n #include \"branch.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"wildmatch.h\"\n #include \"strbuf.h\"\n #include \"url.h\"\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex c04c2cc207..46df0f7c27 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -24,7 +24,7 @@\n #include \"odb/tag.h\"\n #include \"parse-options.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"gpg-interface.h\"\n #include \"odb/oid-array.h\"\n #include \"column.h\"\ndiff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c\nindex 93caca20ef..fb724e46ea 100644\n--- a/builtin/unpack-objects.c\n+++ b/builtin/unpack-objects.c\n@@ -18,7 +18,7 @@\n #include \"odb/replace-object.h\"\n #include \"strbuf.h\"\n #include \"progress.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n #include \"odb/fsck.h\"\n #include \"pack/packfile.h\"\n \ndiff --git a/bundle.c b/bundle.c\nindex 54ec76866b..dc50661bdd 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -12,12 +12,12 @@\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n-#include \"list-objects.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects.h\"\n #include \"run-command.h\"\n #include \"refs/refs.h\"\n #include \"strvec.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"connected.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/bundle.h b/bundle.h\nindex d664b2f2d6..fc78766902 100644\n--- a/bundle.h\n+++ b/bundle.h\n@@ -3,7 +3,7 @@\n \n #include \"strvec.h\"\n #include \"string-list.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n \n struct bundle_header {\n \tunsigned version;\ndiff --git a/chdir-notify.c b/chdir-notify.c\nindex 1237a45e2e..3d1d5ee3d2 100644\n--- a/chdir-notify.c\n+++ b/chdir-notify.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"chdir-notify.h\"\n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"path.h\"\n #include \"strbuf.h\"\n #include \"trace.h\"\ndiff --git a/diff/combine-diff.c b/diff/combine-diff.c\nindex 44f0eb5442..8e03062f39 100644\n--- a/diff/combine-diff.c\n+++ b/diff/combine-diff.c\n@@ -13,12 +13,12 @@\n #include \"quote.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"xdiff/xmacros.h\"\n-#include \"log-tree.h\"\n+#include \"revision/log-tree.h\"\n #include \"refs/refs.h\"\n #include \"odb/tree.h\"\n #include \"diff/userdiff.h\"\n #include \"odb/oid-array.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n static int compare_paths(const struct combine_diff_path *one,\n \t\t\t  const struct diff_filespec *two)\ndiff --git a/diff/diff-lib.c b/diff/diff-lib.c\nindex fb0514dcb0..d48196f7c7 100644\n--- a/diff/diff-lib.c\n+++ b/diff/diff-lib.c\n@@ -14,7 +14,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"read-cache.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n #include \"refs/refs.h\"\n@@ -24,7 +24,7 @@\n #include \"trace.h\"\n #include \"dir.h\"\n #include \"fsmonitor.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n \n /*\n  * diff-files\ndiff --git a/diff/diff-merges.c b/diff/diff-merges.c\nindex ca3cbf7767..8300d21a4f 100644\n--- a/diff/diff-merges.c\n+++ b/diff/diff-merges.c\n@@ -2,7 +2,7 @@\n #include \"diff/diff-merges.h\"\n \n #include \"gettext.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n typedef void (*diff_merges_setup_func_t)(struct rev_info *);\n static void set_separate(struct rev_info *revs);\ndiff --git a/diff/diff-no-index.c b/diff/diff-no-index.c\nindex 5712e5474d..19cb90d121 100644\n--- a/diff/diff-no-index.c\n+++ b/diff/diff-no-index.c\n@@ -13,7 +13,7 @@\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n #include \"gettext.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"parse-options.h\"\n #include \"pathspec.h\"\n #include \"string-list.h\"\ndiff --git a/diff/diff.c b/diff/diff.c\nindex 9062f96b7b..2b87f27238 100644\n--- a/diff/diff.c\n+++ b/diff/diff.c\n@@ -13,7 +13,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"tempfile.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"quote.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n@@ -32,7 +32,7 @@\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"odb/tmp-objdir.h\"\n-#include \"graph.h\"\n+#include \"revision/graph.h\"\n #include \"odb/oid-array.h\"\n #include \"pack/packfile.h\"\n #include \"pager.h\"\ndiff --git a/diff/diffcore-pickaxe.c b/diff/diffcore-pickaxe.c\nindex e7289d9a26..d851afe3db 100644\n--- a/diff/diffcore-pickaxe.c\n+++ b/diff/diffcore-pickaxe.c\n@@ -11,7 +11,7 @@\n #include \"diff/xdiff-interface.h\"\n #include \"kwset.h\"\n #include \"odb/oidset.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"quote.h\"\n \n typedef int (*pickaxe_fn)(mmfile_t *one, mmfile_t *two,\ndiff --git a/diff/range-diff.c b/diff/range-diff.c\nindex 2177b8ba2d..281c043480 100644\n--- a/diff/range-diff.c\n+++ b/diff/range-diff.c\n@@ -15,11 +15,11 @@\n #include \"diff/diffcore.h\"\n #include \"odb/commit.h\"\n #include \"pager.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"repository.h\"\n #include \"diff/userdiff.h\"\n #include \"apply.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n struct patch_util {\n \t/* For the search for an exact match */\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex b19cb3239e..d27a28502f 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -30,8 +30,8 @@\n #include \"connected.h\"\n #include \"fetch-negotiator.h\"\n #include \"odb/fsck.h\"\n-#include \"shallow.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/shallow.h\"\n+#include \"revision/commit-reach.h\"\n #include \"pack/commit-graph.h\"\n #include \"sigchain.h\"\n #include \"mergesort.h\"\ndiff --git a/fetch-pack.h b/fetch-pack.h\nindex 14e4ba1079..42922616be 100644\n--- a/fetch-pack.h\n+++ b/fetch-pack.h\n@@ -3,7 +3,7 @@\n \n #include \"string-list.h\"\n #include \"protocol.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"odb/oidset.h\"\n \n struct oid_array;\ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex 34f769ae9f..4993cc4a02 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -10,12 +10,12 @@\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"hex.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"odb/tag.h\"\n #include \"string-list.h\"\n #include \"branch.h\"\n #include \"fmt-merge-msg.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"gpg-interface.h\"\n #include \"wildmatch.h\"\n \ndiff --git a/git.c b/git.c\nindex 619219afef..9dace05858 100644\n--- a/git.c\n+++ b/git.c\n@@ -14,7 +14,7 @@\n #include \"odb/replace-object.h\"\n #include \"setup.h\"\n #include \"attr.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n \ndiff --git a/grep.c b/grep.c\nindex 88c87ba1c9..c4eb18ccd7 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -6,7 +6,7 @@\n #include \"grep.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"diff/userdiff.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"diff/diff.h\"\ndiff --git a/http-push.c b/http-push.c\nindex 6d38410ccb..d45daee9e0 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -9,9 +9,9 @@\n #include \"odb/blob.h\"\n #include \"http.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"remote.h\"\n-#include \"list-objects.h\"\n+#include \"revision/list-objects.h\"\n #include \"setup.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n@@ -21,7 +21,7 @@\n #include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n \n #ifdef EXPAT_NEEDS_XMLPARSE_H\n #include <xmlparse.h>\ndiff --git a/http-walker.c b/http-walker.c\nindex e73c3677d1..8df0c5329b 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -6,7 +6,7 @@\n #include \"hex.h\"\n #include \"walker.h\"\n #include \"http.h\"\n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"transport.h\"\n #include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\ndiff --git a/merge-ort.c b/merge-ort.c\nindex 61fb855500..71274c24bf 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -25,7 +25,7 @@\n #include \"attr.h\"\n #include \"cache-tree.h\"\n #include \"odb/commit.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n@@ -45,7 +45,7 @@\n #include \"promisor-remote.h\"\n #include \"read-cache-ll.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"sparse-index.h\"\n #include \"strmap.h\"\n #include \"trace2.h\"\ndiff --git a/meson.build b/meson.build\nindex 87060ff883..65be53078d 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -319,8 +319,8 @@ libgit_sources = [\n   'archive.c',\n   'attr.c',\n   'base85.c',\n-  'bisect.c',\n-  'blame.c',\n+  'revision/bisect.c',\n+  'revision/blame.c',\n   'odb/blob.c',\n   'pack/bloom.c',\n   'branch.c',\n@@ -335,7 +335,7 @@ libgit_sources = [\n   'column.c',\n   'diff/combine-diff.c',\n   'pack/commit-graph.c',\n-  'commit-reach.c',\n+  'revision/commit-reach.c',\n   'odb/commit.c',\n   'common-exit.c',\n   'common-init.c',\n@@ -349,7 +349,7 @@ libgit_sources = [\n   'csum-file.c',\n   'ctype.c',\n   'date.c',\n-  'decorate.c',\n+  'revision/decorate.c',\n   'pack/delta-islands.c',\n   'diagnose.c',\n   'pack/diff-delta.c',\n@@ -384,7 +384,7 @@ libgit_sources = [\n   'gettext.c',\n   'git-zlib.c',\n   'gpg-interface.c',\n-  'graph.c',\n+  'revision/graph.c',\n   'grep.c',\n   'odb/hash-lookup.c',\n   'odb/hash.c',\n@@ -397,14 +397,14 @@ libgit_sources = [\n   'json-writer.c',\n   'kwset.c',\n   'levenshtein.c',\n-  'line-log.c',\n-  'line-range.c',\n+  'revision/line-log.c',\n+  'revision/line-range.c',\n   'linear-assignment.c',\n-  'list-objects-filter-options.c',\n-  'list-objects-filter.c',\n-  'list-objects.c',\n+  'revision/list-objects-filter-options.c',\n+  'revision/list-objects-filter.c',\n+  'revision/list-objects.c',\n   'lockfile.c',\n-  'log-tree.c',\n+  'revision/log-tree.c',\n   'odb/loose.c',\n   'refs/ls-refs.c',\n   'mailinfo.c',\n@@ -468,7 +468,7 @@ libgit_sources = [\n   'pathspec.c',\n   'pkt-line.c',\n   'preload-index.c',\n-  'pretty.c',\n+  'revision/pretty.c',\n   'prio-queue.c',\n   'progress.c',\n   'promisor-remote.c',\n@@ -522,14 +522,14 @@ libgit_sources = [\n   'rerere.c',\n   'reset.c',\n   'resolve-undo.c',\n-  'revision.c',\n+  'revision/revision.c',\n   'run-command.c',\n   'send-pack.c',\n   'sequencer.c',\n   'serve.c',\n   'pack/server-info.c',\n   'setup.c',\n-  'shallow.c',\n+  'revision/shallow.c',\n   'sideband.c',\n   'sigchain.c',\n   'sparse-index.c',\ndiff --git a/notes-cache.c b/notes-cache.c\nindex 02fb418c6f..1e734c5c19 100644\n--- a/notes-cache.c\n+++ b/notes-cache.c\n@@ -4,7 +4,7 @@\n #include \"notes-cache.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"repository.h\"\n #include \"odb/commit.h\"\n #include \"refs/refs.h\"\ndiff --git a/notes-merge.c b/notes-merge.c\nindex ff14b7dfcc..53f42ba863 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -22,7 +22,7 @@\n #include \"strbuf.h\"\n #include \"trace.h\"\n #include \"notes-utils.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n \n struct notes_merge_pair {\n \tstruct object_id obj, base, local, remote;\ndiff --git a/odb/commit.c b/odb/commit.c\nindex b78cd28013..1b0703a9ef 100644\n--- a/odb/commit.c\n+++ b/odb/commit.c\n@@ -12,7 +12,7 @@\n #include \"odb/odb.h\"\n #include \"utf8.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"notes.h\"\n #include \"odb/alloc.h\"\n #include \"gpg-interface.h\"\n@@ -23,9 +23,9 @@\n #include \"wt-status.h\"\n #include \"advice.h\"\n #include \"refs/refs.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"setup.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"odb/tree.h\"\n #include \"hook.h\"\n #include \"parse.h\"\ndiff --git a/odb/object-name.c b/odb/object-name.c\nindex ff61d55590..825fc717bf 100644\n--- a/odb/object-name.c\n+++ b/odb/object-name.c\n@@ -17,13 +17,13 @@\n #include \"dir.h\"\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"read-cache-ll.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n #include \"pack/midx.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"date.h\"\n #include \"odb/object-file-convert.h\"\n #include \"prio-queue.h\"\ndiff --git a/odb/source-packed.c b/odb/source-packed.c\nindex 0e391f6fcf..c1e2756471 100644\n--- a/odb/source-packed.c\n+++ b/odb/source-packed.c\n@@ -3,7 +3,7 @@\n #include \"chdir-notify.h\"\n #include \"dir.h\"\n #include \"git-zlib.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"mergesort.h\"\n #include \"pack/midx.h\"\n #include \"odb/source-packed.h\"\ndiff --git a/pack/commit-graph.c b/pack/commit-graph.c\nindex afc04d74a5..d5537a9ee8 100644\n--- a/pack/commit-graph.c\n+++ b/pack/commit-graph.c\n@@ -22,7 +22,7 @@\n #include \"progress.h\"\n #include \"pack/bloom.h\"\n #include \"odb/commit-slab.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"json-writer.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\ndiff --git a/pack/midx-write.c b/pack/midx-write.c\nindex 1f8f24410a..1d5a6525a6 100644\n--- a/pack/midx-write.c\n+++ b/pack/midx-write.c\n@@ -13,8 +13,8 @@\n #include \"pack/chunk-format.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n-#include \"list-objects.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects.h\"\n #include \"path.h\"\n #include \"pack/pack-revindex.h\"\n \ndiff --git a/pack/pack-bitmap-write.c b/pack/pack-bitmap-write.c\nindex 22ee370bde..3b7b41c5d7 100644\n--- a/pack/pack-bitmap-write.c\n+++ b/pack/pack-bitmap-write.c\n@@ -7,14 +7,14 @@\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"progress.h\"\n #include \"pack/pack.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"odb/hash-lookup.h\"\n #include \"pack/pack-objects.h\"\n #include \"path.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"prio-queue.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\ndiff --git a/pack/pack-bitmap.c b/pack/pack-bitmap.c\nindex 3adb5d0563..7cd24a37f5 100644\n--- a/pack/pack-bitmap.c\n+++ b/pack/pack-bitmap.c\n@@ -7,9 +7,9 @@\n #include \"strbuf.h\"\n #include \"odb/tag.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"progress.h\"\n-#include \"list-objects.h\"\n+#include \"revision/list-objects.h\"\n #include \"pack/pack.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"pack/pack-revindex.h\"\n@@ -18,7 +18,7 @@\n #include \"repository.h\"\n #include \"trace2.h\"\n #include \"odb/odb.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"pack/midx.h\"\n #include \"config.h\"\n #include \"pack/pseudo-merge.h\"\ndiff --git a/pack/packfile.c b/pack/packfile.c\nindex 0426bee827..72252faffe 100644\n--- a/pack/packfile.c\n+++ b/pack/packfile.c\n@@ -4,7 +4,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"pack/pack.h\"\n #include \"repository.h\"\n #include \"dir.h\"\ndiff --git a/pack/packfile.h b/pack/packfile.h\nindex 55dc02539b..1e6e69fb77 100644\n--- a/pack/packfile.h\n+++ b/pack/packfile.h\n@@ -1,7 +1,7 @@\n #ifndef PACKFILE_H\n #define PACKFILE_H\n \n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"odb/object.h\"\n #include \"odb/odb.h\"\n #include \"odb/source-files.h\"\ndiff --git a/pack/reachable.c b/pack/reachable.c\nindex 7989f7327a..f61525308e 100644\n--- a/pack/reachable.c\n+++ b/pack/reachable.c\n@@ -7,11 +7,11 @@\n #include \"odb/commit.h\"\n #include \"odb/blob.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"pack/reachable.h\"\n #include \"cache-tree.h\"\n #include \"progress.h\"\n-#include \"list-objects.h\"\n+#include \"revision/list-objects.h\"\n #include \"pack/packfile.h\"\n #include \"refs/worktree.h\"\n #include \"odb/object-file.h\"\ndiff --git a/pack/repack.h b/pack/repack.h\nindex f9fbc895f0..6248e7deac 100644\n--- a/pack/repack.h\n+++ b/pack/repack.h\n@@ -1,7 +1,7 @@\n #ifndef REPACK_H\n #define REPACK_H\n \n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"string-list.h\"\n \n struct pack_objects_args {\ndiff --git a/path-walk.c b/path-walk.c\nindex ed4d3211d2..4b8ddb2a28 100644\n--- a/path-walk.c\n+++ b/path-walk.c\n@@ -8,8 +8,8 @@\n #include \"dir.h\"\n #include \"hashmap.h\"\n #include \"hex.h\"\n-#include \"list-objects.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"odb/object.h\"\n@@ -17,7 +17,7 @@\n #include \"path.h\"\n #include \"prio-queue.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\n #include \"odb/tag.h\"\ndiff --git a/read-cache.c b/read-cache.c\nindex 5bca3fda12..a970eb1b6a 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -34,7 +34,7 @@\n #include \"read-cache.h\"\n #include \"repository.h\"\n #include \"resolve-undo.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\n #include \"varint.h\"\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 35acc13ccc..a792297d8f 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -25,7 +25,7 @@\n #include \"refs/worktree.h\"\n #include \"../wrapper.h\"\n #include \"../write-or-die.h\"\n-#include \"../revision.h\"\n+#include \"revision/revision.h\"\n #include <wildmatch.h>\n \n /* So that we can drop `USE_THE_REPOSITORY_VARIABLE`. */\ndiff --git a/refs/pack-refs.c b/refs/pack-refs.c\nindex c9f36872cc..d6c41d64f1 100644\n--- a/refs/pack-refs.c\n+++ b/refs/pack-refs.c\n@@ -4,7 +4,7 @@\n #include \"refs/pack-refs.h\"\n #include \"parse-options.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n int pack_refs_core(int argc,\n \t\t   const char **argv,\ndiff --git a/refs/ref-filter.c b/refs/ref-filter.c\nindex e3de16b7a7..7635e13f88 100644\n--- a/refs/ref-filter.c\n+++ b/refs/ref-filter.c\n@@ -24,13 +24,13 @@\n #include \"odb/tag.h\"\n #include \"quote.h\"\n #include \"refs/ref-filter.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"utf8.h\"\n #include \"versioncmp.h\"\n #include \"trailer.h\"\n #include \"wt-status.h\"\n #include \"odb/commit-slab.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"refs/worktree.h\"\n #include \"hashmap.h\"\n \ndiff --git a/refs/ref-filter.h b/refs/ref-filter.h\nindex 11180f9570..0f4f80ec20 100644\n--- a/refs/ref-filter.h\n+++ b/refs/ref-filter.h\n@@ -6,7 +6,7 @@\n #include \"odb/commit.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n \n /* Quoting styles */\n #define QUOTE_NONE 0\ndiff --git a/refs/reflog-walk.c b/refs/reflog-walk.c\nindex f9eee9a76f..4c321fb3a8 100644\n--- a/refs/reflog-walk.c\n+++ b/refs/reflog-walk.c\n@@ -5,7 +5,7 @@\n #include \"refs/refs.h\"\n #include \"diff/diff.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"string-list.h\"\n #include \"refs/reflog-walk.h\"\n \ndiff --git a/refs/reflog.c b/refs/reflog.c\nindex 751485f885..1050ae6301 100644\n--- a/refs/reflog.c\n+++ b/refs/reflog.c\n@@ -9,7 +9,7 @@\n #include \"odb/odb.h\"\n #include \"refs/reflog.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"wildmatch.h\"\ndiff --git a/remote.c b/remote.c\nindex c619009d30..8a65967fb0 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -17,12 +17,12 @@\n #include \"path.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"dir.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"advice.h\"\n #include \"connect.h\"\n #include \"parse-options.h\"\ndiff --git a/replay.c b/replay.c\nindex 8dd7b99502..6922a1f137 100644\n--- a/replay.c\n+++ b/replay.c\n@@ -7,7 +7,7 @@\n #include \"odb/object-name.h\"\n #include \"refs/refs.h\"\n #include \"replay.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"sequencer.h\"\n #include \"strmap.h\"\n #include \"odb/tree.h\"\ndiff --git a/bisect.c b/revision/bisect.c\nsimilarity index 99%\nrename from bisect.c\nrename to revision/bisect.c\nindex 1f8d81b894..696e365310 100644\n--- a/bisect.c\n+++ b/revision/bisect.c\n@@ -8,17 +8,17 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"refs/refs.h\"\n-#include \"list-objects.h\"\n+#include \"revision/list-objects.h\"\n #include \"quote.h\"\n #include \"run-command.h\"\n-#include \"log-tree.h\"\n-#include \"bisect.h\"\n+#include \"revision/log-tree.h\"\n+#include \"revision/bisect.h\"\n #include \"odb/oid-array.h\"\n #include \"strvec.h\"\n #include \"odb/commit-slab.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\ndiff --git a/bisect.h b/revision/bisect.h\nsimilarity index 100%\nrename from bisect.h\nrename to revision/bisect.h\ndiff --git a/blame.c b/revision/blame.c\nsimilarity index 99%\nrename from blame.c\nrename to revision/blame.c\nindex c736441f18..54284ed8da 100644\n--- a/blame.c\n+++ b/revision/blame.c\n@@ -14,11 +14,11 @@\n #include \"hex.h\"\n #include \"path.h\"\n #include \"read-cache.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"odb/tag.h\"\n #include \"trace2.h\"\n-#include \"blame.h\"\n+#include \"revision/blame.h\"\n #include \"odb/alloc.h\"\n #include \"odb/commit-slab.h\"\n #include \"pack/bloom.h\"\ndiff --git a/blame.h b/revision/blame.h\nsimilarity index 100%\nrename from blame.h\nrename to revision/blame.h\ndiff --git a/commit-reach.c b/revision/commit-reach.c\nsimilarity index 99%\nrename from commit-reach.c\nrename to revision/commit-reach.c\nindex 0b59c9ba29..e1e1b71819 100644\n--- a/commit-reach.c\n+++ b/revision/commit-reach.c\n@@ -3,13 +3,13 @@\n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n #include \"pack/commit-graph.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n #include \"hex.h\"\n #include \"prio-queue.h\"\n #include \"refs/ref-filter.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"odb/tag.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"ewah/ewok.h\"\n \n /* Remember to update object flag allocation in object.h */\ndiff --git a/commit-reach.h b/revision/commit-reach.h\nsimilarity index 100%\nrename from commit-reach.h\nrename to revision/commit-reach.h\ndiff --git a/decorate.c b/revision/decorate.c\nsimilarity index 98%\nrename from decorate.c\nrename to revision/decorate.c\nindex 262c9198eb..eeba03ec83 100644\n--- a/decorate.c\n+++ b/revision/decorate.c\n@@ -5,7 +5,7 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/object.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n \n static unsigned int hash_obj(const struct object *obj, unsigned int n)\n {\ndiff --git a/decorate.h b/revision/decorate.h\nsimilarity index 100%\nrename from decorate.h\nrename to revision/decorate.h\ndiff --git a/graph.c b/revision/graph.c\nsimilarity index 99%\nrename from graph.c\nrename to revision/graph.c\nindex 66c2be423e..c6f10398a2 100644\n--- a/graph.c\n+++ b/revision/graph.c\n@@ -5,8 +5,8 @@\n #include \"config.h\"\n #include \"odb/commit.h\"\n #include \"color.h\"\n-#include \"graph.h\"\n-#include \"revision.h\"\n+#include \"revision/graph.h\"\n+#include \"revision/revision.h\"\n #include \"strvec.h\"\n \n /* Internal API */\ndiff --git a/graph.h b/revision/graph.h\nsimilarity index 100%\nrename from graph.h\nrename to revision/graph.h\ndiff --git a/line-log.c b/revision/line-log.c\nsimilarity index 99%\nrename from line-log.c\nrename to revision/line-log.c\nindex 78697cb377..3da7af2340 100644\n--- a/line-log.c\n+++ b/revision/line-log.c\n@@ -2,18 +2,18 @@\n \n #include \"git-compat-util.h\"\n #include \"diff/diffcore.h\"\n-#include \"line-range.h\"\n+#include \"revision/line-range.h\"\n #include \"hex.h\"\n #include \"odb/tag.h\"\n #include \"odb/tree.h\"\n #include \"diff/diff.h\"\n #include \"odb/commit.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"strbuf.h\"\n-#include \"line-log.h\"\n+#include \"revision/line-log.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"pack/bloom.h\"\ndiff --git a/line-log.h b/revision/line-log.h\nsimilarity index 100%\nrename from line-log.h\nrename to revision/line-log.h\ndiff --git a/line-range.c b/revision/line-range.c\nsimilarity index 99%\nrename from line-range.c\nrename to revision/line-range.c\nindex 1dbf761ecc..419d90d863 100644\n--- a/line-range.c\n+++ b/revision/line-range.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"line-range.h\"\n+#include \"revision/line-range.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"diff/userdiff.h\"\n \ndiff --git a/line-range.h b/revision/line-range.h\nsimilarity index 100%\nrename from line-range.h\nrename to revision/line-range.h\ndiff --git a/list-objects-filter-options.c b/revision/list-objects-filter-options.c\nsimilarity index 99%\nrename from list-objects-filter-options.c\nrename to revision/list-objects-filter-options.c\nindex bc5d98f9e6..6730808896 100644\n--- a/list-objects-filter-options.c\n+++ b/revision/list-objects-filter-options.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n #include \"gettext.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"promisor-remote.h\"\n #include \"trace.h\"\n #include \"url.h\"\ndiff --git a/list-objects-filter-options.h b/revision/list-objects-filter-options.h\nsimilarity index 100%\nrename from list-objects-filter-options.h\nrename to revision/list-objects-filter-options.h\ndiff --git a/list-objects-filter.c b/revision/list-objects-filter.c\nsimilarity index 99%\nrename from list-objects-filter.c\nrename to revision/list-objects-filter.c\nindex a011cef0b5..0ea4cb826e 100644\n--- a/list-objects-filter.c\n+++ b/revision/list-objects-filter.c\n@@ -6,9 +6,9 @@\n #include \"hex.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n-#include \"list-objects-filter.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects-filter.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"odb/oidmap.h\"\n #include \"odb/oidset.h\"\n #include \"odb/object-name.h\"\ndiff --git a/list-objects-filter.h b/revision/list-objects-filter.h\nsimilarity index 100%\nrename from list-objects-filter.h\nrename to revision/list-objects-filter.h\ndiff --git a/list-objects.c b/revision/list-objects.c\nsimilarity index 98%\nrename from list-objects.c\nrename to revision/list-objects.c\nindex 6b67f0f927..fdf98b629f 100644\n--- a/list-objects.c\n+++ b/revision/list-objects.c\n@@ -9,10 +9,10 @@\n #include \"odb/blob.h\"\n #include \"diff/diff.h\"\n #include \"odb/tree-walk.h\"\n-#include \"revision.h\"\n-#include \"list-objects.h\"\n-#include \"list-objects-filter.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects.h\"\n+#include \"revision/list-objects-filter.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"trace.h\"\ndiff --git a/list-objects.h b/revision/list-objects.h\nsimilarity index 100%\nrename from list-objects.h\nrename to revision/list-objects.h\ndiff --git a/list.h b/revision/list.h\nsimilarity index 100%\nrename from list.h\nrename to revision/list.h\ndiff --git a/log-tree.c b/revision/log-tree.c\nsimilarity index 99%\nrename from log-tree.c\nrename to revision/log-tree.c\nindex ddeafedb45..e555d07072 100644\n--- a/log-tree.c\n+++ b/revision/log-tree.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"odb/commit-slab.h\"\n #include \"config.h\"\n #include \"diff/diff.h\"\n@@ -15,18 +15,18 @@\n #include \"odb/tmp-objdir.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"graph.h\"\n-#include \"log-tree.h\"\n+#include \"revision/graph.h\"\n+#include \"revision/log-tree.h\"\n #include \"merge-ort.h\"\n #include \"refs/reflog-walk.h\"\n #include \"refs/refs.h\"\n #include \"odb/replace-object.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"string-list.h\"\n #include \"color.h\"\n #include \"gpg-interface.h\"\n #include \"sequencer.h\"\n-#include \"line-log.h\"\n+#include \"revision/line-log.h\"\n #include \"help.h\"\n #include \"diff/range-diff.h\"\n #include \"strmap.h\"\ndiff --git a/log-tree.h b/revision/log-tree.h\nsimilarity index 100%\nrename from log-tree.h\nrename to revision/log-tree.h\ndiff --git a/pretty.c b/revision/pretty.c\nsimilarity index 99%\nrename from pretty.c\nrename to revision/pretty.c\nindex 3444617506..cdf63ded49 100644\n--- a/pretty.c\n+++ b/revision/pretty.c\n@@ -11,10 +11,10 @@\n #include \"utf8.h\"\n #include \"diff/diff.h\"\n #include \"pager.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"string-list.h\"\n #include \"mailmap.h\"\n-#include \"log-tree.h\"\n+#include \"revision/log-tree.h\"\n #include \"notes.h\"\n #include \"color.h\"\n #include \"refs/reflog-walk.h\"\ndiff --git a/pretty.h b/revision/pretty.h\nsimilarity index 100%\nrename from pretty.h\nrename to revision/pretty.h\ndiff --git a/revision.c b/revision/revision.c\nsimilarity index 99%\nrename from revision.c\nrename to revision/revision.c\nindex 249a1736fd..9a19a5654a 100644\n--- a/revision.c\n+++ b/revision/revision.c\n@@ -17,20 +17,20 @@\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"refs/refs.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"repository.h\"\n-#include \"graph.h\"\n+#include \"revision/graph.h\"\n #include \"grep.h\"\n #include \"refs/reflog-walk.h\"\n #include \"diff/patch-ids.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n #include \"string-list.h\"\n-#include \"line-log.h\"\n-#include \"log-tree.h\"\n+#include \"revision/line-log.h\"\n+#include \"revision/log-tree.h\"\n #include \"mailmap.h\"\n #include \"odb/commit-slab.h\"\n #include \"cache-tree.h\"\n-#include \"bisect.h\"\n+#include \"revision/bisect.h\"\n #include \"pack/packfile.h\"\n #include \"refs/worktree.h\"\n #include \"path.h\"\n@@ -39,14 +39,14 @@\n #include \"sparse-index.h\"\n #include \"strvec.h\"\n #include \"trace2.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"pack/commit-graph.h\"\n #include \"prio-queue.h\"\n #include \"hashmap.h\"\n #include \"utf8.h\"\n #include \"pack/bloom.h\"\n #include \"json-writer.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"resolve-undo.h\"\n #include \"parse-options.h\"\n #include \"wildmatch.h\"\ndiff --git a/revision.h b/revision/revision.h\nsimilarity index 99%\nrename from revision.h\nrename to revision/revision.h\nindex 64d9a47091..9cb9419b22 100644\n--- a/revision.h\n+++ b/revision/revision.h\n@@ -6,12 +6,12 @@\n #include \"notes.h\"\n #include \"odb/object-name.h\"\n #include \"odb/oidset.h\"\n-#include \"pretty.h\"\n+#include \"revision/pretty.h\"\n #include \"diff/diff.h\"\n #include \"odb/commit-slab-decl.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n #include \"ident.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"prio-queue.h\"\n #include \"strvec.h\"\n \ndiff --git a/shallow.c b/revision/shallow.c\nsimilarity index 99%\nrename from shallow.c\nrename to revision/shallow.c\nindex fa16834aff..51ba602971 100644\n--- a/shallow.c\n+++ b/revision/shallow.c\n@@ -13,11 +13,11 @@\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"odb/commit-slab.h\"\n-#include \"list-objects.h\"\n-#include \"commit-reach.h\"\n-#include \"shallow.h\"\n+#include \"revision/list-objects.h\"\n+#include \"revision/commit-reach.h\"\n+#include \"revision/shallow.h\"\n #include \"statinfo.h\"\n #include \"trace.h\"\n \ndiff --git a/shallow.h b/revision/shallow.h\nsimilarity index 100%\nrename from shallow.h\nrename to revision/shallow.h\ndiff --git a/send-pack.c b/send-pack.c\nindex 97dcfac586..f59686f971 100644\n--- a/send-pack.c\n+++ b/send-pack.c\n@@ -15,7 +15,7 @@\n #include \"version.h\"\n #include \"odb/oid-array.h\"\n #include \"gpg-interface.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"parse-options.h\"\n #include \"trace2.h\"\n #include \"write-or-die.h\"\ndiff --git a/sequencer.c b/sequencer.c\nindex 551e4529c4..d5b1eb9719 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -24,7 +24,7 @@\n #include \"cache-tree.h\"\n #include \"diff/diff.h\"\n #include \"path.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"rerere.h\"\n #include \"merge.h\"\n #include \"merge-ort.h\"\n@@ -34,7 +34,7 @@\n #include \"strvec.h\"\n #include \"quote.h\"\n #include \"trailer.h\"\n-#include \"log-tree.h\"\n+#include \"revision/log-tree.h\"\n #include \"wt-status.h\"\n #include \"hashmap.h\"\n #include \"notes-utils.h\"\n@@ -44,7 +44,7 @@\n #include \"odb/oidset.h\"\n #include \"odb/commit-slab.h\"\n #include \"alias.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"rebase-interactive.h\"\n #include \"reset.h\"\n #include \"branch.h\"\ndiff --git a/setup.c b/setup.c\nindex 925a600dba..62fbda948d 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -14,7 +14,7 @@\n #include \"config.h\"\n #include \"dir.h\"\n #include \"setup.h\"\n-#include \"shallow.h\"\n+#include \"revision/shallow.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"chdir-notify.h\"\ndiff --git a/submodule.c b/submodule.c\nindex a9137aa180..16f4d30b82 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -13,7 +13,7 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"run-command.h\"\n #include \"diff/diffcore.h\"\n #include \"refs/refs.h\"\n@@ -28,7 +28,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"read-cache-ll.h\"\n #include \"setup.h\"\n #include \"advice.h\"\ndiff --git a/t/helper/test-path-walk.c b/t/helper/test-path-walk.c\nindex f41c6be2c6..71d052d504 100644\n--- a/t/helper/test-path-walk.c\n+++ b/t/helper/test-path-walk.c\n@@ -4,11 +4,11 @@\n #include \"dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"odb/object-name.h\"\n #include \"odb/object.h\"\n-#include \"pretty.h\"\n-#include \"revision.h\"\n+#include \"revision/pretty.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"parse-options.h\"\n #include \"strbuf.h\"\ndiff --git a/t/helper/test-reach.c b/t/helper/test-reach.c\nindex df1c677b9f..7f00cc7d9c 100644\n--- a/t/helper/test-reach.c\n+++ b/t/helper/test-reach.c\n@@ -2,7 +2,7 @@\n \n #include \"test-tool.h\"\n #include \"odb/commit.h\"\n-#include \"commit-reach.h\"\n+#include \"revision/commit-reach.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex 8c2fb0aad7..582e8b4d97 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -9,7 +9,7 @@\n #include \"path.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n \n struct flag_definition {\n \tconst char *name;\ndiff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c\nindex 7c66b8566f..57e0bcea63 100644\n--- a/t/helper/test-revision-walking.c\n+++ b/t/helper/test-revision-walking.c\n@@ -13,10 +13,10 @@\n #include \"test-tool.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"line-log.h\"\n+#include \"revision/line-log.h\"\n #include \"odb/object-name.h\"\n #include \"repository.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n \ndiff --git a/t/unit-tests/u-example-decorate.c b/t/unit-tests/u-example-decorate.c\nindex 2f01340c21..85d0277ee2 100644\n--- a/t/unit-tests/u-example-decorate.c\n+++ b/t/unit-tests/u-example-decorate.c\n@@ -2,7 +2,7 @@\n \n #include \"unit-test.h\"\n #include \"odb/object.h\"\n-#include \"decorate.h\"\n+#include \"revision/decorate.h\"\n #include \"repository.h\"\n \n struct test_vars {\ndiff --git a/t/unit-tests/u-list-objects-filter-options.c b/t/unit-tests/u-list-objects-filter-options.c\nindex f7d73701b5..cbcae66fa5 100644\n--- a/t/unit-tests/u-list-objects-filter-options.c\n+++ b/t/unit-tests/u-list-objects-filter-options.c\n@@ -1,5 +1,5 @@\n #include \"unit-test.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"strbuf.h\"\n \n /* Helper to test gently_parse_list_objects_filter() */\ndiff --git a/tempfile.h b/tempfile.h\nindex f571f3c609..40d8d230de 100644\n--- a/tempfile.h\n+++ b/tempfile.h\n@@ -1,7 +1,7 @@\n #ifndef TEMPFILE_H\n #define TEMPFILE_H\n \n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"strbuf.h\"\n \n struct repository;\ndiff --git a/trailer.c b/trailer.c\nindex 33fd1df188..7723c5cf52 100644\n--- a/trailer.c\n+++ b/trailer.c\n@@ -9,7 +9,7 @@\n #include \"odb/commit.h\"\n #include \"strvec.h\"\n #include \"trailer.h\"\n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"tempfile.h\"\n \n /*\ndiff --git a/trailer.h b/trailer.h\nindex b49338858c..5afc1775f2 100644\n--- a/trailer.h\n+++ b/trailer.h\n@@ -1,7 +1,7 @@\n #ifndef TRAILER_H\n #define TRAILER_H\n \n-#include \"list.h\"\n+#include \"revision/list.h\"\n #include \"strbuf.h\"\n \n struct trailer_block;\ndiff --git a/transport.h b/transport.h\nindex a7869d18e0..064f4192cf 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -3,7 +3,7 @@\n \n #include \"run-command.h\"\n #include \"remote.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"string-list.h\"\n #include \"connect.h\"\n \ndiff --git a/upload-pack.c b/upload-pack.c\nindex acd381ebf1..09a986e486 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -15,8 +15,8 @@\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"revision.h\"\n-#include \"list-objects-filter-options.h\"\n+#include \"revision/revision.h\"\n+#include \"revision/list-objects-filter-options.h\"\n #include \"run-command.h\"\n #include \"connect.h\"\n #include \"sigchain.h\"\n@@ -27,8 +27,8 @@\n #include \"protocol.h\"\n #include \"upload-pack.h\"\n #include \"pack/commit-graph.h\"\n-#include \"commit-reach.h\"\n-#include \"shallow.h\"\n+#include \"revision/commit-reach.h\"\n+#include \"revision/shallow.h\"\n #include \"trace.h\"\n #include \"write-or-die.h\"\n #include \"json-writer.h\"\ndiff --git a/wt-status.c b/wt-status.c\nindex 28a0c72a51..83fdf5334f 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -14,7 +14,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n-#include \"revision.h\"\n+#include \"revision/revision.h\"\n #include \"diff/diffcore.h\"\n #include \"quote.h\"\n #include \"repository.h\"\n-- \n2.54.0\n\n"},{"id":"551094","messageId":"20260823171915.2662373-13-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 12/14] index: gather the index sources under index/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:56Z","receivedAt":"2026-08-23T17:19:39Z","isPatch":true,"body":"Move the 20 index C sources and 24 headers into index/ as renames.\nRepoint every reference to their old paths to the new ones: the #include\nlines across the tree, the Makefile and meson.build build entries, and\nthe tutorial #include examples.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                  | 88 +++++++++----------\n Documentation/MyFirstContribution.adoc        |  2 +-\n Makefile                                      | 42 ++++-----\n add-interactive.c                             |  6 +-\n add-patch.c                                   |  4 +-\n apply.c                                       | 10 +--\n archive.c                                     |  2 +-\n archive.h                                     |  2 +-\n attr.c                                        |  4 +-\n builtin/add.c                                 |  8 +-\n builtin/am.c                                  |  8 +-\n builtin/backfill.c                            |  2 +-\n builtin/check-ignore.c                        |  4 +-\n builtin/checkout--worker.c                    |  6 +-\n builtin/checkout-index.c                      | 10 +--\n builtin/checkout.c                            | 24 ++---\n builtin/clean.c                               |  6 +-\n builtin/clone.c                               |  6 +-\n builtin/commit.c                              | 14 +--\n builtin/count-objects.c                       |  2 +-\n builtin/describe.c                            |  2 +-\n builtin/diff-files.c                          |  2 +-\n builtin/diff-index.c                          |  2 +-\n builtin/diff-tree.c                           |  2 +-\n builtin/diff.c                                |  4 +-\n builtin/difftool.c                            |  8 +-\n builtin/fast-import.c                         |  4 +-\n builtin/fsck.c                                |  8 +-\n builtin/fsmonitor--daemon.c                   | 10 +--\n builtin/gc.c                                  |  2 +-\n builtin/grep.c                                |  6 +-\n builtin/history.c                             |  8 +-\n builtin/ls-files.c                            | 10 +--\n builtin/ls-tree.c                             |  2 +-\n builtin/merge-index.c                         |  4 +-\n builtin/merge.c                               | 10 +--\n builtin/mv.c                                  | 12 +--\n builtin/pack-objects.c                        |  2 +-\n builtin/prune.c                               |  2 +-\n builtin/pull.c                                |  6 +-\n builtin/push.c                                |  2 +-\n builtin/read-tree.c                           |  8 +-\n builtin/rebase.c                              |  6 +-\n builtin/rerere.c                              |  2 +-\n builtin/reset.c                               |  8 +-\n builtin/rev-parse.c                           |  4 +-\n builtin/rm.c                                  |  8 +-\n builtin/show-branch.c                         |  2 +-\n builtin/sparse-checkout.c                     |  8 +-\n builtin/stash.c                               | 14 +--\n builtin/submodule--helper.c                   | 10 +--\n builtin/update-index.c                        | 18 ++--\n builtin/worktree.c                            |  6 +-\n builtin/write-tree.c                          |  2 +-\n compat/fsmonitor/fsm-health-darwin.c          |  4 +-\n compat/fsmonitor/fsm-health-linux.c           |  4 +-\n compat/fsmonitor/fsm-health-win32.c           |  4 +-\n compat/fsmonitor/fsm-ipc-unix.c               |  6 +-\n compat/fsmonitor/fsm-ipc-win32.c              |  2 +-\n compat/fsmonitor/fsm-listen-darwin.c          |  6 +-\n compat/fsmonitor/fsm-listen-linux.c           |  8 +-\n compat/fsmonitor/fsm-listen-win32.c           |  4 +-\n compat/fsmonitor/fsm-path-utils-darwin.c      |  4 +-\n compat/fsmonitor/fsm-path-utils-linux.c       |  4 +-\n compat/fsmonitor/fsm-path-utils-win32.c       |  4 +-\n compat/fsmonitor/fsm-settings-unix.c          |  8 +-\n compat/fsmonitor/fsm-settings-win32.c         |  6 +-\n compat/mingw.c                                |  4 +-\n config.c                                      |  2 +-\n convert.c                                     |  2 +-\n diagnose.c                                    |  2 +-\n diff/diff-lib.c                               | 12 +--\n diff/diff-no-index.c                          |  4 +-\n diff/diff.c                                   |  4 +-\n diff/diff.h                                   |  2 +-\n diff/tree-diff.c                              |  2 +-\n git.c                                         |  2 +-\n gpg-interface.c                               |  2 +-\n help.c                                        |  2 +-\n cache-tree.c => index/cache-tree.c            |  4 +-\n cache-tree.h => index/cache-tree.h            |  0\n checkout.c => index/checkout.c                |  2 +-\n checkout.h => index/checkout.h                |  0\n dir-iterator.c => index/dir-iterator.c        |  4 +-\n dir-iterator.h => index/dir-iterator.h        |  0\n dir.c => index/dir.c                          | 14 +--\n dir.h => index/dir.h                          |  4 +-\n entry.c => index/entry.c                      | 14 +--\n entry.h => index/entry.h                      |  0\n .../fsmonitor--daemon.h                       |  2 +-\n fsmonitor-ipc.c => index/fsmonitor-ipc.c      |  2 +-\n fsmonitor-ipc.h => index/fsmonitor-ipc.h      |  0\n fsmonitor-ll.h => index/fsmonitor-ll.h        |  0\n .../fsmonitor-path-utils.h                    |  0\n .../fsmonitor-settings.c                      |  6 +-\n .../fsmonitor-settings.h                      |  0\n fsmonitor.c => index/fsmonitor.c              |  8 +-\n fsmonitor.h => index/fsmonitor.h              |  8 +-\n name-hash.c => index/name-hash.c              |  6 +-\n name-hash.h => index/name-hash.h              |  0\n .../parallel-checkout.c                       |  8 +-\n .../parallel-checkout.h                       |  0\n pathspec.c => index/pathspec.c                |  8 +-\n pathspec.h => index/pathspec.h                |  0\n preload-index.c => index/preload-index.c      | 12 +--\n preload-index.h => index/preload-index.h      |  0\n read-cache-ll.h => index/read-cache-ll.h      |  2 +-\n read-cache.c => index/read-cache.c            | 20 ++---\n read-cache.h => index/read-cache.h            |  4 +-\n resolve-undo.c => index/resolve-undo.c        |  8 +-\n resolve-undo.h => index/resolve-undo.h        |  0\n sparse-index.c => index/sparse-index.c        | 14 +--\n sparse-index.h => index/sparse-index.h        |  0\n split-index.c => index/split-index.c          |  4 +-\n split-index.h => index/split-index.h          |  0\n statinfo.c => index/statinfo.c                |  2 +-\n statinfo.h => index/statinfo.h                |  0\n symlinks.c => index/symlinks.c                |  2 +-\n symlinks.h => index/symlinks.h                |  0\n unpack-trees.c => index/unpack-trees.c        | 22 ++---\n unpack-trees.h => index/unpack-trees.h        |  2 +-\n wt-status.c => index/wt-status.c              |  8 +-\n wt-status.h => index/wt-status.h              |  2 +-\n merge-ort-wrappers.c                          |  2 +-\n merge-ort.c                                   | 12 +--\n merge.c                                       |  4 +-\n meson.build                                   | 40 ++++-----\n notes-merge.c                                 |  2 +-\n odb/commit.c                                  |  2 +-\n odb/fsck.c                                    |  2 +-\n odb/hash-lookup.c                             |  2 +-\n odb/object-file.c                             |  4 +-\n odb/object-name.c                             |  4 +-\n odb/object.c                                  |  2 +-\n odb/odb.c                                     |  2 +-\n odb/source-packed.c                           |  2 +-\n odb/tmp-objdir.c                              |  2 +-\n odb/tree-walk.c                               |  6 +-\n organize/gitorganize-format.c                 |  2 +-\n organize/organize.c                           |  6 +-\n pack/midx.c                                   |  2 +-\n pack/packfile.c                               |  2 +-\n pack/reachable.c                              |  2 +-\n pack/repack.c                                 |  2 +-\n pack/server-info.c                            |  2 +-\n path-walk.c                                   |  2 +-\n path.c                                        |  2 +-\n rebase-interactive.c                          |  2 +-\n refs/files-backend.c                          |  4 +-\n refs/packed-backend.c                         |  4 +-\n refs/ref-filter.c                             |  2 +-\n refs/reftable-backend.c                       |  2 +-\n refs/worktree.c                               |  4 +-\n remote.c                                      |  2 +-\n repository.c                                  |  4 +-\n rerere.c                                      |  8 +-\n reset.c                                       |  4 +-\n revision/bisect.c                             |  2 +-\n revision/blame.c                              |  4 +-\n revision/list-objects-filter.c                |  2 +-\n revision/revision.c                           |  8 +-\n revision/shallow.c                            |  2 +-\n run-command.c                                 |  2 +-\n scalar.c                                      |  6 +-\n sequencer.c                                   | 10 +--\n sequencer.h                                   |  2 +-\n setup.c                                       |  2 +-\n submodule-config.c                            |  2 +-\n submodule.c                                   |  4 +-\n t/helper/test-cache-tree.c                    |  4 +-\n t/helper/test-dir-iterator.c                  |  2 +-\n t/helper/test-dump-cache-tree.c               |  4 +-\n t/helper/test-dump-fsmonitor.c                |  2 +-\n t/helper/test-dump-split-index.c              |  4 +-\n t/helper/test-dump-untracked-cache.c          |  4 +-\n t/helper/test-fsmonitor-client.c              |  4 +-\n t/helper/test-lazy-init-name-hash.c           |  4 +-\n t/helper/test-parse-pathspec-file.c           |  2 +-\n t/helper/test-path-utils.c                    |  2 +-\n t/helper/test-path-walk.c                     |  2 +-\n t/helper/test-read-cache.c                    |  2 +-\n t/helper/test-scrap-cache-tree.c              |  4 +-\n t/helper/test-write-cache.c                   |  2 +-\n t/unit-tests/test-lib.c                       |  2 +-\n t/unit-tests/u-dir.c                          |  2 +-\n t/unit-tests/u-reftable-stack.c               |  2 +-\n t/unit-tests/u-strcmp-offset.c                |  2 +-\n trace2/tr2_sysenv.c                           |  2 +-\n 188 files changed, 497 insertions(+), 497 deletions(-)\n rename cache-tree.c => index/cache-tree.c (99%)\n rename cache-tree.h => index/cache-tree.h (100%)\n rename checkout.c => index/checkout.c (98%)\n rename checkout.h => index/checkout.h (100%)\n rename dir-iterator.c => index/dir-iterator.c (99%)\n rename dir-iterator.h => index/dir-iterator.h (100%)\n rename dir.c => index/dir.c (99%)\n rename dir.h => index/dir.h (99%)\n rename entry.c => index/entry.c (98%)\n rename entry.h => index/entry.h (100%)\n rename fsmonitor--daemon.h => index/fsmonitor--daemon.h (99%)\n rename fsmonitor-ipc.c => index/fsmonitor-ipc.c (99%)\n rename fsmonitor-ipc.h => index/fsmonitor-ipc.h (100%)\n rename fsmonitor-ll.h => index/fsmonitor-ll.h (100%)\n rename fsmonitor-path-utils.h => index/fsmonitor-path-utils.h (100%)\n rename fsmonitor-settings.c => index/fsmonitor-settings.c (98%)\n rename fsmonitor-settings.h => index/fsmonitor-settings.h (100%)\n rename fsmonitor.c => index/fsmonitor.c (99%)\n rename fsmonitor.h => index/fsmonitor.h (95%)\n rename name-hash.c => index/name-hash.c (99%)\n rename name-hash.h => index/name-hash.h (100%)\n rename parallel-checkout.c => index/parallel-checkout.c (99%)\n rename parallel-checkout.h => index/parallel-checkout.h (100%)\n rename pathspec.c => index/pathspec.c (99%)\n rename pathspec.h => index/pathspec.h (100%)\n rename preload-index.c => index/preload-index.c (96%)\n rename preload-index.h => index/preload-index.h (100%)\n rename read-cache-ll.h => index/read-cache-ll.h (99%)\n rename read-cache.c => index/read-cache.c (99%)\n rename read-cache.h => index/read-cache.h (95%)\n rename resolve-undo.c => index/resolve-undo.c (97%)\n rename resolve-undo.h => index/resolve-undo.h (100%)\n rename sparse-index.c => index/sparse-index.c (99%)\n rename sparse-index.h => index/sparse-index.h (100%)\n rename split-index.c => index/split-index.c (99%)\n rename split-index.h => index/split-index.h (100%)\n rename statinfo.c => index/statinfo.c (99%)\n rename statinfo.h => index/statinfo.h (100%)\n rename symlinks.c => index/symlinks.c (99%)\n rename symlinks.h => index/symlinks.h (100%)\n rename unpack-trees.c => index/unpack-trees.c (99%)\n rename unpack-trees.h => index/unpack-trees.h (99%)\n rename wt-status.c => index/wt-status.c (99%)\n rename wt-status.h => index/wt-status.h (99%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex d62d0a2240..fe81c40f09 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -48,12 +48,8 @@ bundle-uri.c component=transport role=lib prefix=bundle-uri includes=transport:5\n bundle-uri.h component=transport role=header prefix=bundle-uri cochange=transport:14\n bundle.c component=transport role=lib prefix=bundle includes=odb:3,revision:3,setup:2,transport:2,diff:1 cochange=transport:63,odb:24,revision:21,refs:17,pack:10\n bundle.h component=transport role=header prefix=bundle includes=revision:1 cochange=transport:37,revision:5\n-cache-tree.c component=index role=lib prefix=cache-tree includes=odb:5,index:2,setup:1,transport:1 cochange=index:94,odb:69,revision:27,transport:21,diff:20\n-cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1\n chdir-notify.c component=? role=lib prefix=chdir-notify includes=revision:1 cochange=index:2,archive:1,merge:1,revision:1\n chdir-notify.h component=? role=public prefix=chdir-notify\n-checkout.c component=index role=lib prefix=checkout includes=setup:2,index:1,odb:1,refs:1,transport:1 cochange=transport:16,refs:6,setup:5,index:3,odb:2\n-checkout.h component=index role=header prefix=checkout includes=odb:1 cochange=index:4,diff:1,odb:1,refs:1,revision:1\n color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,index:14,revision:13,setup:7,transport:7\n color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1\n column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2\n@@ -105,14 +101,8 @@ diff/userdiff.c component=diff role=lib prefix=userdiff includes=setup:2,convert\n diff/userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1\n diff/xdiff-interface.c component=diff role=lib prefix=xdiff-interface includes=setup:2,diff:1,odb:1 cochange=diff:73,index:5,merge:3,notes:3,refs:3\n diff/xdiff-interface.h component=diff role=header prefix=xdiff-interface includes=odb:1 cochange=diff:62,index:2,notes:2,merge:1,odb:1\n-dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1\n-dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1\n-dir.c component=index role=lib prefix=dir includes=index:7,setup:4,odb:2,convert:1,refs:1 cochange=index:343,diff:61,setup:49,odb:37,convert:29\n-dir.h component=index role=header prefix=dir includes=index:2,odb:1 cochange=index:236,odb:13,setup:12,submodule:11,convert:10\n editor.c component=? role=lib prefix=editor includes=setup:2 cochange=transport:20,setup:12,index:8,odb:4,submodule:4\n editor.h component=? role=public prefix=editor cochange=transport:1\n-entry.c component=index role=lib prefix=entry includes=index:7,odb:1,setup:1,submodule:1 cochange=index:96,diff:28,convert:20,setup:17,odb:10\n-entry.h component=index role=header prefix=entry includes=convert:1 cochange=index:18,submodule:4,revision:3,transport:2,convert:1\n environment.c component=setup role=lib prefix=environment includes=setup:5,convert:3,odb:2,merge:1,refs:1 cochange=setup:281,index:77,odb:48,refs:36,transport:28\n environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9\n exec-cmd.c component=? role=lib prefix=strvec includes=setup:1\n@@ -126,15 +116,6 @@ fetch-pack.h component=transport role=header prefix=fetch-pack includes=odb:1,re\n fmt-merge-msg.c component=merge role=lib prefix=fmt-merge-msg includes=odb:3,diff:2,revision:2,setup:2,merge:1 cochange=revision:10,odb:7,index:6,diff:4,setup:4\n fmt-merge-msg.h component=merge role=header prefix=fmt-merge-msg cochange=merge:3,setup:2\n for-each-ref.h component=? role=public prefix=?\n-fsmonitor--daemon.h component=index role=header prefix=fsmonitor--daemon includes=index:1 cochange=index:1\n-fsmonitor-ipc.c component=index role=lib prefix=fsmonitor includes=index:1,setup:1 cochange=index:6,transport:2,merge:1,notes:1,pack:1\n-fsmonitor-ipc.h component=index role=header prefix=fsmonitor cochange=index:2\n-fsmonitor-ll.h component=index role=header prefix=fsmonitor-ll cochange=index:4\n-fsmonitor-path-utils.h component=index role=header prefix=fsmonitor cochange=index:2\n-fsmonitor-settings.c component=index role=lib prefix=fsmonitor includes=index:3,setup:2 cochange=index:17,setup:10,transport:2,diff:1,odb:1\n-fsmonitor-settings.h component=index role=header prefix=fsmonitor-settings cochange=index:11,setup:4\n-fsmonitor.c component=index role=lib prefix=fsmonitor includes=index:4,setup:3 cochange=index:37,setup:16,transport:4,merge:2,refs:2\n-fsmonitor.h component=index role=header prefix=fsmonitor includes=index:4,odb:1 cochange=index:24,setup:7,diff:3,submodule:1\n gettext.c component=? role=lib prefix=gettext includes=setup:1 cochange=pack:5,refs:3,setup:2,transport:2,merge:1\n gettext.h component=? role=public prefix=i18n cochange=transport:2,setup:1\n git-compat-util.h component=? role=public prefix=git-compat-util cochange=setup:48,index:35,odb:22,pack:21,diff:17\n@@ -165,6 +146,50 @@ http.h component=transport role=header prefix=http includes=transport:1 cochange\n ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4\n ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1\n imap-send.c component=? role=program prefix=imap-send includes=setup:3,transport:1 cochange=transport:47,diff:16,index:16,refs:9,odb:8\n+index/cache-tree.c component=index role=lib prefix=cache-tree includes=odb:5,index:2,setup:1,transport:1 cochange=index:94,odb:69,revision:27,transport:21,diff:20\n+index/cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1\n+index/checkout.c component=index role=lib prefix=checkout includes=setup:2,index:1,odb:1,refs:1,transport:1 cochange=transport:16,refs:6,setup:5,index:3,odb:2\n+index/checkout.h component=index role=header prefix=checkout includes=odb:1 cochange=index:4,diff:1,odb:1,refs:1,revision:1\n+index/dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1\n+index/dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1\n+index/dir.c component=index role=lib prefix=dir includes=index:7,setup:4,odb:2,convert:1,refs:1 cochange=index:343,diff:61,setup:49,odb:37,convert:29\n+index/dir.h component=index role=header prefix=dir includes=index:2,odb:1 cochange=index:236,odb:13,setup:12,submodule:11,convert:10\n+index/entry.c component=index role=lib prefix=entry includes=index:7,odb:1,setup:1,submodule:1 cochange=index:96,diff:28,convert:20,setup:17,odb:10\n+index/entry.h component=index role=header prefix=entry includes=convert:1 cochange=index:18,submodule:4,revision:3,transport:2,convert:1\n+index/fsmonitor--daemon.h component=index role=header prefix=fsmonitor--daemon includes=index:1 cochange=index:1\n+index/fsmonitor-ipc.c component=index role=lib prefix=fsmonitor includes=index:1,setup:1 cochange=index:6,transport:2,merge:1,notes:1,pack:1\n+index/fsmonitor-ipc.h component=index role=header prefix=fsmonitor cochange=index:2\n+index/fsmonitor-ll.h component=index role=header prefix=fsmonitor-ll cochange=index:4\n+index/fsmonitor-path-utils.h component=index role=header prefix=fsmonitor cochange=index:2\n+index/fsmonitor-settings.c component=index role=lib prefix=fsmonitor includes=index:3,setup:2 cochange=index:17,setup:10,transport:2,diff:1,odb:1\n+index/fsmonitor-settings.h component=index role=header prefix=fsmonitor-settings cochange=index:11,setup:4\n+index/fsmonitor.c component=index role=lib prefix=fsmonitor includes=index:4,setup:3 cochange=index:37,setup:16,transport:4,merge:2,refs:2\n+index/fsmonitor.h component=index role=header prefix=fsmonitor includes=index:4,odb:1 cochange=index:24,setup:7,diff:3,submodule:1\n+index/name-hash.c component=index role=lib prefix=name-hash includes=index:3,odb:1,setup:1 cochange=diff:43,index:39,revision:18,setup:14,refs:12\n+index/name-hash.h component=index role=header prefix=name-hash cochange=index:7\n+index/parallel-checkout.c component=index role=lib prefix=parallel-checkout includes=index:4,odb:1,setup:1,transport:1 cochange=index:26,transport:7,odb:6,diff:3,merge:3\n+index/parallel-checkout.h component=index role=header prefix=parallel-checkout includes=convert:1 cochange=index:12,convert:1\n+index/pathspec.c component=index role=lib prefix=pathspec includes=index:4,setup:3,convert:1 cochange=index:89,setup:23,convert:16,diff:16,revision:9\n+index/pathspec.h component=index role=header prefix=pathspec cochange=index:67,diff:11,odb:9,convert:6,submodule:4\n+index/preload-index.c component=index role=lib prefix=preload-index includes=index:6,setup:3 cochange=index:52,setup:15,diff:12,revision:5,merge:3\n+index/preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1\n+index/read-cache-ll.h component=index role=header prefix=read-cache includes=index:1,odb:1 cochange=index:8,diff:1,odb:1,revision:1\n+index/read-cache.c component=index role=lib prefix=read-cache includes=index:10,odb:6,setup:4,diff:2,submodule:2 cochange=index:240,odb:81,setup:79,diff:67,pack:46\n+index/read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2\n+index/resolve-undo.c component=index role=lib prefix=resolve-undo includes=index:4,odb:1 cochange=index:33,merge:5,revision:4,diff:3,notes:2\n+index/resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1\n+index/sparse-index.c component=index role=lib prefix=sparse-index includes=index:7,setup:3,odb:1 cochange=index:42,setup:17,diff:2,odb:2,revision:1\n+index/sparse-index.h component=index role=header prefix=sparse-index cochange=index:16,setup:4,merge:1,revision:1\n+index/split-index.c component=index role=lib prefix=split-index includes=index:2,odb:1,setup:1 cochange=index:46,odb:5,revision:4,pack:3,merge:2\n+index/split-index.h component=index role=header prefix=split-index includes=odb:1 cochange=index:21,archive:1,merge:1,revision:1\n+index/statinfo.c component=index role=lib prefix=environment includes=setup:2,index:1 cochange=index:9,setup:6,diff:2,odb:1,revision:1\n+index/statinfo.h component=index role=header prefix=statinfo cochange=index:8,odb:1,revision:1\n+index/symlinks.c component=index role=lib prefix=symlinks includes=index:1,setup:1 cochange=index:23,diff:3,archive:2,convert:1,revision:1\n+index/symlinks.h component=index role=header prefix=symlinks cochange=index:9,diff:1\n+index/unpack-trees.c component=index role=lib prefix=unpack-trees includes=index:11,odb:3,setup:3,submodule:2,convert:1 cochange=index:262,odb:49,diff:41,transport:19,revision:18\n+index/unpack-trees.h component=index role=header prefix=unpack-trees includes=convert:1,index:1,odb:1 cochange=index:75,diff:9,odb:6,setup:5,merge:4\n+index/wt-status.c component=index role=lib prefix=wt-status includes=odb:5,index:4,setup:3,diff:2,refs:2 cochange=index:149,diff:83,transport:55,refs:45,revision:45\n+index/wt-status.h component=index role=header prefix=wt-status includes=index:1,transport:1 cochange=index:89,diff:10,refs:9,revision:4,transport:4\n iterator.h component=? role=public prefix=refs cochange=index:2,refs:2\n json-writer.c component=? role=lib prefix=json-writer\n json-writer.h component=? role=public prefix=json-writer cochange=transport:1\n@@ -194,8 +219,6 @@ merge-ort.h component=merge role=header prefix=merge-ort includes=odb:1 cochange\n merge.c component=merge role=lib prefix=merge includes=odb:4,index:2,merge:1,setup:1 cochange=index:22,merge:6,setup:4,diff:2,odb:2\n merge.h component=merge role=header prefix=merge cochange=merge:1\n mergesort.h component=? role=public prefix=mergesort cochange=odb:1\n-name-hash.c component=index role=lib prefix=name-hash includes=index:3,odb:1,setup:1 cochange=diff:43,index:39,revision:18,setup:14,refs:12\n-name-hash.h component=index role=header prefix=name-hash cochange=index:7\n notes-cache.c component=notes role=lib prefix=notes includes=odb:3,notes:1,refs:1,revision:1,setup:1 cochange=notes:37,odb:29,diff:10,index:10,revision:9\n notes-cache.h component=notes role=header prefix=notes-cache includes=notes:1 cochange=diff:7,notes:3\n notes-merge.c component=notes role=lib prefix=notes-merge includes=odb:4,diff:3,notes:3,index:1,merge:1 cochange=diff:54,revision:41,odb:37,notes:36,index:30\n@@ -300,8 +323,6 @@ pack/server-info.c component=pack role=lib prefix=server-info includes=odb:5,pac\n pack/server-info.h component=pack role=header prefix=server-info cochange=pack:2\n pager.c component=? role=lib prefix=pager includes=setup:4 cochange=setup:23,diff:9,transport:7,revision:3,submodule:3\n pager.h component=? role=public prefix=pager cochange=diff:3,setup:2,revision:1\n-parallel-checkout.c component=index role=lib prefix=parallel-checkout includes=index:4,odb:1,setup:1,transport:1 cochange=index:26,transport:7,odb:6,diff:3,merge:3\n-parallel-checkout.h component=index role=header prefix=parallel-checkout includes=convert:1 cochange=index:12,convert:1\n parse-options-cb.c component=? role=lib prefix=parse-options includes=odb:3,setup:2 cochange=revision:10,transport:10,diff:7,odb:4,refs:3\n parse-options.c component=? role=lib prefix=parse-options cochange=index:14,diff:12,setup:10,transport:10,odb:6\n parse-options.h component=? role=public prefix=parse-options cochange=diff:7,merge:4,archive:3,index:3,refs:3\n@@ -311,12 +332,8 @@ path-walk.c component=? role=lib prefix=path-walk includes=odb:9,revision:3,inde\n path-walk.h component=? role=public prefix=path-walk includes=odb:1 cochange=index:2\n path.c component=? role=lib prefix=path includes=setup:2,index:1,odb:1,pack:1,refs:1 cochange=setup:78,refs:29,index:26,transport:15,odb:12\n path.h component=? role=public prefix=path includes=setup:1 cochange=setup:23,refs:13,odb:11,index:10,pack:8\n-pathspec.c component=index role=lib prefix=pathspec includes=index:4,setup:3,convert:1 cochange=index:89,setup:23,convert:16,diff:16,revision:9\n-pathspec.h component=index role=header prefix=pathspec cochange=index:67,diff:11,odb:9,convert:6,submodule:4\n pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 cochange=transport:102,pack:6,convert:5,diff:5,odb:3\n pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1\n-preload-index.c component=index role=lib prefix=preload-index includes=index:6,setup:3 cochange=index:52,setup:15,diff:12,revision:5,merge:3\n-preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1\n prio-queue.c component=? role=lib prefix=prio-queue cochange=odb:5,revision:5,diff:2,pack:2,transport:2\n prio-queue.h component=? role=public prefix=prio-queue cochange=odb:3,revision:2,transport:2,pack:1\n progress.c component=? role=lib prefix=progress includes=setup:1 cochange=index:11,diff:6,setup:6,pack:4,revision:2\n@@ -331,9 +348,6 @@ protocol.c component=transport role=lib prefix=protocol includes=setup:2,transpo\n protocol.h component=transport role=header prefix=protocol cochange=transport:5\n quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6\n quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5\n-read-cache-ll.h component=index role=header prefix=read-cache includes=index:1,odb:1 cochange=index:8,diff:1,odb:1,revision:1\n-read-cache.c component=index role=lib prefix=read-cache includes=index:10,odb:6,setup:4,diff:2,submodule:2 cochange=index:240,odb:81,setup:79,diff:67,pack:46\n-read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2\n rebase-interactive.c component=? role=lib prefix=rebase-interactive includes=odb:3,setup:3,index:1 cochange=revision:4,transport:4,index:3,odb:3,merge:2\n rebase-interactive.h component=? role=public prefix=rebase-interactive\n rebase.c component=? role=lib prefix=rebase cochange=index:3,pack:3,setup:2,convert:1,diff:1\n@@ -367,8 +381,6 @@ rerere.c component=merge role=lib prefix=rerere includes=index:4,merge:2,odb:2,s\n rerere.h component=merge role=header prefix=rerere cochange=merge:16,odb:1\n reset.c component=? role=lib prefix=reset includes=odb:3,index:2,refs:1,setup:1 cochange=index:9,merge:5,odb:3,notes:2,revision:2\n reset.h component=? role=public prefix=reset includes=odb:1,setup:1\n-resolve-undo.c component=index role=lib prefix=resolve-undo includes=index:4,odb:1 cochange=index:33,merge:5,revision:4,diff:3,notes:2\n-resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1\n revision/bisect.c component=revision role=lib prefix=bisect includes=odb:5,revision:5,setup:2,diff:1,index:1 cochange=revision:61,odb:32,transport:31,refs:13,diff:9\n revision/bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2\n revision/blame.c component=revision role=lib prefix=blame includes=odb:5,diff:2,index:2,pack:2,revision:2 cochange=diff:68,revision:66,odb:56,index:29,pack:22\n@@ -420,13 +432,7 @@ sideband.h component=transport role=header prefix=sideband cochange=transport:23\n sigchain.c component=? role=lib prefix=sigchain cochange=diff:2,transport:1\n sigchain.h component=? role=public prefix=sigchain cochange=diff:2\n simple-ipc.h component=? role=public prefix=simple-ipc includes=transport:1 cochange=submodule:1\n-sparse-index.c component=index role=lib prefix=sparse-index includes=index:7,setup:3,odb:1 cochange=index:42,setup:17,diff:2,odb:2,revision:1\n-sparse-index.h component=index role=header prefix=sparse-index cochange=index:16,setup:4,merge:1,revision:1\n-split-index.c component=index role=lib prefix=split-index includes=index:2,odb:1,setup:1 cochange=index:46,odb:5,revision:4,pack:3,merge:2\n-split-index.h component=index role=header prefix=split-index includes=odb:1 cochange=index:21,archive:1,merge:1,revision:1\n stable-qsort.c component=? role=lib prefix=stable-qsort\n-statinfo.c component=index role=lib prefix=environment includes=setup:2,index:1 cochange=index:9,setup:6,diff:2,odb:1,revision:1\n-statinfo.h component=index role=header prefix=statinfo cochange=index:8,odb:1,revision:1\n strbuf.c component=? role=lib prefix=strbuf cochange=index:16,odb:12,setup:11,revision:10,transport:10\n strbuf.h component=? role=public prefix=strbuf cochange=revision:15,index:14,odb:14,diff:7,setup:7\n string-list.c component=? role=lib prefix=string-list cochange=transport:14,index:8,notes:7,refs:7,diff:5\n@@ -441,8 +447,6 @@ submodule-config.c component=submodule role=lib prefix=submodule-config includes\n submodule-config.h component=submodule role=header prefix=submodule-config includes=odb:1,setup:1,submodule:1 cochange=submodule:54,setup:9,odb:3,diff:2,index:2\n submodule.c component=submodule role=lib prefix=submodule includes=odb:5,setup:4,diff:2,index:2,refs:2 cochange=submodule:134,diff:83,setup:66,index:60,revision:49\n submodule.h component=submodule role=header prefix=submodule cochange=submodule:128,index:22,diff:21,transport:17,setup:6\n-symlinks.c component=index role=lib prefix=symlinks includes=index:1,setup:1 cochange=index:23,diff:3,archive:2,convert:1,revision:1\n-symlinks.h component=index role=header prefix=symlinks cochange=index:9,diff:1\n tar.h component=? role=public prefix=tar-tree\n tempfile.c component=? role=lib prefix=tempfile cochange=pack:5,setup:4,index:3,odb:3,revision:3\n tempfile.h component=? role=public prefix=tempfile includes=revision:1 cochange=revision:3,diff:2,index:2,setup:2\n@@ -463,8 +467,6 @@ unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2\n unix-socket.h component=? role=public prefix=unix-socket\n unix-stream-server.c component=? role=lib prefix=unix-stream-server\n unix-stream-server.h component=? role=public prefix=unix-stream-server\n-unpack-trees.c component=index role=lib prefix=unpack-trees includes=index:11,odb:3,setup:3,submodule:2,convert:1 cochange=index:262,odb:49,diff:41,transport:19,revision:18\n-unpack-trees.h component=index role=header prefix=unpack-trees includes=convert:1,index:1,odb:1 cochange=index:75,diff:9,odb:6,setup:5,merge:4\n upload-pack.c component=transport role=lib prefix=upload-pack includes=transport:6,odb:4,revision:4,setup:4,diff:1 cochange=transport:198,odb:88,revision:80,refs:55,pack:34\n upload-pack.h component=transport role=header prefix=upload-pack cochange=transport:18,refs:5,submodule:1\n url.c component=? role=lib prefix=url cochange=transport:12,revision:8,diff:6,index:2,refs:2\n@@ -490,5 +492,3 @@ write-or-die.c component=? role=lib prefix=write-or-die cochange=pack:6,setup:6,\n write-or-die.h component=? role=public prefix=write-or-die\n ws.c component=convert role=lib prefix=whitespace includes=convert:2 cochange=convert:24,diff:18,archive:9,index:5,setup:5\n ws.h component=convert role=header prefix=whitespace cochange=diff:5,convert:2,setup:2\n-wt-status.c component=index role=lib prefix=wt-status includes=odb:5,index:4,setup:3,diff:2,refs:2 cochange=index:149,diff:83,transport:55,refs:45,revision:45\n-wt-status.h component=index role=header prefix=wt-status includes=index:1,transport:1 cochange=index:89,diff:10,refs:9,revision:4,transport:4\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex 2da56ca8fc..63468494c1 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -390,7 +390,7 @@ to `repo_config()`. Let's modify the code we wrote in the previous commit.\n Be sure to include the header to allow you to use `struct wt_status`:\n \n ----\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n ----\n \n Then modify your `cmd_psuh` implementation to declare your `struct wt_status`,\ndiff --git a/Makefile b/Makefile\nindex 74013e8380..5e404ffa5e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1117,10 +1117,10 @@ LIB_OBJS += pack/bloom.o\n LIB_OBJS += branch.o\n LIB_OBJS += bundle-uri.o\n LIB_OBJS += bundle.o\n-LIB_OBJS += cache-tree.o\n+LIB_OBJS += index/cache-tree.o\n LIB_OBJS += odb/cbtree.o\n LIB_OBJS += chdir-notify.o\n-LIB_OBJS += checkout.o\n+LIB_OBJS += index/checkout.o\n LIB_OBJS += pack/chunk-format.o\n LIB_OBJS += color.o\n LIB_OBJS += column.o\n@@ -1158,10 +1158,10 @@ LIB_OBJS += diff/diffcore-order.o\n LIB_OBJS += diff/diffcore-pickaxe.o\n LIB_OBJS += diff/diffcore-rename.o\n LIB_OBJS += diff/diffcore-rotate.o\n-LIB_OBJS += dir-iterator.o\n-LIB_OBJS += dir.o\n+LIB_OBJS += index/dir-iterator.o\n+LIB_OBJS += index/dir.o\n LIB_OBJS += editor.o\n-LIB_OBJS += entry.o\n+LIB_OBJS += index/entry.o\n LIB_OBJS += environment.o\n LIB_OBJS += ewah/bitmap.o\n LIB_OBJS += ewah/ewah_bitmap.o\n@@ -1173,9 +1173,9 @@ LIB_OBJS += fetch-object-info.o\n LIB_OBJS += fetch-pack.o\n LIB_OBJS += fmt-merge-msg.o\n LIB_OBJS += odb/fsck.o\n-LIB_OBJS += fsmonitor.o\n-LIB_OBJS += fsmonitor-ipc.o\n-LIB_OBJS += fsmonitor-settings.o\n+LIB_OBJS += index/fsmonitor.o\n+LIB_OBJS += index/fsmonitor-ipc.o\n+LIB_OBJS += index/fsmonitor-settings.o\n LIB_OBJS += gettext.o\n LIB_OBJS += git-zlib.o\n LIB_OBJS += gpg-interface.o\n@@ -1213,7 +1213,7 @@ LIB_OBJS += merge-ort-wrappers.o\n LIB_OBJS += merge.o\n LIB_OBJS += pack/midx.o\n LIB_OBJS += pack/midx-write.o\n-LIB_OBJS += name-hash.o\n+LIB_OBJS += index/name-hash.o\n LIB_OBJS += negotiator/default.o\n LIB_OBJS += negotiator/noop.o\n LIB_OBJS += negotiator/skipping.o\n@@ -1252,7 +1252,7 @@ LIB_OBJS += pack/pack-write.o\n LIB_OBJS += pack/packfile.o\n LIB_OBJS += pack/packfile-list.o\n LIB_OBJS += pager.o\n-LIB_OBJS += parallel-checkout.o\n+LIB_OBJS += index/parallel-checkout.o\n LIB_OBJS += parse.o\n LIB_OBJS += parse-options-cb.o\n LIB_OBJS += parse-options.o\n@@ -1260,9 +1260,9 @@ LIB_OBJS += pack/patch-delta.o\n LIB_OBJS += diff/patch-ids.o\n LIB_OBJS += path.o\n LIB_OBJS += path-walk.o\n-LIB_OBJS += pathspec.o\n+LIB_OBJS += index/pathspec.o\n LIB_OBJS += pkt-line.o\n-LIB_OBJS += preload-index.o\n+LIB_OBJS += index/preload-index.o\n LIB_OBJS += revision/pretty.o\n LIB_OBJS += prio-queue.o\n LIB_OBJS += progress.o\n@@ -1275,7 +1275,7 @@ LIB_OBJS += pack/pseudo-merge.o\n LIB_OBJS += quote.o\n LIB_OBJS += diff/range-diff.o\n LIB_OBJS += pack/reachable.o\n-LIB_OBJS += read-cache.o\n+LIB_OBJS += index/read-cache.o\n LIB_OBJS += rebase-interactive.o\n LIB_OBJS += rebase.o\n LIB_OBJS += refs/ref-filter.o\n@@ -1316,7 +1316,7 @@ LIB_OBJS += repo-settings.o\n LIB_OBJS += repository.o\n LIB_OBJS += rerere.o\n LIB_OBJS += reset.o\n-LIB_OBJS += resolve-undo.o\n+LIB_OBJS += index/resolve-undo.o\n LIB_OBJS += revision/revision.o\n LIB_OBJS += run-command.o\n LIB_OBJS += send-pack.o\n@@ -1327,10 +1327,10 @@ LIB_OBJS += setup.o\n LIB_OBJS += revision/shallow.o\n LIB_OBJS += sideband.o\n LIB_OBJS += sigchain.o\n-LIB_OBJS += sparse-index.o\n-LIB_OBJS += split-index.o\n+LIB_OBJS += index/sparse-index.o\n+LIB_OBJS += index/split-index.o\n LIB_OBJS += stable-qsort.o\n-LIB_OBJS += statinfo.o\n+LIB_OBJS += index/statinfo.o\n LIB_OBJS += strbuf.o\n LIB_OBJS += string-list.o\n LIB_OBJS += strmap.o\n@@ -1338,7 +1338,7 @@ LIB_OBJS += strvec.o\n LIB_OBJS += sub-process.o\n LIB_OBJS += submodule-config.o\n LIB_OBJS += submodule.o\n-LIB_OBJS += symlinks.o\n+LIB_OBJS += index/symlinks.o\n LIB_OBJS += odb/tag.o\n LIB_OBJS += tempfile.o\n LIB_OBJS += thread-utils.o\n@@ -1363,7 +1363,7 @@ LIB_OBJS += transport.o\n LIB_OBJS += diff/tree-diff.o\n LIB_OBJS += odb/tree-walk.o\n LIB_OBJS += odb/tree.o\n-LIB_OBJS += unpack-trees.o\n+LIB_OBJS += index/unpack-trees.o\n LIB_OBJS += upload-pack.o\n LIB_OBJS += url.o\n LIB_OBJS += urlmatch.o\n@@ -1381,7 +1381,7 @@ LIB_OBJS += refs/worktree.o\n LIB_OBJS += wrapper.o\n LIB_OBJS += write-or-die.o\n LIB_OBJS += ws.o\n-LIB_OBJS += wt-status.o\n+LIB_OBJS += index/wt-status.o\n LIB_OBJS += diff/xdiff-interface.o\n LIB_OBJS += xdiff/xdiffi.o\n LIB_OBJS += xdiff/xemit.o\n@@ -3219,7 +3219,7 @@ LOCALIZED_C_CORE += builtin/index-pack.c\n LOCALIZED_C_CORE += builtin/push.c\n LOCALIZED_C_CORE += builtin/reset.c\n LOCALIZED_C_CORE += remote.c\n-LOCALIZED_C_CORE += wt-status.c\n+LOCALIZED_C_CORE += index/wt-status.c\n \n LOCALIZED_C_CORE_GEN_PO = $(LOCALIZED_C_CORE:%=.build/pot/po/%.po)\n \ndiff --git a/add-interactive.c b/add-interactive.c\nindex 7bfc410361..5f4d379910 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -7,14 +7,14 @@\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"preload-index.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"revision/revision.h\"\n #include \"refs/refs.h\"\n #include \"string-list.h\"\n #include \"lockfile.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"run-command.h\"\n #include \"prompt.h\"\n #include \"odb/tree.h\"\ndiff --git a/add-patch.c b/add-patch.c\nindex c6860310c1..0499152dbc 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -13,13 +13,13 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"pager.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\n #include \"sigchain.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"color.h\"\n #include \"compat/terminal.h\"\n #include \"prompt.h\"\ndiff --git a/apply.c b/apply.c\nindex b8d97d140d..70d5461fbe 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -17,26 +17,26 @@\n #include \"odb/odb.h\"\n #include \"pack/delta.h\"\n #include \"diff/diff.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"merge-ll.h\"\n #include \"lockfile.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"odb/object-name.h\"\n #include \"odb/object-file.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"quote.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"repository.h\"\n #include \"rerere.h\"\n #include \"apply.h\"\n-#include \"entry.h\"\n+#include \"index/entry.h\"\n #include \"setup.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"wildmatch.h\"\n #include \"ws.h\"\n \ndiff --git a/archive.c b/archive.c\nindex a2402fb7e6..e6fdd2ea8f 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -21,7 +21,7 @@\n #include \"attr.h\"\n #include \"archive.h\"\n #include \"parse-options.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"quote.h\"\n \n static char const * const archive_usage[] = {\ndiff --git a/archive.h b/archive.h\nindex bbe65ba0f9..d1496a485b 100644\n--- a/archive.h\n+++ b/archive.h\n@@ -1,7 +1,7 @@\n #ifndef ARCHIVE_H\n #define ARCHIVE_H\n \n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"string-list.h\"\n \n struct repository;\ndiff --git a/attr.c b/attr.c\nindex e7d364d490..841d2f23ae 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -14,12 +14,12 @@\n #include \"environment.h\"\n #include \"exec-cmd.h\"\n #include \"attr.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"gettext.h\"\n #include \"path.h\"\n #include \"utf8.h\"\n #include \"quote.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"refs/refs.h\"\n #include \"revision/revision.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 4dbdccd928..e544220eb2 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -10,18 +10,18 @@\n #include \"environment.h\"\n #include \"lockfile.h\"\n #include \"editor.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"gettext.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"run-command.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"preload-index.h\"\n+#include \"index/preload-index.h\"\n #include \"diff/diff.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"revision/revision.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 5dbe1f171b..0b6d77004f 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -15,20 +15,20 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"run-command.h\"\n #include \"hook.h\"\n #include \"quote.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"refs/refs.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"branch.h\"\n #include \"odb/object-name.h\"\n-#include \"preload-index.h\"\n+#include \"index/preload-index.h\"\n #include \"sequencer.h\"\n #include \"revision/revision.h\"\n #include \"merge-ort-wrappers.h\"\ndiff --git a/builtin/backfill.c b/builtin/backfill.c\nindex d2ef39bc58..b8e21c844c 100644\n--- a/builtin/backfill.c\n+++ b/builtin/backfill.c\n@@ -7,7 +7,7 @@\n #include \"parse-options.h\"\n #include \"repository.h\"\n #include \"odb/commit.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/check-ignore.c b/builtin/check-ignore.c\nindex 644c9a414f..1d2c3cb8db 100644\n--- a/builtin/check-ignore.c\n+++ b/builtin/check-ignore.c\n@@ -1,11 +1,11 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"quote.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"parse-options.h\"\n #include \"submodule.h\"\n #include \"write-or-die.h\"\ndiff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c\nindex e0772b718b..9c49474753 100644\n--- a/builtin/checkout--worker.c\n+++ b/builtin/checkout--worker.c\n@@ -3,13 +3,13 @@\n \n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"entry.h\"\n+#include \"index/entry.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"parallel-checkout.h\"\n+#include \"index/parallel-checkout.h\"\n #include \"parse-options.h\"\n #include \"pkt-line.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n \n static void packet_to_pc_item(const char *buffer, int len,\n \t\t\t      struct parallel_checkout_item *pc_item)\ndiff --git a/builtin/checkout-index.c b/builtin/checkout-index.c\nindex 311b94ff31..c659e5c764 100644\n--- a/builtin/checkout-index.c\n+++ b/builtin/checkout-index.c\n@@ -13,13 +13,13 @@\n #include \"gettext.h\"\n #include \"lockfile.h\"\n #include \"quote.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"parse-options.h\"\n-#include \"entry.h\"\n-#include \"parallel-checkout.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/entry.h\"\n+#include \"index/parallel-checkout.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n \n #define CHECKOUT_ALL 4\n static int nul_term_line;\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 286fcdc1ba..48882b0f8e 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -4,12 +4,12 @@\n #include \"builtin.h\"\n #include \"advice.h\"\n #include \"branch.h\"\n-#include \"cache-tree.h\"\n-#include \"checkout.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/checkout.h\"\n #include \"odb/commit.h\"\n #include \"config.h\"\n #include \"diff/diff.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n@@ -22,27 +22,27 @@\n #include \"odb/odb.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"preload-index.h\"\n-#include \"read-cache.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/read-cache.h\"\n #include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"repo-settings.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"revision/revision.h\"\n #include \"sequencer.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"unpack-trees.h\"\n-#include \"wt-status.h\"\n+#include \"index/unpack-trees.h\"\n+#include \"index/wt-status.h\"\n #include \"diff/xdiff-interface.h\"\n-#include \"entry.h\"\n-#include \"parallel-checkout.h\"\n+#include \"index/entry.h\"\n+#include \"index/parallel-checkout.h\"\n #include \"add-interactive.h\"\n \n struct checkout_opts {\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 1d5e7e5366..81b3b86491 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -12,18 +12,18 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n #include \"quote.h\"\n #include \"column.h\"\n #include \"color.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"help.h\"\n #include \"prompt.h\"\n \ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 8ed07e1a15..58cf9761a0 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -28,11 +28,11 @@\n #include \"odb/odb.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"transport.h\"\n #include \"strbuf.h\"\n-#include \"dir.h\"\n-#include \"dir-iterator.h\"\n+#include \"index/dir.h\"\n+#include \"index/dir-iterator.h\"\n #include \"iterator.h\"\n #include \"sigchain.h\"\n #include \"branch.h\"\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex aa89e0dc52..85ab748ff0 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -12,9 +12,9 @@\n #include \"advice.h\"\n #include \"config.h\"\n #include \"lockfile.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"color.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"editor.h\"\n #include \"environment.h\"\n #include \"diff/diff.h\"\n@@ -22,21 +22,21 @@\n #include \"add-interactive.h\"\n #include \"gettext.h\"\n #include \"revision/revision.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"preload-index.h\"\n-#include \"read-cache.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/read-cache.h\"\n #include \"repository.h\"\n #include \"string-list.h\"\n #include \"rerere.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"column.h\"\n #include \"sequencer.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"mailmap.h\"\n #include \"help.h\"\n #include \"revision/commit-reach.h\"\ndiff --git a/builtin/count-objects.c b/builtin/count-objects.c\nindex 45a7a61cd3..cf10ddcae1 100644\n--- a/builtin/count-objects.c\n+++ b/builtin/count-objects.c\n@@ -6,7 +6,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"path.h\"\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex bbeba1e465..c22158d157 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -12,7 +12,7 @@\n #include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"revision/revision.h\"\n #include \"diff/diff.h\"\n #include \"hashmap.h\"\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex d1e8d2b462..1f67480362 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -12,7 +12,7 @@\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n-#include \"preload-index.h\"\n+#include \"index/preload-index.h\"\n #include \"revision/revision.h\"\n \n static const char diff_files_usage[] =\ndiff --git a/builtin/diff-index.c b/builtin/diff-index.c\nindex f3b2eadda0..dac8099081 100644\n--- a/builtin/diff-index.c\n+++ b/builtin/diff-index.c\n@@ -6,7 +6,7 @@\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n-#include \"preload-index.h\"\n+#include \"index/preload-index.h\"\n #include \"revision/revision.h\"\n #include \"setup.h\"\n \ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex 2bd5ed4004..8f7f48ac67 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -7,7 +7,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision/log-tree.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"revision/revision.h\"\n #include \"odb/tmp-objdir.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex e4487901d3..0e8c488408 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -18,8 +18,8 @@\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"diff/diffcore.h\"\n-#include \"preload-index.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"revision/revision.h\"\n #include \"revision/log-tree.h\"\n #include \"setup.h\"\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 075112d344..1d3fae8793 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -23,16 +23,16 @@\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"strbuf.h\"\n #include \"lockfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n-#include \"dir.h\"\n-#include \"entry.h\"\n+#include \"index/dir.h\"\n+#include \"index/entry.h\"\n #include \"setup.h\"\n \n static const char *const builtin_difftool_usage[] = {\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex f3af94307f..da586c7c63 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -15,11 +15,11 @@\n #include \"pack/delta.h\"\n #include \"pack/pack.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"refs/refs.h\"\n #include \"csum-file.h\"\n #include \"quote.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"run-command.h\"\n #include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex a00ca35703..6e8fd0e828 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -8,7 +8,7 @@\n #include \"odb/tag.h\"\n #include \"refs/refs.h\"\n #include \"pack/pack.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"odb/fsck.h\"\n #include \"parse-options.h\"\n #include \"progress.h\"\n@@ -18,11 +18,11 @@\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"odb/replace-object.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"run-command.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"refs/worktree.h\"\n #include \"pack/pack-revindex.h\"\n #include \"pack/pack-bitmap.h\"\ndiff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c\nindex 4161dd8282..49b492fba0 100644\n--- a/builtin/fsmonitor--daemon.c\n+++ b/builtin/fsmonitor--daemon.c\n@@ -4,16 +4,16 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"fsmonitor-settings.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-settings.h\"\n #include \"compat/fsmonitor/fsm-health.h\"\n #include \"compat/fsmonitor/fsm-listen.h\"\n-#include \"fsmonitor--daemon.h\"\n+#include \"index/fsmonitor--daemon.h\"\n \n #include \"simple-ipc.h\"\n #include \"strmap.h\"\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex c340489c64..0243b34e3e 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -16,7 +16,7 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"date.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"config.h\"\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d13858caec..20cd821af7 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -20,8 +20,8 @@\n #include \"run-command.h\"\n #include \"grep.h\"\n #include \"quote.h\"\n-#include \"dir.h\"\n-#include \"pathspec.h\"\n+#include \"index/dir.h\"\n+#include \"index/pathspec.h\"\n #include \"setup.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n@@ -33,7 +33,7 @@\n #include \"pager.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"write-or-die.h\"\n \n static const char *grep_prefix;\ndiff --git a/builtin/history.c b/builtin/history.c\nindex 73a31ce152..c817745f30 100644\n--- a/builtin/history.c\n+++ b/builtin/history.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"odb/commit.h\"\n #include \"revision/commit-reach.h\"\n #include \"config.h\"\n@@ -14,7 +14,7 @@\n #include \"odb/oidmap.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"refs/refs.h\"\n #include \"replay.h\"\n #include \"reset.h\"\n@@ -23,8 +23,8 @@\n #include \"strvec.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"unpack-trees.h\"\n-#include \"wt-status.h\"\n+#include \"index/unpack-trees.h\"\n+#include \"index/wt-status.h\"\n \n #define GIT_HISTORY_DROP_USAGE \\\n \tN_(\"git history drop <commit> [--dry-run] [--update-refs=(branches|head)] [--empty=(drop|keep|abort)]\")\ndiff --git a/builtin/ls-files.c b/builtin/ls-files.c\nindex fc3f8f4a72..49e8a685e3 100644\n--- a/builtin/ls-files.c\n+++ b/builtin/ls-files.c\n@@ -13,18 +13,18 @@\n #include \"convert.h\"\n #include \"environment.h\"\n #include \"quote.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n #include \"strbuf.h\"\n #include \"parse-options.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"string-list.h\"\n #include \"path.h\"\n-#include \"pathspec.h\"\n-#include \"read-cache.h\"\n+#include \"index/pathspec.h\"\n+#include \"index/read-cache.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"odb/odb.h\"\n #include \"hex.h\"\ndiff --git a/builtin/ls-tree.c b/builtin/ls-tree.c\nindex 4f7d1d2b6d..b59c186a21 100644\n--- a/builtin/ls-tree.c\n+++ b/builtin/ls-tree.c\n@@ -16,7 +16,7 @@\n #include \"path.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n \n static const char * const ls_tree_usage[] = {\n \tN_(\"git ls-tree [<options>] <tree-ish> [<path>...]\"),\ndiff --git a/builtin/merge-index.c b/builtin/merge-index.c\nindex 3314fb1336..a0dafe16dc 100644\n--- a/builtin/merge-index.c\n+++ b/builtin/merge-index.c\n@@ -3,9 +3,9 @@\n \n #include \"builtin.h\"\n #include \"hex.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"run-command.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n \n static const char *pgm;\n static int one_shot, quiet;\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 268ffc4855..da37fb11eb 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -32,15 +32,15 @@\n #include \"diff/diffcore.h\"\n #include \"path.h\"\n #include \"revision/revision.h\"\n-#include \"unpack-trees.h\"\n-#include \"cache-tree.h\"\n-#include \"dir.h\"\n+#include \"index/unpack-trees.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/dir.h\"\n #include \"color.h\"\n #include \"rerere.h\"\n #include \"help.h\"\n #include \"merge.h\"\n #include \"merge-ort-wrappers.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"remote.h\"\n #include \"fmt-merge-msg.h\"\n #include \"sequencer.h\"\n@@ -49,7 +49,7 @@\n #include \"alias.h\"\n #include \"branch.h\"\n #include \"revision/commit-reach.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"pack/commit-graph.h\"\n \n #define DEFAULT_TWOHEAD (1<<0)\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex e347c100c0..f49eec035e 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -13,21 +13,21 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"odb/object-file.h\"\n #include \"path.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"lockfile.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"string-list.h\"\n #include \"parse-options.h\"\n-#include \"read-cache-ll.h\"\n-#include \"symlinks.h\"\n+#include \"index/read-cache-ll.h\"\n+#include \"index/symlinks.h\"\n \n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\n-#include \"entry.h\"\n+#include \"index/entry.h\"\n \n static const char * const builtin_mv_usage[] = {\n \tN_(\"git mv [-v] [-f] [-n] [-k] <source> <destination>\"),\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 3b025a08e9..b611b27573 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -36,7 +36,7 @@\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"odb/replace-object.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"pack/midx.h\"\n #include \"trace2.h\"\n #include \"revision/shallow.h\"\ndiff --git a/builtin/prune.c b/builtin/prune.c\nindex ba7b1303b3..d2d5bd2619 100644\n--- a/builtin/prune.c\n+++ b/builtin/prune.c\n@@ -3,7 +3,7 @@\n #include \"builtin.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex af120a7e1b..818ddbf956 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -20,15 +20,15 @@\n #include \"run-command.h\"\n #include \"odb/oid-array.h\"\n #include \"remote.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"rebase.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"revision/commit-reach.h\"\n #include \"sequencer.h\"\n \ndiff --git a/builtin/push.c b/builtin/push.c\nindex 39b6ff4b8b..280cfd289f 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -8,7 +8,7 @@\n #include \"advice.h\"\n #include \"branch.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/builtin/read-tree.c b/builtin/read-tree.c\nindex 8898354baa..2bc2f43729 100644\n--- a/builtin/read-tree.c\n+++ b/builtin/read-tree.c\n@@ -14,12 +14,12 @@\n #include \"odb/object-name.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"cache-tree.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/unpack-trees.h\"\n #include \"parse-options.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n \n static int nr_trees;\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex a14a31d60e..62b58da192 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -15,10 +15,10 @@\n #include \"hex.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"refs/refs.h\"\n #include \"config.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"lockfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n@@ -26,7 +26,7 @@\n #include \"path.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"revision/revision.h\"\n #include \"revision/commit-reach.h\"\n #include \"rerere.h\"\ndiff --git a/builtin/rerere.c b/builtin/rerere.c\nindex 545ffe2715..4b1b7d49ce 100644\n--- a/builtin/rerere.c\n+++ b/builtin/rerere.c\n@@ -9,7 +9,7 @@\n #include \"string-list.h\"\n #include \"xdiff/xdiff.h\"\n #include \"diff/xdiff-interface.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n \n static const char * const rerere_usage[] = {\n \tN_(\"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]\"),\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex eed0d0ea0b..96c7bf9cf1 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -29,14 +29,14 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"repository.h\"\n-#include \"unpack-trees.h\"\n-#include \"cache-tree.h\"\n+#include \"index/unpack-trees.h\"\n+#include \"index/cache-tree.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"add-interactive.h\"\n \n #define REFRESH_INDEX_DELAY_WARNING_IN_MS (2 * 1000)\ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex ef4b6795dd..1d97c4869b 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -23,12 +23,12 @@\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"diff/diff.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\n #include \"revision/revision.h\"\n #include \"setup.h\"\n-#include \"split-index.h\"\n+#include \"index/split-index.h\"\n #include \"submodule.h\"\n #include \"revision/commit-reach.h\"\n #include \"revision/shallow.h\"\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex c856b88d09..4f7194f541 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -11,19 +11,19 @@\n #include \"config.h\"\n #include \"environment.h\"\n #include \"lockfile.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"odb/tree-walk.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n \n #include \"string-list.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n \n static const char * const builtin_rm_usage[] = {\n \tN_(\"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\\n\"\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 8db11f6e4c..e0e912439c 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -14,7 +14,7 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n \n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/commit-slab.h\"\n #include \"date.h\"\n #include \"wildmatch.h\"\ndiff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c\nindex 9b4cad87a5..efe6f7897e 100644\n--- a/builtin/sparse-checkout.c\n+++ b/builtin/sparse-checkout.c\n@@ -4,21 +4,21 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"lockfile.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"quote.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"refs/worktree.h\"\n \n static const char *empty_base = \"\";\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 6458e3a2d6..a8337ffdc4 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -11,20 +11,20 @@\n #include \"parse-options.h\"\n #include \"refs/refs.h\"\n #include \"lockfile.h\"\n-#include \"cache-tree.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/unpack-trees.h\"\n #include \"merge-ort-wrappers.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n-#include \"dir.h\"\n-#include \"entry.h\"\n-#include \"preload-index.h\"\n-#include \"read-cache.h\"\n+#include \"index/dir.h\"\n+#include \"index/entry.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/read-cache.h\"\n #include \"repository.h\"\n #include \"rerere.h\"\n #include \"revision/revision.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"revision/log-tree.h\"\n #include \"diff/diffcore.h\"\n #include \"refs/reflog.h\"\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 0e061827f9..5226a5f331 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -10,12 +10,12 @@\n #include \"parse-options.h\"\n #include \"quote.h\"\n #include \"path.h\"\n-#include \"pathspec.h\"\n-#include \"preload-index.h\"\n-#include \"dir.h\"\n-#include \"read-cache.h\"\n+#include \"index/pathspec.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/dir.h\"\n+#include \"index/read-cache.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n #include \"string-list.h\"\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex 54741c3241..b5c8fae02c 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -15,22 +15,22 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"quote.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n #include \"refs/refs.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"parse-options.h\"\n-#include \"pathspec.h\"\n-#include \"dir.h\"\n-#include \"read-cache.h\"\n+#include \"index/pathspec.h\"\n+#include \"index/dir.h\"\n+#include \"index/read-cache.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n-#include \"split-index.h\"\n-#include \"symlinks.h\"\n-#include \"fsmonitor.h\"\n+#include \"index/sparse-index.h\"\n+#include \"index/split-index.h\"\n+#include \"index/symlinks.h\"\n+#include \"index/fsmonitor.h\"\n #include \"write-or-die.h\"\n \n /*\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 90af2193c1..c4068b45d6 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -4,10 +4,10 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"checkout.h\"\n+#include \"index/checkout.h\"\n #include \"config.h\"\n #include \"copy.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n@@ -17,7 +17,7 @@\n #include \"path.h\"\n #include \"strvec.h\"\n #include \"branch.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/write-tree.c b/builtin/write-tree.c\nindex 2e463ab394..4a2b1ceb58 100644\n--- a/builtin/write-tree.c\n+++ b/builtin/write-tree.c\n@@ -10,7 +10,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/tree.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"parse-options.h\"\n \n static const char * const write_tree_usage[] = {\ndiff --git a/compat/fsmonitor/fsm-health-darwin.c b/compat/fsmonitor/fsm-health-darwin.c\nindex c2afcbe6c8..f24d56b3d2 100644\n--- a/compat/fsmonitor/fsm-health-darwin.c\n+++ b/compat/fsmonitor/fsm-health-darwin.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"fsm-health.h\"\n-#include \"fsmonitor--daemon.h\"\n+#include \"index/fsmonitor--daemon.h\"\n \n int fsm_health__ctor(struct fsmonitor_daemon_state *state UNUSED)\n {\ndiff --git a/compat/fsmonitor/fsm-health-linux.c b/compat/fsmonitor/fsm-health-linux.c\nindex 43d67c4b8b..7be822fb1c 100644\n--- a/compat/fsmonitor/fsm-health-linux.c\n+++ b/compat/fsmonitor/fsm-health-linux.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"fsm-health.h\"\n-#include \"fsmonitor--daemon.h\"\n+#include \"index/fsmonitor--daemon.h\"\n \n /*\n  * The Linux fsmonitor implementation uses inotify which has its own\ndiff --git a/compat/fsmonitor/fsm-health-win32.c b/compat/fsmonitor/fsm-health-win32.c\nindex 2aa8c219ac..09dee50777 100644\n--- a/compat/fsmonitor/fsm-health-win32.c\n+++ b/compat/fsmonitor/fsm-health-win32.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"fsm-health.h\"\n-#include \"fsmonitor--daemon.h\"\n+#include \"index/fsmonitor--daemon.h\"\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n \ndiff --git a/compat/fsmonitor/fsm-ipc-unix.c b/compat/fsmonitor/fsm-ipc-unix.c\nindex fe149a1b37..ffd864ae92 100644\n--- a/compat/fsmonitor/fsm-ipc-unix.c\n+++ b/compat/fsmonitor/fsm-ipc-unix.c\n@@ -7,9 +7,9 @@\n #include \"path.h\"\n #include \"repository.h\"\n #include \"strbuf.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n \n static GIT_PATH_FUNC(fsmonitor_ipc__get_default_path, \"fsmonitor--daemon.ipc\")\n \ndiff --git a/compat/fsmonitor/fsm-ipc-win32.c b/compat/fsmonitor/fsm-ipc-win32.c\nindex 41984ea48e..bc92e1fd20 100644\n--- a/compat/fsmonitor/fsm-ipc-win32.c\n+++ b/compat/fsmonitor/fsm-ipc-win32.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-ipc.h\"\n #include \"path.h\"\n \n const char *fsmonitor_ipc__get_path(struct repository *r) {\ndiff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c\nindex 43c3a915a0..fac5256a74 100644\n--- a/compat/fsmonitor/fsm-listen-darwin.c\n+++ b/compat/fsmonitor/fsm-listen-darwin.c\n@@ -24,10 +24,10 @@\n #endif\n \n #include \"git-compat-util.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"fsm-listen.h\"\n-#include \"fsmonitor--daemon.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor--daemon.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n #include \"string-list.h\"\ndiff --git a/compat/fsmonitor/fsm-listen-linux.c b/compat/fsmonitor/fsm-listen-linux.c\nindex e3dca14b62..0208a6d942 100644\n--- a/compat/fsmonitor/fsm-listen-linux.c\n+++ b/compat/fsmonitor/fsm-listen-linux.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/dir.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"fsm-listen.h\"\n-#include \"fsmonitor--daemon.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor--daemon.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n #include \"string-list.h\"\ndiff --git a/compat/fsmonitor/fsm-listen-win32.c b/compat/fsmonitor/fsm-listen-win32.c\nindex 9a6efc9bea..c8cbdf4a97 100644\n--- a/compat/fsmonitor/fsm-listen-win32.c\n+++ b/compat/fsmonitor/fsm-listen-win32.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"fsm-listen.h\"\n-#include \"fsmonitor--daemon.h\"\n+#include \"index/fsmonitor--daemon.h\"\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n #include \"trace2.h\"\ndiff --git a/compat/fsmonitor/fsm-path-utils-darwin.c b/compat/fsmonitor/fsm-path-utils-darwin.c\nindex 049f97eaaf..b67b1262c0 100644\n--- a/compat/fsmonitor/fsm-path-utils-darwin.c\n+++ b/compat/fsmonitor/fsm-path-utils-darwin.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n #include \"gettext.h\"\n #include \"trace.h\"\n #include <dirent.h>\ndiff --git a/compat/fsmonitor/fsm-path-utils-linux.c b/compat/fsmonitor/fsm-path-utils-linux.c\nindex c9866b1b24..da62f0b167 100644\n--- a/compat/fsmonitor/fsm-path-utils-linux.c\n+++ b/compat/fsmonitor/fsm-path-utils-linux.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n #include \"gettext.h\"\n #include \"trace.h\"\n \ndiff --git a/compat/fsmonitor/fsm-path-utils-win32.c b/compat/fsmonitor/fsm-path-utils-win32.c\nindex f4f9cc1f33..112149cf81 100644\n--- a/compat/fsmonitor/fsm-path-utils-win32.c\n+++ b/compat/fsmonitor/fsm-path-utils-win32.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n #include \"gettext.h\"\n #include \"trace.h\"\n \ndiff --git a/compat/fsmonitor/fsm-settings-unix.c b/compat/fsmonitor/fsm-settings-unix.c\nindex a382590635..41106355b1 100644\n--- a/compat/fsmonitor/fsm-settings-unix.c\n+++ b/compat/fsmonitor/fsm-settings-unix.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"fsmonitor-settings.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-settings.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n \n  /*\n  * For the builtin FSMonitor, we create the Unix domain socket for the\ndiff --git a/compat/fsmonitor/fsm-settings-win32.c b/compat/fsmonitor/fsm-settings-win32.c\nindex 0f2aa321f6..5b2872a4f1 100644\n--- a/compat/fsmonitor/fsm-settings-win32.c\n+++ b/compat/fsmonitor/fsm-settings-win32.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n #include \"config.h\"\n #include \"repository.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"fsmonitor-settings.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/fsmonitor-settings.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n \n /*\n  * VFS for Git is incompatible with FSMonitor.\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 785de5beb7..64814ac35d 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -5,13 +5,13 @@\n #include \"abspath.h\"\n #include \"odb/alloc.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"repository.h\"\n #include \"gettext.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"trace2.h\"\n #include \"win32.h\"\n #include \"win32/exit-process.h\"\ndiff --git a/config.c b/config.c\nindex 3f335dbec1..59c6029654 100644\n--- a/config.c\n+++ b/config.c\n@@ -12,7 +12,7 @@\n #include \"date.h\"\n #include \"branch.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"parse.h\"\n #include \"convert.h\"\n #include \"environment.h\"\ndiff --git a/convert.c b/convert.c\nindex 25c800eea2..f71d6dcefd 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -12,7 +12,7 @@\n #include \"attr.h\"\n #include \"run-command.h\"\n #include \"quote.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"sigchain.h\"\n #include \"pkt-line.h\"\n #include \"sub-process.h\"\ndiff --git a/diagnose.c b/diagnose.c\nindex 716dabf05c..0bac203282 100644\n--- a/diagnose.c\n+++ b/diagnose.c\n@@ -2,7 +2,7 @@\n #include \"diagnose.h\"\n #include \"compat/disk.h\"\n #include \"archive.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"help.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/diff/diff-lib.c b/diff/diff-lib.c\nindex d48196f7c7..4a932f9067 100644\n--- a/diff/diff-lib.c\n+++ b/diff/diff-lib.c\n@@ -13,17 +13,17 @@\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"revision/revision.h\"\n-#include \"cache-tree.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/unpack-trees.h\"\n #include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"submodule.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"trace.h\"\n-#include \"dir.h\"\n-#include \"fsmonitor.h\"\n+#include \"index/dir.h\"\n+#include \"index/fsmonitor.h\"\n #include \"revision/commit-reach.h\"\n \n /*\ndiff --git a/diff/diff-no-index.c b/diff/diff-no-index.c\nindex 19cb90d121..12a793096b 100644\n--- a/diff/diff-no-index.c\n+++ b/diff/diff-no-index.c\n@@ -15,9 +15,9 @@\n #include \"gettext.h\"\n #include \"revision/revision.h\"\n #include \"parse-options.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"string-list.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n \n static int read_directory_contents(const char *path, struct string_list *list,\n \t\t\t\t   const struct pathspec *pathspec,\ndiff --git a/diff/diff.c b/diff/diff.c\nindex 2b87f27238..c00b87cca2 100644\n--- a/diff/diff.c\n+++ b/diff/diff.c\n@@ -39,10 +39,10 @@\n #include \"parse-options.h\"\n #include \"help.h\"\n #include \"promisor-remote.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n #include \"strmap.h\"\n #include \"ws.h\"\ndiff --git a/diff/diff.h b/diff/diff.h\nindex 502bf24432..2ef74733b9 100644\n--- a/diff/diff.h\n+++ b/diff/diff.h\n@@ -5,7 +5,7 @@\n #define DIFF_H\n \n #include \"odb/hash.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"strbuf.h\"\n #include \"color.h\"\n \ndiff --git a/diff/tree-diff.c b/diff/tree-diff.c\nindex 4b7c90f6db..a34559daa5 100644\n--- a/diff/tree-diff.c\n+++ b/diff/tree-diff.c\n@@ -11,7 +11,7 @@\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"repository.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n \n /*\n  * Some mode bits are also used internally for computations.\ndiff --git a/git.c b/git.c\nindex 9dace05858..f01a80867b 100644\n--- a/git.c\n+++ b/git.c\n@@ -8,7 +8,7 @@\n #include \"help.h\"\n #include \"odb/object-file.h\"\n #include \"pager.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"run-command.h\"\n #include \"alias.h\"\n #include \"odb/replace-object.h\"\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 034bed7aaa..45a922496b 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -7,7 +7,7 @@\n #include \"gettext.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"ident.h\"\n #include \"gpg-interface.h\"\n #include \"path.h\"\ndiff --git a/help.c b/help.c\nindex 96f98ec621..f7a0950f6c 100644\n--- a/help.c\n+++ b/help.c\n@@ -18,7 +18,7 @@\n #include \"refs/refs.h\"\n #include \"parse-options.h\"\n #include \"prompt.h\"\n-#include \"fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-ipc.h\"\n #include \"repository.h\"\n #include \"alias.h\"\n #include \"utf8.h\"\ndiff --git a/cache-tree.c b/index/cache-tree.c\nsimilarity index 99%\nrename from cache-tree.c\nrename to index/cache-tree.c\nindex 1c4295761a..e7c4bfe45c 100644\n--- a/cache-tree.c\n+++ b/index/cache-tree.c\n@@ -7,11 +7,11 @@\n #include \"lockfile.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"odb/replace-object.h\"\n #include \"repository.h\"\n #include \"promisor-remote.h\"\ndiff --git a/cache-tree.h b/index/cache-tree.h\nsimilarity index 100%\nrename from cache-tree.h\nrename to index/cache-tree.h\ndiff --git a/checkout.c b/index/checkout.c\nsimilarity index 98%\nrename from checkout.c\nrename to index/checkout.c\nindex e3b4d341da..13d8895032 100644\n--- a/checkout.c\n+++ b/index/checkout.c\n@@ -5,7 +5,7 @@\n #include \"remote.h\"\n #include \"refs/refspec.h\"\n #include \"repository.h\"\n-#include \"checkout.h\"\n+#include \"index/checkout.h\"\n #include \"config.h\"\n #include \"strbuf.h\"\n \ndiff --git a/checkout.h b/index/checkout.h\nsimilarity index 100%\nrename from checkout.h\nrename to index/checkout.h\ndiff --git a/dir-iterator.c b/index/dir-iterator.c\nsimilarity index 99%\nrename from dir-iterator.c\nrename to index/dir-iterator.c\nindex 857e1d9bda..382bd4325c 100644\n--- a/dir-iterator.c\n+++ b/index/dir-iterator.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"iterator.h\"\n-#include \"dir-iterator.h\"\n+#include \"index/dir-iterator.h\"\n #include \"string-list.h\"\n \n struct dir_iterator_level {\ndiff --git a/dir-iterator.h b/index/dir-iterator.h\nsimilarity index 100%\nrename from dir-iterator.h\nrename to index/dir-iterator.h\ndiff --git a/dir.c b/index/dir.c\nsimilarity index 99%\nrename from dir.c\nrename to index/dir.c\nindex d230ecdec1..6f74a3e87c 100644\n--- a/dir.c\n+++ b/index/dir.c\n@@ -13,26 +13,26 @@\n #include \"abspath.h\"\n #include \"config.h\"\n #include \"convert.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"odb/object-file.h\"\n #include \"path.h\"\n #include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"wildmatch.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"utf8.h\"\n #include \"varint.h\"\n #include \"ewah/ewok.h\"\n-#include \"fsmonitor-ll.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"strbuf.h\"\n #include \"submodule-config.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n #include \"hex.h\"\ndiff --git a/dir.h b/index/dir.h\nsimilarity index 99%\nrename from dir.h\nrename to index/dir.h\nindex 239c7efb1e..c44cff5bdd 100644\n--- a/dir.h\n+++ b/index/dir.h\n@@ -3,8 +3,8 @@\n \n #include \"odb/hash.h\"\n #include \"hashmap.h\"\n-#include \"pathspec.h\"\n-#include \"statinfo.h\"\n+#include \"index/pathspec.h\"\n+#include \"index/statinfo.h\"\n #include \"strbuf.h\"\n \n struct repository;\ndiff --git a/entry.c b/index/entry.c\nsimilarity index 98%\nrename from entry.c\nrename to index/entry.c\nindex 823a433539..5b89ad2294 100644\n--- a/entry.c\n+++ b/index/entry.c\n@@ -3,18 +3,18 @@\n #include \"git-compat-util.h\"\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"name-hash.h\"\n-#include \"sparse-index.h\"\n+#include \"index/name-hash.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"progress.h\"\n-#include \"fsmonitor.h\"\n-#include \"entry.h\"\n-#include \"parallel-checkout.h\"\n+#include \"index/fsmonitor.h\"\n+#include \"index/entry.h\"\n+#include \"index/parallel-checkout.h\"\n \n static void create_directories(const char *path, int path_len,\n \t\t\t       const struct checkout *state)\ndiff --git a/entry.h b/index/entry.h\nsimilarity index 100%\nrename from entry.h\nrename to index/entry.h\ndiff --git a/fsmonitor--daemon.h b/index/fsmonitor--daemon.h\nsimilarity index 99%\nrename from fsmonitor--daemon.h\nrename to index/fsmonitor--daemon.h\nindex 5cbbec8d94..9a542198cd 100644\n--- a/fsmonitor--daemon.h\n+++ b/index/fsmonitor--daemon.h\n@@ -5,7 +5,7 @@\n \n #include \"hashmap.h\"\n #include \"thread-utils.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n \n struct fsmonitor_batch;\n struct fsmonitor_token_data;\ndiff --git a/fsmonitor-ipc.c b/index/fsmonitor-ipc.c\nsimilarity index 99%\nrename from fsmonitor-ipc.c\nrename to index/fsmonitor-ipc.c\nindex 6112d13064..7c213245a1 100644\n--- a/fsmonitor-ipc.c\n+++ b/index/fsmonitor-ipc.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n-#include \"fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-ipc.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\ndiff --git a/fsmonitor-ipc.h b/index/fsmonitor-ipc.h\nsimilarity index 100%\nrename from fsmonitor-ipc.h\nrename to index/fsmonitor-ipc.h\ndiff --git a/fsmonitor-ll.h b/index/fsmonitor-ll.h\nsimilarity index 100%\nrename from fsmonitor-ll.h\nrename to index/fsmonitor-ll.h\ndiff --git a/fsmonitor-path-utils.h b/index/fsmonitor-path-utils.h\nsimilarity index 100%\nrename from fsmonitor-path-utils.h\nrename to index/fsmonitor-path-utils.h\ndiff --git a/fsmonitor-settings.c b/index/fsmonitor-settings.c\nsimilarity index 98%\nrename from fsmonitor-settings.c\nrename to index/fsmonitor-settings.c\nindex a6587a8972..883b5902a9 100644\n--- a/fsmonitor-settings.c\n+++ b/index/fsmonitor-settings.c\n@@ -2,9 +2,9 @@\n #include \"config.h\"\n #include \"gettext.h\"\n #include \"repository.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"fsmonitor-settings.h\"\n-#include \"fsmonitor-path-utils.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-settings.h\"\n+#include \"index/fsmonitor-path-utils.h\"\n \n /*\n  * We keep this structure definition private and have getters\ndiff --git a/fsmonitor-settings.h b/index/fsmonitor-settings.h\nsimilarity index 100%\nrename from fsmonitor-settings.h\nrename to index/fsmonitor-settings.h\ndiff --git a/fsmonitor.c b/index/fsmonitor.c\nsimilarity index 99%\nrename from fsmonitor.c\nrename to index/fsmonitor.c\nindex 107767527e..606a59d36d 100644\n--- a/fsmonitor.c\n+++ b/index/fsmonitor.c\n@@ -3,12 +3,12 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"ewah/ewok.h\"\n-#include \"fsmonitor.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"name-hash.h\"\n+#include \"index/fsmonitor.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/name-hash.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\ndiff --git a/fsmonitor.h b/index/fsmonitor.h\nsimilarity index 95%\nrename from fsmonitor.h\nrename to index/fsmonitor.h\nindex 59591ee49e..95f4eaefa4 100644\n--- a/fsmonitor.h\n+++ b/index/fsmonitor.h\n@@ -1,11 +1,11 @@\n #ifndef FSMONITOR_H\n #define FSMONITOR_H\n \n-#include \"fsmonitor-ll.h\"\n-#include \"dir.h\"\n-#include \"fsmonitor-settings.h\"\n+#include \"index/fsmonitor-ll.h\"\n+#include \"index/dir.h\"\n+#include \"index/fsmonitor-settings.h\"\n #include \"odb/object.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"trace.h\"\n \n /*\ndiff --git a/name-hash.c b/index/name-hash.c\nsimilarity index 99%\nrename from name-hash.c\nrename to index/name-hash.c\nindex 1464b6d066..5d126bc1a3 100644\n--- a/name-hash.c\n+++ b/index/name-hash.c\n@@ -12,13 +12,13 @@\n #include \"git-compat-util.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"odb/object.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"thread-utils.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n \n struct dir_entry {\n \tstruct hashmap_entry ent;\ndiff --git a/name-hash.h b/index/name-hash.h\nsimilarity index 100%\nrename from name-hash.h\nrename to index/name-hash.h\ndiff --git a/parallel-checkout.c b/index/parallel-checkout.c\nsimilarity index 99%\nrename from parallel-checkout.c\nrename to index/parallel-checkout.c\nindex 85d1c25a81..971c4b33fa 100644\n--- a/parallel-checkout.c\n+++ b/index/parallel-checkout.c\n@@ -3,18 +3,18 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"entry.h\"\n+#include \"index/entry.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"parallel-checkout.h\"\n+#include \"index/parallel-checkout.h\"\n #include \"pkt-line.h\"\n #include \"progress.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"run-command.h\"\n #include \"sigchain.h\"\n #include \"odb/streaming.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"thread-utils.h\"\n #include \"trace2.h\"\n \ndiff --git a/parallel-checkout.h b/index/parallel-checkout.h\nsimilarity index 100%\nrename from parallel-checkout.h\nrename to index/parallel-checkout.h\ndiff --git a/pathspec.c b/index/pathspec.c\nsimilarity index 99%\nrename from pathspec.c\nrename to index/pathspec.c\nindex 281858f21f..7a0c152fb9 100644\n--- a/pathspec.c\n+++ b/index/pathspec.c\n@@ -3,16 +3,16 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"parse.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"attr.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"quote.h\"\n #include \"wildmatch.h\"\n \ndiff --git a/pathspec.h b/index/pathspec.h\nsimilarity index 100%\nrename from pathspec.h\nrename to index/pathspec.h\ndiff --git a/preload-index.c b/index/preload-index.c\nsimilarity index 96%\nrename from preload-index.c\nrename to index/preload-index.c\nindex b222821b44..eab3bfc602 100644\n--- a/preload-index.c\n+++ b/index/preload-index.c\n@@ -5,18 +5,18 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"pathspec.h\"\n-#include \"dir.h\"\n+#include \"index/pathspec.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n-#include \"fsmonitor.h\"\n+#include \"index/fsmonitor.h\"\n #include \"gettext.h\"\n #include \"parse.h\"\n-#include \"preload-index.h\"\n+#include \"index/preload-index.h\"\n #include \"progress.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"thread-utils.h\"\n #include \"repository.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"trace2.h\"\n #include \"config.h\"\n \ndiff --git a/preload-index.h b/index/preload-index.h\nsimilarity index 100%\nrename from preload-index.h\nrename to index/preload-index.h\ndiff --git a/read-cache-ll.h b/index/read-cache-ll.h\nsimilarity index 99%\nrename from read-cache-ll.h\nrename to index/read-cache-ll.h\nindex 312e65ff3c..450de019b4 100644\n--- a/read-cache-ll.h\n+++ b/index/read-cache-ll.h\n@@ -3,7 +3,7 @@\n \n #include \"odb/hash.h\"\n #include \"hashmap.h\"\n-#include \"statinfo.h\"\n+#include \"index/statinfo.h\"\n \n /*\n  * Basic data structures for the directory cache\ndiff --git a/read-cache.c b/index/read-cache.c\nsimilarity index 99%\nrename from read-cache.c\nrename to index/read-cache.c\nindex a970eb1b6a..9c62ae5ee8 100644\n--- a/read-cache.c\n+++ b/index/read-cache.c\n@@ -15,9 +15,9 @@\n #include \"hex.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"refs/refs.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/transaction.h\"\n@@ -27,24 +27,24 @@\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"mem-pool.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n-#include \"preload-index.h\"\n-#include \"read-cache.h\"\n+#include \"index/preload-index.h\"\n+#include \"index/read-cache.h\"\n #include \"repository.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"revision/revision.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\n #include \"varint.h\"\n-#include \"split-index.h\"\n-#include \"symlinks.h\"\n+#include \"index/split-index.h\"\n+#include \"index/symlinks.h\"\n #include \"utf8.h\"\n-#include \"fsmonitor.h\"\n+#include \"index/fsmonitor.h\"\n #include \"thread-utils.h\"\n #include \"progress.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"csum-file.h\"\n #include \"promisor-remote.h\"\n #include \"hook.h\"\ndiff --git a/read-cache.h b/index/read-cache.h\nsimilarity index 95%\nrename from read-cache.h\nrename to index/read-cache.h\nindex 69a7118a66..d8519c7b36 100644\n--- a/read-cache.h\n+++ b/index/read-cache.h\n@@ -1,9 +1,9 @@\n #ifndef READ_CACHE_H\n #define READ_CACHE_H\n \n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"odb/object.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"environment.h\"\n \n /*\ndiff --git a/resolve-undo.c b/index/resolve-undo.c\nsimilarity index 97%\nrename from resolve-undo.c\nrename to index/resolve-undo.c\nindex a54b6c0f79..b94d8b403c 100644\n--- a/resolve-undo.c\n+++ b/index/resolve-undo.c\n@@ -1,11 +1,11 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/hash.h\"\n-#include \"read-cache.h\"\n-#include \"resolve-undo.h\"\n-#include \"sparse-index.h\"\n+#include \"index/read-cache.h\"\n+#include \"index/resolve-undo.h\"\n+#include \"index/sparse-index.h\"\n #include \"string-list.h\"\n \n /* The only error case is to run out of memory in string-list */\ndiff --git a/resolve-undo.h b/index/resolve-undo.h\nsimilarity index 100%\nrename from resolve-undo.h\nrename to index/resolve-undo.h\ndiff --git a/sparse-index.c b/index/sparse-index.c\nsimilarity index 99%\nrename from sparse-index.c\nrename to index/sparse-index.c\nindex 8e00862442..0a061a7658 100644\n--- a/sparse-index.c\n+++ b/index/sparse-index.c\n@@ -5,17 +5,17 @@\n #include \"environment.h\"\n #include \"ewah/ewok.h\"\n #include \"gettext.h\"\n-#include \"name-hash.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/name-hash.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"odb/tree.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"trace2.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n-#include \"fsmonitor-ll.h\"\n+#include \"index/dir.h\"\n+#include \"index/fsmonitor-ll.h\"\n #include \"advice.h\"\n \n /**\ndiff --git a/sparse-index.h b/index/sparse-index.h\nsimilarity index 100%\nrename from sparse-index.h\nrename to index/sparse-index.h\ndiff --git a/split-index.c b/index/split-index.c\nsimilarity index 99%\nrename from split-index.c\nrename to index/split-index.c\nindex 2737cc6118..02a5b011c5 100644\n--- a/split-index.c\n+++ b/index/split-index.c\n@@ -4,9 +4,9 @@\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"mem-pool.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n-#include \"split-index.h\"\n+#include \"index/split-index.h\"\n #include \"strbuf.h\"\n #include \"ewah/ewok.h\"\n \ndiff --git a/split-index.h b/index/split-index.h\nsimilarity index 100%\nrename from split-index.h\nrename to index/split-index.h\ndiff --git a/statinfo.c b/index/statinfo.c\nsimilarity index 99%\nrename from statinfo.c\nrename to index/statinfo.c\nindex 5e00af127d..4a22923009 100644\n--- a/statinfo.c\n+++ b/index/statinfo.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"environment.h\"\n-#include \"statinfo.h\"\n+#include \"index/statinfo.h\"\n #include \"repository.h\"\n \n /*\ndiff --git a/statinfo.h b/index/statinfo.h\nsimilarity index 100%\nrename from statinfo.h\nrename to index/statinfo.h\ndiff --git a/symlinks.c b/index/symlinks.c\nsimilarity index 99%\nrename from symlinks.c\nrename to index/symlinks.c\nindex 9e01ab3bc8..18fadf3f75 100644\n--- a/symlinks.c\n+++ b/index/symlinks.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"setup.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n \n static int threaded_check_leading_path(struct cache_def *cache, const char *name,\n \t\t\t\t       int len, int warn_on_lstat_err);\ndiff --git a/symlinks.h b/index/symlinks.h\nsimilarity index 100%\nrename from symlinks.h\nrename to index/symlinks.h\ndiff --git a/unpack-trees.c b/index/unpack-trees.c\nsimilarity index 99%\nrename from unpack-trees.c\nrename to index/unpack-trees.c\nindex b911700d74..68d85f622e 100644\n--- a/unpack-trees.c\n+++ b/index/unpack-trees.c\n@@ -6,30 +6,30 @@\n #include \"strvec.h\"\n #include \"repository.h\"\n #include \"parse.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"cache-tree.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/unpack-trees.h\"\n #include \"progress.h\"\n #include \"refs/refs.h\"\n #include \"attr.h\"\n-#include \"read-cache.h\"\n-#include \"split-index.h\"\n-#include \"sparse-index.h\"\n+#include \"index/read-cache.h\"\n+#include \"index/split-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"trace2.h\"\n-#include \"fsmonitor.h\"\n+#include \"index/fsmonitor.h\"\n #include \"odb/odb.h\"\n #include \"promisor-remote.h\"\n-#include \"entry.h\"\n-#include \"parallel-checkout.h\"\n+#include \"index/entry.h\"\n+#include \"index/parallel-checkout.h\"\n #include \"setup.h\"\n \n /*\ndiff --git a/unpack-trees.h b/index/unpack-trees.h\nsimilarity index 99%\nrename from unpack-trees.h\nrename to index/unpack-trees.h\nindex d9d3ce09fd..f652a43f11 100644\n--- a/unpack-trees.h\n+++ b/index/unpack-trees.h\n@@ -2,7 +2,7 @@\n #define UNPACK_TREES_H\n \n #include \"convert.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"strvec.h\"\n #include \"string-list.h\"\n #include \"odb/tree-walk.h\"\ndiff --git a/wt-status.c b/index/wt-status.c\nsimilarity index 99%\nrename from wt-status.c\nrename to index/wt-status.c\nindex 83fdf5334f..3381a40e75 100644\n--- a/wt-status.c\n+++ b/index/wt-status.c\n@@ -3,9 +3,9 @@\n \n #include \"git-compat-util.h\"\n #include \"advice.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"odb/object.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n #include \"environment.h\"\n@@ -24,7 +24,7 @@\n #include \"refs/refs.h\"\n #include \"submodule.h\"\n #include \"column.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"setup.h\"\n #include \"strbuf.h\"\n #include \"trace.h\"\n@@ -34,7 +34,7 @@\n #include \"refs/worktree.h\"\n #include \"lockfile.h\"\n #include \"sequencer.h\"\n-#include \"fsmonitor-settings.h\"\n+#include \"index/fsmonitor-settings.h\"\n \n #define AB_DELAY_WARNING_IN_MS (2 * 1000)\n #define UF_DELAY_WARNING_IN_MS (2 * 1000)\ndiff --git a/wt-status.h b/index/wt-status.h\nsimilarity index 99%\nrename from wt-status.h\nrename to index/wt-status.h\nindex e9fe32e98c..b7a508186d 100644\n--- a/wt-status.h\n+++ b/index/wt-status.h\n@@ -3,7 +3,7 @@\n \n #include \"string-list.h\"\n #include \"color.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"remote.h\"\n \n struct repository;\ndiff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c\nindex 846753abdf..c31ed7028d 100644\n--- a/merge-ort-wrappers.c\n+++ b/merge-ort-wrappers.c\n@@ -5,7 +5,7 @@\n #include \"lockfile.h\"\n #include \"merge-ort.h\"\n #include \"merge-ort-wrappers.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"odb/tag.h\"\n #include \"odb/tree.h\"\ndiff --git a/merge-ort.c b/merge-ort.c\nindex 71274c24bf..516cd265c5 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -23,17 +23,17 @@\n #include \"odb/alloc.h\"\n #include \"advice.h\"\n #include \"attr.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"odb/commit.h\"\n #include \"revision/commit-reach.h\"\n #include \"config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"entry.h\"\n+#include \"index/entry.h\"\n #include \"merge-ll.h\"\n #include \"odb/match-trees.h\"\n #include \"mem-pool.h\"\n@@ -43,14 +43,14 @@\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"promisor-remote.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"refs/refs.h\"\n #include \"revision/revision.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"strmap.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"diff/xdiff-interface.h\"\n \n /*\ndiff --git a/merge.c b/merge.c\nindex f46d968b70..0fcfc1460f 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -9,10 +9,10 @@\n #include \"odb/commit.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n \n static const char *merge_argument(struct commit *commit)\n {\ndiff --git a/meson.build b/meson.build\nindex 65be53078d..c61ebc35a6 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -326,10 +326,10 @@ libgit_sources = [\n   'branch.c',\n   'bundle-uri.c',\n   'bundle.c',\n-  'cache-tree.c',\n+  'index/cache-tree.c',\n   'odb/cbtree.c',\n   'chdir-notify.c',\n-  'checkout.c',\n+  'index/checkout.c',\n   'pack/chunk-format.c',\n   'color.c',\n   'column.c',\n@@ -363,10 +363,10 @@ libgit_sources = [\n   'diff/diffcore-pickaxe.c',\n   'diff/diffcore-rename.c',\n   'diff/diffcore-rotate.c',\n-  'dir-iterator.c',\n-  'dir.c',\n+  'index/dir-iterator.c',\n+  'index/dir.c',\n   'editor.c',\n-  'entry.c',\n+  'index/entry.c',\n   'environment.c',\n   'ewah/bitmap.c',\n   'ewah/ewah_bitmap.c',\n@@ -378,9 +378,9 @@ libgit_sources = [\n   'fetch-pack.c',\n   'fmt-merge-msg.c',\n   'odb/fsck.c',\n-  'fsmonitor.c',\n-  'fsmonitor-ipc.c',\n-  'fsmonitor-settings.c',\n+  'index/fsmonitor.c',\n+  'index/fsmonitor-ipc.c',\n+  'index/fsmonitor-settings.c',\n   'gettext.c',\n   'git-zlib.c',\n   'gpg-interface.c',\n@@ -418,7 +418,7 @@ libgit_sources = [\n   'merge.c',\n   'pack/midx.c',\n   'pack/midx-write.c',\n-  'name-hash.c',\n+  'index/name-hash.c',\n   'negotiator/default.c',\n   'negotiator/noop.c',\n   'negotiator/skipping.c',\n@@ -457,7 +457,7 @@ libgit_sources = [\n   'pack/packfile.c',\n   'pack/packfile-list.c',\n   'pager.c',\n-  'parallel-checkout.c',\n+  'index/parallel-checkout.c',\n   'parse.c',\n   'parse-options-cb.c',\n   'parse-options.c',\n@@ -465,9 +465,9 @@ libgit_sources = [\n   'diff/patch-ids.c',\n   'path.c',\n   'path-walk.c',\n-  'pathspec.c',\n+  'index/pathspec.c',\n   'pkt-line.c',\n-  'preload-index.c',\n+  'index/preload-index.c',\n   'revision/pretty.c',\n   'prio-queue.c',\n   'progress.c',\n@@ -480,7 +480,7 @@ libgit_sources = [\n   'quote.c',\n   'diff/range-diff.c',\n   'pack/reachable.c',\n-  'read-cache.c',\n+  'index/read-cache.c',\n   'rebase-interactive.c',\n   'rebase.c',\n   'refs/ref-filter.c',\n@@ -521,7 +521,7 @@ libgit_sources = [\n   'repository.c',\n   'rerere.c',\n   'reset.c',\n-  'resolve-undo.c',\n+  'index/resolve-undo.c',\n   'revision/revision.c',\n   'run-command.c',\n   'send-pack.c',\n@@ -532,10 +532,10 @@ libgit_sources = [\n   'revision/shallow.c',\n   'sideband.c',\n   'sigchain.c',\n-  'sparse-index.c',\n-  'split-index.c',\n+  'index/sparse-index.c',\n+  'index/split-index.c',\n   'stable-qsort.c',\n-  'statinfo.c',\n+  'index/statinfo.c',\n   'strbuf.c',\n   'string-list.c',\n   'strmap.c',\n@@ -543,7 +543,7 @@ libgit_sources = [\n   'sub-process.c',\n   'submodule-config.c',\n   'submodule.c',\n-  'symlinks.c',\n+  'index/symlinks.c',\n   'odb/tag.c',\n   'tempfile.c',\n   'thread-utils.c',\n@@ -568,7 +568,7 @@ libgit_sources = [\n   'diff/tree-diff.c',\n   'odb/tree-walk.c',\n   'odb/tree.c',\n-  'unpack-trees.c',\n+  'index/unpack-trees.c',\n   'upload-pack.c',\n   'url.c',\n   'urlmatch.c',\n@@ -583,7 +583,7 @@ libgit_sources = [\n   'wrapper.c',\n   'write-or-die.c',\n   'ws.c',\n-  'wt-status.c',\n+  'index/wt-status.c',\n   'diff/xdiff-interface.c',\n   'xdiff/xdiffi.c',\n   'xdiff/xemit.c',\ndiff --git a/notes-merge.c b/notes-merge.c\nindex 53f42ba863..2bb6ad735e 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -16,7 +16,7 @@\n #include \"hex.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"merge-ll.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"notes.h\"\n #include \"notes-merge.h\"\n #include \"strbuf.h\"\ndiff --git a/odb/commit.c b/odb/commit.c\nindex 1b0703a9ef..3b490c760c 100644\n--- a/odb/commit.c\n+++ b/odb/commit.c\n@@ -20,7 +20,7 @@\n #include \"odb/commit-slab.h\"\n #include \"prio-queue.h\"\n #include \"odb/hash-lookup.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"advice.h\"\n #include \"refs/refs.h\"\n #include \"revision/commit-reach.h\"\ndiff --git a/odb/fsck.c b/odb/fsck.c\nindex 8c953f61a4..e889268b48 100644\n--- a/odb/fsck.c\n+++ b/odb/fsck.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"date.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\ndiff --git a/odb/hash-lookup.c b/odb/hash-lookup.c\nindex cf2d4a0245..9e8e5efb4f 100644\n--- a/odb/hash-lookup.c\n+++ b/odb/hash-lookup.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"odb/hash.h\"\n #include \"odb/hash-lookup.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n \n static uint32_t take2(const struct object_id *oid, size_t ofs)\n {\ndiff --git a/odb/object-file.c b/odb/object-file.c\nindex 41ee67abb6..847b78e5c7 100644\n--- a/odb/object-file.c\n+++ b/odb/object-file.c\n@@ -11,7 +11,7 @@\n \n #include \"git-compat-util.h\"\n #include \"convert.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"odb/fsck.h\"\n #include \"gettext.h\"\n@@ -25,7 +25,7 @@\n #include \"pack/pack.h\"\n #include \"pack/packfile.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n #include \"strvec.h\"\n #include \"tempfile.h\"\ndiff --git a/odb/object-name.c b/odb/object-name.c\nindex 825fc717bf..95a63c7f64 100644\n--- a/odb/object-name.c\n+++ b/odb/object-name.c\n@@ -14,11 +14,11 @@\n #include \"odb/tree-walk.h\"\n #include \"refs/refs.h\"\n #include \"remote.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n #include \"revision/pretty.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repo-settings.h\"\n #include \"repository.h\"\n #include \"setup.h\"\ndiff --git a/odb/object.c b/odb/object.c\nindex 7c2f920d3f..cd93a7b47b 100644\n--- a/odb/object.c\n+++ b/odb/object.c\n@@ -8,7 +8,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/streaming.h\"\n #include \"odb/blob.h\"\n-#include \"statinfo.h\"\n+#include \"index/statinfo.h\"\n #include \"odb/tree.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\ndiff --git a/odb/odb.c b/odb/odb.c\nindex e942149d91..4e408501e8 100644\n--- a/odb/odb.c\n+++ b/odb/odb.c\n@@ -2,7 +2,7 @@\n #include \"abspath.h\"\n #include \"pack/commit-graph.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/odb/source-packed.c b/odb/source-packed.c\nindex c1e2756471..d3def038c6 100644\n--- a/odb/source-packed.c\n+++ b/odb/source-packed.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"chdir-notify.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"git-zlib.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"mergesort.h\"\ndiff --git a/odb/tmp-objdir.c b/odb/tmp-objdir.c\nindex b9ba5c4cd3..21219e8797 100644\n--- a/odb/tmp-objdir.c\n+++ b/odb/tmp-objdir.c\n@@ -2,7 +2,7 @@\n #include \"odb/tmp-objdir.h\"\n #include \"abspath.h\"\n #include \"chdir-notify.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"odb/object-file.h\"\n #include \"path.h\"\ndiff --git a/odb/tree-walk.c b/odb/tree-walk.c\nindex 51e8037ef5..e3e22e1a32 100644\n--- a/odb/tree-walk.c\n+++ b/odb/tree-walk.c\n@@ -2,17 +2,17 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/tree-walk.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"trace2.h\"\n #include \"odb/tree.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"json-writer.h\"\n #include \"environment.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n \n static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned long size, struct strbuf *err)\n {\ndiff --git a/organize/gitorganize-format.c b/organize/gitorganize-format.c\nindex 541dd373aa..8edf1659e0 100644\n--- a/organize/gitorganize-format.c\n+++ b/organize/gitorganize-format.c\n@@ -2,7 +2,7 @@\n #include \"gitorganize-format.h\"\n #include \"gettext.h\"\n #include \"quote.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"wrapper.h\"\ndiff --git a/organize/organize.c b/organize/organize.c\nindex 298557a3da..f1f0aec6ea 100644\n--- a/organize/organize.c\n+++ b/organize/organize.c\n@@ -5,16 +5,16 @@\n #include \"organizer-protocol.h\"\n #include \"config.h\"\n #include \"gettext.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"quote.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"wrapper.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n \n /* The configured command organize.<key> (labeler or organizer), or NULL. */\n static const char *organize_command(struct repository *repo, const char *key)\ndiff --git a/pack/midx.c b/pack/midx.c\nindex 2608e99468..76e77d0dd2 100644\n--- a/pack/midx.c\n+++ b/pack/midx.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"hex.h\"\n #include \"pack/packfile.h\"\n #include \"odb/hash-lookup.h\"\ndiff --git a/pack/packfile.c b/pack/packfile.c\nindex 72252faffe..77de6bb821 100644\n--- a/pack/packfile.c\n+++ b/pack/packfile.c\n@@ -7,7 +7,7 @@\n #include \"revision/list.h\"\n #include \"pack/pack.h\"\n #include \"repository.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"pack/packfile.h\"\n #include \"pack/delta.h\"\n #include \"odb/hash-lookup.h\"\ndiff --git a/pack/reachable.c b/pack/reachable.c\nindex f61525308e..5b8a2a4f79 100644\n--- a/pack/reachable.c\n+++ b/pack/reachable.c\n@@ -9,7 +9,7 @@\n #include \"diff/diff.h\"\n #include \"revision/revision.h\"\n #include \"pack/reachable.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"progress.h\"\n #include \"revision/list-objects.h\"\n #include \"pack/packfile.h\"\ndiff --git a/pack/repack.c b/pack/repack.c\nindex 91dde13b29..52e7779a44 100644\n--- a/pack/repack.c\n+++ b/pack/repack.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"pack/midx.h\"\n #include \"odb/odb.h\"\n #include \"pack/packfile.h\"\ndiff --git a/pack/server-info.c b/pack/server-info.c\nindex 627d2e3c98..dbd86d6fd2 100644\n--- a/pack/server-info.c\n+++ b/pack/server-info.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"hex.h\"\n #include \"repository.h\"\n #include \"refs/refs.h\"\ndiff --git a/path-walk.c b/path-walk.c\nindex 4b8ddb2a28..00686d3dbf 100644\n--- a/path-walk.c\n+++ b/path-walk.c\n@@ -5,7 +5,7 @@\n #include \"path-walk.h\"\n #include \"odb/blob.h\"\n #include \"odb/commit.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"hashmap.h\"\n #include \"hex.h\"\n #include \"revision/list-objects.h\"\ndiff --git a/path.c b/path.c\nindex 516abb3f82..e4d489e10a 100644\n--- a/path.c\n+++ b/path.c\n@@ -8,7 +8,7 @@\n #include \"repository.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"refs/worktree.h\"\n #include \"setup.h\"\n #include \"submodule-config.h\"\ndiff --git a/rebase-interactive.c b/rebase-interactive.c\nindex df9c2d1275..ee2ef8b535 100644\n--- a/rebase-interactive.c\n+++ b/rebase-interactive.c\n@@ -11,7 +11,7 @@\n #include \"strbuf.h\"\n #include \"odb/commit-slab.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/object-name.h\"\n \n static const char edit_todo_list_advice[] =\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex a792297d8f..e6e07938a3 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -16,10 +16,10 @@\n #include \"packed-backend.h\"\n #include \"../ident.h\"\n #include \"../iterator.h\"\n-#include \"../dir-iterator.h\"\n+#include \"index/dir-iterator.h\"\n #include \"../lockfile.h\"\n #include \"../path.h\"\n-#include \"../dir.h\"\n+#include \"index/dir.h\"\n #include \"../chdir-notify.h\"\n #include \"../setup.h\"\n #include \"refs/worktree.h\"\ndiff --git a/refs/packed-backend.c b/refs/packed-backend.c\nindex afcb800a5f..97f76c1d76 100644\n--- a/refs/packed-backend.c\n+++ b/refs/packed-backend.c\n@@ -2,7 +2,7 @@\n \n #include \"../git-compat-util.h\"\n #include \"../config.h\"\n-#include \"../dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/fsck.h\"\n #include \"../gettext.h\"\n #include \"odb/hash.h\"\n@@ -13,7 +13,7 @@\n #include \"../iterator.h\"\n #include \"../lockfile.h\"\n #include \"../chdir-notify.h\"\n-#include \"../statinfo.h\"\n+#include \"index/statinfo.h\"\n #include \"refs/worktree.h\"\n #include \"../wrapper.h\"\n #include \"../write-or-die.h\"\ndiff --git a/refs/ref-filter.c b/refs/ref-filter.c\nindex 7635e13f88..32027789a8 100644\n--- a/refs/ref-filter.c\n+++ b/refs/ref-filter.c\n@@ -28,7 +28,7 @@\n #include \"utf8.h\"\n #include \"versioncmp.h\"\n #include \"trailer.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"odb/commit-slab.h\"\n #include \"revision/commit-reach.h\"\n #include \"refs/worktree.h\"\ndiff --git a/refs/reftable-backend.c b/refs/reftable-backend.c\nindex 120f9c947f..0c02b2d287 100644\n--- a/refs/reftable-backend.c\n+++ b/refs/reftable-backend.c\n@@ -2,7 +2,7 @@\n #include \"../abspath.h\"\n #include \"../chdir-notify.h\"\n #include \"../config.h\"\n-#include \"../dir.h\"\n+#include \"index/dir.h\"\n #include \"../environment.h\"\n #include \"odb/fsck.h\"\n #include \"../gettext.h\"\ndiff --git a/refs/worktree.c b/refs/worktree.c\nindex 3578229534..0f1fe6a7d2 100644\n--- a/refs/worktree.c\n+++ b/refs/worktree.c\n@@ -10,8 +10,8 @@\n #include \"setup.h\"\n #include \"strbuf.h\"\n #include \"refs/worktree.h\"\n-#include \"dir.h\"\n-#include \"wt-status.h\"\n+#include \"index/dir.h\"\n+#include \"index/wt-status.h\"\n #include \"config.h\"\n \n void free_worktree(struct worktree *worktree)\ndiff --git a/remote.c b/remote.c\nindex 8a65967fb0..2b376893b3 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -18,7 +18,7 @@\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n #include \"revision/revision.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\ndiff --git a/repository.c b/repository.c\nindex b5e442f9f3..8771145515 100644\n--- a/repository.c\n+++ b/repository.c\n@@ -9,12 +9,12 @@\n #include \"odb/object.h\"\n #include \"lockfile.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"remote.h\"\n #include \"setup.h\"\n #include \"odb/loose.h\"\n #include \"submodule-config.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"trace2.h\"\n #include \"promisor-remote.h\"\n #include \"refs/refs.h\"\ndiff --git a/rerere.c b/rerere.c\nindex 3055989a41..df30ebbe93 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -10,14 +10,14 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"string-list.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"rerere.h\"\n #include \"diff/xdiff-interface.h\"\n-#include \"dir.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/dir.h\"\n+#include \"index/resolve-undo.h\"\n #include \"merge-ll.h\"\n #include \"path.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"strmap.h\"\ndiff --git a/reset.c b/reset.c\nindex 29bbeaa9d4..0eddc94d8c 100644\n--- a/reset.c\n+++ b/reset.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n@@ -8,7 +8,7 @@\n #include \"reset.h\"\n #include \"odb/tree-walk.h\"\n #include \"odb/tree.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"hook.h\"\n \n static int update_refs(struct repository *repo,\ndiff --git a/revision/bisect.c b/revision/bisect.c\nindex 696e365310..7805872c3e 100644\n--- a/revision/bisect.c\n+++ b/revision/bisect.c\n@@ -22,7 +22,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n \n static struct oid_array good_revs;\n static struct oid_array skipped_revs;\ndiff --git a/revision/blame.c b/revision/blame.c\nindex 54284ed8da..a75bf22193 100644\n--- a/revision/blame.c\n+++ b/revision/blame.c\n@@ -4,7 +4,7 @@\n #include \"git-compat-util.h\"\n #include \"refs/refs.h\"\n #include \"odb/odb.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"mergesort.h\"\n #include \"odb/commit.h\"\n #include \"convert.h\"\n@@ -13,7 +13,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"path.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"revision/revision.h\"\n #include \"setup.h\"\n #include \"odb/tag.h\"\ndiff --git a/revision/list-objects-filter.c b/revision/list-objects-filter.c\nindex 0ea4cb826e..da88781aef 100644\n--- a/revision/list-objects-filter.c\n+++ b/revision/list-objects-filter.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\ndiff --git a/revision/revision.c b/revision/revision.c\nindex 9a19a5654a..97c6fa6fef 100644\n--- a/revision/revision.c\n+++ b/revision/revision.c\n@@ -29,14 +29,14 @@\n #include \"revision/log-tree.h\"\n #include \"mailmap.h\"\n #include \"odb/commit-slab.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"revision/bisect.h\"\n #include \"pack/packfile.h\"\n #include \"refs/worktree.h\"\n #include \"path.h\"\n-#include \"read-cache.h\"\n+#include \"index/read-cache.h\"\n #include \"setup.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"trace2.h\"\n #include \"revision/commit-reach.h\"\n@@ -47,7 +47,7 @@\n #include \"pack/bloom.h\"\n #include \"json-writer.h\"\n #include \"revision/list-objects-filter-options.h\"\n-#include \"resolve-undo.h\"\n+#include \"index/resolve-undo.h\"\n #include \"parse-options.h\"\n #include \"wildmatch.h\"\n \ndiff --git a/revision/shallow.c b/revision/shallow.c\nindex 51ba602971..f4ce207278 100644\n--- a/revision/shallow.c\n+++ b/revision/shallow.c\n@@ -18,7 +18,7 @@\n #include \"revision/list-objects.h\"\n #include \"revision/commit-reach.h\"\n #include \"revision/shallow.h\"\n-#include \"statinfo.h\"\n+#include \"index/statinfo.h\"\n #include \"trace.h\"\n \n void set_alternate_shallow_file(struct repository *r, const char *path)\ndiff --git a/run-command.c b/run-command.c\nindex e0c4325900..80382354dc 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -7,7 +7,7 @@\n #include \"gettext.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n-#include \"symlinks.h\"\n+#include \"index/symlinks.h\"\n #include \"thread-utils.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\ndiff --git a/scalar.c b/scalar.c\nindex 2cb09af1a5..d1e397ef50 100644\n--- a/scalar.c\n+++ b/scalar.c\n@@ -11,10 +11,10 @@\n #include \"config.h\"\n #include \"run-command.h\"\n #include \"simple-ipc.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"fsmonitor-settings.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/fsmonitor-settings.h\"\n #include \"refs/refs.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"pack/packfile.h\"\n #include \"help.h\"\n #include \"setup.h\"\ndiff --git a/sequencer.c b/sequencer.c\nindex d5b1eb9719..f4a0f77eaf 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -10,7 +10,7 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n@@ -21,7 +21,7 @@\n #include \"run-command.h\"\n #include \"hook.h\"\n #include \"utf8.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"diff/diff.h\"\n #include \"path.h\"\n #include \"revision/revision.h\"\n@@ -30,16 +30,16 @@\n #include \"merge-ort.h\"\n #include \"merge-ort-wrappers.h\"\n #include \"refs/refs.h\"\n-#include \"sparse-index.h\"\n+#include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"quote.h\"\n #include \"trailer.h\"\n #include \"revision/log-tree.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n #include \"hashmap.h\"\n #include \"notes-utils.h\"\n #include \"sigchain.h\"\n-#include \"unpack-trees.h\"\n+#include \"index/unpack-trees.h\"\n #include \"odb/oidmap.h\"\n #include \"odb/oidset.h\"\n #include \"odb/commit-slab.h\"\ndiff --git a/sequencer.h b/sequencer.h\nindex 64a9c7fb1b..0906cc127d 100644\n--- a/sequencer.h\n+++ b/sequencer.h\n@@ -3,7 +3,7 @@\n \n #include \"strbuf.h\"\n #include \"strvec.h\"\n-#include \"wt-status.h\"\n+#include \"index/wt-status.h\"\n \n struct commit;\n struct index_state;\ndiff --git a/setup.c b/setup.c\nindex 62fbda948d..e4e9ca83fe 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -12,7 +12,7 @@\n #include \"refs/refs.h\"\n #include \"repository.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"setup.h\"\n #include \"revision/shallow.h\"\n #include \"string-list.h\"\ndiff --git a/submodule-config.c b/submodule-config.c\nindex 094e64d8fd..c8be0acbb1 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\ndiff --git a/submodule.c b/submodule.c\nindex 16f4d30b82..e14b53d3c8 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -7,7 +7,7 @@\n #include \"config.h\"\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"environment.h\"\n@@ -29,7 +29,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"revision/commit-reach.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n #include \"advice.h\"\n #include \"url.h\"\ndiff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c\nindex 9f613d2911..cf7e7efc5d 100644\n--- a/t/helper/test-cache-tree.c\n+++ b/t/helper/test-cache-tree.c\n@@ -5,9 +5,9 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/tree.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n #include \"parse-options.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-dir-iterator.c b/t/helper/test-dir-iterator.c\nindex 8d46e8ba40..f2734c5f88 100644\n--- a/t/helper/test-dir-iterator.c\n+++ b/t/helper/test-dir-iterator.c\n@@ -2,7 +2,7 @@\n #include \"git-compat-util.h\"\n #include \"strbuf.h\"\n #include \"iterator.h\"\n-#include \"dir-iterator.h\"\n+#include \"index/dir-iterator.h\"\n \n static const char *error_name(int error_number)\n {\ndiff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\nindex 849727d69b..599b316ac1 100644\n--- a/t/helper/test-dump-cache-tree.c\n+++ b/t/helper/test-dump-cache-tree.c\n@@ -4,8 +4,8 @@\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"odb/tree.h\"\n-#include \"cache-tree.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/cache-tree.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c\nindex c991cbbb8a..1dbdb28fbf 100644\n--- a/t/helper/test-dump-fsmonitor.c\n+++ b/t/helper/test-dump-fsmonitor.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c\nindex aae0a40a74..79c8628005 100644\n--- a/t/helper/test-dump-split-index.c\n+++ b/t/helper/test-dump-split-index.c\n@@ -2,10 +2,10 @@\n \n #include \"test-tool.h\"\n #include \"hex.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n-#include \"split-index.h\"\n+#include \"index/split-index.h\"\n #include \"ewah/ewok.h\"\n \n static void show_bit(size_t pos, void *data UNUSED)\ndiff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c\nindex 24308bd371..c31d01f3b5 100644\n--- a/t/helper/test-dump-untracked-cache.c\n+++ b/t/helper/test-dump-untracked-cache.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"hex.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-fsmonitor-client.c b/t/helper/test-fsmonitor-client.c\nindex dc1dff23fb..845c1db493 100644\n--- a/t/helper/test-fsmonitor-client.c\n+++ b/t/helper/test-fsmonitor-client.c\n@@ -7,8 +7,8 @@\n \n #include \"test-tool.h\"\n #include \"parse-options.h\"\n-#include \"fsmonitor-ipc.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/fsmonitor-ipc.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n #include \"thread-utils.h\"\ndiff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\nindex 43cead6d7d..6f16fcf7e8 100644\n--- a/t/helper/test-lazy-init-name-hash.c\n+++ b/t/helper/test-lazy-init-name-hash.c\n@@ -2,9 +2,9 @@\n \n #include \"test-tool.h\"\n #include \"environment.h\"\n-#include \"name-hash.h\"\n+#include \"index/name-hash.h\"\n #include \"parse-options.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n #include \"trace.h\"\ndiff --git a/t/helper/test-parse-pathspec-file.c b/t/helper/test-parse-pathspec-file.c\nindex 89ecefd1cd..1b21e919db 100644\n--- a/t/helper/test-parse-pathspec-file.c\n+++ b/t/helper/test-parse-pathspec-file.c\n@@ -1,6 +1,6 @@\n #include \"test-tool.h\"\n #include \"parse-options.h\"\n-#include \"pathspec.h\"\n+#include \"index/pathspec.h\"\n \n int cmd__parse_pathspec_file(int argc, const char **argv)\n {\ndiff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c\nindex f77b3f9d70..fd98a5bfd9 100644\n--- a/t/helper/test-path-utils.c\n+++ b/t/helper/test-path-utils.c\n@@ -5,7 +5,7 @@\n #include \"abspath.h\"\n #include \"environment.h\"\n #include \"path.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"setup.h\"\n #include \"string-list.h\"\n #include \"trace.h\"\ndiff --git a/t/helper/test-path-walk.c b/t/helper/test-path-walk.c\nindex 71d052d504..f689ff3c53 100644\n--- a/t/helper/test-path-walk.c\n+++ b/t/helper/test-path-walk.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"environment.h\"\n #include \"hex.h\"\n #include \"revision/list-objects-filter-options.h\"\ndiff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c\nindex 6b08ba8f07..dad40b8ad7 100644\n--- a/t/helper/test-read-cache.c\n+++ b/t/helper/test-read-cache.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"config.h\"\n #include \"environment.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\nindex f4f7df067d..8e40a08436 100644\n--- a/t/helper/test-scrap-cache-tree.c\n+++ b/t/helper/test-scrap-cache-tree.c\n@@ -2,11 +2,11 @@\n \n #include \"test-tool.h\"\n #include \"lockfile.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n #include \"odb/tree.h\"\n-#include \"cache-tree.h\"\n+#include \"index/cache-tree.h\"\n \n int cmd__scrap_cache_tree(int ac UNUSED, const char **av UNUSED)\n {\ndiff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c\nindex 98e1477c98..ffe468b445 100644\n--- a/t/helper/test-write-cache.c\n+++ b/t/helper/test-write-cache.c\n@@ -2,7 +2,7 @@\n \n #include \"test-tool.h\"\n #include \"lockfile.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n #include \"repository.h\"\n #include \"setup.h\"\n \ndiff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c\nindex 72ee20a06f..4d4e37019e 100644\n--- a/t/unit-tests/test-lib.c\n+++ b/t/unit-tests/test-lib.c\n@@ -31,7 +31,7 @@ static struct {\n  * There are other compilers that do the same, and are not for\n  * Windows.\n  */\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n \n static const char *make_relative(const char *location)\n {\ndiff --git a/t/unit-tests/u-dir.c b/t/unit-tests/u-dir.c\nindex 2d0adaa39e..72de0b0299 100644\n--- a/t/unit-tests/u-dir.c\n+++ b/t/unit-tests/u-dir.c\n@@ -1,5 +1,5 @@\n #include \"unit-test.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n \n #define TEST_WITHIN_DEPTH(path, depth, max_depth, expect) do { \\\n \t\tint actual = within_depth(path, strlen(path), \\\ndiff --git a/t/unit-tests/u-reftable-stack.c b/t/unit-tests/u-reftable-stack.c\nindex e6c1635940..4c53301154 100644\n--- a/t/unit-tests/u-reftable-stack.c\n+++ b/t/unit-tests/u-reftable-stack.c\n@@ -9,7 +9,7 @@ license that can be found in the LICENSE file or at\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"unit-test.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"lib-reftable.h\"\n #include \"reftable/merged.h\"\n #include \"reftable/reftable-error.h\"\ndiff --git a/t/unit-tests/u-strcmp-offset.c b/t/unit-tests/u-strcmp-offset.c\nindex 7e8e9acf3c..8b65c5555c 100644\n--- a/t/unit-tests/u-strcmp-offset.c\n+++ b/t/unit-tests/u-strcmp-offset.c\n@@ -1,5 +1,5 @@\n #include \"unit-test.h\"\n-#include \"read-cache-ll.h\"\n+#include \"index/read-cache-ll.h\"\n \n static void check_strcmp_offset(const char *string1, const char *string2,\n \t\t\t\tint expect_result, uintmax_t expect_offset)\ndiff --git a/trace2/tr2_sysenv.c b/trace2/tr2_sysenv.c\nindex 4abc218514..c63aebbec5 100644\n--- a/trace2/tr2_sysenv.c\n+++ b/trace2/tr2_sysenv.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"config.h\"\n-#include \"dir.h\"\n+#include \"index/dir.h\"\n #include \"tr2_sysenv.h\"\n \n /*\n-- \n2.54.0\n\n"},{"id":"551096","messageId":"20260823171915.2662373-14-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 13/14] setup: gather the setup sources under setup/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:57Z","receivedAt":"2026-08-23T17:19:42Z","isPatch":true,"body":"Move the 9 setup C sources and 9 headers into setup/ as renames. Repoint\nevery reference to their old paths to the new ones: the #include lines\nacross the tree, the Makefile and meson.build build entries, and the\ntutorial #include examples.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                 | 36 ++++++++++----------\n Documentation/MyFirstContribution.adoc       |  4 +--\n Documentation/MyFirstObjectWalk.adoc         |  2 +-\n Makefile                                     | 30 ++++++++--------\n add-interactive.c                            |  2 +-\n add-patch.c                                  |  6 ++--\n advice.c                                     |  4 +--\n apply.c                                      |  8 ++---\n archive-tar.c                                |  2 +-\n archive-zip.c                                |  2 +-\n archive.c                                    |  6 ++--\n attr.c                                       |  6 ++--\n branch.c                                     |  6 ++--\n builtin.h                                    |  2 +-\n builtin/add.c                                |  4 +--\n builtin/am.c                                 |  6 ++--\n builtin/backfill.c                           |  6 ++--\n builtin/bisect.c                             |  2 +-\n builtin/blame.c                              |  6 ++--\n builtin/branch.c                             |  4 +--\n builtin/bugreport.c                          |  6 ++--\n builtin/bundle.c                             |  2 +-\n builtin/cat-file.c                           |  8 ++---\n builtin/check-attr.c                         |  6 ++--\n builtin/check-ignore.c                       |  4 +--\n builtin/check-mailmap.c                      |  6 ++--\n builtin/check-ref-format.c                   |  2 +-\n builtin/checkout--worker.c                   |  4 +--\n builtin/checkout-index.c                     |  6 ++--\n builtin/checkout.c                           | 10 +++---\n builtin/clean.c                              |  6 ++--\n builtin/clone.c                              |  8 ++---\n builtin/column.c                             |  2 +-\n builtin/commit-graph.c                       |  4 +--\n builtin/commit-tree.c                        |  4 +--\n builtin/commit.c                             |  6 ++--\n builtin/config.c                             |  8 ++---\n builtin/count-objects.c                      |  4 +--\n builtin/credential-cache--daemon.c           |  2 +-\n builtin/credential-store.c                   |  2 +-\n builtin/credential.c                         |  4 +--\n builtin/describe.c                           |  6 ++--\n builtin/diff-files.c                         |  2 +-\n builtin/diff-index.c                         |  4 +--\n builtin/diff-pairs.c                         |  2 +-\n builtin/diff-tree.c                          |  2 +-\n builtin/diff.c                               |  4 +--\n builtin/difftool.c                           |  8 ++---\n builtin/fast-export.c                        |  4 +--\n builtin/fast-import.c                        |  4 +--\n builtin/fetch.c                              |  4 +--\n builtin/fmt-merge-msg.c                      |  2 +-\n builtin/for-each-ref.c                       |  4 +--\n builtin/for-each-repo.c                      |  4 +--\n builtin/fsck.c                               |  2 +-\n builtin/fsmonitor--daemon.c                  |  4 +--\n builtin/gc.c                                 |  8 ++---\n builtin/grep.c                               |  6 ++--\n builtin/hash-object.c                        |  6 ++--\n builtin/help.c                               |  8 ++---\n builtin/history.c                            |  4 +--\n builtin/hook.c                               |  6 ++--\n builtin/index-pack.c                         |  6 ++--\n builtin/init-db.c                            |  4 +--\n builtin/interpret-trailers.c                 |  4 +--\n builtin/last-modified.c                      |  6 ++--\n builtin/log.c                                |  6 ++--\n builtin/ls-files.c                           |  6 ++--\n builtin/ls-tree.c                            |  4 +--\n builtin/mailinfo.c                           |  2 +-\n builtin/merge-base.c                         |  4 +--\n builtin/merge-file.c                         |  4 +--\n builtin/merge-ours.c                         |  4 +--\n builtin/merge-tree.c                         |  4 +--\n builtin/merge.c                              | 10 +++---\n builtin/mktag.c                              |  2 +-\n builtin/multi-pack-index.c                   |  6 ++--\n builtin/mv.c                                 |  6 ++--\n builtin/name-rev.c                           |  4 +--\n builtin/notes.c                              |  4 +--\n builtin/organize.c                           |  2 +-\n builtin/pack-objects.c                       |  4 +--\n builtin/patch-id.c                           |  6 ++--\n builtin/prune.c                              |  2 +-\n builtin/pull.c                               |  4 +--\n builtin/push.c                               |  4 +--\n builtin/range-diff.c                         |  2 +-\n builtin/read-tree.c                          |  6 ++--\n builtin/rebase.c                             |  6 ++--\n builtin/receive-pack.c                       | 10 +++---\n builtin/reflog.c                             |  2 +-\n builtin/refs.c                               |  2 +-\n builtin/remote.c                             |  4 +--\n builtin/repack.c                             |  4 +--\n builtin/replace.c                            |  4 +--\n builtin/replay.c                             |  2 +-\n builtin/repo.c                               |  4 +--\n builtin/rerere.c                             |  2 +-\n builtin/reset.c                              |  8 ++---\n builtin/rev-list.c                           |  4 +--\n builtin/rev-parse.c                          | 10 +++---\n builtin/revert.c                             |  2 +-\n builtin/rm.c                                 |  6 ++--\n builtin/send-pack.c                          |  4 +--\n builtin/shortlog.c                           |  6 ++--\n builtin/show-branch.c                        |  4 +--\n builtin/show-ref.c                           |  4 +--\n builtin/sparse-checkout.c                    |  6 ++--\n builtin/stash.c                              |  8 ++---\n builtin/stripspace.c                         |  6 ++--\n builtin/submodule--helper.c                  |  6 ++--\n builtin/symbolic-ref.c                       |  4 +--\n builtin/tag.c                                |  4 +--\n builtin/unpack-file.c                        |  4 +--\n builtin/unpack-objects.c                     |  4 +--\n builtin/update-index.c                       |  6 ++--\n builtin/update-ref.c                         |  4 +--\n builtin/update-server-info.c                 |  4 +--\n builtin/upload-archive.c                     |  2 +-\n builtin/upload-pack.c                        |  4 +--\n builtin/var.c                                |  6 ++--\n builtin/verify-commit.c                      |  4 +--\n builtin/verify-pack.c                        |  4 +--\n builtin/verify-tag.c                         |  4 +--\n builtin/worktree.c                           |  6 ++--\n builtin/write-tree.c                         |  4 +--\n bundle-uri.c                                 |  2 +-\n bundle.c                                     |  4 +--\n color.c                                      |  2 +-\n column.c                                     |  2 +-\n common-init.c                                |  4 +--\n compat/fsmonitor/fsm-health-darwin.c         |  2 +-\n compat/fsmonitor/fsm-health-linux.c          |  2 +-\n compat/fsmonitor/fsm-health-win32.c          |  2 +-\n compat/fsmonitor/fsm-ipc-unix.c              |  4 +--\n compat/fsmonitor/fsm-ipc-win32.c             |  2 +-\n compat/fsmonitor/fsm-listen-win32.c          |  2 +-\n compat/fsmonitor/fsm-settings-unix.c         |  2 +-\n compat/fsmonitor/fsm-settings-win32.c        |  4 +--\n compat/mingw.c                               |  6 ++--\n compat/precompose_utf8.c                     |  4 +--\n compat/regex/regex.c                         |  2 +-\n compat/win32/path-utils.c                    |  4 +--\n compat/win32/trace2_win32_process_info.c     |  2 +-\n connect.c                                    |  8 ++---\n contrib/libgit-sys/public_symbol_export.c    |  4 +--\n convert.c                                    |  2 +-\n credential.c                                 |  6 ++--\n daemon.c                                     |  6 ++--\n diagnose.c                                   |  2 +-\n diff/combine-diff.c                          |  2 +-\n diff/diff-lib.c                              |  2 +-\n diff/diff.c                                  |  6 ++--\n diff/range-diff.c                            |  4 +--\n diff/tree-diff.c                             |  2 +-\n diff/userdiff.c                              |  4 +--\n diff/xdiff-interface.c                       |  4 +--\n editor.c                                     |  4 +--\n exec-cmd.c                                   |  2 +-\n fetch-negotiator.c                           |  2 +-\n fetch-pack.c                                 |  8 ++---\n fmt-merge-msg.c                              |  4 +--\n gettext.c                                    |  2 +-\n git.c                                        |  8 ++---\n gpg-interface.c                              |  6 ++--\n grep.c                                       |  2 +-\n help.c                                       |  8 ++---\n http-backend.c                               |  8 ++---\n http-fetch.c                                 |  6 ++--\n http-push.c                                  |  6 ++--\n http-walker.c                                |  2 +-\n http.c                                       |  6 ++--\n imap-send.c                                  |  6 ++--\n index/cache-tree.c                           |  2 +-\n index/checkout.c                             |  4 +--\n index/dir.c                                  |  8 ++---\n index/entry.c                                |  2 +-\n index/fsmonitor-ipc.c                        |  2 +-\n index/fsmonitor-settings.c                   |  4 +--\n index/fsmonitor.c                            |  6 ++--\n index/name-hash.c                            |  2 +-\n index/parallel-checkout.c                    |  2 +-\n index/pathspec.c                             |  6 ++--\n index/preload-index.c                        |  6 ++--\n index/read-cache.c                           |  8 ++---\n index/read-cache.h                           |  2 +-\n index/sparse-index.c                         |  6 ++--\n index/split-index.c                          |  2 +-\n index/statinfo.c                             |  4 +--\n index/symlinks.c                             |  2 +-\n index/unpack-trees.c                         |  6 ++--\n index/wt-status.c                            |  6 ++--\n lockfile.c                                   |  2 +-\n mailinfo.c                                   |  4 +--\n mailmap.c                                    |  6 ++--\n merge-ll.c                                   |  2 +-\n merge-ort-wrappers.c                         |  2 +-\n merge-ort.c                                  |  4 +--\n merge.c                                      |  2 +-\n meson.build                                  | 18 +++++-----\n negotiator/default.c                         |  2 +-\n negotiator/skipping.c                        |  2 +-\n notes-cache.c                                |  2 +-\n notes-merge.c                                |  2 +-\n notes-utils.c                                |  4 +--\n notes.c                                      |  4 +--\n odb/alloc.c                                  |  2 +-\n odb/commit.c                                 |  8 ++---\n odb/fsck.c                                   |  6 ++--\n odb/hash.h                                   |  2 +-\n odb/loose.c                                  |  2 +-\n odb/match-trees.c                            |  2 +-\n odb/object-file-convert.c                    |  2 +-\n odb/object-file.c                            |  4 +--\n odb/object-name.c                            | 10 +++---\n odb/odb.c                                    |  6 ++--\n odb/replace-object.c                         |  2 +-\n odb/replace-object.h                         |  2 +-\n odb/source-files.c                           |  2 +-\n odb/source-inmemory.c                        |  2 +-\n odb/source-loose.c                           |  2 +-\n odb/streaming.c                              |  4 +--\n odb/tag.c                                    |  4 +--\n odb/tmp-objdir.c                             |  4 +--\n odb/tree-walk.c                              |  2 +-\n odb/tree.c                                   |  4 +--\n organize/organize.c                          |  4 +--\n oss-fuzz/fuzz-commit-graph.c                 |  2 +-\n oss-fuzz/fuzz-config.c                       |  2 +-\n pack/bloom.c                                 |  4 +--\n pack/commit-graph.c                          |  4 +--\n pack/delta-islands.c                         |  2 +-\n pack/midx-write.c                            |  2 +-\n pack/midx.c                                  |  2 +-\n pack/pack-bitmap-write.c                     |  4 +--\n pack/pack-bitmap.c                           |  4 +--\n pack/pack-check.c                            |  4 +--\n pack/pack-objects.c                          |  2 +-\n pack/pack-revindex.c                         |  2 +-\n pack/pack-write.c                            |  4 +--\n pack/packfile.c                              |  4 +--\n pack/packfile.h                              |  2 +-\n pack/prune-packed.c                          |  2 +-\n pack/pseudo-merge.c                          |  2 +-\n pack/reachable.c                             |  2 +-\n pack/repack-cruft.c                          |  2 +-\n pack/repack-filtered.c                       |  2 +-\n pack/repack-geometry.c                       |  2 +-\n pack/repack-promisor.c                       |  2 +-\n pack/repack.c                                |  2 +-\n pack/server-info.c                           |  2 +-\n pager.c                                      |  8 ++---\n parse-options-cb.c                           |  4 +--\n path-walk.c                                  |  2 +-\n path.c                                       |  4 +--\n path.h                                       |  2 +-\n progress.c                                   |  2 +-\n promisor-remote.c                            |  6 ++--\n promisor-remote.h                            |  2 +-\n prompt.c                                     |  4 +--\n protocol-caps.c                              |  2 +-\n protocol.c                                   |  4 +--\n rebase-interactive.c                         |  6 ++--\n refs/files-backend.c                         | 10 +++---\n refs/ls-refs.c                               |  6 ++--\n refs/pack-refs.c                             |  4 +--\n refs/packed-backend.c                        |  2 +-\n refs/ref-cache.c                             |  2 +-\n refs/ref-filter.c                            | 10 +++---\n refs/reflog-walk.c                           |  2 +-\n refs/reflog.c                                |  4 +--\n refs/refs.c                                  | 12 +++----\n refs/refs.h                                  |  4 +--\n refs/reftable-backend.c                      | 10 +++---\n refs/worktree.c                              |  8 ++---\n remote-curl.c                                |  6 ++--\n remote.c                                     |  6 ++--\n replay.c                                     |  2 +-\n rerere.c                                     |  4 +--\n reset.c                                      |  2 +-\n reset.h                                      |  2 +-\n revision/bisect.c                            |  4 +--\n revision/blame.c                             |  2 +-\n revision/graph.c                             |  2 +-\n revision/line-log.c                          |  4 +--\n revision/list-objects-filter-options.c       |  2 +-\n revision/list-objects.c                      |  2 +-\n revision/log-tree.c                          |  6 ++--\n revision/pretty.c                            |  4 +--\n revision/revision.c                          |  8 ++---\n revision/revision.h                          |  2 +-\n revision/shallow.c                           |  2 +-\n revision/shallow.h                           |  2 +-\n run-command.c                                |  4 +--\n scalar.c                                     |  4 +--\n send-pack.c                                  |  4 +--\n sequencer.c                                  |  8 ++---\n serve.c                                      |  6 ++--\n alias.c => setup/alias.c                     |  4 +--\n alias.h => setup/alias.h                     |  0\n config.c => setup/config.c                   |  8 ++---\n config.h => setup/config.h                   |  2 +-\n environment.c => setup/environment.c         | 10 +++---\n environment.h => setup/environment.h         |  2 +-\n hook.c => setup/hook.c                       |  8 ++---\n hook.h => setup/hook.h                       |  2 +-\n ident.c => setup/ident.c                     |  4 +--\n ident.h => setup/ident.h                     |  0\n repo-settings.c => setup/repo-settings.c     |  8 ++---\n repo-settings.h => setup/repo-settings.h     |  0\n repository.c => setup/repository.c           |  8 ++---\n repository.h => setup/repository.h           |  4 +--\n setup.c => setup/setup.c                     |  8 ++---\n setup.h => setup/setup.h                     |  0\n version.c => setup/version.c                 |  2 +-\n version.h => setup/version.h                 |  0\n shell.c                                      |  2 +-\n sideband.c                                   |  2 +-\n submodule-config.c                           |  6 ++--\n submodule-config.h                           |  2 +-\n submodule.c                                  |  8 ++---\n t/helper/test-advise.c                       |  6 ++--\n t/helper/test-bitmap.c                       |  2 +-\n t/helper/test-bloom.c                        |  4 +--\n t/helper/test-cache-tree.c                   |  4 +--\n t/helper/test-config.c                       |  4 +--\n t/helper/test-dump-cache-tree.c              |  4 +--\n t/helper/test-dump-fsmonitor.c               |  4 +--\n t/helper/test-dump-split-index.c             |  4 +--\n t/helper/test-dump-untracked-cache.c         |  4 +--\n t/helper/test-find-pack.c                    |  2 +-\n t/helper/test-fsmonitor-client.c             |  4 +--\n t/helper/test-lazy-init-name-hash.c          |  6 ++--\n t/helper/test-match-trees.c                  |  4 +--\n t/helper/test-pack-deltas.c                  |  2 +-\n t/helper/test-pack-mtimes.c                  |  2 +-\n t/helper/test-partial-clone.c                |  4 +--\n t/helper/test-path-utils.c                   |  4 +--\n t/helper/test-path-walk.c                    |  4 +--\n t/helper/test-progress.c                     |  2 +-\n t/helper/test-reach.c                        |  2 +-\n t/helper/test-read-cache.c                   |  8 ++---\n t/helper/test-read-graph.c                   |  4 +--\n t/helper/test-read-midx.c                    |  4 +--\n t/helper/test-ref-store.c                    |  4 +--\n t/helper/test-repository.c                   |  6 ++--\n t/helper/test-revision-walking.c             |  4 +--\n t/helper/test-scrap-cache-tree.c             |  4 +--\n t/helper/test-serve-v2.c                     |  4 +--\n t/helper/test-submodule-config.c             |  6 ++--\n t/helper/test-submodule-nested-repo-config.c |  4 +--\n t/helper/test-submodule.c                    |  4 +--\n t/helper/test-subprocess.c                   |  2 +-\n t/helper/test-synthesize.c                   |  4 +--\n t/helper/test-trace2.c                       |  4 +--\n t/helper/test-userdiff.c                     |  4 +--\n t/helper/test-write-cache.c                  |  4 +--\n t/unit-tests/u-example-decorate.c            |  2 +-\n t/unit-tests/u-odb-inmemory.c                |  2 +-\n trace.c                                      |  4 +--\n trace2.c                                     |  4 +--\n trace2/tr2_cfg.c                             |  2 +-\n trace2/tr2_sysenv.c                          |  2 +-\n trace2/tr2_tgt_event.c                       |  6 ++--\n trace2/tr2_tgt_normal.c                      |  6 ++--\n trace2/tr2_tgt_perf.c                        |  6 ++--\n trailer.c                                    |  4 +--\n transport-helper.c                           |  4 +--\n transport.c                                  |  6 ++--\n upload-pack.c                                |  8 ++---\n urlmatch.h                                   |  2 +-\n versioncmp.c                                 |  2 +-\n walker.c                                     |  2 +-\n 373 files changed, 798 insertions(+), 798 deletions(-)\n rename alias.c => setup/alias.c (98%)\n rename alias.h => setup/alias.h (100%)\n rename config.c => setup/config.c (99%)\n rename config.h => setup/config.h (99%)\n rename environment.c => setup/environment.c (99%)\n rename environment.h => setup/environment.h (99%)\n rename hook.c => setup/hook.c (99%)\n rename hook.h => setup/hook.h (99%)\n rename ident.c => setup/ident.c (99%)\n rename ident.h => setup/ident.h (100%)\n rename repo-settings.c => setup/repo-settings.c (98%)\n rename repo-settings.h => setup/repo-settings.h (100%)\n rename repository.c => setup/repository.c (99%)\n rename repository.h => setup/repository.h (99%)\n rename setup.c => setup/setup.c (99%)\n rename setup.h => setup/setup.h (100%)\n rename version.c => setup/version.c (98%)\n rename version.h => setup/version.h (100%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex fe81c40f09..cb6416bfc3 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -28,8 +28,6 @@ add-patch.c component=? role=lib prefix=add-patch includes=setup:3,index:2,odb:2\n add-patch.h component=? role=public prefix=add-patch cochange=odb:1\n advice.c component=? role=lib prefix=advice includes=setup:2 cochange=transport:18,index:12,odb:9,diff:8,revision:8\n advice.h component=? role=public prefix=advice cochange=transport:14,index:9,odb:6,submodule:4,pack:3\n-alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2\n-alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1\n apply.c component=? role=lib prefix=apply includes=index:5,setup:4,odb:3,diff:2,merge:2 cochange=index:93,setup:43,diff:41,odb:26,merge:24\n apply.h component=? role=public prefix=apply includes=odb:1 cochange=diff:2\n archive-tar.c component=archive role=lib prefix=archive-tar includes=archive:1,odb:1,setup:1 cochange=archive:59,index:12,diff:9,odb:9,transport:8\n@@ -58,8 +56,6 @@ common-exit.c component=? role=lib prefix=common-main\n common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1\n common-init.h component=? role=public prefix=common-main\n common-main.c component=? role=lib prefix=common-main cochange=setup:5,transport:4,convert:3,index:1\n-config.c component=setup role=lib prefix=config includes=setup:4,odb:2,convert:1,index:1,refs:1 cochange=setup:274,index:93,diff:75,refs:48,revision:46\n-config.h component=setup role=header prefix=config includes=setup:1 cochange=setup:100,index:30,transport:23,submodule:21,merge:6\n connect.c component=transport role=lib prefix=connect includes=transport:7,setup:4,odb:1,refs:1 cochange=transport:238,setup:19,diff:13,index:10,refs:10\n connect.h component=transport role=header prefix=connect includes=transport:1 cochange=transport:58,refs:1\n connected.c component=transport role=lib prefix=connected includes=transport:3,odb:1,pack:1 cochange=transport:39,pack:31,odb:7,diff:6,index:5\n@@ -103,8 +99,6 @@ diff/xdiff-interface.c component=diff role=lib prefix=xdiff-interface includes=s\n diff/xdiff-interface.h component=diff role=header prefix=xdiff-interface includes=odb:1 cochange=diff:62,index:2,notes:2,merge:1,odb:1\n editor.c component=? role=lib prefix=editor includes=setup:2 cochange=transport:20,setup:12,index:8,odb:4,submodule:4\n editor.h component=? role=public prefix=editor cochange=transport:1\n-environment.c component=setup role=lib prefix=environment includes=setup:5,convert:3,odb:2,merge:1,refs:1 cochange=setup:281,index:77,odb:48,refs:36,transport:28\n-environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9\n exec-cmd.c component=? role=lib prefix=strvec includes=setup:1\n exec-cmd.h component=? role=public prefix=argv-array cochange=refs:4,transport:4,odb:1,setup:1,submodule:1\n fetch-negotiator.c component=transport role=lib prefix=repo-settings includes=setup:1,transport:1 cochange=setup:8,transport:7,index:2,odb:1\n@@ -135,16 +129,12 @@ hex-ll.c component=? role=lib prefix=hex-ll\n hex-ll.h component=? role=public prefix=hex-ll\n hex.c component=? role=lib prefix=hex includes=odb:1 cochange=odb:7,revision:5,notes:3,transport:3,refs:2\n hex.h component=? role=public prefix=hex includes=odb:1 cochange=revision:3,odb:2,convert:1,merge:1,pack:1\n-hook.c component=setup role=lib prefix=hook includes=setup:4 cochange=setup:37,transport:10,odb:8,refs:5,diff:3\n-hook.h component=setup role=header prefix=hook includes=setup:1 cochange=setup:34,transport:6,odb:5,refs:5,pack:3\n http-backend.c component=? role=program prefix=http-backend includes=setup:4,odb:3,transport:2,pack:1,refs:1 cochange=transport:57,pack:41,setup:19,refs:14,revision:13\n http-fetch.c component=? role=program prefix=http-fetch includes=setup:3,transport:2 cochange=transport:46,setup:10,pack:9,index:7,refs:7\n http-push.c component=? role=program prefix=http-push includes=odb:7,revision:3,setup:3,transport:2,diff:1 cochange=transport:272,odb:134,revision:82,pack:60,diff:34\n http-walker.c component=transport role=lib prefix=http includes=transport:3,odb:2,pack:1,revision:1,setup:1 cochange=transport:73,pack:40,odb:17,index:11,refs:7\n http.c component=transport role=lib prefix=http includes=transport:4,setup:3,odb:2,pack:2 cochange=transport:195,pack:71,odb:27,diff:8,setup:8\n http.h component=transport role=header prefix=http includes=transport:1 cochange=transport:149,pack:15,diff:6,odb:4,archive:3\n-ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4\n-ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1\n imap-send.c component=? role=program prefix=imap-send includes=setup:3,transport:1 cochange=transport:47,diff:16,index:16,refs:9,odb:8\n index/cache-tree.c component=index role=lib prefix=cache-tree includes=odb:5,index:2,setup:1,transport:1 cochange=index:94,odb:69,revision:27,transport:21,diff:20\n index/cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1\n@@ -373,10 +363,6 @@ remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,trans\n remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2\n replay.c component=? role=lib prefix=replay includes=odb:2,merge:1,refs:1,revision:1,setup:1 cochange=transport:1\n replay.h component=? role=public prefix=replay includes=odb:1\n-repo-settings.c component=setup role=lib prefix=repo-settings includes=setup:4,pack:2 cochange=setup:65,pack:17,index:8,transport:8,odb:6\n-repo-settings.h component=setup role=header prefix=environment cochange=setup:40,pack:7,refs:6,odb:4,diff:2\n-repository.c component=setup role=lib prefix=repository includes=setup:4,odb:3,index:2,transport:2,refs:1 cochange=setup:141,odb:39,index:27,refs:18,submodule:17\n-repository.h component=setup role=header prefix=repository includes=setup:2 cochange=setup:157,index:31,refs:25,pack:22,odb:19\n rerere.c component=merge role=lib prefix=rerere includes=index:4,merge:2,odb:2,setup:2,diff:1 cochange=index:54,merge:29,pack:26,odb:25,transport:25\n rerere.h component=merge role=header prefix=rerere cochange=merge:16,odb:1\n reset.c component=? role=lib prefix=reset includes=odb:3,index:2,refs:1,setup:1 cochange=index:9,merge:5,odb:3,notes:2,revision:2\n@@ -420,8 +406,24 @@ sequencer.c component=? role=lib prefix=sequencer includes=odb:8,index:5,merge:4\n sequencer.h component=? role=public prefix=sequencer includes=index:1 cochange=revision:5,index:4,notes:3,odb:3,transport:3\n serve.c component=transport role=lib prefix=serve includes=transport:6,setup:3,odb:1,refs:1 cochange=transport:53,refs:7,odb:4,setup:3,index:1\n serve.h component=transport role=header prefix=serve cochange=transport:9,refs:3,submodule:1\n-setup.c component=setup role=lib prefix=setup includes=setup:4,odb:2,refs:2,index:1,revision:1 cochange=setup:177,refs:47,transport:44,index:39,odb:24\n-setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:70,refs:8,index:5,revision:4,submodule:4\n+setup/alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2\n+setup/alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1\n+setup/config.c component=setup role=lib prefix=config includes=setup:4,odb:2,convert:1,index:1,refs:1 cochange=setup:274,index:93,diff:75,refs:48,revision:46\n+setup/config.h component=setup role=header prefix=config includes=setup:1 cochange=setup:100,index:30,transport:23,submodule:21,merge:6\n+setup/environment.c component=setup role=lib prefix=environment includes=setup:5,convert:3,odb:2,merge:1,refs:1 cochange=setup:281,index:77,odb:48,refs:36,transport:28\n+setup/environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9\n+setup/hook.c component=setup role=lib prefix=hook includes=setup:4 cochange=setup:37,transport:10,odb:8,refs:5,diff:3\n+setup/hook.h component=setup role=header prefix=hook includes=setup:1 cochange=setup:34,transport:6,odb:5,refs:5,pack:3\n+setup/ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4\n+setup/ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1\n+setup/repo-settings.c component=setup role=lib prefix=repo-settings includes=setup:4,pack:2 cochange=setup:65,pack:17,index:8,transport:8,odb:6\n+setup/repo-settings.h component=setup role=header prefix=environment cochange=setup:40,pack:7,refs:6,odb:4,diff:2\n+setup/repository.c component=setup role=lib prefix=repository includes=setup:4,odb:3,index:2,transport:2,refs:1 cochange=setup:141,odb:39,index:27,refs:18,submodule:17\n+setup/repository.h component=setup role=header prefix=repository includes=setup:2 cochange=setup:157,index:31,refs:25,pack:22,odb:19\n+setup/setup.c component=setup role=lib prefix=setup includes=setup:4,odb:2,refs:2,index:1,revision:1 cochange=setup:177,refs:47,transport:44,index:39,odb:24\n+setup/setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:70,refs:8,index:5,revision:4,submodule:4\n+setup/version.c component=setup role=lib prefix=version includes=setup:1 cochange=setup:8,transport:2\n+setup/version.h component=setup role=header prefix=version cochange=setup:8,transport:2\n sh-i18n--envsubst.c component=? role=program prefix=sh-i18n--envsubst cochange=index:3,diff:1,transport:1\n sha1dc_git.c component=? role=lib prefix=sha1dc cochange=diff:3,odb:2,revision:2,setup:1\n sha1dc_git.h component=? role=public prefix=sha1dc cochange=odb:2\n@@ -478,8 +480,6 @@ utf8.c component=? role=lib prefix=utf8 cochange=revision:6,index:3,setup:3,tran\n utf8.h component=? role=public prefix=utf8 cochange=revision:6,index:2,setup:2,transport:2,convert:1\n varint.c component=? role=lib prefix=varint cochange=index:2,transport:1\n varint.h component=? role=public prefix=varint cochange=index:2,transport:1\n-version.c component=setup role=lib prefix=version includes=setup:1 cochange=setup:8,transport:2\n-version.h component=setup role=header prefix=version cochange=setup:8,transport:2\n versioncmp.c component=? role=lib prefix=versioncmp includes=setup:1 cochange=setup:5,pack:3,transport:3,index:2,refs:2\n versioncmp.h component=? role=public prefix=versioncmp cochange=refs:1\n walker.c component=transport role=lib prefix=refs includes=odb:6,refs:1,setup:1,transport:1 cochange=odb:70,transport:55,revision:42,refs:24,pack:17\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex 63468494c1..9d899efb36 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -331,8 +331,8 @@ on the command line, including the name of our command. (If `prefix` is empty\n for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so\n helpful. So what other context can we get?\n \n-Add a line to `#include \"config.h\"`, `#include \"repository.h\"` and\n-`#include \"environment.h\"`.\n+Add a line to `#include \"setup/config.h\"`, `#include \"setup/repository.h\"` and\n+`#include \"setup/environment.h\"`.\n Then, add the following bits to the function body:\n function body:\n \ndiff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc\nindex 7fb63e6861..6e3715bad7 100644\n--- a/Documentation/MyFirstObjectWalk.adoc\n+++ b/Documentation/MyFirstObjectWalk.adoc\n@@ -219,7 +219,7 @@ Add a new function to `builtin/walken.c`.\n We'll also need to include the `config.h` header:\n \n ----\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n ...\n \ndiff --git a/Makefile b/Makefile\nindex 5e404ffa5e..cec75e834a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1102,7 +1102,7 @@ LIB_OBJS += abspath.o\n LIB_OBJS += add-interactive.o\n LIB_OBJS += add-patch.o\n LIB_OBJS += advice.o\n-LIB_OBJS += alias.o\n+LIB_OBJS += setup/alias.o\n LIB_OBJS += odb/alloc.o\n LIB_OBJS += apply.o\n LIB_OBJS += archive-tar.o\n@@ -1135,7 +1135,7 @@ LIB_OBJS += compat/obstack.o\n LIB_OBJS += compat/open.o\n LIB_OBJS += compat/terminal.o\n LIB_OBJS += compiler-tricks/not-constant.o\n-LIB_OBJS += config.o\n+LIB_OBJS += setup/config.o\n LIB_OBJS += connect.o\n LIB_OBJS += connected.o\n LIB_OBJS += convert.o\n@@ -1162,7 +1162,7 @@ LIB_OBJS += index/dir-iterator.o\n LIB_OBJS += index/dir.o\n LIB_OBJS += editor.o\n LIB_OBJS += index/entry.o\n-LIB_OBJS += environment.o\n+LIB_OBJS += setup/environment.o\n LIB_OBJS += ewah/bitmap.o\n LIB_OBJS += ewah/ewah_bitmap.o\n LIB_OBJS += ewah/ewah_io.o\n@@ -1187,8 +1187,8 @@ LIB_OBJS += hashmap.o\n LIB_OBJS += help.o\n LIB_OBJS += hex.o\n LIB_OBJS += hex-ll.o\n-LIB_OBJS += hook.o\n-LIB_OBJS += ident.o\n+LIB_OBJS += setup/hook.o\n+LIB_OBJS += setup/ident.o\n LIB_OBJS += json-writer.o\n LIB_OBJS += kwset.o\n LIB_OBJS += levenshtein.o\n@@ -1312,8 +1312,8 @@ LIB_OBJS += pack/repack-midx.o\n LIB_OBJS += pack/repack-promisor.o\n LIB_OBJS += odb/replace-object.o\n LIB_OBJS += replay.o\n-LIB_OBJS += repo-settings.o\n-LIB_OBJS += repository.o\n+LIB_OBJS += setup/repo-settings.o\n+LIB_OBJS += setup/repository.o\n LIB_OBJS += rerere.o\n LIB_OBJS += reset.o\n LIB_OBJS += index/resolve-undo.o\n@@ -1323,7 +1323,7 @@ LIB_OBJS += send-pack.o\n LIB_OBJS += sequencer.o\n LIB_OBJS += serve.o\n LIB_OBJS += pack/server-info.o\n-LIB_OBJS += setup.o\n+LIB_OBJS += setup/setup.o\n LIB_OBJS += revision/shallow.o\n LIB_OBJS += sideband.o\n LIB_OBJS += sigchain.o\n@@ -1373,7 +1373,7 @@ LIB_OBJS += utf8.o\n ifdef NO_RUST\n LIB_OBJS += varint.o\n endif\n-LIB_OBJS += version.o\n+LIB_OBJS += setup/version.o\n LIB_OBJS += versioncmp.o\n LIB_OBJS += walker.o\n LIB_OBJS += wildmatch.o\n@@ -2691,7 +2691,7 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)\n \n help.sp help.s help.o: command-list.h\n builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h\n-hook.sp hook.s hook.o: hook-list.h\n+setup/hook.sp setup/hook.s setup/hook.o: hook-list.h\n \n builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX\n builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \\\n@@ -2708,7 +2708,7 @@ pager.sp pager.s pager.o: EXTRA_CPPFLAGS = \\\n version-def.h: version-def.h.in GIT-VERSION-GEN GIT-VERSION-FILE GIT-USER-AGENT\n \t$(QUIET_GEN)$(call version_gen,\"$(shell pwd)\",$<,$@)\n \n-version.sp version.s version.o: version-def.h\n+setup/version.sp setup/version.s setup/version.o: version-def.h\n \n $(BUILT_INS): git$X\n \t$(QUIET_BUILT_IN)$(RM) $@ && \\\n@@ -2973,12 +2973,12 @@ exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \\\n \t'-DBINDIR=\"$(bindir_relative_SQ)\"' \\\n \t'-DFALLBACK_RUNTIME_PREFIX=\"$(prefix_SQ)\"'\n \n-setup.sp setup.s setup.o: GIT-PREFIX\n-setup.sp setup.s setup.o: EXTRA_CPPFLAGS = \\\n+setup/setup.sp setup/setup.s setup/setup.o: GIT-PREFIX\n+setup/setup.sp setup/setup.s setup/setup.o: EXTRA_CPPFLAGS = \\\n \t-DDEFAULT_GIT_TEMPLATE_DIR='\"$(template_dir_SQ)\"'\n \n-config.sp config.s config.o: GIT-PREFIX\n-config.sp config.s config.o: EXTRA_CPPFLAGS = \\\n+setup/config.sp setup/config.s setup/config.o: GIT-PREFIX\n+setup/config.sp setup/config.s setup/config.o: EXTRA_CPPFLAGS = \\\n \t-DETC_GITCONFIG='\"$(ETC_GITCONFIG_SQ)\"'\n \n attr.sp attr.s attr.o: GIT-PREFIX\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 5f4d379910..e14a2c98f3 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -9,7 +9,7 @@\n #include \"hex.h\"\n #include \"index/preload-index.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n #include \"refs/refs.h\"\n #include \"string-list.h\"\ndiff --git a/add-patch.c b/add-patch.c\nindex 0499152dbc..f1f4b0c4c6 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -5,16 +5,16 @@\n #include \"add-patch.h\"\n #include \"advice.h\"\n #include \"odb/commit.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"pager.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"sigchain.h\"\n #include \"run-command.h\"\ndiff --git a/advice.c b/advice.c\nindex 63bf8b0c5f..3139ac5e87 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"color.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"help.h\"\n #include \"string-list.h\"\ndiff --git a/apply.c b/apply.c\nindex 70d5461fbe..75f81b1444 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -13,12 +13,12 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"base85.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/odb.h\"\n #include \"pack/delta.h\"\n #include \"diff/diff.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"diff/xdiff-interface.h\"\n@@ -31,11 +31,11 @@\n #include \"path.h\"\n #include \"quote.h\"\n #include \"index/read-cache.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"rerere.h\"\n #include \"apply.h\"\n #include \"index/entry.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/symlinks.h\"\n #include \"wildmatch.h\"\n #include \"ws.h\"\ndiff --git a/archive-tar.c b/archive-tar.c\nindex 318b9bcc24..525b517749 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -5,7 +5,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n #include \"hex.h\"\ndiff --git a/archive-zip.c b/archive-zip.c\nindex df1edadd33..1e8baf3205 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -5,7 +5,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"archive.h\"\n #include \"gettext.h\"\n #include \"git-zlib.h\"\ndiff --git a/archive.c b/archive.c\nindex e6fdd2ea8f..3f3922c3e6 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -3,16 +3,16 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n #include \"revision/pretty.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"refs/refs.h\"\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\ndiff --git a/attr.c b/attr.c\nindex 841d2f23ae..9180683faa 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -10,8 +10,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"attr.h\"\n #include \"index/dir.h\"\n@@ -23,7 +23,7 @@\n #include \"refs/refs.h\"\n #include \"revision/revision.h\"\n #include \"odb/odb.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"thread-utils.h\"\n #include \"odb/tree-walk.h\"\n #include \"odb/object-name.h\"\ndiff --git a/branch.c b/branch.c\nindex d752e55b88..14483c1402 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -2,9 +2,9 @@\n \n #include \"git-compat-util.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"branch.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n@@ -12,7 +12,7 @@\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n #include \"remote.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"sequencer.h\"\n #include \"odb/commit.h\"\n #include \"refs/worktree.h\"\ndiff --git a/builtin.h b/builtin.h\nindex 0ac855e534..7c48a8e29f 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -2,7 +2,7 @@\n #define BUILTIN_H\n \n #include \"git-compat-util.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n /*\n  * builtin API\ndiff --git a/builtin/add.c b/builtin/add.c\nindex e544220eb2..69b6d7e7ca 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -6,8 +6,8 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"lockfile.h\"\n #include \"editor.h\"\n #include \"index/dir.h\"\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 0b6d77004f..053043e477 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -9,15 +9,15 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"index/dir.h\"\n #include \"run-command.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"quote.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\ndiff --git a/builtin/backfill.c b/builtin/backfill.c\nindex b8e21c844c..f30addad55 100644\n--- a/builtin/backfill.c\n+++ b/builtin/backfill.c\n@@ -3,12 +3,12 @@\n \n #include \"builtin.h\"\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"parse-options.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/commit.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\ndiff --git a/builtin/bisect.c b/builtin/bisect.c\nindex cfb0741d22..61205f13b6 100644\n--- a/builtin/bisect.c\n+++ b/builtin/bisect.c\n@@ -3,7 +3,7 @@\n \n #include \"builtin.h\"\n #include \"copy.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 9e5776e31b..23e6f77d42 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -8,9 +8,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"color.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\n@@ -31,7 +31,7 @@\n #include \"pager.h\"\n #include \"revision/blame.h\"\n #include \"refs/refs.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"odb/tag.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex c80df76d36..eeab13a4b6 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -8,10 +8,10 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"color.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"refs/refs.h\"\n #include \"odb/commit.h\"\n #include \"gettext.h\"\ndiff --git a/builtin/bugreport.c b/builtin/bugreport.c\nindex f78c3f2aed..dffed32db6 100644\n--- a/builtin/bugreport.c\n+++ b/builtin/bugreport.c\n@@ -8,11 +8,11 @@\n #include \"strbuf.h\"\n #include \"help.h\"\n #include \"compat/compiler.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"hook-list.h\"\n #include \"diagnose.h\"\n-#include \"setup.h\"\n-#include \"version.h\"\n+#include \"setup/setup.h\"\n+#include \"setup/version.h\"\n \n static void get_system_info(struct strbuf *sys_info)\n {\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex 1e170e9278..6dbe478bcb 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -2,7 +2,7 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"gettext.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"parse-options.h\"\n #include \"pkt-line.h\"\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex 94979a2683..4a5c73720d 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -8,13 +8,13 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"parse-options.h\"\n #include \"diff/userdiff.h\"\n@@ -28,7 +28,7 @@\n #include \"promisor-remote.h\"\n #include \"mailmap.h\"\n #include \"write-or-die.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n #include \"remote.h\"\n #include \"transport.h\"\n \ndiff --git a/builtin/check-attr.c b/builtin/check-attr.c\nindex 02ff3b4eb5..8eb5d4e748 100644\n--- a/builtin/check-attr.c\n+++ b/builtin/check-attr.c\n@@ -1,12 +1,12 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"attr.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n #include \"quote.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"parse-options.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/check-ignore.c b/builtin/check-ignore.c\nindex 1d2c3cb8db..00a04404bd 100644\n--- a/builtin/check-ignore.c\n+++ b/builtin/check-ignore.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"quote.h\"\n #include \"index/pathspec.h\"\ndiff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c\nindex 3f2a39cae0..4c3fc0de7a 100644\n--- a/builtin/check-mailmap.c\n+++ b/builtin/check-mailmap.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"mailmap.h\"\n #include \"parse-options.h\"\n #include \"strbuf.h\"\ndiff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c\nindex 5de8c0e6f5..cb8f539b02 100644\n--- a/builtin/check-ref-format.c\n+++ b/builtin/check-ref-format.c\n@@ -6,7 +6,7 @@\n \n #include \"builtin.h\"\n #include \"refs/refs.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n \n static const char builtin_check_ref_format_usage[] =\ndiff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c\nindex 9c49474753..aa1ca1ed14 100644\n--- a/builtin/checkout--worker.c\n+++ b/builtin/checkout--worker.c\n@@ -2,9 +2,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/entry.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"index/parallel-checkout.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/checkout-index.c b/builtin/checkout-index.c\nindex c659e5c764..139f4f9441 100644\n--- a/builtin/checkout-index.c\n+++ b/builtin/checkout-index.c\n@@ -8,8 +8,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"lockfile.h\"\n #include \"quote.h\"\n@@ -18,7 +18,7 @@\n #include \"index/entry.h\"\n #include \"index/parallel-checkout.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n \n #define CHECKOUT_ALL 4\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 48882b0f8e..3dedddc61a 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -7,13 +7,13 @@\n #include \"index/cache-tree.h\"\n #include \"index/checkout.h\"\n #include \"odb/commit.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"merge-ll.h\"\n #include \"lockfile.h\"\n #include \"mem-pool.h\"\n@@ -26,11 +26,11 @@\n #include \"index/read-cache.h\"\n #include \"refs/refs.h\"\n #include \"remote.h\"\n-#include \"repo-settings.h\"\n+#include \"setup/repo-settings.h\"\n #include \"index/resolve-undo.h\"\n #include \"revision/revision.h\"\n #include \"sequencer.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 81b3b86491..35a5c1465d 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -11,14 +11,14 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n #include \"quote.h\"\n #include \"column.h\"\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 58cf9761a0..a8f7e1b6f3 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -15,9 +15,9 @@\n \n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"copy.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n@@ -38,13 +38,13 @@\n #include \"branch.h\"\n #include \"remote.h\"\n #include \"run-command.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"connected.h\"\n #include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"pkt-line.h\"\n #include \"revision/list-objects-filter-options.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"bundle.h\"\n #include \"bundle-uri.h\"\n \ndiff --git a/builtin/column.c b/builtin/column.c\nindex 87dce3c6e5..8603d23d1f 100644\n--- a/builtin/column.c\n+++ b/builtin/column.c\n@@ -1,6 +1,6 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/commit-graph.c b/builtin/commit-graph.c\nindex 2de897402e..d4dc4985d3 100644\n--- a/builtin/commit-graph.c\n+++ b/builtin/commit-graph.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"odb/commit.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/commit-tree.c b/builtin/commit-tree.c\nindex 598ef30372..eb6fa99d14 100644\n--- a/builtin/commit-tree.c\n+++ b/builtin/commit-tree.c\n@@ -5,8 +5,8 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 85ab748ff0..3bf6f012c0 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -10,13 +10,13 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"lockfile.h\"\n #include \"index/cache-tree.h\"\n #include \"color.h\"\n #include \"index/dir.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"add-interactive.h\"\n@@ -30,7 +30,7 @@\n #include \"path.h\"\n #include \"index/preload-index.h\"\n #include \"index/read-cache.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"string-list.h\"\n #include \"rerere.h\"\n #include \"index/unpack-trees.h\"\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 15782dfe64..3c56c7380d 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -2,18 +2,18 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"color.h\"\n #include \"date.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"parse-options.h\"\n #include \"urlmatch.h\"\n #include \"path.h\"\n #include \"quote.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"refs/worktree.h\"\n \ndiff --git a/builtin/count-objects.c b/builtin/count-objects.c\nindex cf10ddcae1..0a28c0a552 100644\n--- a/builtin/count-objects.c\n+++ b/builtin/count-objects.c\n@@ -5,9 +5,9 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"path.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c\nindex 65cc619bec..313f4c58e8 100644\n--- a/builtin/credential-cache--daemon.c\n+++ b/builtin/credential-cache--daemon.c\n@@ -7,7 +7,7 @@\n \n #ifndef NO_UNIX_SOCKETS\n \n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"tempfile.h\"\n #include \"credential.h\"\n #include \"unix-socket.h\"\ndiff --git a/builtin/credential-store.c b/builtin/credential-store.c\nindex bc1453c6b2..91004b6188 100644\n--- a/builtin/credential-store.c\n+++ b/builtin/credential-store.c\n@@ -1,6 +1,6 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"lockfile.h\"\n #include \"credential.h\"\ndiff --git a/builtin/credential.c b/builtin/credential.c\nindex a295c80b36..1917982734 100644\n--- a/builtin/credential.c\n+++ b/builtin/credential.c\n@@ -3,8 +3,8 @@\n #include \"git-compat-util.h\"\n #include \"credential.h\"\n #include \"builtin.h\"\n-#include \"environment.h\"\n-#include \"config.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/config.h\"\n \n static const char usage_msg[] =\n \t\"git credential (fill|approve|reject)\";\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex c22158d157..0c840c84ad 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n@@ -16,7 +16,7 @@\n #include \"revision/revision.h\"\n #include \"diff/diff.h\"\n #include \"hashmap.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"run-command.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex 1f67480362..d536ce8475 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -8,7 +8,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\ndiff --git a/builtin/diff-index.c b/builtin/diff-index.c\nindex dac8099081..dac7eac2d8 100644\n--- a/builtin/diff-index.c\n+++ b/builtin/diff-index.c\n@@ -2,13 +2,13 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"odb/commit.h\"\n #include \"index/preload-index.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static const char diff_cache_usage[] =\n \"git diff-index [-m] [--cached] [--merge-base] \"\ndiff --git a/builtin/diff-pairs.c b/builtin/diff-pairs.c\nindex df5630be47..6400caf0a6 100644\n--- a/builtin/diff-pairs.c\n+++ b/builtin/diff-pairs.c\n@@ -1,5 +1,5 @@\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n #include \"gettext.h\"\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex 8f7f48ac67..010a996ab6 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"gettext.h\"\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 0e8c488408..badef1411b 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -8,7 +8,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"ewah/ewok.h\"\n #include \"lockfile.h\"\n #include \"color.h\"\n@@ -22,7 +22,7 @@\n #include \"index/read-cache-ll.h\"\n #include \"revision/revision.h\"\n #include \"revision/log-tree.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/tree.h\"\n \ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 1d3fae8793..425f3ddf83 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -15,16 +15,16 @@\n #include \"builtin.h\"\n \n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"copy.h\"\n #include \"run-command.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"strbuf.h\"\n@@ -33,7 +33,7 @@\n #include \"odb/odb.h\"\n #include \"index/dir.h\"\n #include \"index/entry.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static const char *const builtin_difftool_usage[] = {\n \tN_(\"git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]\"),\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 565cdccb40..5e5e100884 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -8,8 +8,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\ndiff --git a/builtin/fast-import.c b/builtin/fast-import.c\nindex da586c7c63..16353c1d71 100644\n--- a/builtin/fast-import.c\n+++ b/builtin/fast-import.c\n@@ -3,10 +3,10 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"lockfile.h\"\n #include \"odb/object.h\"\n #include \"odb/blob.h\"\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 2f744ac8b8..60be51f079 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -7,9 +7,9 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\ndiff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c\nindex cf4273a52c..a7e681afdf 100644\n--- a/builtin/fmt-merge-msg.c\n+++ b/builtin/fmt-merge-msg.c\n@@ -1,5 +1,5 @@\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"fmt-merge-msg.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c\nindex 9b3f277cb8..6a39f52698 100644\n--- a/builtin/for-each-ref.c\n+++ b/builtin/for-each-ref.c\n@@ -1,7 +1,7 @@\n #include \"builtin.h\"\n #include \"odb/commit.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"for-each-ref.h\"\n #include \"gettext.h\"\n #include \"odb/object.h\"\ndiff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c\nindex 927d3d92da..0ee86283cd 100644\n--- a/builtin/for-each-repo.c\n+++ b/builtin/for-each-repo.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 6e8fd0e828..049f32e13a 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -1,7 +1,7 @@\n #include \"builtin.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"odb/tree.h\"\n #include \"odb/blob.h\"\ndiff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c\nindex 49b492fba0..8d82f210cc 100644\n--- a/builtin/fsmonitor--daemon.c\n+++ b/builtin/fsmonitor--daemon.c\n@@ -3,9 +3,9 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"index/fsmonitor-ll.h\"\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 0243b34e3e..e4c482c243 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -17,9 +17,9 @@\n #include \"abspath.h\"\n #include \"date.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n #include \"parse-options.h\"\n@@ -39,8 +39,8 @@\n #include \"remote.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n-#include \"hook.h\"\n-#include \"setup.h\"\n+#include \"setup/hook.h\"\n+#include \"setup/setup.h\"\n #include \"trace2.h\"\n #include \"refs/worktree.h\"\n \ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex 20cd821af7..10df2dacef 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -9,10 +9,10 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/tag.h\"\n #include \"odb/tree-walk.h\"\n #include \"parse-options.h\"\n@@ -22,7 +22,7 @@\n #include \"quote.h\"\n #include \"index/dir.h\"\n #include \"index/pathspec.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/hash-object.c b/builtin/hash-object.c\nindex 335575862c..95a5105c2a 100644\n--- a/builtin/hash-object.c\n+++ b/builtin/hash-object.c\n@@ -7,8 +7,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n@@ -16,7 +16,7 @@\n #include \"odb/blob.h\"\n #include \"quote.h\"\n #include \"parse-options.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/help.c b/builtin/help.c\nindex a140339999..4d1c5e18bd 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -5,8 +5,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"pager.h\"\n@@ -15,8 +15,8 @@\n #include \"run-command.h\"\n #include \"config-list.h\"\n #include \"help.h\"\n-#include \"alias.h\"\n-#include \"setup.h\"\n+#include \"setup/alias.h\"\n+#include \"setup/setup.h\"\n \n #ifndef DEFAULT_HELP_FORMAT\n #define DEFAULT_HELP_FORMAT \"man\"\ndiff --git a/builtin/history.c b/builtin/history.c\nindex c817745f30..9c38be5b38 100644\n--- a/builtin/history.c\n+++ b/builtin/history.c\n@@ -4,9 +4,9 @@\n #include \"index/cache-tree.h\"\n #include \"odb/commit.h\"\n #include \"revision/commit-reach.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\ndiff --git a/builtin/hook.c b/builtin/hook.c\nindex cceeb3586e..6cff5b0889 100644\n--- a/builtin/hook.c\n+++ b/builtin/hook.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"parse-options.h\"\n #include \"thread-utils.h\"\n \ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 23d7e68020..167a6df9e7 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -2,9 +2,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"pack/delta.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"pack/pack.h\"\n@@ -29,7 +29,7 @@\n #include \"odb/tree-walk.h\"\n #include \"promisor-remote.h\"\n #include \"run-command.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n \n static const char index_pack_usage[] =\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex f459635129..bc8496b585 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -6,12 +6,12 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"refs/refs.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n \n static int guess_repository_type(const char *git_dir)\ndiff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c\nindex e7e86e9523..2462307a98 100644\n--- a/builtin/interpret-trailers.c\n+++ b/builtin/interpret-trailers.c\n@@ -6,13 +6,13 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"string-list.h\"\n #include \"tempfile.h\"\n #include \"trailer.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n static const char * const git_interpret_trailers_usage[] = {\n \tN_(\"git interpret-trailers [--in-place] [--trim-empty]\\n\"\ndiff --git a/builtin/last-modified.c b/builtin/last-modified.c\nindex 88e122db9b..763d0f93a7 100644\n--- a/builtin/last-modified.c\n+++ b/builtin/last-modified.c\n@@ -4,10 +4,10 @@\n #include \"pack/commit-graph.h\"\n #include \"odb/commit-slab.h\"\n #include \"odb/commit.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"ewah/ewok.h\"\n #include \"hashmap.h\"\n #include \"hex.h\"\n@@ -16,7 +16,7 @@\n #include \"parse-options.h\"\n #include \"prio-queue.h\"\n #include \"quote.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n \n /* Remember to update object flag allocation in object.h */\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 82144cf2b6..5b79637af3 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -9,8 +9,8 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\n@@ -37,7 +37,7 @@\n #include \"parse-options.h\"\n #include \"revision/line-log.h\"\n #include \"branch.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"mailmap.h\"\n #include \"progress.h\"\n #include \"odb/commit-slab.h\"\ndiff --git a/builtin/ls-files.c b/builtin/ls-files.c\nindex 49e8a685e3..3ef55beb89 100644\n--- a/builtin/ls-files.c\n+++ b/builtin/ls-files.c\n@@ -9,9 +9,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"quote.h\"\n #include \"index/dir.h\"\n #include \"gettext.h\"\n@@ -23,7 +23,7 @@\n #include \"path.h\"\n #include \"index/pathspec.h\"\n #include \"index/read-cache.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/ls-tree.c b/builtin/ls-tree.c\nindex b59c186a21..70ca5dca69 100644\n--- a/builtin/ls-tree.c\n+++ b/builtin/ls-tree.c\n@@ -6,8 +6,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n \n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex 8de7ba7de1..943757ebcf 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -5,7 +5,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"mailinfo.h\"\ndiff --git a/builtin/merge-base.c b/builtin/merge-base.c\nindex 7eec05ae7b..fa9c4945d4 100644\n--- a/builtin/merge-base.c\n+++ b/builtin/merge-base.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/merge-file.c b/builtin/merge-file.c\nindex 12701b1d81..7075fce70d 100644\n--- a/builtin/merge-file.c\n+++ b/builtin/merge-file.c\n@@ -8,9 +8,9 @@\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"xdiff/xdiff.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/merge-ours.c b/builtin/merge-ours.c\nindex c33e176c65..3900f64b5d 100644\n--- a/builtin/merge-ours.c\n+++ b/builtin/merge-ours.c\n@@ -10,8 +10,8 @@\n \n #include \"git-compat-util.h\"\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"diff/diff.h\"\n \n static const char builtin_merge_ours_usage[] =\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 41d8bbcbc1..7a73454060 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"odb/tree-walk.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"help.h\"\n@@ -17,7 +17,7 @@\n #include \"merge-blobs.h\"\n #include \"quote.h\"\n #include \"odb/tree.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"strvec.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex da37fb11eb..090e2a8fb1 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -13,17 +13,17 @@\n \n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"lockfile.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"diff/diff.h\"\n #include \"diff/diff-merges.h\"\n #include \"refs/refs.h\"\n@@ -46,7 +46,7 @@\n #include \"sequencer.h\"\n #include \"string-list.h\"\n #include \"odb/tag.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n #include \"branch.h\"\n #include \"revision/commit-reach.h\"\n #include \"index/wt-status.h\"\ndiff --git a/builtin/mktag.c b/builtin/mktag.c\nindex eb25acc4a5..f7ed512639 100644\n--- a/builtin/mktag.c\n+++ b/builtin/mktag.c\n@@ -8,7 +8,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"odb/fsck.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n static char const * const builtin_mktag_usage[] = {\n \t\"git mktag\",\ndiff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c\nindex 81401e37d5..2d78a08326 100644\n--- a/builtin/multi-pack-index.c\n+++ b/builtin/multi-pack-index.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"pack/midx.h\"\n@@ -12,7 +12,7 @@\n #include \"odb/source.h\"\n #include \"odb/source-files.h\"\n #include \"odb/replace-object.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n #define BUILTIN_MIDX_WRITE_USAGE \\\n \tN_(\"git multi-pack-index [<options>] write [--preferred-pack=<pack>]\\n\" \\\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex f49eec035e..bc51d64c95 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -10,8 +10,8 @@\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"index/name-hash.h\"\n #include \"odb/object-file.h\"\n@@ -24,7 +24,7 @@\n #include \"index/read-cache-ll.h\"\n #include \"index/symlinks.h\"\n \n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\n #include \"index/entry.h\"\ndiff --git a/builtin/name-rev.c b/builtin/name-rev.c\nindex 31bc960b34..5cccf689f5 100644\n--- a/builtin/name-rev.c\n+++ b/builtin/name-rev.c\n@@ -2,10 +2,10 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"refs/refs.h\"\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 61087b0fa5..5a1201b315 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -8,9 +8,9 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"notes.h\"\ndiff --git a/builtin/organize.c b/builtin/organize.c\nindex 925ef17128..35bf5cf90d 100644\n--- a/builtin/organize.c\n+++ b/builtin/organize.c\n@@ -13,7 +13,7 @@\n #include \"gettext.h\"\n #include \"organize/organize.h\"\n #include \"parse-options.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strvec.h\"\n \n static const char *const organize_usage[] = {\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex b611b27573..cc97d7e814 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -2,10 +2,10 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"attr.h\"\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\ndiff --git a/builtin/patch-id.c b/builtin/patch-id.c\nindex 7207279cef..22196195d2 100644\n--- a/builtin/patch-id.c\n+++ b/builtin/patch-id.c\n@@ -1,14 +1,14 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static void flush_current_id(size_t patchlen, struct object_id *id, struct object_id *result)\n {\ndiff --git a/builtin/prune.c b/builtin/prune.c\nindex d2d5bd2619..fc70161992 100644\n--- a/builtin/prune.c\n+++ b/builtin/prune.c\n@@ -4,7 +4,7 @@\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision/revision.h\"\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 818ddbf956..cca98abb65 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -10,8 +10,8 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"merge.h\"\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 280cfd289f..b4556466d7 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -7,9 +7,9 @@\n #include \"builtin.h\"\n #include \"advice.h\"\n #include \"branch.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refspec.h\"\ndiff --git a/builtin/range-diff.c b/builtin/range-diff.c\nindex 323046c696..ffb36c6086 100644\n--- a/builtin/range-diff.c\n+++ b/builtin/range-diff.c\n@@ -5,7 +5,7 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"diff/range-diff.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"parse.h\"\n #include \"color.h\"\n \ndiff --git a/builtin/read-tree.c b/builtin/read-tree.c\nindex 2bc2f43729..6c2ea503f7 100644\n--- a/builtin/read-tree.c\n+++ b/builtin/read-tree.c\n@@ -5,8 +5,8 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n@@ -18,7 +18,7 @@\n #include \"index/unpack-trees.h\"\n #include \"parse-options.h\"\n #include \"index/resolve-undo.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"submodule.h\"\n \ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 62b58da192..03bc28aba9 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -10,14 +10,14 @@\n #include \"builtin.h\"\n \n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n #include \"index/dir.h\"\n #include \"refs/refs.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/unpack-trees.h\"\n #include \"lockfile.h\"\n #include \"odb/object-file.h\"\n@@ -35,7 +35,7 @@\n #include \"rebase-interactive.h\"\n #include \"reset.h\"\n #include \"trace2.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"trailer.h\"\n \n static char const * const builtin_rebase_usage[] = {\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 9a816f1e86..718073653c 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -5,16 +5,16 @@\n #include \"abspath.h\"\n #include \"odb/commit.h\"\n #include \"revision/commit-reach.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"connect.h\"\n #include \"connected.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"odb/fsck.h\"\n #include \"gettext.h\"\n #include \"gpg-interface.h\"\n #include \"hex.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"lockfile.h\"\n #include \"odb/object.h\"\n #include \"odb/object-file.h\"\n@@ -31,7 +31,7 @@\n #include \"remote.h\"\n #include \"run-command.h\"\n #include \"pack/server-info.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"revision/shallow.h\"\n #include \"sideband.h\"\n #include \"sigchain.h\"\n@@ -39,7 +39,7 @@\n #include \"strvec.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"refs/worktree.h\"\n \n static const char * const receive_pack_usage[] = {\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex d8d1cb2c6a..83e40a0194 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\ndiff --git a/builtin/refs.c b/builtin/refs.c\nindex abfc0acdd2..d6e28a6043 100644\n--- a/builtin/refs.c\n+++ b/builtin/refs.c\n@@ -1,5 +1,5 @@\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/fsck.h\"\n #include \"refs/pack-refs.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 3f6cee14ff..5a4fa6de8b 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -2,10 +2,10 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"date.h\"\n #include \"gettext.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"transport.h\"\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex aa74f2161a..1d861c6062 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -1,8 +1,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 83497cd974..37f3dbd537 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -9,9 +9,9 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\ndiff --git a/builtin/replay.c b/builtin/replay.c\nindex 4f5515a314..f2f8c16343 100644\n--- a/builtin/replay.c\n+++ b/builtin/replay.c\n@@ -5,7 +5,7 @@\n #include \"git-compat-util.h\"\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex b296e2cda7..e736c97e9a 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -2,7 +2,7 @@\n \n #include \"builtin.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n@@ -14,7 +14,7 @@\n #include \"refs/ref-filter.h\"\n #include \"refs/refs.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"revision/shallow.h\"\ndiff --git a/builtin/rerere.c b/builtin/rerere.c\nindex 4b1b7d49ce..f7d406168c 100644\n--- a/builtin/rerere.c\n+++ b/builtin/rerere.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"rerere.h\"\ndiff --git a/builtin/reset.c b/builtin/reset.c\nindex 96c7bf9cf1..2202e0006d 100644\n--- a/builtin/reset.c\n+++ b/builtin/reset.c\n@@ -12,8 +12,8 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n@@ -28,10 +28,10 @@\n #include \"odb/object-name.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/unpack-trees.h\"\n #include \"index/cache-tree.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"trace.h\"\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 21d7b8aa81..54aabd084f 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -2,10 +2,10 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision/revision.h\"\ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex 1d97c4869b..6f394db8d2 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -11,9 +11,9 @@\n \n #include \"abspath.h\"\n #include \"revision/bisect.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n@@ -24,10 +24,10 @@\n #include \"path.h\"\n #include \"diff/diff.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repo-settings.h\"\n-#include \"repository.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/split-index.h\"\n #include \"submodule.h\"\n #include \"revision/commit-reach.h\"\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex ae3f186f12..f220268baa 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -4,7 +4,7 @@\n #include \"builtin.h\"\n #include \"parse-options.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"revision/revision.h\"\n #include \"rerere.h\"\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex 4f7194f541..cf59a9895d 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -8,8 +8,8 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"lockfile.h\"\n #include \"index/dir.h\"\n #include \"gettext.h\"\n@@ -20,7 +20,7 @@\n #include \"index/read-cache.h\"\n \n #include \"string-list.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"index/pathspec.h\"\ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex 2597a47bde..1e358bc0b0 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -1,6 +1,6 @@\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"pkt-line.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/shortlog.c b/builtin/shortlog.c\nindex 2fe86d6f46..fe98e4f21b 100644\n--- a/builtin/shortlog.c\n+++ b/builtin/shortlog.c\n@@ -1,16 +1,16 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"string-list.h\"\n #include \"revision/revision.h\"\n #include \"utf8.h\"\n #include \"mailmap.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"shortlog.h\"\n #include \"parse-options.h\"\n #include \"trailer.h\"\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex e0e912439c..31008f6d51 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\ndiff --git a/builtin/show-ref.c b/builtin/show-ref.c\nindex e4b186b930..77362ae6c7 100644\n--- a/builtin/show-ref.c\n+++ b/builtin/show-ref.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs-internal.h\"\ndiff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c\nindex efe6f7897e..8f2daa10ac 100644\n--- a/builtin/sparse-checkout.c\n+++ b/builtin/sparse-checkout.c\n@@ -3,9 +3,9 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n@@ -17,7 +17,7 @@\n #include \"lockfile.h\"\n #include \"index/unpack-trees.h\"\n #include \"quote.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"refs/worktree.h\"\n \ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex a8337ffdc4..81b3506598 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -2,8 +2,8 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n@@ -20,10 +20,10 @@\n #include \"index/entry.h\"\n #include \"index/preload-index.h\"\n #include \"index/read-cache.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"rerere.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"revision/log-tree.h\"\n #include \"diff/diffcore.h\"\ndiff --git a/builtin/stripspace.c b/builtin/stripspace.c\nindex 18705f1a5b..9547c474e3 100644\n--- a/builtin/stripspace.c\n+++ b/builtin/stripspace.c\n@@ -1,10 +1,10 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 5226a5f331..5a97263743 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -2,11 +2,11 @@\n \n #include \"builtin.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n \n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\n #include \"path.h\"\n@@ -14,7 +14,7 @@\n #include \"index/preload-index.h\"\n #include \"index/dir.h\"\n #include \"index/read-cache.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\ndiff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c\nindex 9ea9ca6500..d5461ac52c 100644\n--- a/builtin/symbolic-ref.c\n+++ b/builtin/symbolic-ref.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"refs/refs.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex 46df0f7c27..08a50c3c43 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -11,9 +11,9 @@\n \n #include \"builtin.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\ndiff --git a/builtin/unpack-file.c b/builtin/unpack-file.c\nindex 47f43f5a87..600da7fd06 100644\n--- a/builtin/unpack-file.c\n+++ b/builtin/unpack-file.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c\nindex fb724e46ea..9081e618b3 100644\n--- a/builtin/unpack-objects.c\n+++ b/builtin/unpack-objects.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n #include \"hex.h\"\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex b5c8fae02c..1824c9590e 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -8,8 +8,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n@@ -26,7 +26,7 @@\n #include \"index/pathspec.h\"\n #include \"index/dir.h\"\n #include \"index/read-cache.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"index/split-index.h\"\n #include \"index/symlinks.h\"\ndiff --git a/builtin/update-ref.c b/builtin/update-ref.c\nindex 5bcd100e52..57090fffae 100644\n--- a/builtin/update-ref.c\n+++ b/builtin/update-ref.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\ndiff --git a/builtin/update-server-info.c b/builtin/update-server-info.c\nindex 41bbd0114f..ca087aa41f 100644\n--- a/builtin/update-server-info.c\n+++ b/builtin/update-server-info.c\n@@ -1,6 +1,6 @@\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"pack/server-info.h\"\ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex 718e74b3ac..7b63b0185b 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -5,7 +5,7 @@\n #include \"builtin.h\"\n #include \"archive.h\"\n #include \"pkt-line.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"sideband.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/upload-pack.c b/builtin/upload-pack.c\nindex dc37ffb70c..7131fb6689 100644\n--- a/builtin/upload-pack.c\n+++ b/builtin/upload-pack.c\n@@ -9,9 +9,9 @@\n #include \"odb/replace-object.h\"\n #include \"upload-pack.h\"\n #include \"serve.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n \n static const char * const upload_pack_usage[] = {\n \tN_(\"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\\n\"\ndiff --git a/builtin/var.c b/builtin/var.c\nindex d01c87dfa2..0d48bd81a8 100644\n--- a/builtin/var.c\n+++ b/builtin/var.c\n@@ -9,10 +9,10 @@\n #include \"builtin.h\"\n \n #include \"attr.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n-#include \"ident.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/ident.h\"\n #include \"pager.h\"\n #include \"refs/refs.h\"\n #include \"path.h\"\ndiff --git a/builtin/verify-commit.c b/builtin/verify-commit.c\nindex 3ec03f016c..529b2d2573 100644\n--- a/builtin/verify-commit.c\n+++ b/builtin/verify-commit.c\n@@ -6,8 +6,8 @@\n  * Based on git-verify-tag\n  */\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n #include \"odb/commit.h\"\ndiff --git a/builtin/verify-pack.c b/builtin/verify-pack.c\nindex 65fd6629a0..1b282e6bb9 100644\n--- a/builtin/verify-pack.c\n+++ b/builtin/verify-pack.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"run-command.h\"\n #include \"parse-options.h\"\ndiff --git a/builtin/verify-tag.c b/builtin/verify-tag.c\nindex 460244f25b..82edf73980 100644\n--- a/builtin/verify-tag.c\n+++ b/builtin/verify-tag.c\n@@ -6,8 +6,8 @@\n  * Based on git-verify-tag.sh\n  */\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/tag.h\"\n #include \"odb/object-name.h\"\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex c4068b45d6..1d808800cc 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -5,10 +5,10 @@\n #include \"abspath.h\"\n #include \"advice.h\"\n #include \"index/checkout.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"copy.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n@@ -21,7 +21,7 @@\n #include \"refs/refs.h\"\n #include \"remote.h\"\n #include \"run-command.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"sigchain.h\"\n #include \"submodule.h\"\n #include \"utf8.h\"\ndiff --git a/builtin/write-tree.c b/builtin/write-tree.c\nindex 4a2b1ceb58..7d21f64007 100644\n--- a/builtin/write-tree.c\n+++ b/builtin/write-tree.c\n@@ -5,8 +5,8 @@\n  */\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/tree.h\"\ndiff --git a/bundle-uri.c b/bundle-uri.c\nindex 96ddf92347..cd26d38249 100644\n--- a/bundle-uri.c\n+++ b/bundle-uri.c\n@@ -10,7 +10,7 @@\n #include \"run-command.h\"\n #include \"hashmap.h\"\n #include \"pkt-line.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"fetch-pack.h\"\n #include \"remote.h\"\n #include \"trace2.h\"\ndiff --git a/bundle.c b/bundle.c\nindex dc50661bdd..1e01ab38d4 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -4,11 +4,11 @@\n #include \"git-compat-util.h\"\n #include \"lockfile.h\"\n #include \"bundle.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\ndiff --git a/color.c b/color.c\nindex 00b53f97ac..06a0b92958 100644\n--- a/color.c\n+++ b/color.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"color.h\"\n #include \"editor.h\"\n #include \"gettext.h\"\ndiff --git a/column.c b/column.c\nindex 93fae316b4..505abf2bfb 100644\n--- a/column.c\n+++ b/column.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"column.h\"\n #include \"string-list.h\"\n #include \"pager.h\"\ndiff --git a/common-init.c b/common-init.c\nindex 7e6b392800..aacfc85db6 100644\n--- a/common-init.c\n+++ b/common-init.c\n@@ -7,9 +7,9 @@\n #include \"attr.h\"\n #include \"odb/odb.h\"\n #include \"parse.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/replace-object.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\n \ndiff --git a/compat/fsmonitor/fsm-health-darwin.c b/compat/fsmonitor/fsm-health-darwin.c\nindex f24d56b3d2..dfa07f4b7b 100644\n--- a/compat/fsmonitor/fsm-health-darwin.c\n+++ b/compat/fsmonitor/fsm-health-darwin.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"fsm-health.h\"\n #include \"index/fsmonitor--daemon.h\"\ndiff --git a/compat/fsmonitor/fsm-health-linux.c b/compat/fsmonitor/fsm-health-linux.c\nindex 7be822fb1c..60f878b55e 100644\n--- a/compat/fsmonitor/fsm-health-linux.c\n+++ b/compat/fsmonitor/fsm-health-linux.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"fsm-health.h\"\n #include \"index/fsmonitor--daemon.h\"\ndiff --git a/compat/fsmonitor/fsm-health-win32.c b/compat/fsmonitor/fsm-health-win32.c\nindex 09dee50777..c4574f1eb0 100644\n--- a/compat/fsmonitor/fsm-health-win32.c\n+++ b/compat/fsmonitor/fsm-health-win32.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"fsm-health.h\"\n #include \"index/fsmonitor--daemon.h\"\ndiff --git a/compat/fsmonitor/fsm-ipc-unix.c b/compat/fsmonitor/fsm-ipc-unix.c\nindex ffd864ae92..bb1bed15fb 100644\n--- a/compat/fsmonitor/fsm-ipc-unix.c\n+++ b/compat/fsmonitor/fsm-ipc-unix.c\n@@ -1,11 +1,11 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"index/fsmonitor-ipc.h\"\ndiff --git a/compat/fsmonitor/fsm-ipc-win32.c b/compat/fsmonitor/fsm-ipc-win32.c\nindex bc92e1fd20..d3febb8dbd 100644\n--- a/compat/fsmonitor/fsm-ipc-win32.c\n+++ b/compat/fsmonitor/fsm-ipc-win32.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/fsmonitor-ipc.h\"\n #include \"path.h\"\n \ndiff --git a/compat/fsmonitor/fsm-listen-win32.c b/compat/fsmonitor/fsm-listen-win32.c\nindex c8cbdf4a97..4c49b04a7b 100644\n--- a/compat/fsmonitor/fsm-listen-win32.c\n+++ b/compat/fsmonitor/fsm-listen-win32.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"fsm-listen.h\"\n #include \"index/fsmonitor--daemon.h\"\ndiff --git a/compat/fsmonitor/fsm-settings-unix.c b/compat/fsmonitor/fsm-settings-unix.c\nindex 41106355b1..67c49d0ca7 100644\n--- a/compat/fsmonitor/fsm-settings-unix.c\n+++ b/compat/fsmonitor/fsm-settings-unix.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"index/fsmonitor-ipc.h\"\n #include \"index/fsmonitor-settings.h\"\ndiff --git a/compat/fsmonitor/fsm-settings-win32.c b/compat/fsmonitor/fsm-settings-win32.c\nindex 5b2872a4f1..4c822e01ed 100644\n--- a/compat/fsmonitor/fsm-settings-win32.c\n+++ b/compat/fsmonitor/fsm-settings-win32.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"repository.h\"\n+#include \"setup/config.h\"\n+#include \"setup/repository.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"index/fsmonitor-settings.h\"\n #include \"index/fsmonitor-path-utils.h\"\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 64814ac35d..9fce208dde 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -4,10 +4,10 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"odb/alloc.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n-#include \"repository.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/repository.h\"\n #include \"gettext.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\ndiff --git a/compat/precompose_utf8.c b/compat/precompose_utf8.c\nindex 8077f6235b..c047c17675 100644\n--- a/compat/precompose_utf8.c\n+++ b/compat/precompose_utf8.c\n@@ -7,8 +7,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"path.h\"\n #include \"strbuf.h\"\ndiff --git a/compat/regex/regex.c b/compat/regex/regex.c\nindex 4b09cc4e14..25f7e13d9e 100644\n--- a/compat/regex/regex.c\n+++ b/compat/regex/regex.c\n@@ -20,7 +20,7 @@\n #pragma GCC diagnostic ignored \"-Wsign-compare\"\n \n #ifdef HAVE_CONFIG_H\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #endif\n \n /* Make sure no one compiles this code with a C++ compiler.  */\ndiff --git a/compat/win32/path-utils.c b/compat/win32/path-utils.c\nindex f779f367cf..043b077d67 100644\n--- a/compat/win32/path-utils.c\n+++ b/compat/win32/path-utils.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"../../git-compat-util.h\"\n-#include \"../../environment.h\"\n-#include \"../../repository.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/repository.h\"\n \n int win32_has_dos_drive_prefix(const char *path)\n {\ndiff --git a/compat/win32/trace2_win32_process_info.c b/compat/win32/trace2_win32_process_info.c\nindex 6a6a396078..6fe122e637 100644\n--- a/compat/win32/trace2_win32_process_info.c\n+++ b/compat/win32/trace2_win32_process_info.c\n@@ -2,7 +2,7 @@\n \n #include \"../../git-compat-util.h\"\n #include \"../../json-writer.h\"\n-#include \"../../repository.h\"\n+#include \"setup/repository.h\"\n #include \"../../strvec.h\"\n #include \"../../trace2.h\"\n #include \"lazyload.h\"\ndiff --git a/connect.c b/connect.c\nindex a24b019b2c..2a1b177490 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"pkt-line.h\"\n@@ -18,9 +18,9 @@\n #include \"transport.h\"\n #include \"trace2.h\"\n #include \"strbuf.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"protocol.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n #include \"bundle-uri.h\"\n #include \"promisor-remote.h\"\n \ndiff --git a/contrib/libgit-sys/public_symbol_export.c b/contrib/libgit-sys/public_symbol_export.c\nindex dfbb257115..02765ba5a9 100644\n--- a/contrib/libgit-sys/public_symbol_export.c\n+++ b/contrib/libgit-sys/public_symbol_export.c\n@@ -5,9 +5,9 @@\n  */\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"contrib/libgit-sys/public_symbol_export.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n \n #pragma GCC visibility push(default)\n \ndiff --git a/convert.c b/convert.c\nindex f71d6dcefd..5490c4a558 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n #include \"copy.h\"\n #include \"gettext.h\"\ndiff --git a/credential.c b/credential.c\nindex 2594c0c422..dfbd1e9f74 100644\n--- a/credential.c\n+++ b/credential.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"credential.h\"\n #include \"gettext.h\"\n #include \"string-list.h\"\n@@ -12,9 +12,9 @@\n #include \"sigchain.h\"\n #include \"strbuf.h\"\n #include \"urlmatch.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"trace2.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n void credential_init(struct credential *c)\n {\ndiff --git a/daemon.c b/daemon.c\nindex 5d7978211c..219eeab179 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -2,14 +2,14 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"path.h\"\n #include \"pkt-line.h\"\n #include \"protocol.h\"\n #include \"run-command.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n \ndiff --git a/diagnose.c b/diagnose.c\nindex 0bac203282..341354ee6d 100644\n--- a/diagnose.c\n+++ b/diagnose.c\n@@ -10,7 +10,7 @@\n #include \"odb/odb.h\"\n #include \"pack/packfile.h\"\n #include \"parse-options.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"write-or-die.h\"\n \n struct archive_dir {\ndiff --git a/diff/combine-diff.c b/diff/combine-diff.c\nindex 8e03062f39..4446183707 100644\n--- a/diff/combine-diff.c\n+++ b/diff/combine-diff.c\n@@ -7,7 +7,7 @@\n #include \"convert.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"quote.h\"\ndiff --git a/diff/diff-lib.c b/diff/diff-lib.c\nindex 4a932f9067..fa3ca39389 100644\n--- a/diff/diff-lib.c\n+++ b/diff/diff-lib.c\n@@ -18,7 +18,7 @@\n #include \"index/cache-tree.h\"\n #include \"index/unpack-trees.h\"\n #include \"refs/refs.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"submodule.h\"\n #include \"index/symlinks.h\"\n #include \"trace.h\"\ndiff --git a/diff/diff.c b/diff/diff.c\nindex c00b87cca2..4603493a36 100644\n--- a/diff/diff.c\n+++ b/diff/diff.c\n@@ -8,9 +8,9 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"base85.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"tempfile.h\"\n #include \"revision/revision.h\"\n@@ -43,7 +43,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strmap.h\"\n #include \"ws.h\"\n \ndiff --git a/diff/range-diff.c b/diff/range-diff.c\nindex 281c043480..80ebfe1114 100644\n--- a/diff/range-diff.c\n+++ b/diff/range-diff.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"diff/range-diff.h\"\n #include \"odb/object-name.h\"\n@@ -16,7 +16,7 @@\n #include \"odb/commit.h\"\n #include \"pager.h\"\n #include \"revision/pretty.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"diff/userdiff.h\"\n #include \"apply.h\"\n #include \"revision/revision.h\"\ndiff --git a/diff/tree-diff.c b/diff/tree-diff.c\nindex a34559daa5..30fc2725e7 100644\n--- a/diff/tree-diff.c\n+++ b/diff/tree-diff.c\n@@ -10,7 +10,7 @@\n #include \"odb/hash.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/dir.h\"\n \n /*\ndiff --git a/diff/userdiff.c b/diff/userdiff.c\nindex 8993b622c1..63d195e7d7 100644\n--- a/diff/userdiff.c\n+++ b/diff/userdiff.c\n@@ -2,11 +2,11 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/userdiff.h\"\n #include \"attr.h\"\n #include \"strbuf.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n \n static struct userdiff_driver *drivers;\n static int ndrivers;\ndiff --git a/diff/xdiff-interface.c b/diff/xdiff-interface.c\nindex 2c87316caa..8b016b327c 100644\n--- a/diff/xdiff-interface.c\n+++ b/diff/xdiff-interface.c\n@@ -1,9 +1,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"strbuf.h\"\ndiff --git a/editor.c b/editor.c\nindex 0d1cb8768d..5c0238eb80 100644\n--- a/editor.c\n+++ b/editor.c\n@@ -3,9 +3,9 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"pager.h\"\n #include \"path.h\"\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex 507e67d528..5e0e00fb79 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"path.h\"\ndiff --git a/fetch-negotiator.c b/fetch-negotiator.c\nindex be383367f5..90fee42b50 100644\n--- a/fetch-negotiator.c\n+++ b/fetch-negotiator.c\n@@ -3,7 +3,7 @@\n #include \"negotiator/default.h\"\n #include \"negotiator/skipping.h\"\n #include \"negotiator/noop.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n void fetch_negotiator_init(struct repository *r,\n \t\t\t   struct fetch_negotiator *negotiator)\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex d27a28502f..5bc72eb370 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -2,10 +2,10 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"repository.h\"\n-#include \"config.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/config.h\"\n #include \"date.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n@@ -20,7 +20,7 @@\n #include \"run-command.h\"\n #include \"connect.h\"\n #include \"trace2.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n #include \"pack/packfile.h\"\ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex 4993cc4a02..d38b2b5c8c 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"refs/refs.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\ndiff --git a/gettext.c b/gettext.c\nindex 8d08a61f84..7bb4305ad6 100644\n--- a/gettext.c\n+++ b/gettext.c\n@@ -6,7 +6,7 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"utf8.h\"\ndiff --git a/git.c b/git.c\nindex f01a80867b..693604a598 100644\n--- a/git.c\n+++ b/git.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"help.h\"\n@@ -10,9 +10,9 @@\n #include \"pager.h\"\n #include \"index/read-cache-ll.h\"\n #include \"run-command.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n #include \"odb/replace-object.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"attr.h\"\n #include \"revision/shallow.h\"\n #include \"trace.h\"\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 45a922496b..69e99d56c0 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -2,18 +2,18 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"date.h\"\n #include \"gettext.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"index/dir.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"gpg-interface.h\"\n #include \"path.h\"\n #include \"sigchain.h\"\n #include \"tempfile.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n \n static int git_gpg_config(const char *, const char *,\n \t\t\t  const struct config_context *, void *);\ndiff --git a/grep.c b/grep.c\nindex c4eb18ccd7..9eda692529 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"grep.h\"\n #include \"hex.h\"\ndiff --git a/help.c b/help.c\nindex f7a0950f6c..34ab22ade5 100644\n--- a/help.c\n+++ b/help.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"git-zlib.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"builtin.h\"\n #include \"exec-cmd.h\"\n #include \"run-command.h\"\n@@ -14,13 +14,13 @@\n #include \"command-list.h\"\n #include \"string-list.h\"\n #include \"column.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"refs/refs.h\"\n #include \"parse-options.h\"\n #include \"prompt.h\"\n #include \"index/fsmonitor-ipc.h\"\n-#include \"repository.h\"\n-#include \"alias.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/alias.h\"\n #include \"utf8.h\"\n \n #ifndef NO_CURL\ndiff --git a/http-backend.c b/http-backend.c\nindex 57589cc127..dcf8506c1e 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -2,12 +2,12 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"git-zlib.h\"\n #include \"hex.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"refs/refs.h\"\n #include \"pkt-line.h\"\n #include \"odb/object.h\"\n@@ -16,7 +16,7 @@\n #include \"run-command.h\"\n #include \"string-list.h\"\n #include \"url.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"pack/packfile.h\"\n #include \"odb/odb.h\"\ndiff --git a/http-fetch.c b/http-fetch.c\nindex 05f68f306a..ad2447ce72 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -1,13 +1,13 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"http.h\"\n #include \"walker.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\ndiff --git a/http-push.c b/http-push.c\nindex d45daee9e0..fb18e8756f 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"odb/blob.h\"\n@@ -12,7 +12,7 @@\n #include \"revision/revision.h\"\n #include \"remote.h\"\n #include \"revision/list-objects.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n #include \"odb/tree.h\"\ndiff --git a/http-walker.c b/http-walker.c\nindex 8df0c5329b..b5bba74da4 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"hex.h\"\n #include \"walker.h\"\n #include \"http.h\"\ndiff --git a/http.c b/http.c\nindex 24a6b30ab3..5b3b2b24d6 100644\n--- a/http.c\n+++ b/http.c\n@@ -3,16 +3,16 @@\n \n #include \"git-compat-util.h\"\n #include \"git-curl-compat.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"http.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"pack/pack.h\"\n #include \"run-command.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\n #include \"credential.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"pkt-line.h\"\n #include \"gettext.h\"\n #include \"trace.h\"\ndiff --git a/imap-send.c b/imap-send.c\nindex 0d16d02029..de244d8011 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -26,13 +26,13 @@\n \n #include \"git-compat-util.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"credential.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"run-command.h\"\n #include \"parse-options.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #ifdef USE_CURL_FOR_IMAP_SEND\n #include \"http.h\"\ndiff --git a/index/cache-tree.c b/index/cache-tree.c\nindex e7c4bfe45c..bb813bd840 100644\n--- a/index/cache-tree.c\n+++ b/index/cache-tree.c\n@@ -13,7 +13,7 @@\n #include \"odb/transaction.h\"\n #include \"index/read-cache-ll.h\"\n #include \"odb/replace-object.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"promisor-remote.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\ndiff --git a/index/checkout.c b/index/checkout.c\nindex 13d8895032..b262ada8c7 100644\n--- a/index/checkout.c\n+++ b/index/checkout.c\n@@ -4,9 +4,9 @@\n #include \"odb/object-name.h\"\n #include \"remote.h\"\n #include \"refs/refspec.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/checkout.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"strbuf.h\"\n \n struct tracking_name_data {\ndiff --git a/index/dir.c b/index/dir.c\nindex 6f74a3e87c..8eb684c005 100644\n--- a/index/dir.c\n+++ b/index/dir.c\n@@ -11,16 +11,16 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"index/name-hash.h\"\n #include \"odb/object-file.h\"\n #include \"path.h\"\n #include \"refs/refs.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"wildmatch.h\"\n #include \"index/pathspec.h\"\n #include \"utf8.h\"\n@@ -28,7 +28,7 @@\n #include \"ewah/ewok.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"strbuf.h\"\n #include \"submodule-config.h\"\ndiff --git a/index/entry.c b/index/entry.c\nindex 5b89ad2294..b37c53198f 100644\n--- a/index/entry.c\n+++ b/index/entry.c\n@@ -4,7 +4,7 @@\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"index/name-hash.h\"\ndiff --git a/index/fsmonitor-ipc.c b/index/fsmonitor-ipc.c\nindex 7c213245a1..68c0148de6 100644\n--- a/index/fsmonitor-ipc.c\n+++ b/index/fsmonitor-ipc.c\n@@ -4,7 +4,7 @@\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n #include \"index/fsmonitor-ipc.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\ndiff --git a/index/fsmonitor-settings.c b/index/fsmonitor-settings.c\nindex 883b5902a9..4668dd424e 100644\n--- a/index/fsmonitor-settings.c\n+++ b/index/fsmonitor-settings.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/fsmonitor-ipc.h\"\n #include \"index/fsmonitor-settings.h\"\n #include \"index/fsmonitor-path-utils.h\"\ndiff --git a/index/fsmonitor.c b/index/fsmonitor.c\nindex 606a59d36d..32bc60e44a 100644\n--- a/index/fsmonitor.c\n+++ b/index/fsmonitor.c\n@@ -2,14 +2,14 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"ewah/ewok.h\"\n #include \"index/fsmonitor.h\"\n #include \"index/fsmonitor-ipc.h\"\n #include \"index/name-hash.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"trace2.h\"\ndiff --git a/index/name-hash.c b/index/name-hash.c\nindex 5d126bc1a3..49c0dd5775 100644\n--- a/index/name-hash.c\n+++ b/index/name-hash.c\n@@ -10,7 +10,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"index/name-hash.h\"\n #include \"odb/object.h\"\ndiff --git a/index/parallel-checkout.c b/index/parallel-checkout.c\nindex 971c4b33fa..0905a7ff1e 100644\n--- a/index/parallel-checkout.c\n+++ b/index/parallel-checkout.c\n@@ -2,7 +2,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/entry.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\ndiff --git a/index/pathspec.c b/index/pathspec.c\nindex 7a0c152fb9..fe80ab49d1 100644\n--- a/index/pathspec.c\n+++ b/index/pathspec.c\n@@ -4,13 +4,13 @@\n #include \"abspath.h\"\n #include \"parse.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"index/pathspec.h\"\n #include \"attr.h\"\n #include \"index/read-cache.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"index/symlinks.h\"\n #include \"quote.h\"\ndiff --git a/index/preload-index.c b/index/preload-index.c\nindex eab3bfc602..d2d01ae72d 100644\n--- a/index/preload-index.c\n+++ b/index/preload-index.c\n@@ -7,7 +7,7 @@\n #include \"git-compat-util.h\"\n #include \"index/pathspec.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"index/fsmonitor.h\"\n #include \"gettext.h\"\n #include \"parse.h\"\n@@ -15,10 +15,10 @@\n #include \"progress.h\"\n #include \"index/read-cache.h\"\n #include \"thread-utils.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/symlinks.h\"\n #include \"trace2.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n /*\n  * Mostly randomly chosen maximum thread counts: we\ndiff --git a/index/read-cache.c b/index/read-cache.c\nindex 9c62ae5ee8..20a5e191a4 100644\n--- a/index/read-cache.c\n+++ b/index/read-cache.c\n@@ -8,7 +8,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"date.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n@@ -24,7 +24,7 @@\n #include \"odb/oid-array.h\"\n #include \"odb/tree.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"mem-pool.h\"\n #include \"index/name-hash.h\"\n@@ -32,7 +32,7 @@\n #include \"path.h\"\n #include \"index/preload-index.h\"\n #include \"index/read-cache.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/resolve-undo.h\"\n #include \"revision/revision.h\"\n #include \"strbuf.h\"\n@@ -47,7 +47,7 @@\n #include \"index/sparse-index.h\"\n #include \"csum-file.h\"\n #include \"promisor-remote.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n #include \"advice.h\"\ndiff --git a/index/read-cache.h b/index/read-cache.h\nindex d8519c7b36..69d04e93be 100644\n--- a/index/read-cache.h\n+++ b/index/read-cache.h\n@@ -4,7 +4,7 @@\n #include \"index/read-cache-ll.h\"\n #include \"odb/object.h\"\n #include \"index/pathspec.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n \n /*\n  * Determine the appropriate index mode for a file based on its stat()\ndiff --git a/index/sparse-index.c b/index/sparse-index.c\nindex 0a061a7658..7ac6142023 100644\n--- a/index/sparse-index.c\n+++ b/index/sparse-index.c\n@@ -2,18 +2,18 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"ewah/ewok.h\"\n #include \"gettext.h\"\n #include \"index/name-hash.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/sparse-index.h\"\n #include \"odb/tree.h\"\n #include \"index/pathspec.h\"\n #include \"trace2.h\"\n #include \"index/cache-tree.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n #include \"index/fsmonitor-ll.h\"\n #include \"advice.h\"\ndiff --git a/index/split-index.c b/index/split-index.c\nindex 02a5b011c5..9835b71f21 100644\n--- a/index/split-index.c\n+++ b/index/split-index.c\n@@ -5,7 +5,7 @@\n #include \"odb/hash.h\"\n #include \"mem-pool.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/split-index.h\"\n #include \"strbuf.h\"\n #include \"ewah/ewok.h\"\ndiff --git a/index/statinfo.c b/index/statinfo.c\nindex 4a22923009..5f4d710795 100644\n--- a/index/statinfo.c\n+++ b/index/statinfo.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"index/statinfo.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n /*\n  * Munge st_size into an unsigned int.\ndiff --git a/index/symlinks.c b/index/symlinks.c\nindex 18fadf3f75..ab894f2e05 100644\n--- a/index/symlinks.c\n+++ b/index/symlinks.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/symlinks.h\"\n \n static int threaded_check_leading_path(struct cache_def *cache, const char *name,\ndiff --git a/index/unpack-trees.c b/index/unpack-trees.c\nindex 68d85f622e..2eecede699 100644\n--- a/index/unpack-trees.c\n+++ b/index/unpack-trees.c\n@@ -4,10 +4,10 @@\n #include \"git-compat-util.h\"\n #include \"advice.h\"\n #include \"strvec.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"parse.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"index/name-hash.h\"\n@@ -30,7 +30,7 @@\n #include \"promisor-remote.h\"\n #include \"index/entry.h\"\n #include \"index/parallel-checkout.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n /*\n  * Error messages expected by scripts out of plumbing commands such as\ndiff --git a/index/wt-status.c b/index/wt-status.c\nindex 3381a40e75..847438f121 100644\n--- a/index/wt-status.c\n+++ b/index/wt-status.c\n@@ -8,7 +8,7 @@\n #include \"index/dir.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n@@ -17,7 +17,7 @@\n #include \"revision/revision.h\"\n #include \"diff/diffcore.h\"\n #include \"quote.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n #include \"remote.h\"\n@@ -25,7 +25,7 @@\n #include \"submodule.h\"\n #include \"column.h\"\n #include \"index/read-cache.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\ndiff --git a/lockfile.c b/lockfile.c\nindex 100f603771..942b919941 100644\n--- a/lockfile.c\n+++ b/lockfile.c\n@@ -9,7 +9,7 @@\n #include \"gettext.h\"\n #include \"lockfile.h\"\n #include \"parse.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"wrapper.h\"\n \ndiff --git a/mailinfo.c b/mailinfo.c\nindex 13949ff31e..6c44a6c6c6 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -1,8 +1,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex-ll.h\"\n #include \"utf8.h\"\ndiff --git a/mailmap.c b/mailmap.c\nindex 558b1972f8..670fb01403 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -1,11 +1,11 @@\n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"string-list.h\"\n #include \"mailmap.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n-#include \"setup.h\"\n-#include \"config.h\"\n+#include \"setup/setup.h\"\n+#include \"setup/config.h\"\n \n struct mailmap_info {\n \tchar *name;\ndiff --git a/merge-ll.c b/merge-ll.c\nindex 2aa45bfa90..9cb5119aa2 100644\n--- a/merge-ll.c\n+++ b/merge-ll.c\n@@ -8,7 +8,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"convert.h\"\n #include \"attr.h\"\n #include \"diff/xdiff-interface.h\"\ndiff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c\nindex c31ed7028d..227181d105 100644\n--- a/merge-ort-wrappers.c\n+++ b/merge-ort-wrappers.c\n@@ -6,7 +6,7 @@\n #include \"merge-ort.h\"\n #include \"merge-ort-wrappers.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/tag.h\"\n #include \"odb/tree.h\"\n \ndiff --git a/merge-ort.c b/merge-ort.c\nindex 516cd265c5..f101b5e0c4 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -26,11 +26,11 @@\n #include \"index/cache-tree.h\"\n #include \"odb/commit.h\"\n #include \"revision/commit-reach.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"index/entry.h\"\ndiff --git a/merge.c b/merge.c\nindex 0fcfc1460f..95a943c477 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -7,7 +7,7 @@\n #include \"lockfile.h\"\n #include \"merge.h\"\n #include \"odb/commit.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"index/resolve-undo.h\"\n #include \"odb/tree.h\"\ndiff --git a/meson.build b/meson.build\nindex c61ebc35a6..bad597d8ff 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -311,7 +311,7 @@ libgit_sources = [\n   'add-interactive.c',\n   'add-patch.c',\n   'advice.c',\n-  'alias.c',\n+  'setup/alias.c',\n   'odb/alloc.c',\n   'apply.c',\n   'archive-tar.c',\n@@ -340,7 +340,7 @@ libgit_sources = [\n   'common-exit.c',\n   'common-init.c',\n   'compiler-tricks/not-constant.c',\n-  'config.c',\n+  'setup/config.c',\n   'connect.c',\n   'connected.c',\n   'convert.c',\n@@ -367,7 +367,7 @@ libgit_sources = [\n   'index/dir.c',\n   'editor.c',\n   'index/entry.c',\n-  'environment.c',\n+  'setup/environment.c',\n   'ewah/bitmap.c',\n   'ewah/ewah_bitmap.c',\n   'ewah/ewah_io.c',\n@@ -392,8 +392,8 @@ libgit_sources = [\n   'help.c',\n   'hex.c',\n   'hex-ll.c',\n-  'hook.c',\n-  'ident.c',\n+  'setup/hook.c',\n+  'setup/ident.c',\n   'json-writer.c',\n   'kwset.c',\n   'levenshtein.c',\n@@ -517,8 +517,8 @@ libgit_sources = [\n   'pack/repack-promisor.c',\n   'odb/replace-object.c',\n   'replay.c',\n-  'repo-settings.c',\n-  'repository.c',\n+  'setup/repo-settings.c',\n+  'setup/repository.c',\n   'rerere.c',\n   'reset.c',\n   'index/resolve-undo.c',\n@@ -528,7 +528,7 @@ libgit_sources = [\n   'sequencer.c',\n   'serve.c',\n   'pack/server-info.c',\n-  'setup.c',\n+  'setup/setup.c',\n   'revision/shallow.c',\n   'sideband.c',\n   'sigchain.c',\n@@ -575,7 +575,7 @@ libgit_sources = [\n   'usage.c',\n   'diff/userdiff.c',\n   'utf8.c',\n-  'version.c',\n+  'setup/version.c',\n   'versioncmp.c',\n   'walker.c',\n   'wildmatch.c',\ndiff --git a/negotiator/default.c b/negotiator/default.c\nindex 7d67933e06..3211453743 100644\n--- a/negotiator/default.c\n+++ b/negotiator/default.c\n@@ -6,7 +6,7 @@\n #include \"../fetch-negotiator.h\"\n #include \"../prio-queue.h\"\n #include \"refs/refs.h\"\n-#include \"../repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/tag.h\"\n \n /* Remember to update object flag allocation in object.h */\ndiff --git a/negotiator/skipping.c b/negotiator/skipping.c\nindex 9e685f54a1..eabfac6edd 100644\n--- a/negotiator/skipping.c\n+++ b/negotiator/skipping.c\n@@ -7,7 +7,7 @@\n #include \"../hex.h\"\n #include \"../prio-queue.h\"\n #include \"refs/refs.h\"\n-#include \"../repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/tag.h\"\n \n /* Remember to update object flag allocation in object.h */\ndiff --git a/notes-cache.c b/notes-cache.c\nindex 1e734c5c19..3963f3bf08 100644\n--- a/notes-cache.c\n+++ b/notes-cache.c\n@@ -5,7 +5,7 @@\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n #include \"revision/pretty.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/commit.h\"\n #include \"refs/refs.h\"\n #include \"strbuf.h\"\ndiff --git a/notes-merge.c b/notes-merge.c\nindex 2bb6ad735e..67e6da2ebd 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -10,7 +10,7 @@\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n #include \"hex.h\"\ndiff --git a/notes-utils.c b/notes-utils.c\nindex 491de7a7ce..62a99fdd4b 100644\n--- a/notes-utils.c\n+++ b/notes-utils.c\n@@ -1,9 +1,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"refs/refs.h\"\n #include \"notes-utils.h\"\ndiff --git a/notes.c b/notes.c\nindex 5842226c68..87a1cdf542 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"notes.h\"\n #include \"odb/object-file.h\"\ndiff --git a/odb/alloc.c b/odb/alloc.c\nindex e0f0146bf8..f261262b6f 100644\n--- a/odb/alloc.c\n+++ b/odb/alloc.c\n@@ -13,7 +13,7 @@\n #include \"odb/blob.h\"\n #include \"odb/tree.h\"\n #include \"odb/commit.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/tag.h\"\n #include \"odb/alloc.h\"\n \ndiff --git a/odb/commit.c b/odb/commit.c\nindex 3b490c760c..83c14e7dc4 100644\n--- a/odb/commit.c\n+++ b/odb/commit.c\n@@ -4,10 +4,10 @@\n #include \"odb/tag.h\"\n #include \"odb/commit.h\"\n #include \"pack/commit-graph.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"utf8.h\"\n@@ -24,10 +24,10 @@\n #include \"advice.h\"\n #include \"refs/refs.h\"\n #include \"revision/commit-reach.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"revision/shallow.h\"\n #include \"odb/tree.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"parse.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-file-convert.h\"\ndiff --git a/odb/fsck.c b/odb/fsck.c\nindex e889268b48..ec6c57ef06 100644\n--- a/odb/fsck.c\n+++ b/odb/fsck.c\n@@ -1,11 +1,11 @@\n #include \"git-compat-util.h\"\n #include \"date.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/object.h\"\n #include \"attr.h\"\n #include \"odb/blob.h\"\n@@ -20,7 +20,7 @@\n #include \"odb/oidset.h\"\n #include \"pack/packfile.h\"\n #include \"submodule-config.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"help.h\"\n \n static ssize_t max_tree_entry_len = 4096;\ndiff --git a/odb/hash.h b/odb/hash.h\nindex cf94ad5700..602ca12f28 100644\n--- a/odb/hash.h\n+++ b/odb/hash.h\n@@ -269,7 +269,7 @@ enum get_oid_result {\n };\n \n #ifdef USE_THE_REPOSITORY_VARIABLE\n-# include \"repository.h\"\n+# include \"setup/repository.h\"\n # define the_hash_algo the_repository->hash_algo\n #endif\n \ndiff --git a/odb/loose.c b/odb/loose.c\nindex 58af1f7910..d9866de7c7 100644\n--- a/odb/loose.c\n+++ b/odb/loose.c\n@@ -5,7 +5,7 @@\n #include \"odb/odb.h\"\n #include \"odb/source-files.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"wrapper.h\"\n #include \"gettext.h\"\n #include \"odb/loose.h\"\ndiff --git a/odb/match-trees.c b/odb/match-trees.c\nindex 4062373e11..9672d3d84c 100644\n--- a/odb/match-trees.c\n+++ b/odb/match-trees.c\n@@ -8,7 +8,7 @@\n #include \"odb/tree-walk.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n static int score_missing(unsigned mode)\n {\ndiff --git a/odb/object-file-convert.c b/odb/object-file-convert.c\nindex cad75963f7..b17574202d 100644\n--- a/odb/object-file-convert.c\n+++ b/odb/object-file-convert.c\n@@ -4,7 +4,7 @@\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/hash.h\"\n #include \"odb/object.h\"\n #include \"odb/loose.h\"\ndiff --git a/odb/object-file.c b/odb/object-file.c\nindex 847b78e5c7..762fedcc8e 100644\n--- a/odb/object-file.c\n+++ b/odb/object-file.c\n@@ -12,7 +12,7 @@\n #include \"git-compat-util.h\"\n #include \"convert.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"odb/fsck.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n@@ -26,7 +26,7 @@\n #include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"tempfile.h\"\n #include \"odb/tmp-objdir.h\"\ndiff --git a/odb/object-name.c b/odb/object-name.c\nindex 95a63c7f64..af03d8d0e5 100644\n--- a/odb/object-name.c\n+++ b/odb/object-name.c\n@@ -4,8 +4,8 @@\n #include \"git-compat-util.h\"\n #include \"odb/object-name.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/tag.h\"\n@@ -19,9 +19,9 @@\n #include \"odb/oid-array.h\"\n #include \"revision/pretty.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repo-settings.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"pack/midx.h\"\n #include \"revision/commit-reach.h\"\n #include \"date.h\"\ndiff --git a/odb/odb.c b/odb/odb.c\nindex 4e408501e8..f326dbb284 100644\n--- a/odb/odb.c\n+++ b/odb/odb.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"pack/commit-graph.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"khash.h\"\n@@ -21,7 +21,7 @@\n #include \"quote.h\"\n #include \"odb/replace-object.h\"\n #include \"run-command.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"strvec.h\"\n #include \"submodule.h\"\ndiff --git a/odb/replace-object.c b/odb/replace-object.c\nindex c69c5aa200..a5b33d27a6 100644\n--- a/odb/replace-object.c\n+++ b/odb/replace-object.c\n@@ -5,7 +5,7 @@\n #include \"odb/odb.h\"\n #include \"odb/replace-object.h\"\n #include \"refs/refs.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/commit.h\"\n \n static int register_replace_ref(const struct reference *ref, void *cb_data)\ndiff --git a/odb/replace-object.h b/odb/replace-object.h\nindex d7139028a3..8473817292 100644\n--- a/odb/replace-object.h\n+++ b/odb/replace-object.h\n@@ -2,7 +2,7 @@\n #define REPLACE_OBJECT_H\n \n #include \"odb/oidmap.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/odb.h\"\n \n struct replace_object {\ndiff --git a/odb/source-files.c b/odb/source-files.c\nindex b526e5c219..7b8a21d137 100644\n--- a/odb/source-files.c\n+++ b/odb/source-files.c\n@@ -2,7 +2,7 @@\n #include \"abspath.h\"\n #include \"odb/blob.h\"\n #include \"chdir-notify.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"lockfile.h\"\n #include \"odb/object-file.h\"\ndiff --git a/odb/source-inmemory.c b/odb/source-inmemory.c\nindex 288b51848e..6c3ada4640 100644\n--- a/odb/source-inmemory.c\n+++ b/odb/source-inmemory.c\n@@ -4,7 +4,7 @@\n #include \"odb/source-inmemory.h\"\n #include \"odb/streaming.h\"\n #include \"odb/oidtree.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n struct inmemory_object {\n \tenum object_type type;\ndiff --git a/odb/source-loose.c b/odb/source-loose.c\nindex 2b073d2a22..acf5a15b89 100644\n--- a/odb/source-loose.c\n+++ b/odb/source-loose.c\n@@ -12,7 +12,7 @@\n #include \"odb/streaming.h\"\n #include \"odb/oidtree.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"tempfile.h\"\n #include \"write-or-die.h\"\ndiff --git a/odb/streaming.c b/odb/streaming.c\nindex c3a06f5622..dd33584a64 100644\n--- a/odb/streaming.c\n+++ b/odb/streaming.c\n@@ -4,8 +4,8 @@\n \n #include \"git-compat-util.h\"\n #include \"convert.h\"\n-#include \"environment.h\"\n-#include \"repository.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/repository.h\"\n #include \"odb/odb.h\"\n #include \"odb/source.h\"\n #include \"odb/streaming.h\"\ndiff --git a/odb/tag.c b/odb/tag.c\nindex 36cb7732a8..7d74850db3 100644\n--- a/odb/tag.c\n+++ b/odb/tag.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"odb/tag.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n@@ -12,7 +12,7 @@\n #include \"gpg-interface.h\"\n #include \"hex.h\"\n #include \"pack/packfile.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n const char *tag_type = \"tag\";\n \ndiff --git a/odb/tmp-objdir.c b/odb/tmp-objdir.c\nindex 21219e8797..281a25bd6a 100644\n--- a/odb/tmp-objdir.c\n+++ b/odb/tmp-objdir.c\n@@ -3,7 +3,7 @@\n #include \"abspath.h\"\n #include \"chdir-notify.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"odb/object-file.h\"\n #include \"path.h\"\n #include \"string-list.h\"\n@@ -12,7 +12,7 @@\n #include \"quote.h\"\n #include \"odb/odb.h\"\n #include \"odb/source.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n struct tmp_objdir {\n \tstruct repository *repo;\ndiff --git a/odb/tree-walk.c b/odb/tree-walk.c\nindex e3e22e1a32..270913835c 100644\n--- a/odb/tree-walk.c\n+++ b/odb/tree-walk.c\n@@ -11,7 +11,7 @@\n #include \"odb/tree.h\"\n #include \"index/pathspec.h\"\n #include \"json-writer.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"index/read-cache-ll.h\"\n \n static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned long size, struct strbuf *err)\ndiff --git a/odb/tree.c b/odb/tree.c\nindex f1a9779d1a..3bcb9ef191 100644\n--- a/odb/tree.c\n+++ b/odb/tree.c\n@@ -6,8 +6,8 @@\n #include \"odb/commit.h\"\n #include \"odb/alloc.h\"\n #include \"odb/tree-walk.h\"\n-#include \"repository.h\"\n-#include \"environment.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/environment.h\"\n \n const char *tree_type = \"tree\";\n \ndiff --git a/organize/organize.c b/organize/organize.c\nindex f1f0aec6ea..ef4888aab7 100644\n--- a/organize/organize.c\n+++ b/organize/organize.c\n@@ -3,12 +3,12 @@\n #include \"gitorganize-format.h\"\n #include \"labeler-protocol.h\"\n #include \"organizer-protocol.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"index/pathspec.h\"\n #include \"quote.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\ndiff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c\nindex e0ef2ef871..bc14cb4304 100644\n--- a/oss-fuzz/fuzz-commit-graph.c\n+++ b/oss-fuzz/fuzz-commit-graph.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"pack/commit-graph.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);\n \ndiff --git a/oss-fuzz/fuzz-config.c b/oss-fuzz/fuzz-config.c\nindex 94027f5b97..86048ef9d8 100644\n--- a/oss-fuzz/fuzz-config.c\n+++ b/oss-fuzz/fuzz-config.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n int LLVMFuzzerTestOneInput(const uint8_t *, size_t);\n static int config_parser_callback(const char *, const char *,\ndiff --git a/pack/bloom.c b/pack/bloom.c\nindex 3fdbbf3aba..c36ebbf9c5 100644\n--- a/pack/bloom.c\n+++ b/pack/bloom.c\n@@ -10,8 +10,8 @@\n #include \"odb/commit-slab.h\"\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n-#include \"config.h\"\n-#include \"repository.h\"\n+#include \"setup/config.h\"\n+#include \"setup/repository.h\"\n \n define_commit_slab(bloom_filter_slab, struct bloom_filter);\n \ndiff --git a/pack/commit-graph.c b/pack/commit-graph.c\nindex d5537a9ee8..b060a5a16e 100644\n--- a/pack/commit-graph.c\n+++ b/pack/commit-graph.c\n@@ -1,9 +1,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"csum-file.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\ndiff --git a/pack/delta-islands.c b/pack/delta-islands.c\nindex 7c48204384..e911354aa1 100644\n--- a/pack/delta-islands.c\n+++ b/pack/delta-islands.c\n@@ -17,7 +17,7 @@\n #include \"pack/pack-objects.h\"\n #include \"pack/delta-islands.h\"\n #include \"odb/oid-array.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n KHASH_INIT(str, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)\n \ndiff --git a/pack/midx-write.c b/pack/midx-write.c\nindex 1d5a6525a6..bd4a200b82 100644\n--- a/pack/midx-write.c\n+++ b/pack/midx-write.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"pack/packfile.h\"\ndiff --git a/pack/midx.c b/pack/midx.c\nindex 76e77d0dd2..e3a67aa45a 100644\n--- a/pack/midx.c\n+++ b/pack/midx.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n #include \"hex.h\"\n #include \"pack/packfile.h\"\ndiff --git a/pack/pack-bitmap-write.c b/pack/pack-bitmap-write.c\nindex 3b7b41c5d7..1863ff2dd5 100644\n--- a/pack/pack-bitmap-write.c\n+++ b/pack/pack-bitmap-write.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n@@ -21,7 +21,7 @@\n #include \"odb/tree-walk.h\"\n #include \"pack/pseudo-merge.h\"\n #include \"odb/oid-array.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/alloc.h\"\n #include \"refs/refs.h\"\n #include \"strmap.h\"\ndiff --git a/pack/pack-bitmap.c b/pack/pack-bitmap.c\nindex 7cd24a37f5..4851c0d074 100644\n--- a/pack/pack-bitmap.c\n+++ b/pack/pack-bitmap.c\n@@ -15,12 +15,12 @@\n #include \"pack/pack-revindex.h\"\n #include \"pack/pack-objects.h\"\n #include \"pack/packfile.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"trace2.h\"\n #include \"odb/odb.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"pack/midx.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"pack/pseudo-merge.h\"\n \n /*\ndiff --git a/pack/pack-check.c b/pack/pack-check.c\nindex e66ef8f1b7..9123d4da21 100644\n--- a/pack/pack-check.c\n+++ b/pack/pack-check.c\n@@ -1,9 +1,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"pack/pack.h\"\n #include \"progress.h\"\n #include \"pack/packfile.h\"\ndiff --git a/pack/pack-objects.c b/pack/pack-objects.c\nindex aa1d5bb1c9..b3059f4865 100644\n--- a/pack/pack-objects.c\n+++ b/pack/pack-objects.c\n@@ -4,7 +4,7 @@\n #include \"pack/pack-objects.h\"\n #include \"pack/packfile.h\"\n #include \"parse.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n static uint32_t locate_object_entry_hash(struct packing_data *pdata,\n \t\t\t\t\t const struct object_id *oid,\ndiff --git a/pack/pack-revindex.c b/pack/pack-revindex.c\nindex 51cf1f82c6..637802f16b 100644\n--- a/pack/pack-revindex.c\n+++ b/pack/pack-revindex.c\n@@ -6,7 +6,7 @@\n #include \"strbuf.h\"\n #include \"trace2.h\"\n #include \"parse.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"pack/midx.h\"\n #include \"csum-file.h\"\n \ndiff --git a/pack/pack-write.c b/pack/pack-write.c\nindex 3ced89d932..45066b9657 100644\n--- a/pack/pack-write.c\n+++ b/pack/pack-write.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"pack/pack.h\"\n@@ -11,7 +11,7 @@\n #include \"pack/pack-objects.h\"\n #include \"pack/pack-revindex.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n \n void reset_pack_idx_option(struct pack_idx_option *opts)\ndiff --git a/pack/packfile.c b/pack/packfile.c\nindex 77de6bb821..9509d6efcb 100644\n--- a/pack/packfile.c\n+++ b/pack/packfile.c\n@@ -1,12 +1,12 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision/list.h\"\n #include \"pack/pack.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"index/dir.h\"\n #include \"pack/packfile.h\"\n #include \"pack/delta.h\"\ndiff --git a/pack/packfile.h b/pack/packfile.h\nindex 1e6e69fb77..2640288e9b 100644\n--- a/pack/packfile.h\n+++ b/pack/packfile.h\n@@ -8,7 +8,7 @@\n #include \"odb/source-packed.h\"\n #include \"odb/oidset.h\"\n #include \"pack/packfile-list.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n /* in odb.h */\n struct object_info;\ndiff --git a/pack/prune-packed.c b/pack/prune-packed.c\nindex 52473c6bf9..f94fcfebec 100644\n--- a/pack/prune-packed.c\n+++ b/pack/prune-packed.c\n@@ -6,7 +6,7 @@\n #include \"pack/packfile.h\"\n #include \"progress.h\"\n #include \"pack/prune-packed.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n static struct progress *progress;\n \ndiff --git a/pack/pseudo-merge.c b/pack/pseudo-merge.c\nindex 07c6ebea05..a3a0e5b0e9 100644\n--- a/pack/pseudo-merge.c\n+++ b/pack/pseudo-merge.c\n@@ -6,7 +6,7 @@\n #include \"date.h\"\n #include \"odb/oid-array.h\"\n #include \"strbuf.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"string-list.h\"\n #include \"refs/refs.h\"\n #include \"pack/pack-bitmap.h\"\ndiff --git a/pack/reachable.c b/pack/reachable.c\nindex 5b8a2a4f79..4c35f26119 100644\n--- a/pack/reachable.c\n+++ b/pack/reachable.c\n@@ -17,7 +17,7 @@\n #include \"odb/object-file.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"pack/pack-mtimes.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"run-command.h\"\n #include \"sequencer.h\"\n \ndiff --git a/pack/repack-cruft.c b/pack/repack-cruft.c\nindex 0f49a59ca7..fc05d13955 100644\n--- a/pack/repack-cruft.c\n+++ b/pack/repack-cruft.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"pack/repack.h\"\n #include \"pack/packfile.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n \n static void combine_small_cruft_packs(FILE *in, off_t combine_cruft_below_size,\ndiff --git a/pack/repack-filtered.c b/pack/repack-filtered.c\nindex 2a77018951..a590533bf5 100644\n--- a/pack/repack-filtered.c\n+++ b/pack/repack-filtered.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"pack/repack.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"string-list.h\"\n \ndiff --git a/pack/repack-geometry.c b/pack/repack-geometry.c\nindex 1ae2e8be9f..0771905997 100644\n--- a/pack/repack-geometry.c\n+++ b/pack/repack-geometry.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"pack/repack.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"hex.h\"\n #include \"pack/midx.h\"\n #include \"pack/packfile.h\"\ndiff --git a/pack/repack-promisor.c b/pack/repack-promisor.c\nindex 628903244c..f1538a5365 100644\n--- a/pack/repack-promisor.c\n+++ b/pack/repack-promisor.c\n@@ -4,7 +4,7 @@\n #include \"pack/pack.h\"\n #include \"pack/packfile.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n \n struct write_oid_context {\ndiff --git a/pack/repack.c b/pack/repack.c\nindex 52e7779a44..7c115c30fc 100644\n--- a/pack/repack.c\n+++ b/pack/repack.c\n@@ -5,7 +5,7 @@\n #include \"pack/packfile.h\"\n #include \"path.h\"\n #include \"pack/repack.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"tempfile.h\"\n \ndiff --git a/pack/server-info.c b/pack/server-info.c\nindex dbd86d6fd2..ecaaa25e9d 100644\n--- a/pack/server-info.c\n+++ b/pack/server-info.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"index/dir.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"refs/refs.h\"\n #include \"odb/object.h\"\n #include \"odb/commit.h\"\ndiff --git a/pager.c b/pager.c\nindex 543ef12936..add45ef679 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -1,12 +1,12 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n #include \"pager.h\"\n #include \"run-command.h\"\n #include \"sigchain.h\"\n-#include \"alias.h\"\n-#include \"repository.h\"\n-#include \"environment.h\"\n+#include \"setup/alias.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/environment.h\"\n \n int pager_use_color = 1;\n \ndiff --git a/parse-options-cb.c b/parse-options-cb.c\nindex 7826b8ad43..ba587028d7 100644\n--- a/parse-options-cb.c\n+++ b/parse-options-cb.c\n@@ -6,10 +6,10 @@\n #include \"odb/commit.h\"\n #include \"color.h\"\n #include \"date.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/path-walk.c b/path-walk.c\nindex 00686d3dbf..e99e43f95a 100644\n--- a/path-walk.c\n+++ b/path-walk.c\n@@ -16,7 +16,7 @@\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n #include \"prio-queue.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\ndiff --git a/path.c b/path.c\nindex e4d489e10a..1ae08c384b 100644\n--- a/path.c\n+++ b/path.c\n@@ -5,12 +5,12 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"gettext.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n #include \"index/dir.h\"\n #include \"refs/worktree.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"submodule-config.h\"\n #include \"path.h\"\n #include \"pack/packfile.h\"\ndiff --git a/path.h b/path.h\nindex 7e7408dd05..36711c6647 100644\n--- a/path.h\n+++ b/path.h\n@@ -294,7 +294,7 @@ void format_path(struct strbuf *dest, const char *path,\n \n # ifdef USE_THE_REPOSITORY_VARIABLE\n #  include \"strbuf.h\"\n-#  include \"repository.h\"\n+#  include \"setup/repository.h\"\n \n #define GIT_PATH_FUNC(func, filename) \\\n \tconst char *func(void) \\\ndiff --git a/progress.c b/progress.c\nindex 8315bdc3d4..3faea369df 100644\n--- a/progress.c\n+++ b/progress.c\n@@ -14,7 +14,7 @@\n #include \"git-compat-util.h\"\n #include \"pager.h\"\n #include \"progress.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\ndiff --git a/promisor-remote.c b/promisor-remote.c\nindex da6b1225dd..80caaeca99 100644\n--- a/promisor-remote.c\n+++ b/promisor-remote.c\n@@ -5,15 +5,15 @@\n #include \"hex.h\"\n #include \"odb/odb.h\"\n #include \"promisor-remote.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"trace2.h\"\n #include \"transport.h\"\n #include \"strvec.h\"\n #include \"pack/packfile.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"wildmatch.h\"\n \n struct promisor_remote_config {\ndiff --git a/promisor-remote.h b/promisor-remote.h\nindex 301f5ac5cb..9adca948f9 100644\n--- a/promisor-remote.h\n+++ b/promisor-remote.h\n@@ -1,7 +1,7 @@\n #ifndef PROMISOR_REMOTE_H\n #define PROMISOR_REMOTE_H\n \n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n struct object_id;\n \ndiff --git a/prompt.c b/prompt.c\nindex d8d74c7e37..36f24790f1 100644\n--- a/prompt.c\n+++ b/prompt.c\n@@ -2,8 +2,8 @@\n \n #include \"git-compat-util.h\"\n #include \"parse.h\"\n-#include \"environment.h\"\n-#include \"repository.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\n #include \"prompt.h\"\ndiff --git a/protocol-caps.c b/protocol-caps.c\nindex edac5dbd05..ffda7e11dd 100644\n--- a/protocol-caps.c\n+++ b/protocol-caps.c\n@@ -6,7 +6,7 @@\n #include \"odb/hash.h\"\n #include \"odb/object.h\"\n #include \"odb/odb.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\n \ndiff --git a/protocol.c b/protocol.c\nindex a3e26a8dd3..7f19dbc04d 100644\n--- a/protocol.c\n+++ b/protocol.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"protocol.h\"\n #include \"trace2.h\"\n \ndiff --git a/rebase-interactive.c b/rebase-interactive.c\nindex ee2ef8b535..f328910af4 100644\n--- a/rebase-interactive.c\n+++ b/rebase-interactive.c\n@@ -3,14 +3,14 @@\n #include \"git-compat-util.h\"\n #include \"odb/commit.h\"\n #include \"editor.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"sequencer.h\"\n #include \"rebase-interactive.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"odb/commit-slab.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n #include \"odb/object-name.h\"\n \ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex e6e07938a3..22aaa69a23 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -2,26 +2,26 @@\n \n #include \"../git-compat-util.h\"\n #include \"../abspath.h\"\n-#include \"../config.h\"\n+#include \"setup/config.h\"\n #include \"../copy.h\"\n-#include \"../environment.h\"\n+#include \"setup/environment.h\"\n #include \"../gettext.h\"\n #include \"odb/hash.h\"\n #include \"../hex.h\"\n #include \"odb/fsck.h\"\n #include \"refs/refs.h\"\n-#include \"../repo-settings.h\"\n+#include \"setup/repo-settings.h\"\n #include \"refs-internal.h\"\n #include \"ref-cache.h\"\n #include \"packed-backend.h\"\n-#include \"../ident.h\"\n+#include \"setup/ident.h\"\n #include \"../iterator.h\"\n #include \"index/dir-iterator.h\"\n #include \"../lockfile.h\"\n #include \"../path.h\"\n #include \"index/dir.h\"\n #include \"../chdir-notify.h\"\n-#include \"../setup.h\"\n+#include \"setup/setup.h\"\n #include \"refs/worktree.h\"\n #include \"../wrapper.h\"\n #include \"../write-or-die.h\"\ndiff --git a/refs/ls-refs.c b/refs/ls-refs.c\nindex 75b9b5e620..03ab2720e9 100644\n--- a/refs/ls-refs.c\n+++ b/refs/ls-refs.c\n@@ -1,16 +1,16 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"refs/refs.h\"\n #include \"strvec.h\"\n #include \"refs/ls-refs.h\"\n #include \"pkt-line.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"string-list.h\"\n \n static enum {\ndiff --git a/refs/pack-refs.c b/refs/pack-refs.c\nindex d6c41d64f1..cf586ddf36 100644\n--- a/refs/pack-refs.c\n+++ b/refs/pack-refs.c\n@@ -1,6 +1,6 @@\n #include \"builtin.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"refs/pack-refs.h\"\n #include \"parse-options.h\"\n #include \"refs/refs.h\"\ndiff --git a/refs/packed-backend.c b/refs/packed-backend.c\nindex 97f76c1d76..88fac2f868 100644\n--- a/refs/packed-backend.c\n+++ b/refs/packed-backend.c\n@@ -1,7 +1,7 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"../git-compat-util.h\"\n-#include \"../config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n #include \"odb/fsck.h\"\n #include \"../gettext.h\"\ndiff --git a/refs/ref-cache.c b/refs/ref-cache.c\nindex 3599199b8e..e06d56bce5 100644\n--- a/refs/ref-cache.c\n+++ b/refs/ref-cache.c\n@@ -1,7 +1,7 @@\n #include \"../git-compat-util.h\"\n #include \"odb/hash.h\"\n #include \"refs/refs.h\"\n-#include \"../repository.h\"\n+#include \"setup/repository.h\"\n #include \"refs-internal.h\"\n #include \"ref-cache.h\"\n #include \"../iterator.h\"\ndiff --git a/refs/ref-filter.c b/refs/ref-filter.c\nindex 32027789a8..9a426b6ce9 100644\n--- a/refs/ref-filter.c\n+++ b/refs/ref-filter.c\n@@ -2,9 +2,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gpg-interface.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n@@ -14,11 +14,11 @@\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n-#include \"repo-settings.h\"\n-#include \"repository.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/repository.h\"\n #include \"odb/commit.h\"\n #include \"mailmap.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"remote.h\"\n #include \"color.h\"\n #include \"odb/tag.h\"\ndiff --git a/refs/reflog-walk.c b/refs/reflog-walk.c\nindex 4c321fb3a8..8157b7fb0b 100644\n--- a/refs/reflog-walk.c\n+++ b/refs/reflog-walk.c\n@@ -4,7 +4,7 @@\n #include \"odb/commit.h\"\n #include \"refs/refs.h\"\n #include \"diff/diff.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n #include \"string-list.h\"\n #include \"refs/reflog-walk.h\"\ndiff --git a/refs/reflog.c b/refs/reflog.c\nindex 1050ae6301..cdd8bcf6fd 100644\n--- a/refs/reflog.c\n+++ b/refs/reflog.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"odb/odb.h\"\ndiff --git a/refs/refs.c b/refs/refs.c\nindex 2bc9c3cecd..2cafa50349 100644\n--- a/refs/refs.c\n+++ b/refs/refs.c\n@@ -5,8 +5,8 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"strmap.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n@@ -14,7 +14,7 @@\n #include \"iterator.h\"\n #include \"refs/refs.h\"\n #include \"refs/refs-internal.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"odb/object-name.h\"\n #include \"odb/odb.h\"\n #include \"odb/object.h\"\n@@ -22,12 +22,12 @@\n #include \"submodule.h\"\n #include \"refs/worktree.h\"\n #include \"strvec.h\"\n-#include \"repo-settings.h\"\n-#include \"setup.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/setup.h\"\n #include \"date.h\"\n #include \"odb/commit.h\"\n #include \"wildmatch.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"odb/fsck.h\"\n \n /*\ndiff --git a/refs/refs.h b/refs/refs.h\nindex 1746d1035c..03d145deb7 100644\n--- a/refs/refs.h\n+++ b/refs/refs.h\n@@ -3,8 +3,8 @@\n \n #include \"odb/object-name.h\"\n #include \"odb/commit.h\"\n-#include \"repository.h\"\n-#include \"repo-settings.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/repo-settings.h\"\n \n struct fsck_options;\n struct object_id;\ndiff --git a/refs/reftable-backend.c b/refs/reftable-backend.c\nindex 0c02b2d287..932e91fe8a 100644\n--- a/refs/reftable-backend.c\n+++ b/refs/reftable-backend.c\n@@ -1,14 +1,14 @@\n #include \"../git-compat-util.h\"\n #include \"../abspath.h\"\n #include \"../chdir-notify.h\"\n-#include \"../config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"../environment.h\"\n+#include \"setup/environment.h\"\n #include \"odb/fsck.h\"\n #include \"../gettext.h\"\n #include \"odb/hash.h\"\n #include \"../hex.h\"\n-#include \"../ident.h\"\n+#include \"setup/ident.h\"\n #include \"../iterator.h\"\n #include \"../parse.h\"\n #include \"../path.h\"\n@@ -19,8 +19,8 @@\n #include \"../reftable/reftable-iterator.h\"\n #include \"../reftable/reftable-record.h\"\n #include \"../reftable/reftable-stack.h\"\n-#include \"../repo-settings.h\"\n-#include \"../setup.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/setup.h\"\n #include \"../strmap.h\"\n #include \"../trace2.h\"\n #include \"refs/worktree.h\"\ndiff --git a/refs/worktree.c b/refs/worktree.c\nindex 0f1fe6a7d2..63a7251c47 100644\n--- a/refs/worktree.c\n+++ b/refs/worktree.c\n@@ -2,17 +2,17 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"refs/refs.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"refs/worktree.h\"\n #include \"index/dir.h\"\n #include \"index/wt-status.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n \n void free_worktree(struct worktree *worktree)\n {\ndiff --git a/remote-curl.c b/remote-curl.c\nindex a6a145c046..d0aa42c974 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -3,8 +3,8 @@\n \n #include \"git-compat-util.h\"\n #include \"git-curl-compat.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"remote.h\"\n@@ -19,7 +19,7 @@\n #include \"credential.h\"\n #include \"odb/oid-array.h\"\n #include \"send-pack.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"protocol.h\"\n #include \"quote.h\"\n #include \"trace2.h\"\ndiff --git a/remote.c b/remote.c\nindex 2b376893b3..ae77c5b1db 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -3,8 +3,8 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"remote.h\"\n@@ -19,7 +19,7 @@\n #include \"diff/diff.h\"\n #include \"revision/revision.h\"\n #include \"index/dir.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"revision/commit-reach.h\"\ndiff --git a/replay.c b/replay.c\nindex 6922a1f137..97ef099650 100644\n--- a/replay.c\n+++ b/replay.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"merge-ort.h\"\n #include \"odb/object-name.h\"\ndiff --git a/rerere.c b/rerere.c\nindex df30ebbe93..bd6e452036 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -3,9 +3,9 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"copy.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\ndiff --git a/reset.c b/reset.c\nindex 0eddc94d8c..8155336712 100644\n--- a/reset.c\n+++ b/reset.c\n@@ -9,7 +9,7 @@\n #include \"odb/tree-walk.h\"\n #include \"odb/tree.h\"\n #include \"index/unpack-trees.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n \n static int update_refs(struct repository *repo,\n \t\t       const struct reset_working_tree_options *opts,\ndiff --git a/reset.h b/reset.h\nindex 52055ad68d..09179ece6d 100644\n--- a/reset.h\n+++ b/reset.h\n@@ -2,7 +2,7 @@\n #define RESET_H\n \n #include \"odb/hash.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n \n #define GIT_REFLOG_ACTION_ENVIRONMENT \"GIT_REFLOG_ACTION\"\n \ndiff --git a/revision/bisect.c b/revision/bisect.c\nindex 7805872c3e..7949d74e14 100644\n--- a/revision/bisect.c\n+++ b/revision/bisect.c\n@@ -2,10 +2,10 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"diff/diff.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision/revision.h\"\ndiff --git a/revision/blame.c b/revision/blame.c\nindex a75bf22193..11e3dd63ff 100644\n--- a/revision/blame.c\n+++ b/revision/blame.c\n@@ -15,7 +15,7 @@\n #include \"path.h\"\n #include \"index/read-cache.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"odb/tag.h\"\n #include \"trace2.h\"\n #include \"revision/blame.h\"\ndiff --git a/revision/graph.c b/revision/graph.c\nindex c6f10398a2..9524af5010 100644\n--- a/revision/graph.c\n+++ b/revision/graph.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"color.h\"\n #include \"revision/graph.h\"\ndiff --git a/revision/line-log.c b/revision/line-log.c\nindex 3da7af2340..97fe28d3ef 100644\n--- a/revision/line-log.c\n+++ b/revision/line-log.c\n@@ -9,12 +9,12 @@\n #include \"diff/diff.h\"\n #include \"odb/commit.h\"\n #include \"revision/decorate.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n #include \"diff/xdiff-interface.h\"\n #include \"strbuf.h\"\n #include \"revision/line-log.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"pack/bloom.h\"\n #include \"odb/tree-walk.h\"\ndiff --git a/revision/list-objects-filter-options.c b/revision/list-objects-filter-options.c\nindex 6730808896..38604a580c 100644\n--- a/revision/list-objects-filter-options.c\n+++ b/revision/list-objects-filter-options.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"promisor-remote.h\"\ndiff --git a/revision/list-objects.c b/revision/list-objects.c\nindex fdf98b629f..8544ff2a2a 100644\n--- a/revision/list-objects.c\n+++ b/revision/list-objects.c\n@@ -16,7 +16,7 @@\n #include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n #include \"trace.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n \n struct traversal_context {\n \tstruct rev_info *revs;\ndiff --git a/revision/log-tree.c b/revision/log-tree.c\nindex e555d07072..679dd21806 100644\n--- a/revision/log-tree.c\n+++ b/revision/log-tree.c\n@@ -4,14 +4,14 @@\n #include \"git-compat-util.h\"\n #include \"revision/commit-reach.h\"\n #include \"odb/commit-slab.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"diff/diff.h\"\n #include \"diff/diffcore.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"odb/object-file.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/tmp-objdir.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\ndiff --git a/revision/pretty.c b/revision/pretty.c\nindex cdf63ded49..7925bea766 100644\n--- a/revision/pretty.c\n+++ b/revision/pretty.c\n@@ -2,9 +2,9 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"odb/hash.h\"\n #include \"hex.h\"\ndiff --git a/revision/revision.c b/revision/revision.c\nindex 97c6fa6fef..7470333ae6 100644\n--- a/revision/revision.c\n+++ b/revision/revision.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n@@ -18,7 +18,7 @@\n #include \"diff/diff-merges.h\"\n #include \"refs/refs.h\"\n #include \"revision/revision.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/graph.h\"\n #include \"grep.h\"\n #include \"refs/reflog-walk.h\"\n@@ -35,7 +35,7 @@\n #include \"refs/worktree.h\"\n #include \"path.h\"\n #include \"index/read-cache.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"index/sparse-index.h\"\n #include \"strvec.h\"\n #include \"trace2.h\"\ndiff --git a/revision/revision.h b/revision/revision.h\nindex 9cb9419b22..5a894e27a4 100644\n--- a/revision/revision.h\n+++ b/revision/revision.h\n@@ -10,7 +10,7 @@\n #include \"diff/diff.h\"\n #include \"odb/commit-slab-decl.h\"\n #include \"revision/decorate.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"prio-queue.h\"\n #include \"strvec.h\"\ndiff --git a/revision/shallow.c b/revision/shallow.c\nindex f4ce207278..a6e8a66c14 100644\n--- a/revision/shallow.c\n+++ b/revision/shallow.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"tempfile.h\"\n #include \"lockfile.h\"\n #include \"odb/odb.h\"\ndiff --git a/revision/shallow.h b/revision/shallow.h\nindex 0cb1d5ba70..60b283c9d5 100644\n--- a/revision/shallow.h\n+++ b/revision/shallow.h\n@@ -4,7 +4,7 @@\n #include \"odb/commit.h\"\n #include \"lockfile.h\"\n #include \"odb/object.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n \n struct oid_array;\ndiff --git a/run-command.c b/run-command.c\nindex 80382354dc..83702c99f1 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"run-command.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"sigchain.h\"\n@@ -14,7 +14,7 @@\n #include \"trace.h\"\n #include \"trace2.h\"\n #include \"quote.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"pack/packfile.h\"\n #include \"compat/nonblock.h\"\n \ndiff --git a/scalar.c b/scalar.c\nindex d1e397ef50..17468d1332 100644\n--- a/scalar.c\n+++ b/scalar.c\n@@ -8,7 +8,7 @@\n #include \"abspath.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"run-command.h\"\n #include \"simple-ipc.h\"\n #include \"index/fsmonitor-ipc.h\"\n@@ -17,7 +17,7 @@\n #include \"index/dir.h\"\n #include \"pack/packfile.h\"\n #include \"help.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"trace2.h\"\n #include \"path.h\"\n \ndiff --git a/send-pack.c b/send-pack.c\nindex f59686f971..546835b0aa 100644\n--- a/send-pack.c\n+++ b/send-pack.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/commit.h\"\n #include \"date.h\"\n #include \"gettext.h\"\n@@ -12,7 +12,7 @@\n #include \"connect.h\"\n #include \"send-pack.h\"\n #include \"transport.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"odb/oid-array.h\"\n #include \"gpg-interface.h\"\n #include \"revision/shallow.h\"\ndiff --git a/sequencer.c b/sequencer.c\nindex f4a0f77eaf..1dd0c6af95 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -4,9 +4,9 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"copy.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"lockfile.h\"\n@@ -19,7 +19,7 @@\n #include \"odb/commit.h\"\n #include \"sequencer.h\"\n #include \"run-command.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"utf8.h\"\n #include \"index/cache-tree.h\"\n #include \"diff/diff.h\"\n@@ -43,7 +43,7 @@\n #include \"odb/oidmap.h\"\n #include \"odb/oidset.h\"\n #include \"odb/commit-slab.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n #include \"revision/commit-reach.h\"\n #include \"rebase-interactive.h\"\n #include \"reset.h\"\ndiff --git a/serve.c b/serve.c\nindex df3086fb3a..4408187c47 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -1,9 +1,9 @@\n #include \"git-compat-util.h\"\n-#include \"repository.h\"\n-#include \"config.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/config.h\"\n #include \"odb/hash.h\"\n #include \"pkt-line.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"refs/ls-refs.h\"\n #include \"protocol-caps.h\"\n #include \"serve.h\"\ndiff --git a/alias.c b/setup/alias.c\nsimilarity index 98%\nrename from alias.c\nrename to setup/alias.c\nindex e737c49edd..c6939bd88e 100644\n--- a/alias.c\n+++ b/setup/alias.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"alias.h\"\n-#include \"config.h\"\n+#include \"setup/alias.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\ndiff --git a/alias.h b/setup/alias.h\nsimilarity index 100%\nrename from alias.h\nrename to setup/alias.h\ndiff --git a/config.c b/setup/config.c\nsimilarity index 99%\nrename from config.c\nrename to setup/config.c\nindex 59c6029654..3f26a8beda 100644\n--- a/config.c\n+++ b/setup/config.c\n@@ -11,14 +11,14 @@\n #include \"advice.h\"\n #include \"date.h\"\n #include \"branch.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n #include \"parse.h\"\n #include \"convert.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"lockfile.h\"\n #include \"exec-cmd.h\"\n #include \"strbuf.h\"\n@@ -31,7 +31,7 @@\n #include \"utf8.h\"\n #include \"color.h\"\n #include \"refs/refs.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"trace2.h\"\n #include \"wildmatch.h\"\ndiff --git a/config.h b/setup/config.h\nsimilarity index 99%\nrename from config.h\nrename to setup/config.h\nindex 31fe3e2961..44aba10ce1 100644\n--- a/config.h\n+++ b/setup/config.h\n@@ -3,7 +3,7 @@\n \n #include \"hashmap.h\"\n #include \"string-list.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"parse.h\"\n \n /**\ndiff --git a/environment.c b/setup/environment.c\nsimilarity index 99%\nrename from environment.c\nrename to setup/environment.c\nindex 6066417b62..0b135d4d8d 100644\n--- a/environment.c\n+++ b/setup/environment.c\n@@ -17,15 +17,15 @@\n #include \"branch.h\"\n #include \"color.h\"\n #include \"convert.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"git-zlib.h\"\n-#include \"ident.h\"\n+#include \"setup/ident.h\"\n #include \"lockfile.h\"\n #include \"mailmap.h\"\n #include \"odb/object-name.h\"\n-#include \"repository.h\"\n-#include \"config.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/config.h\"\n #include \"refs/refs.h\"\n #include \"fmt-merge-msg.h\"\n #include \"odb/commit.h\"\n@@ -34,7 +34,7 @@\n #include \"path.h\"\n #include \"quote.h\"\n #include \"chdir-notify.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"ws.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/environment.h b/setup/environment.h\nsimilarity index 99%\nrename from environment.h\nrename to setup/environment.h\nindex e7ec5b0437..ba8004e179 100644\n--- a/environment.h\n+++ b/setup/environment.h\n@@ -1,7 +1,7 @@\n #ifndef ENVIRONMENT_H\n #define ENVIRONMENT_H\n \n-#include \"repo-settings.h\"\n+#include \"setup/repo-settings.h\"\n #include \"branch.h\"\n \n /* Double-check local_repo_env below if you add to this list. */\ndiff --git a/hook.c b/setup/hook.c\nsimilarity index 99%\nrename from hook.c\nrename to setup/hook.c\nindex d10eef4763..e4cfca5fa5 100644\n--- a/hook.c\n+++ b/setup/hook.c\n@@ -1,15 +1,15 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n-#include \"hook.h\"\n+#include \"setup/hook.h\"\n #include \"hook-list.h\"\n #include \"parse.h\"\n #include \"path.h\"\n #include \"run-command.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"strmap.h\"\n #include \"thread-utils.h\"\ndiff --git a/hook.h b/setup/hook.h\nsimilarity index 99%\nrename from hook.h\nrename to setup/hook.h\nindex 27bb1aeb2e..f5ca5364cc 100644\n--- a/hook.h\n+++ b/setup/hook.h\n@@ -1,6 +1,6 @@\n #ifndef HOOK_H\n #define HOOK_H\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"run-command.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\ndiff --git a/ident.c b/setup/ident.c\nsimilarity index 99%\nrename from ident.c\nrename to setup/ident.c\nindex 0b7aacecd7..27e620fdf4 100644\n--- a/ident.c\n+++ b/setup/ident.c\n@@ -6,8 +6,8 @@\n  * Copyright (C) 2005 Linus Torvalds\n  */\n #include \"git-compat-util.h\"\n-#include \"ident.h\"\n-#include \"config.h\"\n+#include \"setup/ident.h\"\n+#include \"setup/config.h\"\n #include \"date.h\"\n #include \"gettext.h\"\n #include \"mailmap.h\"\ndiff --git a/ident.h b/setup/ident.h\nsimilarity index 100%\nrename from ident.h\nrename to setup/ident.h\ndiff --git a/repo-settings.c b/setup/repo-settings.c\nsimilarity index 98%\nrename from repo-settings.c\nrename to setup/repo-settings.c\nindex f40d1436a9..3c71eb6fc6 100644\n--- a/repo-settings.c\n+++ b/setup/repo-settings.c\n@@ -1,10 +1,10 @@\n #include \"git-compat-util.h\"\n-#include \"config.h\"\n-#include \"repo-settings.h\"\n-#include \"repository.h\"\n+#include \"setup/config.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/repository.h\"\n #include \"pack/midx.h\"\n #include \"pack/pack-objects.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static void repo_cfg_bool(struct repository *r, const char *key, int *dest,\n \t\t\t  int def)\ndiff --git a/repo-settings.h b/setup/repo-settings.h\nsimilarity index 100%\nrename from repo-settings.h\nrename to setup/repo-settings.h\ndiff --git a/repository.c b/setup/repository.c\nsimilarity index 99%\nrename from repository.c\nrename to setup/repository.c\nindex 8771145515..77be866c82 100644\n--- a/repository.c\n+++ b/setup/repository.c\n@@ -1,17 +1,17 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"repository.h\"\n-#include \"hook.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/hook.h\"\n #include \"odb/odb.h\"\n #include \"odb/source.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"odb/object.h\"\n #include \"lockfile.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\n #include \"remote.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"odb/loose.h\"\n #include \"submodule-config.h\"\n #include \"index/sparse-index.h\"\ndiff --git a/repository.h b/setup/repository.h\nsimilarity index 99%\nrename from repository.h\nrename to setup/repository.h\nindex 3b467a2513..3157f56e9c 100644\n--- a/repository.h\n+++ b/setup/repository.h\n@@ -3,8 +3,8 @@\n \n #include \"strmap.h\"\n #include \"string-list.h\"\n-#include \"repo-settings.h\"\n-#include \"environment.h\"\n+#include \"setup/repo-settings.h\"\n+#include \"setup/environment.h\"\n \n struct config_set;\n struct git_hash_algo;\ndiff --git a/setup.c b/setup/setup.c\nsimilarity index 99%\nrename from setup.c\nrename to setup/setup.c\nindex e4e9ca83fe..e71fa7b118 100644\n--- a/setup.c\n+++ b/setup/setup.c\n@@ -3,17 +3,17 @@\n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n #include \"copy.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\n #include \"refs/refs.h\"\n-#include \"repository.h\"\n-#include \"config.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/config.h\"\n #include \"index/dir.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"revision/shallow.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\ndiff --git a/setup.h b/setup/setup.h\nsimilarity index 100%\nrename from setup.h\nrename to setup/setup.h\ndiff --git a/version.c b/setup/version.c\nsimilarity index 98%\nrename from version.c\nrename to setup/version.c\nindex 21ec7c0fbe..c4a55edb5c 100644\n--- a/version.c\n+++ b/setup/version.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"version.h\"\n+#include \"setup/version.h\"\n #include \"strbuf.h\"\n #include \"gettext.h\"\n \ndiff --git a/version.h b/setup/version.h\nsimilarity index 100%\nrename from version.h\nrename to setup/version.h\ndiff --git a/shell.c b/shell.c\nindex 76333c8068..4e7f8e43c0 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -3,7 +3,7 @@\n #include \"exec-cmd.h\"\n #include \"strbuf.h\"\n #include \"run-command.h\"\n-#include \"alias.h\"\n+#include \"setup/alias.h\"\n \n #define COMMAND_DIR \"git-shell-commands\"\n #define HELP_COMMAND COMMAND_DIR \"/help\"\ndiff --git a/sideband.c b/sideband.c\nindex 374187402e..b915fdf114 100644\n--- a/sideband.c\n+++ b/sideband.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"color.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"editor.h\"\n #include \"gettext.h\"\n #include \"sideband.h\"\ndiff --git a/submodule-config.c b/submodule-config.c\nindex c8be0acbb1..334cfb54ee 100644\n--- a/submodule-config.c\n+++ b/submodule-config.c\n@@ -3,12 +3,12 @@\n \n #include \"git-compat-util.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n-#include \"config.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/config.h\"\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n #include \"strbuf.h\"\ndiff --git a/submodule-config.h b/submodule-config.h\nindex 3f4f0bf454..b1d075a754 100644\n--- a/submodule-config.h\n+++ b/submodule-config.h\n@@ -1,7 +1,7 @@\n #ifndef SUBMODULE_CONFIG_CACHE_H\n #define SUBMODULE_CONFIG_CACHE_H\n \n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"submodule.h\"\n #include \"odb/tree-walk.h\"\n \ndiff --git a/submodule.c b/submodule.c\nindex e14b53d3c8..16b3ffbcc6 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -3,14 +3,14 @@\n \n #include \"git-compat-util.h\"\n #include \"abspath.h\"\n-#include \"repository.h\"\n-#include \"config.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/config.h\"\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n #include \"index/dir.h\"\n #include \"diff/diff.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"revision/revision.h\"\n@@ -30,7 +30,7 @@\n #include \"odb/odb.h\"\n #include \"revision/commit-reach.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"advice.h\"\n #include \"url.h\"\n \ndiff --git a/t/helper/test-advise.c b/t/helper/test-advise.c\nindex 8f9db2693e..1f4a67bb65 100644\n--- a/t/helper/test-advise.c\n+++ b/t/helper/test-advise.c\n@@ -2,9 +2,9 @@\n \n #include \"test-tool.h\"\n #include \"advice.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n-#include \"setup.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n+#include \"setup/setup.h\"\n \n int cmd__advise_if_enabled(int argc, const char **argv)\n {\ndiff --git a/t/helper/test-bitmap.c b/t/helper/test-bitmap.c\nindex 59beba76d2..40bf0c790f 100644\n--- a/t/helper/test-bitmap.c\n+++ b/t/helper/test-bitmap.c\n@@ -6,7 +6,7 @@\n #include \"odb/odb.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"pack/pseudo-merge.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static int bitmap_list_commits(void)\n {\ndiff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c\nindex 5c469af08d..0be36ac656 100644\n--- a/t/helper/test-bloom.c\n+++ b/t/helper/test-bloom.c\n@@ -4,8 +4,8 @@\n #include \"pack/bloom.h\"\n #include \"hex.h\"\n #include \"odb/commit.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n \n static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;\n \ndiff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c\nindex cf7e7efc5d..bbdedf44dd 100644\n--- a/t/helper/test-cache-tree.c\n+++ b/t/helper/test-cache-tree.c\n@@ -8,8 +8,8 @@\n #include \"index/cache-tree.h\"\n #include \"parse-options.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n \n static char const * const test_cache_tree_usage[] = {\n \tN_(\"test-tool cache-tree <options> (control|prime|update)\"),\ndiff --git a/t/helper/test-config.c b/t/helper/test-config.c\nindex cfb3f4b111..8d5a7af0b4 100644\n--- a/t/helper/test-config.c\n+++ b/t/helper/test-config.c\n@@ -2,8 +2,8 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"test-tool.h\"\n-#include \"config.h\"\n-#include \"setup.h\"\n+#include \"setup/config.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n \n /*\ndiff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c\nindex 599b316ac1..251aea165d 100644\n--- a/t/helper/test-dump-cache-tree.c\n+++ b/t/helper/test-dump-cache-tree.c\n@@ -6,8 +6,8 @@\n #include \"odb/tree.h\"\n #include \"index/cache-tree.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n \n static void dump_one(struct cache_tree *it, const char *pfx, const char *x)\n {\ndiff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c\nindex 1dbdb28fbf..adcb90bd3a 100644\n--- a/t/helper/test-dump-fsmonitor.c\n+++ b/t/helper/test-dump-fsmonitor.c\n@@ -2,8 +2,8 @@\n \n #include \"test-tool.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n \n int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)\n {\ndiff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c\nindex 79c8628005..f3013bba91 100644\n--- a/t/helper/test-dump-split-index.c\n+++ b/t/helper/test-dump-split-index.c\n@@ -3,8 +3,8 @@\n #include \"test-tool.h\"\n #include \"hex.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"index/split-index.h\"\n #include \"ewah/ewok.h\"\n \ndiff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c\nindex c31d01f3b5..8fc213e26a 100644\n--- a/t/helper/test-dump-untracked-cache.c\n+++ b/t/helper/test-dump-untracked-cache.c\n@@ -4,8 +4,8 @@\n #include \"index/dir.h\"\n #include \"hex.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n \n static int compare_untracked(const void *a_, const void *b_)\n {\ndiff --git a/t/helper/test-find-pack.c b/t/helper/test-find-pack.c\nindex 216e7abb9a..def817ba1b 100644\n--- a/t/helper/test-find-pack.c\n+++ b/t/helper/test-find-pack.c\n@@ -5,7 +5,7 @@\n #include \"odb/odb.h\"\n #include \"pack/packfile.h\"\n #include \"parse-options.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n /*\n  * Display the path(s), one per line, of the packfile(s) containing\ndiff --git a/t/helper/test-fsmonitor-client.c b/t/helper/test-fsmonitor-client.c\nindex 845c1db493..35f313e568 100644\n--- a/t/helper/test-fsmonitor-client.c\n+++ b/t/helper/test-fsmonitor-client.c\n@@ -9,8 +9,8 @@\n #include \"parse-options.h\"\n #include \"index/fsmonitor-ipc.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"thread-utils.h\"\n #include \"trace2.h\"\n \ndiff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c\nindex 6f16fcf7e8..328732f72a 100644\n--- a/t/helper/test-lazy-init-name-hash.c\n+++ b/t/helper/test-lazy-init-name-hash.c\n@@ -1,12 +1,12 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"index/name-hash.h\"\n #include \"parse-options.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"trace.h\"\n \n static int single;\ndiff --git a/t/helper/test-match-trees.c b/t/helper/test-match-trees.c\nindex b6122af08f..65a56444c8 100644\n--- a/t/helper/test-match-trees.c\n+++ b/t/helper/test-match-trees.c\n@@ -4,8 +4,8 @@\n #include \"hex.h\"\n #include \"odb/match-trees.h\"\n #include \"odb/object-name.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"odb/tree.h\"\n \n int cmd__match_trees(int ac UNUSED, const char **av)\ndiff --git a/t/helper/test-pack-deltas.c b/t/helper/test-pack-deltas.c\nindex a3117ca6fc..f86434bf93 100644\n--- a/t/helper/test-pack-deltas.c\n+++ b/t/helper/test-pack-deltas.c\n@@ -9,7 +9,7 @@\n #include \"pack/pack.h\"\n #include \"pack/pack-objects.h\"\n #include \"parse-options.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n \ndiff --git a/t/helper/test-pack-mtimes.c b/t/helper/test-pack-mtimes.c\nindex 4750a33140..a662bebb10 100644\n--- a/t/helper/test-pack-mtimes.c\n+++ b/t/helper/test-pack-mtimes.c\n@@ -6,7 +6,7 @@\n #include \"odb/odb.h\"\n #include \"pack/packfile.h\"\n #include \"pack/pack-mtimes.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static void dump_mtimes(struct packed_git *p)\n {\ndiff --git a/t/helper/test-partial-clone.c b/t/helper/test-partial-clone.c\nindex 76fc0329fc..db27488954 100644\n--- a/t/helper/test-partial-clone.c\n+++ b/t/helper/test-partial-clone.c\n@@ -2,9 +2,9 @@\n \n #include \"test-tool.h\"\n #include \"hex.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/odb.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n /*\n  * Prints the size of the object corresponding to the given hash in a specific\ndiff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c\nindex fd98a5bfd9..34ccd254e5 100644\n--- a/t/helper/test-path-utils.c\n+++ b/t/helper/test-path-utils.c\n@@ -3,10 +3,10 @@\n \n #include \"test-tool.h\"\n #include \"abspath.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n #include \"trace.h\"\n #include \"utf8.h\"\ndiff --git a/t/helper/test-path-walk.c b/t/helper/test-path-walk.c\nindex f689ff3c53..8bf2ec3dc6 100644\n--- a/t/helper/test-path-walk.c\n+++ b/t/helper/test-path-walk.c\n@@ -2,14 +2,14 @@\n \n #include \"test-tool.h\"\n #include \"index/dir.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"odb/object-name.h\"\n #include \"odb/object.h\"\n #include \"revision/pretty.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"parse-options.h\"\n #include \"strbuf.h\"\n #include \"path-walk.h\"\ndiff --git a/t/helper/test-progress.c b/t/helper/test-progress.c\nindex 1f75b7bd19..8146c56f08 100644\n--- a/t/helper/test-progress.c\n+++ b/t/helper/test-progress.c\n@@ -24,7 +24,7 @@\n #include \"test-tool.h\"\n #include \"parse-options.h\"\n #include \"progress.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n \ndiff --git a/t/helper/test-reach.c b/t/helper/test-reach.c\nindex 7f00cc7d9c..30bde7d2ee 100644\n--- a/t/helper/test-reach.c\n+++ b/t/helper/test-reach.c\n@@ -7,7 +7,7 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"refs/ref-filter.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n #include \"odb/tag.h\"\n \ndiff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c\nindex dad40b8ad7..ae2e1f19f4 100644\n--- a/t/helper/test-read-cache.c\n+++ b/t/helper/test-read-cache.c\n@@ -1,11 +1,11 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"config.h\"\n-#include \"environment.h\"\n+#include \"setup/config.h\"\n+#include \"setup/environment.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n \n int cmd__read_cache(int argc, const char **argv)\n {\ndiff --git a/t/helper/test-read-graph.c b/t/helper/test-read-graph.c\nindex c80df07586..76f0833cc0 100644\n--- a/t/helper/test-read-graph.c\n+++ b/t/helper/test-read-graph.c\n@@ -2,10 +2,10 @@\n \n #include \"test-tool.h\"\n #include \"pack/commit-graph.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/odb.h\"\n #include \"pack/bloom.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static void dump_graph_info(struct commit_graph *graph)\n {\ndiff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c\nindex 1e3db8cd81..ce8c10d4f1 100644\n--- a/t/helper/test-read-midx.c\n+++ b/t/helper/test-read-midx.c\n@@ -3,11 +3,11 @@\n #include \"test-tool.h\"\n #include \"hex.h\"\n #include \"pack/midx.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"odb/odb.h\"\n #include \"pack/pack-bitmap.h\"\n #include \"pack/packfile.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"gettext.h\"\n #include \"pack/pack-revindex.h\"\n \ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex 582e8b4d97..522520046e 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -3,11 +3,11 @@\n #include \"test-tool.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"refs/worktree.h\"\n #include \"odb/odb.h\"\n #include \"path.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"strbuf.h\"\n #include \"revision/revision.h\"\n \ndiff --git a/t/helper/test-repository.c b/t/helper/test-repository.c\nindex 58f486a471..947aaf6b94 100644\n--- a/t/helper/test-repository.c\n+++ b/t/helper/test-repository.c\n@@ -3,11 +3,11 @@\n #include \"test-tool.h\"\n #include \"pack/commit-graph.h\"\n #include \"odb/commit.h\"\n-#include \"environment.h\"\n+#include \"setup/environment.h\"\n #include \"hex.h\"\n #include \"odb/object.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"odb/tree.h\"\n \n static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,\ndiff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c\nindex 57e0bcea63..264c96fc59 100644\n--- a/t/helper/test-revision-walking.c\n+++ b/t/helper/test-revision-walking.c\n@@ -15,9 +15,9 @@\n #include \"diff/diff.h\"\n #include \"revision/line-log.h\"\n #include \"odb/object-name.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"revision/revision.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n #include \"string-list.h\"\n \n static void print_commit(struct commit *commit)\ndiff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c\nindex 8e40a08436..0989f969da 100644\n--- a/t/helper/test-scrap-cache-tree.c\n+++ b/t/helper/test-scrap-cache-tree.c\n@@ -3,8 +3,8 @@\n #include \"test-tool.h\"\n #include \"lockfile.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"odb/tree.h\"\n #include \"index/cache-tree.h\"\n \ndiff --git a/t/helper/test-serve-v2.c b/t/helper/test-serve-v2.c\nindex 27f3ed8947..13452d4eab 100644\n--- a/t/helper/test-serve-v2.c\n+++ b/t/helper/test-serve-v2.c\n@@ -3,9 +3,9 @@\n #include \"test-tool.h\"\n #include \"gettext.h\"\n #include \"parse-options.h\"\n-#include \"repository.h\"\n+#include \"setup/repository.h\"\n #include \"serve.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n static char const * const serve_usage[] = {\n \tN_(\"test-tool serve-v2 [<options>]\"),\ndiff --git a/t/helper/test-submodule-config.c b/t/helper/test-submodule-config.c\nindex 7a756d4f8d..e928d148f6 100644\n--- a/t/helper/test-submodule-config.c\n+++ b/t/helper/test-submodule-config.c\n@@ -1,11 +1,11 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"config.h\"\n+#include \"setup/config.h\"\n #include \"odb/hash.h\"\n #include \"odb/object-name.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n \ndiff --git a/t/helper/test-submodule-nested-repo-config.c b/t/helper/test-submodule-nested-repo-config.c\nindex 7e31d3fe47..a7078a0ef4 100644\n--- a/t/helper/test-submodule-nested-repo-config.c\n+++ b/t/helper/test-submodule-nested-repo-config.c\n@@ -1,8 +1,8 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"test-tool.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"submodule-config.h\"\n \n static void die_usage(const char **argv, const char *msg)\ndiff --git a/t/helper/test-submodule.c b/t/helper/test-submodule.c\nindex 3c5c4c4a09..7a82e1f0f9 100644\n--- a/t/helper/test-submodule.c\n+++ b/t/helper/test-submodule.c\n@@ -4,8 +4,8 @@\n #include \"test-tool-utils.h\"\n #include \"parse-options.h\"\n #include \"remote.h\"\n-#include \"repository.h\"\n-#include \"setup.h\"\n+#include \"setup/repository.h\"\n+#include \"setup/setup.h\"\n #include \"strbuf.h\"\n #include \"submodule-config.h\"\n #include \"submodule.h\"\ndiff --git a/t/helper/test-subprocess.c b/t/helper/test-subprocess.c\nindex a8194d24b3..b2b1d5494e 100644\n--- a/t/helper/test-subprocess.c\n+++ b/t/helper/test-subprocess.c\n@@ -2,7 +2,7 @@\n \n #include \"test-tool.h\"\n #include \"run-command.h\"\n-#include \"setup.h\"\n+#include \"setup/setup.h\"\n \n int cmd__subprocess(int "},{"id":"551095","messageId":"20260823171915.2662373-15-mmontalbo@gmail.com","threadId":"66210","inReplyTo":"20260823171915.2662373-1-mmontalbo@gmail.com","subject":"[RFC PATCH 14/14] transport: gather the transport sources under transport/","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-23T17:18:58Z","receivedAt":"2026-08-23T17:19:43Z","isPatch":true,"body":"Move the 22 transport C sources and 21 headers into transport/ as\nrenames. Repoint every reference to their old paths to the new ones: the\n#include lines across the tree, the Makefile and meson.build build\nentries, the contrib CMake sources.\n\nSigned-off-by: Michael Montalbo <mmontalbo@gmail.com>\n---\n .gitorganize                                  | 86 +++++++++----------\n Makefile                                      | 54 ++++++------\n branch.c                                      |  2 +-\n builtin/archive.c                             |  4 +-\n builtin/backfill.c                            |  2 +-\n builtin/branch.c                              |  2 +-\n builtin/bundle.c                              |  4 +-\n builtin/cat-file.c                            |  6 +-\n builtin/checkout--worker.c                    |  2 +-\n builtin/checkout.c                            |  2 +-\n builtin/clone.c                               | 12 +--\n builtin/fast-export.c                         |  2 +-\n builtin/fetch-pack.c                          | 10 +--\n builtin/fetch.c                               | 12 +--\n builtin/gc.c                                  |  2 +-\n builtin/grep.c                                |  2 +-\n builtin/index-pack.c                          |  2 +-\n builtin/log.c                                 |  4 +-\n builtin/ls-remote.c                           |  6 +-\n builtin/merge.c                               |  2 +-\n builtin/pack-objects.c                        |  4 +-\n builtin/pull.c                                |  2 +-\n builtin/push.c                                |  8 +-\n builtin/receive-pack.c                        | 12 +--\n builtin/remote-ext.c                          |  4 +-\n builtin/remote-fd.c                           |  2 +-\n builtin/remote.c                              |  4 +-\n builtin/repack.c                              |  2 +-\n builtin/send-pack.c                           | 12 +--\n builtin/submodule--helper.c                   |  2 +-\n builtin/upload-archive.c                      |  4 +-\n builtin/upload-pack.c                         |  8 +-\n builtin/worktree.c                            |  2 +-\n compat/simple-ipc/ipc-win32.c                 |  2 +-\n contrib/buildsystems/CMakeLists.txt           |  6 +-\n convert.c                                     |  2 +-\n daemon.c                                      |  4 +-\n diff/diff.c                                   |  2 +-\n diff/diffcore-break.c                         |  2 +-\n diff/diffcore-rename.c                        |  2 +-\n help.c                                        |  2 +-\n http-backend.c                                |  4 +-\n http-fetch.c                                  |  4 +-\n http-push.c                                   |  4 +-\n imap-send.c                                   |  2 +-\n index/cache-tree.c                            |  2 +-\n index/checkout.c                              |  2 +-\n index/parallel-checkout.c                     |  2 +-\n index/read-cache.c                            |  2 +-\n index/unpack-trees.c                          |  2 +-\n index/wt-status.c                             |  2 +-\n index/wt-status.h                             |  2 +-\n merge-ort.c                                   |  2 +-\n meson.build                                   | 46 +++++-----\n negotiator/default.c                          |  2 +-\n negotiator/noop.c                             |  2 +-\n negotiator/skipping.c                         |  2 +-\n odb/object-name.c                             |  2 +-\n odb/odb.c                                     |  2 +-\n odb/source-files.c                            |  2 +-\n pack/pack-write.c                             |  2 +-\n pack/packfile.c                               |  2 +-\n refs/ls-refs.c                                |  2 +-\n refs/ref-filter.c                             |  2 +-\n refs/refspec.c                                |  2 +-\n revision/list-objects-filter-options.c        |  2 +-\n revision/shallow.c                            |  2 +-\n setup/repository.c                            |  4 +-\n simple-ipc.h                                  |  2 +-\n sub-process.c                                 |  2 +-\n submodule.c                                   |  2 +-\n t/helper/test-bundle-uri.c                    |  6 +-\n t/helper/test-pkt-line.c                      |  4 +-\n t/helper/test-proc-receive.c                  |  4 +-\n t/helper/test-rot13-filter.c                  |  2 +-\n t/helper/test-serve-v2.c                      |  2 +-\n t/helper/test-submodule.c                     |  2 +-\n bundle-uri.c => transport/bundle-uri.c        | 10 +--\n bundle-uri.h => transport/bundle-uri.h        |  0\n bundle.c => transport/bundle.c                |  4 +-\n bundle.h => transport/bundle.h                |  0\n connect.c => transport/connect.c              | 14 +--\n connect.h => transport/connect.h              |  2 +-\n connected.c => transport/connected.c          |  6 +-\n connected.h => transport/connected.h          |  0\n .../fetch-negotiator.c                        |  2 +-\n .../fetch-negotiator.h                        |  0\n .../fetch-object-info.c                       |  6 +-\n .../fetch-object-info.h                       |  4 +-\n fetch-pack.c => transport/fetch-pack.c        | 16 ++--\n fetch-pack.h => transport/fetch-pack.h        |  2 +-\n .../git-curl-compat.h                         |  0\n http-walker.c => transport/http-walker.c      |  6 +-\n http.c => transport/http.c                    |  8 +-\n http.h => transport/http.h                    |  2 +-\n pkt-line.c => transport/pkt-line.c            |  4 +-\n pkt-line.h => transport/pkt-line.h            |  0\n .../promisor-remote.c                         |  4 +-\n .../promisor-remote.h                         |  0\n protocol-caps.c => transport/protocol-caps.c  |  4 +-\n protocol-caps.h => transport/protocol-caps.h  |  0\n protocol.c => transport/protocol.c            |  2 +-\n protocol.h => transport/protocol.h            |  0\n remote-curl.c => transport/remote-curl.c      | 18 ++--\n remote.c => transport/remote.c                |  6 +-\n remote.h => transport/remote.h                |  0\n send-pack.c => transport/send-pack.c          | 12 +--\n send-pack.h => transport/send-pack.h          |  0\n serve.c => transport/serve.c                  | 12 +--\n serve.h => transport/serve.h                  |  0\n sideband.c => transport/sideband.c            |  4 +-\n sideband.h => transport/sideband.h            |  0\n .../transport-helper.c                        |  8 +-\n .../transport-internal.h                      |  2 +-\n transport.c => transport/transport.c          | 24 +++---\n transport.h => transport/transport.h          |  4 +-\n upload-pack.c => transport/upload-pack.c      | 12 +--\n upload-pack.h => transport/upload-pack.h      |  0\n walker.c => transport/walker.c                |  2 +-\n walker.h => transport/walker.h                |  2 +-\n 120 files changed, 320 insertions(+), 320 deletions(-)\n rename bundle-uri.c => transport/bundle-uri.c (99%)\n rename bundle-uri.h => transport/bundle-uri.h (100%)\n rename bundle.c => transport/bundle.c (99%)\n rename bundle.h => transport/bundle.h (100%)\n rename connect.c => transport/connect.c (99%)\n rename connect.h => transport/connect.h (98%)\n rename connected.c => transport/connected.c (98%)\n rename connected.h => transport/connected.h (100%)\n rename fetch-negotiator.c => transport/fetch-negotiator.c (94%)\n rename fetch-negotiator.h => transport/fetch-negotiator.h (100%)\n rename fetch-object-info.c => transport/fetch-object-info.c (97%)\n rename fetch-object-info.h => transport/fetch-object-info.h (91%)\n rename fetch-pack.c => transport/fetch-pack.c (99%)\n rename fetch-pack.h => transport/fetch-pack.h (99%)\n rename git-curl-compat.h => transport/git-curl-compat.h (100%)\n rename http-walker.c => transport/http-walker.c (99%)\n rename http.c => transport/http.c (99%)\n rename http.h => transport/http.h (99%)\n rename pkt-line.c => transport/pkt-line.c (99%)\n rename pkt-line.h => transport/pkt-line.h (100%)\n rename promisor-remote.c => transport/promisor-remote.c (99%)\n rename promisor-remote.h => transport/promisor-remote.h (100%)\n rename protocol-caps.c => transport/protocol-caps.c (98%)\n rename protocol-caps.h => transport/protocol-caps.h (100%)\n rename protocol.c => transport/protocol.c (98%)\n rename protocol.h => transport/protocol.h (100%)\n rename remote-curl.c => transport/remote-curl.c (99%)\n rename remote.c => transport/remote.c (99%)\n rename remote.h => transport/remote.h (100%)\n rename send-pack.c => transport/send-pack.c (99%)\n rename send-pack.h => transport/send-pack.h (100%)\n rename serve.c => transport/serve.c (97%)\n rename serve.h => transport/serve.h (100%)\n rename sideband.c => transport/sideband.c (99%)\n rename sideband.h => transport/sideband.h (100%)\n rename transport-helper.c => transport/transport-helper.c (99%)\n rename transport-internal.h => transport/transport-internal.h (98%)\n rename transport.c => transport/transport.c (99%)\n rename transport.h => transport/transport.h (99%)\n rename upload-pack.c => transport/upload-pack.c (99%)\n rename upload-pack.h => transport/upload-pack.h (100%)\n rename walker.c => transport/walker.c (99%)\n rename walker.h => transport/walker.h (97%)\n\ndiff --git a/.gitorganize b/.gitorganize\nindex cb6416bfc3..f2f686feac 100644\n--- a/.gitorganize\n+++ b/.gitorganize\n@@ -42,10 +42,6 @@ base85.h component=? role=public prefix=base85 cochange=diff:1\n branch.c component=? role=lib prefix=branch includes=refs:3,setup:3,odb:2,submodule:1,transport:1 cochange=refs:62,transport:41,setup:28,index:19,revision:12\n branch.h component=? role=public prefix=branch cochange=setup:8,refs:4,submodule:4\n builtin.h component=? role=public prefix=builtin includes=setup:1 cochange=diff:15,index:15,transport:12,odb:6,notes:5\n-bundle-uri.c component=transport role=lib prefix=bundle-uri includes=transport:5,odb:1,refs:1,setup:1 cochange=transport:28,setup:7,odb:4,merge:2,pack:2\n-bundle-uri.h component=transport role=header prefix=bundle-uri cochange=transport:14\n-bundle.c component=transport role=lib prefix=bundle includes=odb:3,revision:3,setup:2,transport:2,diff:1 cochange=transport:63,odb:24,revision:21,refs:17,pack:10\n-bundle.h component=transport role=header prefix=bundle includes=revision:1 cochange=transport:37,revision:5\n chdir-notify.c component=? role=lib prefix=chdir-notify includes=revision:1 cochange=index:2,archive:1,merge:1,revision:1\n chdir-notify.h component=? role=public prefix=chdir-notify\n color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,index:14,revision:13,setup:7,transport:7\n@@ -56,10 +52,6 @@ common-exit.c component=? role=lib prefix=common-main\n common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1\n common-init.h component=? role=public prefix=common-main\n common-main.c component=? role=lib prefix=common-main cochange=setup:5,transport:4,convert:3,index:1\n-connect.c component=transport role=lib prefix=connect includes=transport:7,setup:4,odb:1,refs:1 cochange=transport:238,setup:19,diff:13,index:10,refs:10\n-connect.h component=transport role=header prefix=connect includes=transport:1 cochange=transport:58,refs:1\n-connected.c component=transport role=lib prefix=connected includes=transport:3,odb:1,pack:1 cochange=transport:39,pack:31,odb:7,diff:6,index:5\n-connected.h component=transport role=header prefix=connected cochange=transport:23\n convert.c component=convert role=lib prefix=convert includes=convert:2,index:1,merge:1,odb:1,setup:1 cochange=convert:59,diff:43,index:41,setup:30,transport:30\n convert.h component=convert role=header prefix=convert includes=odb:1 cochange=convert:29,index:18,diff:8,setup:8,archive:4\n copy.c component=? role=lib prefix=copy cochange=pack:6,transport:5,diff:3,odb:3,merge:2\n@@ -101,19 +93,12 @@ editor.c component=? role=lib prefix=editor includes=setup:2 cochange=transport:\n editor.h component=? role=public prefix=editor cochange=transport:1\n exec-cmd.c component=? role=lib prefix=strvec includes=setup:1\n exec-cmd.h component=? role=public prefix=argv-array cochange=refs:4,transport:4,odb:1,setup:1,submodule:1\n-fetch-negotiator.c component=transport role=lib prefix=repo-settings includes=setup:1,transport:1 cochange=setup:8,transport:7,index:2,odb:1\n-fetch-negotiator.h component=transport role=header prefix=fetch-negotiator cochange=transport:7,setup:3,odb:1,pack:1,revision:1\n-fetch-object-info.c component=transport role=lib prefix=cat-file includes=transport:3,odb:2 cochange=transport:7,odb:1\n-fetch-object-info.h component=transport role=header prefix=cat-file includes=transport:2 cochange=transport:7,odb:1\n-fetch-pack.c component=transport role=lib prefix=fetch-pack includes=transport:8,odb:7,setup:4,pack:3,revision:2 cochange=transport:303,odb:96,revision:46,pack:40,setup:25\n-fetch-pack.h component=transport role=header prefix=fetch-pack includes=odb:1,revision:1,transport:1 cochange=transport:108,odb:2,pack:2,refs:2,diff:1\n fmt-merge-msg.c component=merge role=lib prefix=fmt-merge-msg includes=odb:3,diff:2,revision:2,setup:2,merge:1 cochange=revision:10,odb:7,index:6,diff:4,setup:4\n fmt-merge-msg.h component=merge role=header prefix=fmt-merge-msg cochange=merge:3,setup:2\n for-each-ref.h component=? role=public prefix=?\n gettext.c component=? role=lib prefix=gettext includes=setup:1 cochange=pack:5,refs:3,setup:2,transport:2,merge:1\n gettext.h component=? role=public prefix=i18n cochange=transport:2,setup:1\n git-compat-util.h component=? role=public prefix=git-compat-util cochange=setup:48,index:35,odb:22,pack:21,diff:17\n-git-curl-compat.h component=transport role=header prefix=git-curl-compat cochange=transport:22\n git-zlib.c component=? role=lib prefix=git-zlib cochange=archive:2,odb:1,transport:1\n git-zlib.h component=? role=public prefix=git-zlib cochange=archive:3,setup:2,odb:1,transport:1\n git.c component=? role=lib prefix=git includes=setup:4,odb:2,convert:1,index:1,revision:1 cochange=setup:70,revision:54,transport:47,index:28,diff:25\n@@ -132,9 +117,6 @@ hex.h component=? role=public prefix=hex includes=odb:1 cochange=revision:3,odb:\n http-backend.c component=? role=program prefix=http-backend includes=setup:4,odb:3,transport:2,pack:1,refs:1 cochange=transport:57,pack:41,setup:19,refs:14,revision:13\n http-fetch.c component=? role=program prefix=http-fetch includes=setup:3,transport:2 cochange=transport:46,setup:10,pack:9,index:7,refs:7\n http-push.c component=? role=program prefix=http-push includes=odb:7,revision:3,setup:3,transport:2,diff:1 cochange=transport:272,odb:134,revision:82,pack:60,diff:34\n-http-walker.c component=transport role=lib prefix=http includes=transport:3,odb:2,pack:1,revision:1,setup:1 cochange=transport:73,pack:40,odb:17,index:11,refs:7\n-http.c component=transport role=lib prefix=http includes=transport:4,setup:3,odb:2,pack:2 cochange=transport:195,pack:71,odb:27,diff:8,setup:8\n-http.h component=transport role=header prefix=http includes=transport:1 cochange=transport:149,pack:15,diff:6,odb:4,archive:3\n imap-send.c component=? role=program prefix=imap-send includes=setup:3,transport:1 cochange=transport:47,diff:16,index:16,refs:9,odb:8\n index/cache-tree.c component=index role=lib prefix=cache-tree includes=odb:5,index:2,setup:1,transport:1 cochange=index:94,odb:69,revision:27,transport:21,diff:20\n index/cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1\n@@ -322,20 +304,12 @@ path-walk.c component=? role=lib prefix=path-walk includes=odb:9,revision:3,inde\n path-walk.h component=? role=public prefix=path-walk includes=odb:1 cochange=index:2\n path.c component=? role=lib prefix=path includes=setup:2,index:1,odb:1,pack:1,refs:1 cochange=setup:78,refs:29,index:26,transport:15,odb:12\n path.h component=? role=public prefix=path includes=setup:1 cochange=setup:23,refs:13,odb:11,index:10,pack:8\n-pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 cochange=transport:102,pack:6,convert:5,diff:5,odb:3\n-pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1\n prio-queue.c component=? role=lib prefix=prio-queue cochange=odb:5,revision:5,diff:2,pack:2,transport:2\n prio-queue.h component=? role=public prefix=prio-queue cochange=odb:3,revision:2,transport:2,pack:1\n progress.c component=? role=lib prefix=progress includes=setup:1 cochange=index:11,diff:6,setup:6,pack:4,revision:2\n progress.h component=? role=public prefix=progress cochange=index:5,diff:3\n-promisor-remote.c component=transport role=lib prefix=promisor-remote includes=setup:3,transport:2,odb:1,pack:1 cochange=transport:32,setup:15,odb:6,pack:5,index:4\n-promisor-remote.h component=transport role=header prefix=promisor-remote includes=setup:1 cochange=transport:18,setup:7,diff:4,index:3,revision:3\n prompt.c component=? role=lib prefix=prompt includes=setup:2 cochange=index:7,setup:6,pack:4,diff:3,transport:2\n prompt.h component=? role=public prefix=prompt cochange=transport:1\n-protocol-caps.c component=transport role=lib prefix=protocol-caps includes=odb:3,transport:2,setup:1 cochange=transport:6,odb:3,refs:2,merge:1,setup:1\n-protocol-caps.h component=transport role=header prefix=protocol-caps cochange=transport:6,refs:2\n-protocol.c component=transport role=lib prefix=protocol includes=setup:2,transport:1 cochange=transport:21,index:4,setup:4,refs:2,diff:1\n-protocol.h component=transport role=header prefix=protocol cochange=transport:5\n quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6\n quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5\n rebase-interactive.c component=? role=lib prefix=rebase-interactive includes=odb:3,setup:3,index:1 cochange=revision:4,transport:4,index:3,odb:3,merge:2\n@@ -358,9 +332,6 @@ refs/refspec.c component=refs role=lib prefix=refspec includes=refs:2,odb:1,tran\n refs/refspec.h component=refs role=header prefix=refspec cochange=transport:31,refs:29,submodule:3,index:2\n refs/worktree.c component=refs role=lib prefix=worktree includes=setup:4,index:2,refs:2 cochange=refs:73,setup:53,index:22,submodule:13,pack:11\n refs/worktree.h component=refs role=header prefix=worktree includes=refs:1 cochange=refs:61,revision:10,pack:5,setup:5,odb:4\n-remote-curl.c component=transport role=lib prefix=remote-curl includes=transport:9,setup:3,odb:1 cochange=transport:226,diff:9,revision:6,setup:5,archive:4\n-remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,transport:3,refs:2,revision:2 cochange=transport:272,refs:91,revision:56,index:51,odb:30\n-remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2\n replay.c component=? role=lib prefix=replay includes=odb:2,merge:1,refs:1,revision:1,setup:1 cochange=transport:1\n replay.h component=? role=public prefix=replay includes=odb:1\n rerere.c component=merge role=lib prefix=rerere includes=index:4,merge:2,odb:2,setup:2,diff:1 cochange=index:54,merge:29,pack:26,odb:25,transport:25\n@@ -400,12 +371,8 @@ run-command.c component=? role=lib prefix=run-command includes=setup:2,index:1,p\n run-command.h component=? role=public prefix=run-command cochange=transport:21,setup:8,odb:6,submodule:5,refs:4\n sane-ctype.h component=? role=public prefix=sane-ctype\n scalar.c component=? role=lib prefix=scalar includes=index:3,setup:2,pack:1,refs:1 cochange=setup:9,transport:7,pack:4,index:3,merge:3\n-send-pack.c component=transport role=lib prefix=send-pack includes=transport:6,odb:3,setup:2,revision:1 cochange=transport:177,odb:29,revision:17,refs:15,pack:8\n-send-pack.h component=transport role=header prefix=send-pack cochange=transport:39\n sequencer.c component=? role=lib prefix=sequencer includes=odb:8,index:5,merge:4,setup:4,revision:3 cochange=revision:84,odb:83,index:77,refs:60,transport:55\n sequencer.h component=? role=public prefix=sequencer includes=index:1 cochange=revision:5,index:4,notes:3,odb:3,transport:3\n-serve.c component=transport role=lib prefix=serve includes=transport:6,setup:3,odb:1,refs:1 cochange=transport:53,refs:7,odb:4,setup:3,index:1\n-serve.h component=transport role=header prefix=serve cochange=transport:9,refs:3,submodule:1\n setup/alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2\n setup/alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1\n setup/config.c component=setup role=lib prefix=config includes=setup:4,odb:2,convert:1,index:1,refs:1 cochange=setup:274,index:93,diff:75,refs:48,revision:46\n@@ -429,8 +396,6 @@ sha1dc_git.c component=? role=lib prefix=sha1dc cochange=diff:3,odb:2,revision:2\n sha1dc_git.h component=? role=public prefix=sha1dc cochange=odb:2\n shell.c component=? role=program prefix=shell includes=setup:1 cochange=transport:10,setup:4,revision:2\n shortlog.h component=? role=public prefix=shortlog cochange=revision:2\n-sideband.c component=transport role=lib prefix=sideband includes=transport:2,setup:1 cochange=transport:51,revision:6,diff:5,index:5,refs:4\n-sideband.h component=transport role=header prefix=sideband cochange=transport:23\n sigchain.c component=? role=lib prefix=sigchain cochange=diff:2,transport:1\n sigchain.h component=? role=public prefix=sigchain cochange=diff:2\n simple-ipc.h component=? role=public prefix=simple-ipc includes=transport:1 cochange=submodule:1\n@@ -460,17 +425,54 @@ trace2.c component=? role=lib prefix=trace2 includes=setup:2 cochange=setup:2\n trace2.h component=? role=public prefix=trace2 cochange=setup:2\n trailer.c component=? role=lib prefix=trailer includes=setup:2,odb:1,revision:1 cochange=transport:13,revision:12,odb:8,index:7,refs:6\n trailer.h component=? role=public prefix=trailer includes=revision:1 cochange=revision:7,refs:1\n-transport-helper.c component=transport role=lib prefix=transport-helper includes=transport:4,odb:2,refs:2,setup:2,pack:1 cochange=transport:210,refs:23,revision:16,odb:14,index:12\n-transport-internal.h component=transport role=header prefix=transport includes=transport:1 cochange=transport:42,refs:3,odb:1,submodule:1\n-transport.c component=transport role=lib prefix=transport includes=transport:12,setup:3,odb:2,refs:2,submodule:1 cochange=transport:482,refs:35,setup:31,submodule:29,revision:21\n-transport.h component=transport role=header prefix=transport includes=transport:2,revision:1 cochange=transport:249,submodule:6,odb:4,revision:2,diff:1\n+transport/bundle-uri.c component=transport role=lib prefix=bundle-uri includes=transport:5,odb:1,refs:1,setup:1 cochange=transport:28,setup:7,odb:4,merge:2,pack:2\n+transport/bundle-uri.h component=transport role=header prefix=bundle-uri cochange=transport:14\n+transport/bundle.c component=transport role=lib prefix=bundle includes=odb:3,revision:3,setup:2,transport:2,diff:1 cochange=transport:63,odb:24,revision:21,refs:17,pack:10\n+transport/bundle.h component=transport role=header prefix=bundle includes=revision:1 cochange=transport:37,revision:5\n+transport/connect.c component=transport role=lib prefix=connect includes=transport:7,setup:4,odb:1,refs:1 cochange=transport:238,setup:19,diff:13,index:10,refs:10\n+transport/connect.h component=transport role=header prefix=connect includes=transport:1 cochange=transport:58,refs:1\n+transport/connected.c component=transport role=lib prefix=connected includes=transport:3,odb:1,pack:1 cochange=transport:39,pack:31,odb:7,diff:6,index:5\n+transport/connected.h component=transport role=header prefix=connected cochange=transport:23\n+transport/fetch-negotiator.c component=transport role=lib prefix=repo-settings includes=setup:1,transport:1 cochange=setup:8,transport:7,index:2,odb:1\n+transport/fetch-negotiator.h component=transport role=header prefix=fetch-negotiator cochange=transport:7,setup:3,odb:1,pack:1,revision:1\n+transport/fetch-object-info.c component=transport role=lib prefix=cat-file includes=transport:3,odb:2 cochange=transport:7,odb:1\n+transport/fetch-object-info.h component=transport role=header prefix=cat-file includes=transport:2 cochange=transport:7,odb:1\n+transport/fetch-pack.c component=transport role=lib prefix=fetch-pack includes=transport:8,odb:7,setup:4,pack:3,revision:2 cochange=transport:303,odb:96,revision:46,pack:40,setup:25\n+transport/fetch-pack.h component=transport role=header prefix=fetch-pack includes=odb:1,revision:1,transport:1 cochange=transport:108,odb:2,pack:2,refs:2,diff:1\n+transport/git-curl-compat.h component=transport role=header prefix=git-curl-compat cochange=transport:22\n+transport/http-walker.c component=transport role=lib prefix=http includes=transport:3,odb:2,pack:1,revision:1,setup:1 cochange=transport:73,pack:40,odb:17,index:11,refs:7\n+transport/http.c component=transport role=lib prefix=http includes=transport:4,setup:3,odb:2,pack:2 cochange=transport:195,pack:71,odb:27,diff:8,setup:8\n+transport/http.h component=transport role=header prefix=http includes=transport:1 cochange=transport:149,pack:15,diff:6,odb:4,archive:3\n+transport/pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 cochange=transport:102,pack:6,convert:5,diff:5,odb:3\n+transport/pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1\n+transport/promisor-remote.c component=transport role=lib prefix=promisor-remote includes=setup:3,transport:2,odb:1,pack:1 cochange=transport:32,setup:15,odb:6,pack:5,index:4\n+transport/promisor-remote.h component=transport role=header prefix=promisor-remote includes=setup:1 cochange=transport:18,setup:7,diff:4,index:3,revision:3\n+transport/protocol-caps.c component=transport role=lib prefix=protocol-caps includes=odb:3,transport:2,setup:1 cochange=transport:6,odb:3,refs:2,merge:1,setup:1\n+transport/protocol-caps.h component=transport role=header prefix=protocol-caps cochange=transport:6,refs:2\n+transport/protocol.c component=transport role=lib prefix=protocol includes=setup:2,transport:1 cochange=transport:21,index:4,setup:4,refs:2,diff:1\n+transport/protocol.h component=transport role=header prefix=protocol cochange=transport:5\n+transport/remote-curl.c component=transport role=lib prefix=remote-curl includes=transport:9,setup:3,odb:1 cochange=transport:226,diff:9,revision:6,setup:5,archive:4\n+transport/remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,transport:3,refs:2,revision:2 cochange=transport:272,refs:91,revision:56,index:51,odb:30\n+transport/remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2\n+transport/send-pack.c component=transport role=lib prefix=send-pack includes=transport:6,odb:3,setup:2,revision:1 cochange=transport:177,odb:29,revision:17,refs:15,pack:8\n+transport/send-pack.h component=transport role=header prefix=send-pack cochange=transport:39\n+transport/serve.c component=transport role=lib prefix=serve includes=transport:6,setup:3,odb:1,refs:1 cochange=transport:53,refs:7,odb:4,setup:3,index:1\n+transport/serve.h component=transport role=header prefix=serve cochange=transport:9,refs:3,submodule:1\n+transport/sideband.c component=transport role=lib prefix=sideband includes=transport:2,setup:1 cochange=transport:51,revision:6,diff:5,index:5,refs:4\n+transport/sideband.h component=transport role=header prefix=sideband cochange=transport:23\n+transport/transport-helper.c component=transport role=lib prefix=transport-helper includes=transport:4,odb:2,refs:2,setup:2,pack:1 cochange=transport:210,refs:23,revision:16,odb:14,index:12\n+transport/transport-internal.h component=transport role=header prefix=transport includes=transport:1 cochange=transport:42,refs:3,odb:1,submodule:1\n+transport/transport.c component=transport role=lib prefix=transport includes=transport:12,setup:3,odb:2,refs:2,submodule:1 cochange=transport:482,refs:35,setup:31,submodule:29,revision:21\n+transport/transport.h component=transport role=header prefix=transport includes=transport:2,revision:1 cochange=transport:249,submodule:6,odb:4,revision:2,diff:1\n+transport/upload-pack.c component=transport role=lib prefix=upload-pack includes=transport:6,odb:4,revision:4,setup:4,diff:1 cochange=transport:198,odb:88,revision:80,refs:55,pack:34\n+transport/upload-pack.h component=transport role=header prefix=upload-pack cochange=transport:18,refs:5,submodule:1\n+transport/walker.c component=transport role=lib prefix=refs includes=odb:6,refs:1,setup:1,transport:1 cochange=odb:70,transport:55,revision:42,refs:24,pack:17\n+transport/walker.h component=transport role=header prefix=walker includes=transport:1 cochange=transport:19\n unicode-width.h component=? role=public prefix=unicode\n unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2,setup:1\n unix-socket.h component=? role=public prefix=unix-socket\n unix-stream-server.c component=? role=lib prefix=unix-stream-server\n unix-stream-server.h component=? role=public prefix=unix-stream-server\n-upload-pack.c component=transport role=lib prefix=upload-pack includes=transport:6,odb:4,revision:4,setup:4,diff:1 cochange=transport:198,odb:88,revision:80,refs:55,pack:34\n-upload-pack.h component=transport role=header prefix=upload-pack cochange=transport:18,refs:5,submodule:1\n url.c component=? role=lib prefix=url cochange=transport:12,revision:8,diff:6,index:2,refs:2\n url.h component=? role=public prefix=url cochange=transport:9,revision:4,submodule:1\n urlmatch.c component=? role=lib prefix=urlmatch cochange=diff:3,odb:2,revision:2,setup:2,transport:2\n@@ -482,8 +484,6 @@ varint.c component=? role=lib prefix=varint cochange=index:2,transport:1\n varint.h component=? role=public prefix=varint cochange=index:2,transport:1\n versioncmp.c component=? role=lib prefix=versioncmp includes=setup:1 cochange=setup:5,pack:3,transport:3,index:2,refs:2\n versioncmp.h component=? role=public prefix=versioncmp cochange=refs:1\n-walker.c component=transport role=lib prefix=refs includes=odb:6,refs:1,setup:1,transport:1 cochange=odb:70,transport:55,revision:42,refs:24,pack:17\n-walker.h component=transport role=header prefix=walker includes=transport:1 cochange=transport:19\n wildmatch.c component=? role=lib prefix=hex cochange=index:4,refs:3,diff:1,odb:1,revision:1\n wildmatch.h component=? role=public prefix=? cochange=index:3,refs:2,diff:1,revision:1,setup:1\n wrapper.c component=? role=lib prefix=wrapper cochange=setup:21,index:16,pack:6,transport:5,convert:4\ndiff --git a/Makefile b/Makefile\nindex cec75e834a..396d9b09cf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1115,8 +1115,8 @@ LIB_OBJS += revision/blame.o\n LIB_OBJS += odb/blob.o\n LIB_OBJS += pack/bloom.o\n LIB_OBJS += branch.o\n-LIB_OBJS += bundle-uri.o\n-LIB_OBJS += bundle.o\n+LIB_OBJS += transport/bundle-uri.o\n+LIB_OBJS += transport/bundle.o\n LIB_OBJS += index/cache-tree.o\n LIB_OBJS += odb/cbtree.o\n LIB_OBJS += chdir-notify.o\n@@ -1136,8 +1136,8 @@ LIB_OBJS += compat/open.o\n LIB_OBJS += compat/terminal.o\n LIB_OBJS += compiler-tricks/not-constant.o\n LIB_OBJS += setup/config.o\n-LIB_OBJS += connect.o\n-LIB_OBJS += connected.o\n+LIB_OBJS += transport/connect.o\n+LIB_OBJS += transport/connected.o\n LIB_OBJS += convert.o\n LIB_OBJS += copy.o\n LIB_OBJS += credential.o\n@@ -1168,9 +1168,9 @@ LIB_OBJS += ewah/ewah_bitmap.o\n LIB_OBJS += ewah/ewah_io.o\n LIB_OBJS += ewah/ewah_rlw.o\n LIB_OBJS += exec-cmd.o\n-LIB_OBJS += fetch-negotiator.o\n-LIB_OBJS += fetch-object-info.o\n-LIB_OBJS += fetch-pack.o\n+LIB_OBJS += transport/fetch-negotiator.o\n+LIB_OBJS += transport/fetch-object-info.o\n+LIB_OBJS += transport/fetch-pack.o\n LIB_OBJS += fmt-merge-msg.o\n LIB_OBJS += odb/fsck.o\n LIB_OBJS += index/fsmonitor.o\n@@ -1261,15 +1261,15 @@ LIB_OBJS += diff/patch-ids.o\n LIB_OBJS += path.o\n LIB_OBJS += path-walk.o\n LIB_OBJS += index/pathspec.o\n-LIB_OBJS += pkt-line.o\n+LIB_OBJS += transport/pkt-line.o\n LIB_OBJS += index/preload-index.o\n LIB_OBJS += revision/pretty.o\n LIB_OBJS += prio-queue.o\n LIB_OBJS += progress.o\n-LIB_OBJS += promisor-remote.o\n+LIB_OBJS += transport/promisor-remote.o\n LIB_OBJS += prompt.o\n-LIB_OBJS += protocol.o\n-LIB_OBJS += protocol-caps.o\n+LIB_OBJS += transport/protocol.o\n+LIB_OBJS += transport/protocol-caps.o\n LIB_OBJS += pack/prune-packed.o\n LIB_OBJS += pack/pseudo-merge.o\n LIB_OBJS += quote.o\n@@ -1303,7 +1303,7 @@ LIB_OBJS += reftable/system.o\n LIB_OBJS += reftable/table.o\n LIB_OBJS += reftable/tree.o\n LIB_OBJS += reftable/writer.o\n-LIB_OBJS += remote.o\n+LIB_OBJS += transport/remote.o\n LIB_OBJS += pack/repack.o\n LIB_OBJS += pack/repack-cruft.o\n LIB_OBJS += pack/repack-filtered.o\n@@ -1319,13 +1319,13 @@ LIB_OBJS += reset.o\n LIB_OBJS += index/resolve-undo.o\n LIB_OBJS += revision/revision.o\n LIB_OBJS += run-command.o\n-LIB_OBJS += send-pack.o\n+LIB_OBJS += transport/send-pack.o\n LIB_OBJS += sequencer.o\n-LIB_OBJS += serve.o\n+LIB_OBJS += transport/serve.o\n LIB_OBJS += pack/server-info.o\n LIB_OBJS += setup/setup.o\n LIB_OBJS += revision/shallow.o\n-LIB_OBJS += sideband.o\n+LIB_OBJS += transport/sideband.o\n LIB_OBJS += sigchain.o\n LIB_OBJS += index/sparse-index.o\n LIB_OBJS += index/split-index.o\n@@ -1358,13 +1358,13 @@ LIB_OBJS += trace2/tr2_tgt_perf.o\n LIB_OBJS += trace2/tr2_tls.o\n LIB_OBJS += trace2/tr2_tmr.o\n LIB_OBJS += trailer.o\n-LIB_OBJS += transport-helper.o\n-LIB_OBJS += transport.o\n+LIB_OBJS += transport/transport-helper.o\n+LIB_OBJS += transport/transport.o\n LIB_OBJS += diff/tree-diff.o\n LIB_OBJS += odb/tree-walk.o\n LIB_OBJS += odb/tree.o\n LIB_OBJS += index/unpack-trees.o\n-LIB_OBJS += upload-pack.o\n+LIB_OBJS += transport/upload-pack.o\n LIB_OBJS += url.o\n LIB_OBJS += urlmatch.o\n LIB_OBJS += usage.o\n@@ -1375,7 +1375,7 @@ LIB_OBJS += varint.o\n endif\n LIB_OBJS += setup/version.o\n LIB_OBJS += versioncmp.o\n-LIB_OBJS += walker.o\n+LIB_OBJS += transport/walker.o\n LIB_OBJS += wildmatch.o\n LIB_OBJS += refs/worktree.o\n LIB_OBJS += wrapper.o\n@@ -1833,7 +1833,7 @@ else\n         endif\n         ifdef USE_CURL_FOR_IMAP_SEND\n \t\tBASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND\n-\t\tIMAP_SEND_BUILDDEPS = http.o\n+\t\tIMAP_SEND_BUILDDEPS = transport/http.o\n \t\tIMAP_SEND_LDFLAGS += $(CURL_LIBCURL)\n         endif\n         ifndef NO_EXPAT\n@@ -2901,7 +2901,7 @@ ifdef INCLUDE_LIBGIT_RS\n endif\n \n ifndef NO_CURL\n-\tOBJECTS += http.o http-walker.o remote-curl.o\n+\tOBJECTS += transport/http.o transport/http-walker.o transport/remote-curl.o\n endif\n \n .PHONY: objects\n@@ -2989,13 +2989,13 @@ gettext.sp gettext.s gettext.o: GIT-PREFIX\n gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \\\n \t-DGIT_LOCALE_PATH='\"$(localedir_relative_SQ)\"'\n \n-http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \\\n+http-push.sp transport/http.sp transport/http-walker.sp transport/remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \\\n \t-DCURL_DISABLE_TYPECHECK\n \n pack/pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count\n \n ifdef NO_EXPAT\n-http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT\n+transport/http-walker.sp transport/http-walker.s transport/http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT\n endif\n \n ifdef NO_REGEX\n@@ -3017,10 +3017,10 @@ git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(IMAP_SEND_LDFLAGS) $(LIBS)\n \n-git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n+git-http-fetch$X: transport/http.o transport/http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(LIBS)\n-git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)\n+git-http-push$X: transport/http.o http-push.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n@@ -3030,7 +3030,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)\n \tln -s $< $@ 2>/dev/null || \\\n \tcp $< $@\n \n-$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)\n+$(REMOTE_CURL_PRIMARY): transport/remote-curl.o transport/http.o transport/http-walker.o GIT-LDFLAGS $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)\n \n@@ -3218,7 +3218,7 @@ LOCALIZED_C_CORE += builtin/clone.c\n LOCALIZED_C_CORE += builtin/index-pack.c\n LOCALIZED_C_CORE += builtin/push.c\n LOCALIZED_C_CORE += builtin/reset.c\n-LOCALIZED_C_CORE += remote.c\n+LOCALIZED_C_CORE += transport/remote.c\n LOCALIZED_C_CORE += index/wt-status.c\n \n LOCALIZED_C_CORE_GEN_PO = $(LOCALIZED_C_CORE:%=.build/pot/po/%.po)\ndiff --git a/branch.c b/branch.c\nindex 14483c1402..a8b2d808a0 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -11,7 +11,7 @@\n #include \"path.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"setup/repository.h\"\n #include \"sequencer.h\"\n #include \"odb/commit.h\"\ndiff --git a/builtin/archive.c b/builtin/archive.c\nindex 3c1288a123..3355461fce 100644\n--- a/builtin/archive.c\n+++ b/builtin/archive.c\n@@ -5,9 +5,9 @@\n #include \"builtin.h\"\n #include \"archive.h\"\n #include \"gettext.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n \n static void create_output_file(const char *output_file)\n {\ndiff --git a/builtin/backfill.c b/builtin/backfill.c\nindex f30addad55..4278a46b8c 100644\n--- a/builtin/backfill.c\n+++ b/builtin/backfill.c\n@@ -16,7 +16,7 @@\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/oidset.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"strmap.h\"\n #include \"string-list.h\"\n #include \"revision/revision.h\"\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex eeab13a4b6..cbaa726584 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -16,7 +16,7 @@\n #include \"odb/commit.h\"\n #include \"gettext.h\"\n #include \"odb/object-name.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"parse-options.h\"\n #include \"branch.h\"\n #include \"path.h\"\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex 6dbe478bcb..86a9c9b01a 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -5,8 +5,8 @@\n #include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n-#include \"bundle.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/bundle.h\"\n \n /*\n  * Basic handler for bundle files to connect repositories via sneakernet.\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex 4a5c73720d..536b40a17c 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -25,12 +25,12 @@\n #include \"odb/odb.h\"\n #include \"odb/streaming.h\"\n #include \"odb/replace-object.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"mailmap.h\"\n #include \"write-or-die.h\"\n #include \"setup/alias.h\"\n-#include \"remote.h\"\n-#include \"transport.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/transport.h\"\n \n /*\n  * Maximum length for a remote URL. While no universal standard exists,\ndiff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c\nindex aa1ca1ed14..1347f4d2fc 100644\n--- a/builtin/checkout--worker.c\n+++ b/builtin/checkout--worker.c\n@@ -8,7 +8,7 @@\n #include \"gettext.h\"\n #include \"index/parallel-checkout.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"index/read-cache-ll.h\"\n \n static void packet_to_pc_item(const char *buffer, int len,\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 3dedddc61a..53ec5431bf 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -25,7 +25,7 @@\n #include \"index/preload-index.h\"\n #include \"index/read-cache.h\"\n #include \"refs/refs.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"setup/repo-settings.h\"\n #include \"index/resolve-undo.h\"\n #include \"revision/revision.h\"\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex a8f7e1b6f3..f800d6cf97 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -29,24 +29,24 @@\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"index/unpack-trees.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"strbuf.h\"\n #include \"index/dir.h\"\n #include \"index/dir-iterator.h\"\n #include \"iterator.h\"\n #include \"sigchain.h\"\n #include \"branch.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"run-command.h\"\n #include \"setup/setup.h\"\n-#include \"connected.h\"\n+#include \"transport/connected.h\"\n #include \"pack/packfile.h\"\n #include \"path.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"setup/hook.h\"\n-#include \"bundle.h\"\n-#include \"bundle-uri.h\"\n+#include \"transport/bundle.h\"\n+#include \"transport/bundle-uri.h\"\n \n /*\n  * Overall FIXMEs:\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 5e5e100884..9080474629 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -28,7 +28,7 @@\n #include \"utf8.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"odb/blob.h\"\n #include \"gpg-interface.h\"\n \ndiff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c\nindex c6ae0197ab..5f2cfefed4 100644\n--- a/builtin/fetch-pack.c\n+++ b/builtin/fetch-pack.c\n@@ -5,12 +5,12 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/object-file.h\"\n-#include \"pkt-line.h\"\n-#include \"fetch-pack.h\"\n-#include \"remote.h\"\n-#include \"connect.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/fetch-pack.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/connect.h\"\n #include \"odb/oid-array.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n \n static const char fetch_pack_usage[] =\n \"git fetch-pack [--all] [--stdin] [--quiet | -q] [--keep | -k] [--thin] \"\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 60be51f079..b23990bd51 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -19,28 +19,28 @@\n #include \"odb/oid-array.h\"\n #include \"odb/commit.h\"\n #include \"string-list.h\"\n-#include \"remote.h\"\n-#include \"transport.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/transport.h\"\n #include \"run-command.h\"\n #include \"parse-options.h\"\n #include \"sigchain.h\"\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n-#include \"connected.h\"\n+#include \"transport/connected.h\"\n #include \"strvec.h\"\n #include \"utf8.h\"\n #include \"pager.h\"\n #include \"path.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"revision/commit-reach.h\"\n #include \"branch.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"pack/commit-graph.h\"\n #include \"revision/shallow.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n-#include \"bundle-uri.h\"\n+#include \"transport/bundle-uri.h\"\n \n #define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000)\n \ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex e4c482c243..886be058bd 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -36,7 +36,7 @@\n #include \"rerere.h\"\n #include \"revision/revision.h\"\n #include \"refs/refs.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n #include \"setup/hook.h\"\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex 10df2dacef..7e8df3cdd1 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -32,7 +32,7 @@\n #include \"odb/oidset.h\"\n #include \"pager.h\"\n #include \"path.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"index/read-cache-ll.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 167a6df9e7..9eb9f1d0b0 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -27,7 +27,7 @@\n #include \"path.h\"\n #include \"odb/replace-object.h\"\n #include \"odb/tree-walk.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"run-command.h\"\n #include \"setup/setup.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 5b79637af3..29199b6684 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -32,7 +32,7 @@\n #include \"diff/patch-ids.h\"\n #include \"path.h\"\n #include \"shortlog.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"string-list.h\"\n #include \"parse-options.h\"\n #include \"revision/line-log.h\"\n@@ -45,7 +45,7 @@\n #include \"utf8.h\"\n \n #include \"revision/commit-reach.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"diff/range-diff.h\"\n #include \"odb/tmp-objdir.h\"\n #include \"odb/tree.h\"\ndiff --git a/builtin/ls-remote.c b/builtin/ls-remote.c\nindex 1b12d6e6ec..7d07c9d399 100644\n--- a/builtin/ls-remote.c\n+++ b/builtin/ls-remote.c\n@@ -2,10 +2,10 @@\n #include \"builtin.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"transport.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/transport.h\"\n+#include \"transport/pkt-line.h\"\n #include \"refs/ref-filter.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"parse-options.h\"\n #include \"wildmatch.h\"\n \ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 090e2a8fb1..6605dc1f91 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -41,7 +41,7 @@\n #include \"merge.h\"\n #include \"merge-ort-wrappers.h\"\n #include \"index/resolve-undo.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"fmt-merge-msg.h\"\n #include \"sequencer.h\"\n #include \"string-list.h\"\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex cc97d7e814..2376d21a7a 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -40,10 +40,10 @@\n #include \"pack/midx.h\"\n #include \"trace2.h\"\n #include \"revision/shallow.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"pack/pack-mtimes.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"odb/blob.h\"\n #include \"odb/tree.h\"\n #include \"path-walk.h\"\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex cca98abb65..9206d7d1c2 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -19,7 +19,7 @@\n #include \"parse-options.h\"\n #include \"run-command.h\"\n #include \"odb/oid-array.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"index/dir.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\ndiff --git a/builtin/push.c b/builtin/push.c\nindex b4556466d7..2480f95e5b 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -14,13 +14,13 @@\n #include \"hex.h\"\n #include \"refs/refspec.h\"\n #include \"run-command.h\"\n-#include \"remote.h\"\n-#include \"transport.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/transport.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\n-#include \"send-pack.h\"\n+#include \"transport/send-pack.h\"\n #include \"trace2.h\"\n #include \"color.h\"\n \ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 718073653c..731fc89894 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -6,8 +6,8 @@\n #include \"odb/commit.h\"\n #include \"revision/commit-reach.h\"\n #include \"setup/config.h\"\n-#include \"connect.h\"\n-#include \"connected.h\"\n+#include \"transport/connect.h\"\n+#include \"transport/connected.h\"\n #include \"setup/environment.h\"\n #include \"exec-cmd.h\"\n #include \"odb/fsck.h\"\n@@ -25,15 +25,15 @@\n #include \"pack/pack.h\"\n #include \"pack/packfile.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n-#include \"protocol.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/protocol.h\"\n #include \"refs/refs.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"run-command.h\"\n #include \"pack/server-info.h\"\n #include \"setup/setup.h\"\n #include \"revision/shallow.h\"\n-#include \"sideband.h\"\n+#include \"transport/sideband.h\"\n #include \"sigchain.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\ndiff --git a/builtin/remote-ext.c b/builtin/remote-ext.c\nindex bd2037f27d..c5409c69c2 100644\n--- a/builtin/remote-ext.c\n+++ b/builtin/remote-ext.c\n@@ -1,7 +1,7 @@\n #include \"builtin.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"run-command.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n \n static const char usage_msg[] =\n \t\"git remote-ext <remote> <url>\";\ndiff --git a/builtin/remote-fd.c b/builtin/remote-fd.c\nindex 39908546ba..6bccb2a0c7 100644\n--- a/builtin/remote-fd.c\n+++ b/builtin/remote-fd.c\n@@ -1,5 +1,5 @@\n #include \"builtin.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n \n static const char usage_msg[] =\n \t\"git remote-fd <remote> <url>\";\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 5a4fa6de8b..fe039f8cfc 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -8,8 +8,8 @@\n #include \"setup/ident.h\"\n #include \"parse-options.h\"\n #include \"path.h\"\n-#include \"transport.h\"\n-#include \"remote.h\"\n+#include \"transport/transport.h\"\n+#include \"transport/remote.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\n #include \"run-command.h\"\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex 1d861c6062..b54e47053e 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -11,7 +11,7 @@\n #include \"pack/midx.h\"\n #include \"pack/packfile.h\"\n #include \"pack/prune-packed.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"pack/repack.h\"\n #include \"revision/shallow.h\"\n \ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex 1e358bc0b0..203f830385 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -2,16 +2,16 @@\n #include \"setup/config.h\"\n #include \"setup/environment.h\"\n #include \"hex.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"run-command.h\"\n-#include \"remote.h\"\n-#include \"connect.h\"\n-#include \"send-pack.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/connect.h\"\n+#include \"transport/send-pack.h\"\n #include \"quote.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"odb/oid-array.h\"\n #include \"gettext.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"parse-options.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 5a97263743..042687f46d 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -20,7 +20,7 @@\n #include \"submodule-config.h\"\n #include \"string-list.h\"\n #include \"run-command.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n #include \"revision/revision.h\"\ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex 7b63b0185b..f837d8cc78 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -4,9 +4,9 @@\n #define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"archive.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"setup/setup.h\"\n-#include \"sideband.h\"\n+#include \"transport/sideband.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n \ndiff --git a/builtin/upload-pack.c b/builtin/upload-pack.c\nindex 7131fb6689..9eae3a2d9f 100644\n--- a/builtin/upload-pack.c\n+++ b/builtin/upload-pack.c\n@@ -3,12 +3,12 @@\n #include \"builtin.h\"\n #include \"exec-cmd.h\"\n #include \"gettext.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"parse-options.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"odb/replace-object.h\"\n-#include \"upload-pack.h\"\n-#include \"serve.h\"\n+#include \"transport/upload-pack.h\"\n+#include \"transport/serve.h\"\n #include \"setup/setup.h\"\n #include \"odb/commit.h\"\n #include \"setup/environment.h\"\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 1d808800cc..412289cba7 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -19,7 +19,7 @@\n #include \"branch.h\"\n #include \"index/read-cache-ll.h\"\n #include \"refs/refs.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"run-command.h\"\n #include \"setup/hook.h\"\n #include \"sigchain.h\"\ndiff --git a/compat/simple-ipc/ipc-win32.c b/compat/simple-ipc/ipc-win32.c\nindex 4a3e7df9c7..cf15ab82c0 100644\n--- a/compat/simple-ipc/ipc-win32.c\n+++ b/compat/simple-ipc/ipc-win32.c\n@@ -3,7 +3,7 @@\n #include \"gettext.h\"\n #include \"simple-ipc.h\"\n #include \"strbuf.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"thread-utils.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 8f56203f34..e0c63639f9 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -771,15 +771,15 @@ add_executable(scalar ${CMAKE_SOURCE_DIR}/scalar.c)\n target_link_libraries(scalar common-main)\n \n if(CURL_FOUND)\n-\tadd_library(http_obj OBJECT ${CMAKE_SOURCE_DIR}/http.c)\n+\tadd_library(http_obj OBJECT ${CMAKE_SOURCE_DIR}/transport/http.c)\n \n \tadd_executable(git-imap-send ${CMAKE_SOURCE_DIR}/imap-send.c)\n \ttarget_link_libraries(git-imap-send http_obj common-main ${CURL_LIBRARIES})\n \n-\tadd_executable(git-http-fetch ${CMAKE_SOURCE_DIR}/http-walker.c ${CMAKE_SOURCE_DIR}/http-fetch.c)\n+\tadd_executable(git-http-fetch ${CMAKE_SOURCE_DIR}/transport/http-walker.c ${CMAKE_SOURCE_DIR}/http-fetch.c)\n \ttarget_link_libraries(git-http-fetch http_obj common-main ${CURL_LIBRARIES})\n \n-\tadd_executable(git-remote-http ${CMAKE_SOURCE_DIR}/http-walker.c ${CMAKE_SOURCE_DIR}/remote-curl.c)\n+\tadd_executable(git-remote-http ${CMAKE_SOURCE_DIR}/transport/http-walker.c ${CMAKE_SOURCE_DIR}/transport/remote-curl.c)\n \ttarget_link_libraries(git-remote-http http_obj common-main ${CURL_LIBRARIES} )\n \n \tif(EXPAT_FOUND)\ndiff --git a/convert.c b/convert.c\nindex 5490c4a558..15fc4fc0d8 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -14,7 +14,7 @@\n #include \"quote.h\"\n #include \"index/read-cache-ll.h\"\n #include \"sigchain.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"sub-process.h\"\n #include \"trace.h\"\n #include \"utf8.h\"\ndiff --git a/daemon.c b/daemon.c\nindex 219eeab179..5f9ed302ab 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -6,8 +6,8 @@\n #include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"path.h\"\n-#include \"pkt-line.h\"\n-#include \"protocol.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/protocol.h\"\n #include \"run-command.h\"\n #include \"setup/setup.h\"\n #include \"strbuf.h\"\ndiff --git a/diff/diff.c b/diff/diff.c\nindex 4603493a36..86c0fddf24 100644\n--- a/diff/diff.c\n+++ b/diff/diff.c\n@@ -38,7 +38,7 @@\n #include \"pager.h\"\n #include \"parse-options.h\"\n #include \"help.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"index/dir.h\"\n #include \"odb/object-file.h\"\n #include \"odb/object-name.h\"\ndiff --git a/diff/diffcore-break.c b/diff/diffcore-break.c\nindex c822a0d56d..d4689ad0d3 100644\n--- a/diff/diffcore-break.c\n+++ b/diff/diffcore-break.c\n@@ -8,7 +8,7 @@\n #include \"diff/diffcore.h\"\n #include \"odb/hash.h\"\n #include \"odb/object.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n \n static int should_break(struct repository *r,\n \t\t\tstruct diff_filespec *src,\ndiff --git a/diff/diffcore-rename.c b/diff/diffcore-rename.c\nindex 16746444d8..25e40cd39d 100644\n--- a/diff/diffcore-rename.c\n+++ b/diff/diffcore-rename.c\n@@ -13,7 +13,7 @@\n #include \"mem-pool.h\"\n #include \"odb/oid-array.h\"\n #include \"progress.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\n #include \"trace2.h\"\ndiff --git a/help.c b/help.c\nindex 34ab22ade5..f3440c7695 100644\n--- a/help.c\n+++ b/help.c\n@@ -24,7 +24,7 @@\n #include \"utf8.h\"\n \n #ifndef NO_CURL\n-#include \"git-curl-compat.h\" /* For LIBCURL_VERSION only */\n+#include \"transport/git-curl-compat.h\" /* For LIBCURL_VERSION only */\n #endif\n \n struct category_description {\ndiff --git a/http-backend.c b/http-backend.c\nindex dcf8506c1e..b10f7e02f2 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -9,7 +9,7 @@\n #include \"path.h\"\n #include \"setup/repository.h\"\n #include \"refs/refs.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"odb/object.h\"\n #include \"odb/tag.h\"\n #include \"exec-cmd.h\"\n@@ -20,7 +20,7 @@\n #include \"strvec.h\"\n #include \"pack/packfile.h\"\n #include \"odb/odb.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"date.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/http-fetch.c b/http-fetch.c\nindex ad2447ce72..e3846d0b41 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -5,8 +5,8 @@\n #include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"http.h\"\n-#include \"walker.h\"\n+#include \"transport/http.h\"\n+#include \"transport/walker.h\"\n #include \"setup/setup.h\"\n #include \"strvec.h\"\n #include \"url.h\"\ndiff --git a/http-push.c b/http-push.c\nindex fb18e8756f..3014dad9be 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -7,10 +7,10 @@\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"odb/blob.h\"\n-#include \"http.h\"\n+#include \"transport/http.h\"\n #include \"diff/diff.h\"\n #include \"revision/revision.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"revision/list-objects.h\"\n #include \"setup/setup.h\"\n #include \"sigchain.h\"\ndiff --git a/imap-send.c b/imap-send.c\nindex de244d8011..6a16304783 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -35,7 +35,7 @@\n #include \"setup/setup.h\"\n #include \"strbuf.h\"\n #ifdef USE_CURL_FOR_IMAP_SEND\n-#include \"http.h\"\n+#include \"transport/http.h\"\n #endif\n \n #if defined(USE_CURL_FOR_IMAP_SEND)\ndiff --git a/index/cache-tree.c b/index/cache-tree.c\nindex bb813bd840..283c1cbc3d 100644\n--- a/index/cache-tree.c\n+++ b/index/cache-tree.c\n@@ -14,7 +14,7 @@\n #include \"index/read-cache-ll.h\"\n #include \"odb/replace-object.h\"\n #include \"setup/repository.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"trace.h\"\n #include \"trace2.h\"\n \ndiff --git a/index/checkout.c b/index/checkout.c\nindex b262ada8c7..09c1cd14a6 100644\n--- a/index/checkout.c\n+++ b/index/checkout.c\n@@ -2,7 +2,7 @@\n \n #include \"git-compat-util.h\"\n #include \"odb/object-name.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"refs/refspec.h\"\n #include \"setup/repository.h\"\n #include \"index/checkout.h\"\ndiff --git a/index/parallel-checkout.c b/index/parallel-checkout.c\nindex 0905a7ff1e..a525abbcd7 100644\n--- a/index/parallel-checkout.c\n+++ b/index/parallel-checkout.c\n@@ -8,7 +8,7 @@\n #include \"odb/hash.h\"\n #include \"hex.h\"\n #include \"index/parallel-checkout.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"progress.h\"\n #include \"index/read-cache-ll.h\"\n #include \"run-command.h\"\ndiff --git a/index/read-cache.c b/index/read-cache.c\nindex 20a5e191a4..60d496535a 100644\n--- a/index/read-cache.c\n+++ b/index/read-cache.c\n@@ -46,7 +46,7 @@\n #include \"progress.h\"\n #include \"index/sparse-index.h\"\n #include \"csum-file.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"setup/hook.h\"\n #include \"submodule.h\"\n #include \"submodule-config.h\"\ndiff --git a/index/unpack-trees.c b/index/unpack-trees.c\nindex 2eecede699..e06b0a6a77 100644\n--- a/index/unpack-trees.c\n+++ b/index/unpack-trees.c\n@@ -27,7 +27,7 @@\n #include \"trace2.h\"\n #include \"index/fsmonitor.h\"\n #include \"odb/odb.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"index/entry.h\"\n #include \"index/parallel-checkout.h\"\n #include \"setup/setup.h\"\ndiff --git a/index/wt-status.c b/index/wt-status.c\nindex 847438f121..ef7b513214 100644\n--- a/index/wt-status.c\n+++ b/index/wt-status.c\n@@ -20,7 +20,7 @@\n #include \"setup/repository.h\"\n #include \"run-command.h\"\n #include \"strvec.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"refs/refs.h\"\n #include \"submodule.h\"\n #include \"column.h\"\ndiff --git a/index/wt-status.h b/index/wt-status.h\nindex b7a508186d..81bb7292b9 100644\n--- a/index/wt-status.h\n+++ b/index/wt-status.h\n@@ -4,7 +4,7 @@\n #include \"string-list.h\"\n #include \"color.h\"\n #include \"index/pathspec.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n \n struct repository;\n struct worktree;\ndiff --git a/merge-ort.c b/merge-ort.c\nindex f101b5e0c4..cc21e397de 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -42,7 +42,7 @@\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"index/read-cache-ll.h\"\n #include \"refs/refs.h\"\n #include \"revision/revision.h\"\ndiff --git a/meson.build b/meson.build\nindex bad597d8ff..6902f5de75 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -324,8 +324,8 @@ libgit_sources = [\n   'odb/blob.c',\n   'pack/bloom.c',\n   'branch.c',\n-  'bundle-uri.c',\n-  'bundle.c',\n+  'transport/bundle-uri.c',\n+  'transport/bundle.c',\n   'index/cache-tree.c',\n   'odb/cbtree.c',\n   'chdir-notify.c',\n@@ -341,8 +341,8 @@ libgit_sources = [\n   'common-init.c',\n   'compiler-tricks/not-constant.c',\n   'setup/config.c',\n-  'connect.c',\n-  'connected.c',\n+  'transport/connect.c',\n+  'transport/connected.c',\n   'convert.c',\n   'copy.c',\n   'credential.c',\n@@ -373,9 +373,9 @@ libgit_sources = [\n   'ewah/ewah_io.c',\n   'ewah/ewah_rlw.c',\n   'exec-cmd.c',\n-  'fetch-negotiator.c',\n-  'fetch-object-info.c',\n-  'fetch-pack.c',\n+  'transport/fetch-negotiator.c',\n+  'transport/fetch-object-info.c',\n+  'transport/fetch-pack.c',\n   'fmt-merge-msg.c',\n   'odb/fsck.c',\n   'index/fsmonitor.c',\n@@ -466,15 +466,15 @@ libgit_sources = [\n   'path.c',\n   'path-walk.c',\n   'index/pathspec.c',\n-  'pkt-line.c',\n+  'transport/pkt-line.c',\n   'index/preload-index.c',\n   'revision/pretty.c',\n   'prio-queue.c',\n   'progress.c',\n-  'promisor-remote.c',\n+  'transport/promisor-remote.c',\n   'prompt.c',\n-  'protocol.c',\n-  'protocol-caps.c',\n+  'transport/protocol.c',\n+  'transport/protocol-caps.c',\n   'pack/prune-packed.c',\n   'pack/pseudo-merge.c',\n   'quote.c',\n@@ -508,7 +508,7 @@ libgit_sources = [\n   'reftable/table.c',\n   'reftable/tree.c',\n   'reftable/writer.c',\n-  'remote.c',\n+  'transport/remote.c',\n   'pack/repack.c',\n   'pack/repack-cruft.c',\n   'pack/repack-filtered.c',\n@@ -524,13 +524,13 @@ libgit_sources = [\n   'index/resolve-undo.c',\n   'revision/revision.c',\n   'run-command.c',\n-  'send-pack.c',\n+  'transport/send-pack.c',\n   'sequencer.c',\n-  'serve.c',\n+  'transport/serve.c',\n   'pack/server-info.c',\n   'setup/setup.c',\n   'revision/shallow.c',\n-  'sideband.c',\n+  'transport/sideband.c',\n   'sigchain.c',\n   'index/sparse-index.c',\n   'index/split-index.c',\n@@ -563,13 +563,13 @@ libgit_sources = [\n   'trace2/tr2_tls.c',\n   'trace2/tr2_tmr.c',\n   'trailer.c',\n-  'transport-helper.c',\n-  'transport.c',\n+  'transport/transport-helper.c',\n+  'transport/transport.c',\n   'diff/tree-diff.c',\n   'odb/tree-walk.c',\n   'odb/tree.c',\n   'index/unpack-trees.c',\n-  'upload-pack.c',\n+  'transport/upload-pack.c',\n   'url.c',\n   'urlmatch.c',\n   'usage.c',\n@@ -577,7 +577,7 @@ libgit_sources = [\n   'utf8.c',\n   'setup/version.c',\n   'versioncmp.c',\n-  'walker.c',\n+  'transport/walker.c',\n   'wildmatch.c',\n   'refs/worktree.c',\n   'wrapper.c',\n@@ -1918,14 +1918,14 @@ bin_wrappers += executable('scalar',\n if curl.found()\n   libgit_curl = declare_dependency(\n     sources: [\n-      'http.c',\n-      'http-walker.c',\n+      'transport/http.c',\n+      'transport/http-walker.c',\n     ],\n     dependencies: [libgit_commonmain, curl],\n   )\n \n   test_dependencies += executable('git-remote-http',\n-    sources: 'remote-curl.c',\n+    sources: 'transport/remote-curl.c',\n     dependencies: [libgit_curl],\n     install: true,\n     install_dir: git_exec_path,\n@@ -1949,7 +1949,7 @@ if curl.found()\n \n   foreach alias : [ 'git-remote-https', 'git-remote-ftp', 'git-remote-ftps' ]\n     test_dependencies += executable(alias,\n-      sources: 'remote-curl.c',\n+      sources: 'transport/remote-curl.c',\n       dependencies: [libgit_curl],\n     )\n \ndiff --git a/negotiator/default.c b/negotiator/default.c\nindex 3211453743..98f2b44b7e 100644\n--- a/negotiator/default.c\n+++ b/negotiator/default.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"default.h\"\n #include \"odb/commit.h\"\n-#include \"../fetch-negotiator.h\"\n+#include \"transport/fetch-negotiator.h\"\n #include \"../prio-queue.h\"\n #include \"refs/refs.h\"\n #include \"setup/repository.h\"\ndiff --git a/negotiator/noop.c b/negotiator/noop.c\nindex edf1b456f3..e547d6bb1f 100644\n--- a/negotiator/noop.c\n+++ b/negotiator/noop.c\n@@ -1,6 +1,6 @@\n #include \"git-compat-util.h\"\n #include \"noop.h\"\n-#include \"../fetch-negotiator.h\"\n+#include \"transport/fetch-negotiator.h\"\n \n static void known_common(struct fetch_negotiator *n UNUSED,\n \t\t\t struct commit *c UNUSED)\ndiff --git a/negotiator/skipping.c b/negotiator/skipping.c\nindex eabfac6edd..e01c339dd0 100644\n--- a/negotiator/skipping.c\n+++ b/negotiator/skipping.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"skipping.h\"\n #include \"odb/commit.h\"\n-#include \"../fetch-negotiator.h\"\n+#include \"transport/fetch-negotiator.h\"\n #include \"../hex.h\"\n #include \"../prio-queue.h\"\n #include \"refs/refs.h\"\ndiff --git a/odb/object-name.c b/odb/object-name.c\nindex af03d8d0e5..e734455585 100644\n--- a/odb/object-name.c\n+++ b/odb/object-name.c\n@@ -13,7 +13,7 @@\n #include \"odb/tree.h\"\n #include \"odb/tree-walk.h\"\n #include \"refs/refs.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"index/dir.h\"\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\ndiff --git a/odb/odb.c b/odb/odb.c\nindex f326dbb284..76b0712120 100644\n--- a/odb/odb.c\n+++ b/odb/odb.c\n@@ -17,7 +17,7 @@\n #include \"odb/source-inmemory.h\"\n #include \"pack/packfile.h\"\n #include \"path.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"quote.h\"\n #include \"odb/replace-object.h\"\n #include \"run-command.h\"\ndiff --git a/odb/source-files.c b/odb/source-files.c\nindex 7b8a21d137..02671605ab 100644\n--- a/odb/source-files.c\n+++ b/odb/source-files.c\n@@ -13,7 +13,7 @@\n #include \"pack/pack-objects.h\"\n #include \"pack/packfile.h\"\n #include \"path.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"pack/repack.h\"\n #include \"run-command.h\"\n #include \"strbuf.h\"\ndiff --git a/pack/pack-write.c b/pack/pack-write.c\nindex 45066b9657..59b4638839 100644\n--- a/pack/pack-write.c\n+++ b/pack/pack-write.c\n@@ -4,7 +4,7 @@\n #include \"hex.h\"\n #include \"pack/pack.h\"\n #include \"csum-file.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"pack/chunk-format.h\"\n #include \"odb/object-file.h\"\n #include \"pack/pack-mtimes.h\"\ndiff --git a/pack/packfile.c b/pack/packfile.c\nindex 9509d6efcb..15df048ce7 100644\n--- a/pack/packfile.c\n+++ b/pack/packfile.c\n@@ -23,7 +23,7 @@\n #include \"pack/midx.h\"\n #include \"pack/commit-graph.h\"\n #include \"pack/pack-revindex.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"pack/pack-mtimes.h\"\n \n char *odb_pack_name(struct repository *r, struct strbuf *buf,\ndiff --git a/refs/ls-refs.c b/refs/ls-refs.c\nindex 03ab2720e9..83f847de81 100644\n--- a/refs/ls-refs.c\n+++ b/refs/ls-refs.c\n@@ -9,7 +9,7 @@\n #include \"refs/refs.h\"\n #include \"strvec.h\"\n #include \"refs/ls-refs.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"setup/config.h\"\n #include \"string-list.h\"\n \ndiff --git a/refs/ref-filter.c b/refs/ref-filter.c\nindex 9a426b6ce9..c369856b54 100644\n--- a/refs/ref-filter.c\n+++ b/refs/ref-filter.c\n@@ -19,7 +19,7 @@\n #include \"odb/commit.h\"\n #include \"mailmap.h\"\n #include \"setup/ident.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"color.h\"\n #include \"odb/tag.h\"\n #include \"quote.h\"\ndiff --git a/refs/refspec.c b/refs/refspec.c\nindex 324c274bff..bbd520f54b 100644\n--- a/refs/refspec.c\n+++ b/refs/refspec.c\n@@ -8,7 +8,7 @@\n #include \"strvec.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"strbuf.h\"\n \n /*\ndiff --git a/revision/list-objects-filter-options.c b/revision/list-objects-filter-options.c\nindex 38604a580c..a22dc5b435 100644\n--- a/revision/list-objects-filter-options.c\n+++ b/revision/list-objects-filter-options.c\n@@ -4,7 +4,7 @@\n #include \"setup/config.h\"\n #include \"gettext.h\"\n #include \"revision/list-objects-filter-options.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"trace.h\"\n #include \"url.h\"\n #include \"parse-options.h\"\ndiff --git a/revision/shallow.c b/revision/shallow.c\nindex a6e8a66c14..8822ef7f4c 100644\n--- a/revision/shallow.c\n+++ b/revision/shallow.c\n@@ -8,7 +8,7 @@\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"refs/refs.h\"\n #include \"odb/oid-array.h\"\n #include \"path.h\"\ndiff --git a/setup/repository.c b/setup/repository.c\nindex 77be866c82..cd2719fb33 100644\n--- a/setup/repository.c\n+++ b/setup/repository.c\n@@ -10,13 +10,13 @@\n #include \"lockfile.h\"\n #include \"path.h\"\n #include \"index/read-cache-ll.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"setup/setup.h\"\n #include \"odb/loose.h\"\n #include \"submodule-config.h\"\n #include \"index/sparse-index.h\"\n #include \"trace2.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"refs/refs.h\"\n \n /*\ndiff --git a/simple-ipc.h b/simple-ipc.h\nindex 701e005cb8..038ae97f02 100644\n--- a/simple-ipc.h\n+++ b/simple-ipc.h\n@@ -37,7 +37,7 @@ enum ipc_active_state {\n };\n \n #ifdef SUPPORTS_SIMPLE_IPC\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n \n /*\n  * Simple IPC Client Side API.\ndiff --git a/sub-process.c b/sub-process.c\nindex 2d5c965169..e639cca9b9 100644\n--- a/sub-process.c\n+++ b/sub-process.c\n@@ -4,7 +4,7 @@\n #include \"git-compat-util.h\"\n #include \"sub-process.h\"\n #include \"sigchain.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n \n int cmd2process_cmp(const void *cmp_data UNUSED,\n \t\t    const struct hashmap_entry *eptr,\ndiff --git a/submodule.c b/submodule.c\nindex 16b3ffbcc6..0272a7d553 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -22,7 +22,7 @@\n #include \"strvec.h\"\n #include \"thread-utils.h\"\n #include \"path.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"refs/worktree.h\"\n #include \"parse-options.h\"\n #include \"odb/object-file.h\"\ndiff --git a/t/helper/test-bundle-uri.c b/t/helper/test-bundle-uri.c\nindex 0c5fa723d8..48946a6fc2 100644\n--- a/t/helper/test-bundle-uri.c\n+++ b/t/helper/test-bundle-uri.c\n@@ -1,11 +1,11 @@\n #include \"test-tool.h\"\n #include \"parse-options.h\"\n-#include \"bundle-uri.h\"\n+#include \"transport/bundle-uri.h\"\n #include \"gettext.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n-#include \"transport.h\"\n-#include \"remote.h\"\n+#include \"transport/transport.h\"\n+#include \"transport/remote.h\"\n \n enum input_mode {\n \tKEY_VALUE_PAIRS,\ndiff --git a/t/helper/test-pkt-line.c b/t/helper/test-pkt-line.c\nindex 4daa82f00f..2ddc243472 100644\n--- a/t/helper/test-pkt-line.c\n+++ b/t/helper/test-pkt-line.c\n@@ -1,7 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"test-tool.h\"\n-#include \"pkt-line.h\"\n-#include \"sideband.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/sideband.h\"\n #include \"write-or-die.h\"\n #include \"parse-options.h\"\n \ndiff --git a/t/helper/test-proc-receive.c b/t/helper/test-proc-receive.c\nindex 8eccc34216..01576400b8 100644\n--- a/t/helper/test-proc-receive.c\n+++ b/t/helper/test-proc-receive.c\n@@ -1,8 +1,8 @@\n #include \"test-tool.h\"\n-#include \"connect.h\"\n+#include \"transport/connect.h\"\n #include \"hex.h\"\n #include \"parse-options.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"sigchain.h\"\n #include \"string-list.h\"\n \ndiff --git a/t/helper/test-rot13-filter.c b/t/helper/test-rot13-filter.c\nindex ad37e10034..40da1eac59 100644\n--- a/t/helper/test-rot13-filter.c\n+++ b/t/helper/test-rot13-filter.c\n@@ -37,7 +37,7 @@\n  */\n \n #include \"test-tool.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"string-list.h\"\n #include \"strmap.h\"\n #include \"parse-options.h\"\ndiff --git a/t/helper/test-serve-v2.c b/t/helper/test-serve-v2.c\nindex 13452d4eab..56754c27d3 100644\n--- a/t/helper/test-serve-v2.c\n+++ b/t/helper/test-serve-v2.c\n@@ -4,7 +4,7 @@\n #include \"gettext.h\"\n #include \"parse-options.h\"\n #include \"setup/repository.h\"\n-#include \"serve.h\"\n+#include \"transport/serve.h\"\n #include \"setup/setup.h\"\n \n static char const * const serve_usage[] = {\ndiff --git a/t/helper/test-submodule.c b/t/helper/test-submodule.c\nindex 7a82e1f0f9..2290808d5c 100644\n--- a/t/helper/test-submodule.c\n+++ b/t/helper/test-submodule.c\n@@ -3,7 +3,7 @@\n #include \"test-tool.h\"\n #include \"test-tool-utils.h\"\n #include \"parse-options.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"setup/repository.h\"\n #include \"setup/setup.h\"\n #include \"strbuf.h\"\ndiff --git a/bundle-uri.c b/transport/bundle-uri.c\nsimilarity index 99%\nrename from bundle-uri.c\nrename to transport/bundle-uri.c\nindex cd26d38249..e2466e27a2 100644\n--- a/bundle-uri.c\n+++ b/transport/bundle-uri.c\n@@ -2,17 +2,17 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"bundle-uri.h\"\n-#include \"bundle.h\"\n+#include \"transport/bundle-uri.h\"\n+#include \"transport/bundle.h\"\n #include \"copy.h\"\n #include \"gettext.h\"\n #include \"refs/refs.h\"\n #include \"run-command.h\"\n #include \"hashmap.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"setup/config.h\"\n-#include \"fetch-pack.h\"\n-#include \"remote.h\"\n+#include \"transport/fetch-pack.h\"\n+#include \"transport/remote.h\"\n #include \"trace2.h\"\n #include \"odb/odb.h\"\n \ndiff --git a/bundle-uri.h b/transport/bundle-uri.h\nsimilarity index 100%\nrename from bundle-uri.h\nrename to transport/bundle-uri.h\ndiff --git a/bundle.c b/transport/bundle.c\nsimilarity index 99%\nrename from bundle.c\nrename to transport/bundle.c\nindex 1e01ab38d4..6a272e9390 100644\n--- a/bundle.c\n+++ b/transport/bundle.c\n@@ -3,7 +3,7 @@\n \n #include \"git-compat-util.h\"\n #include \"lockfile.h\"\n-#include \"bundle.h\"\n+#include \"transport/bundle.h\"\n #include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n@@ -18,7 +18,7 @@\n #include \"refs/refs.h\"\n #include \"strvec.h\"\n #include \"revision/list-objects-filter-options.h\"\n-#include \"connected.h\"\n+#include \"transport/connected.h\"\n #include \"write-or-die.h\"\n \n static const char v2_bundle_signature[] = \"# v2 git bundle\\n\";\ndiff --git a/bundle.h b/transport/bundle.h\nsimilarity index 100%\nrename from bundle.h\nrename to transport/bundle.h\ndiff --git a/connect.c b/transport/connect.c\nsimilarity index 99%\nrename from connect.c\nrename to transport/connect.c\nindex 2a1b177490..e11fc530f6 100644\n--- a/connect.c\n+++ b/transport/connect.c\n@@ -5,24 +5,24 @@\n #include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"quote.h\"\n #include \"refs/refs.h\"\n #include \"run-command.h\"\n-#include \"remote.h\"\n-#include \"connect.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/connect.h\"\n #include \"url.h\"\n #include \"string-list.h\"\n #include \"odb/oid-array.h\"\n #include \"path.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"trace2.h\"\n #include \"strbuf.h\"\n #include \"setup/version.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"setup/alias.h\"\n-#include \"bundle-uri.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/bundle-uri.h\"\n+#include \"transport/promisor-remote.h\"\n \n static char *server_capabilities_v1;\n static struct strvec server_capabilities_v2 = STRVEC_INIT;\ndiff --git a/connect.h b/transport/connect.h\nsimilarity index 98%\nrename from connect.h\nrename to transport/connect.h\nindex 957e5fe2b9..97828112d7 100644\n--- a/connect.h\n+++ b/transport/connect.h\n@@ -1,7 +1,7 @@\n #ifndef CONNECT_H\n #define CONNECT_H\n \n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n \n #define CONNECT_VERBOSE       (1u << 0)\n #define CONNECT_DIAG_URL      (1u << 1)\ndiff --git a/connected.c b/transport/connected.c\nsimilarity index 98%\nrename from connected.c\nrename to transport/connected.c\nindex 1884614b80..c5b8edda1e 100644\n--- a/connected.c\n+++ b/transport/connected.c\n@@ -6,10 +6,10 @@\n #include \"odb/odb.h\"\n #include \"run-command.h\"\n #include \"sigchain.h\"\n-#include \"connected.h\"\n-#include \"transport.h\"\n+#include \"transport/connected.h\"\n+#include \"transport/transport.h\"\n #include \"pack/packfile.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n \n static int promised_object_cb(const struct object_id *oid UNUSED,\n \t\t\t      struct object_info *oi UNUSED,\ndiff --git a/connected.h b/transport/connected.h\nsimilarity index 100%\nrename from connected.h\nrename to transport/connected.h\ndiff --git a/fetch-negotiator.c b/transport/fetch-negotiator.c\nsimilarity index 94%\nrename from fetch-negotiator.c\nrename to transport/fetch-negotiator.c\nindex 90fee42b50..19670d0c2c 100644\n--- a/fetch-negotiator.c\n+++ b/transport/fetch-negotiator.c\n@@ -1,5 +1,5 @@\n #include \"git-compat-util.h\"\n-#include \"fetch-negotiator.h\"\n+#include \"transport/fetch-negotiator.h\"\n #include \"negotiator/default.h\"\n #include \"negotiator/skipping.h\"\n #include \"negotiator/noop.h\"\ndiff --git a/fetch-negotiator.h b/transport/fetch-negotiator.h\nsimilarity index 100%\nrename from fetch-negotiator.h\nrename to transport/fetch-negotiator.h\ndiff --git a/fetch-object-info.c b/transport/fetch-object-info.c\nsimilarity index 97%\nrename from fetch-object-info.c\nrename to transport/fetch-object-info.c\nindex 30cf131aed..d834731c91 100644\n--- a/fetch-object-info.c\n+++ b/transport/fetch-object-info.c\n@@ -1,11 +1,11 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"pkt-line.h\"\n-#include \"connect.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/connect.h\"\n #include \"odb/oid-array.h\"\n #include \"odb/odb.h\"\n-#include \"fetch-object-info.h\"\n+#include \"transport/fetch-object-info.h\"\n #include \"string-list.h\"\n \n /* Sends object-info command and its arguments into the request buffer. */\ndiff --git a/fetch-object-info.h b/transport/fetch-object-info.h\nsimilarity index 91%\nrename from fetch-object-info.h\nrename to transport/fetch-object-info.h\nindex 269cebb3f7..12ae9dc3b5 100644\n--- a/fetch-object-info.h\n+++ b/transport/fetch-object-info.h\n@@ -1,8 +1,8 @@\n #ifndef FETCH_OBJECT_INFO_H\n #define FETCH_OBJECT_INFO_H\n \n-#include \"pkt-line.h\"\n-#include \"protocol.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/protocol.h\"\n \n struct object_info_args {\n \tstruct string_list *object_info_options;\ndiff --git a/fetch-pack.c b/transport/fetch-pack.c\nsimilarity index 99%\nrename from fetch-pack.c\nrename to transport/fetch-pack.c\nindex 5bc72eb370..953de0a964 100644\n--- a/fetch-pack.c\n+++ b/transport/fetch-pack.c\n@@ -10,15 +10,15 @@\n #include \"hex.h\"\n #include \"lockfile.h\"\n #include \"refs/refs.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"odb/commit.h\"\n #include \"odb/tag.h\"\n #include \"pack/pack.h\"\n-#include \"sideband.h\"\n-#include \"fetch-pack.h\"\n-#include \"remote.h\"\n+#include \"transport/sideband.h\"\n+#include \"transport/fetch-pack.h\"\n+#include \"transport/remote.h\"\n #include \"run-command.h\"\n-#include \"connect.h\"\n+#include \"transport/connect.h\"\n #include \"trace2.h\"\n #include \"setup/version.h\"\n #include \"odb/oid-array.h\"\n@@ -27,8 +27,8 @@\n #include \"odb/odb.h\"\n #include \"odb/object-name.h\"\n #include \"path.h\"\n-#include \"connected.h\"\n-#include \"fetch-negotiator.h\"\n+#include \"transport/connected.h\"\n+#include \"transport/fetch-negotiator.h\"\n #include \"odb/fsck.h\"\n #include \"revision/shallow.h\"\n #include \"revision/commit-reach.h\"\n@@ -36,7 +36,7 @@\n #include \"sigchain.h\"\n #include \"mergesort.h\"\n #include \"prio-queue.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n \n static int transfer_unpack_limit = -1;\n static int fetch_unpack_limit = -1;\ndiff --git a/fetch-pack.h b/transport/fetch-pack.h\nsimilarity index 99%\nrename from fetch-pack.h\nrename to transport/fetch-pack.h\nindex 42922616be..be5c5f2143 100644\n--- a/fetch-pack.h\n+++ b/transport/fetch-pack.h\n@@ -2,7 +2,7 @@\n #define FETCH_PACK_H\n \n #include \"string-list.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"odb/oidset.h\"\n \ndiff --git a/git-curl-compat.h b/transport/git-curl-compat.h\nsimilarity index 100%\nrename from git-curl-compat.h\nrename to transport/git-curl-compat.h\ndiff --git a/http-walker.c b/transport/http-walker.c\nsimilarity index 99%\nrename from http-walker.c\nrename to transport/http-walker.c\nindex b5bba74da4..e0f8eb7162 100644\n--- a/http-walker.c\n+++ b/transport/http-walker.c\n@@ -4,10 +4,10 @@\n #include \"git-compat-util.h\"\n #include \"setup/repository.h\"\n #include \"hex.h\"\n-#include \"walker.h\"\n-#include \"http.h\"\n+#include \"transport/walker.h\"\n+#include \"transport/http.h\"\n #include \"revision/list.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"pack/packfile.h\"\n #include \"odb/object-file.h\"\n #include \"odb/odb.h\"\ndiff --git a/http.c b/transport/http.c\nsimilarity index 99%\nrename from http.c\nrename to transport/http.c\nindex 5b3b2b24d6..bb92754a80 100644\n--- a/http.c\n+++ b/transport/http.c\n@@ -2,10 +2,10 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"git-curl-compat.h\"\n+#include \"transport/git-curl-compat.h\"\n #include \"setup/environment.h\"\n #include \"hex.h\"\n-#include \"http.h\"\n+#include \"transport/http.h\"\n #include \"setup/config.h\"\n #include \"pack/pack.h\"\n #include \"run-command.h\"\n@@ -13,10 +13,10 @@\n #include \"urlmatch.h\"\n #include \"credential.h\"\n #include \"setup/version.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"gettext.h\"\n #include \"trace.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"pack/packfile.h\"\n #include \"string-list.h\"\n #include \"odb/object-file.h\"\ndiff --git a/http.h b/transport/http.h\nsimilarity index 99%\nrename from http.h\nrename to transport/http.h\nindex 729c51904d..fab359450f 100644\n--- a/http.h\n+++ b/transport/http.h\n@@ -11,7 +11,7 @@ struct packfile_list;\n \n #include \"gettext.h\"\n #include \"strbuf.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n \n #define DEFAULT_MAX_REQUESTS 5\n \ndiff --git a/pkt-line.c b/transport/pkt-line.c\nsimilarity index 99%\nrename from pkt-line.c\nrename to transport/pkt-line.c\nindex 3fc3e9ea70..d8b341b75e 100644\n--- a/pkt-line.c\n+++ b/transport/pkt-line.c\n@@ -1,10 +1,10 @@\n #include \"git-compat-util.h\"\n #include \"copy.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"run-command.h\"\n-#include \"sideband.h\"\n+#include \"transport/sideband.h\"\n #include \"trace.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/pkt-line.h b/transport/pkt-line.h\nsimilarity index 100%\nrename from pkt-line.h\nrename to transport/pkt-line.h\ndiff --git a/promisor-remote.c b/transport/promisor-remote.c\nsimilarity index 99%\nrename from promisor-remote.c\nrename to transport/promisor-remote.c\nindex 80caaeca99..e32b6d4e30 100644\n--- a/promisor-remote.c\n+++ b/transport/promisor-remote.c\n@@ -4,10 +4,10 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n #include \"setup/config.h\"\n #include \"trace2.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"strvec.h\"\n #include \"pack/packfile.h\"\n #include \"setup/environment.h\"\ndiff --git a/promisor-remote.h b/transport/promisor-remote.h\nsimilarity index 100%\nrename from promisor-remote.h\nrename to transport/promisor-remote.h\ndiff --git a/protocol-caps.c b/transport/protocol-caps.c\nsimilarity index 98%\nrename from protocol-caps.c\nrename to transport/protocol-caps.c\nindex ffda7e11dd..6217bebc27 100644\n--- a/protocol-caps.c\n+++ b/transport/protocol-caps.c\n@@ -1,8 +1,8 @@\n #include \"git-compat-util.h\"\n-#include \"protocol-caps.h\"\n+#include \"transport/protocol-caps.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"odb/hash.h\"\n #include \"odb/object.h\"\n #include \"odb/odb.h\"\ndiff --git a/protocol-caps.h b/transport/protocol-caps.h\nsimilarity index 100%\nrename from protocol-caps.h\nrename to transport/protocol-caps.h\ndiff --git a/protocol.c b/transport/protocol.c\nsimilarity index 98%\nrename from protocol.c\nrename to transport/protocol.c\nindex 7f19dbc04d..33051e8a08 100644\n--- a/protocol.c\n+++ b/transport/protocol.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"setup/config.h\"\n #include \"setup/environment.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"trace2.h\"\n \n static enum protocol_version parse_protocol_version(const char *value)\ndiff --git a/protocol.h b/transport/protocol.h\nsimilarity index 100%\nrename from protocol.h\nrename to transport/protocol.h\ndiff --git a/remote-curl.c b/transport/remote-curl.c\nsimilarity index 99%\nrename from remote-curl.c\nrename to transport/remote-curl.c\nindex d0aa42c974..f643515c56 100644\n--- a/remote-curl.c\n+++ b/transport/remote-curl.c\n@@ -2,28 +2,28 @@\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n-#include \"git-curl-compat.h\"\n+#include \"transport/git-curl-compat.h\"\n #include \"setup/config.h\"\n #include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"remote.h\"\n-#include \"connect.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/connect.h\"\n #include \"strbuf.h\"\n-#include \"walker.h\"\n-#include \"http.h\"\n+#include \"transport/walker.h\"\n+#include \"transport/http.h\"\n #include \"run-command.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"credential.h\"\n #include \"odb/oid-array.h\"\n-#include \"send-pack.h\"\n+#include \"transport/send-pack.h\"\n #include \"setup/setup.h\"\n-#include \"protocol.h\"\n+#include \"transport/protocol.h\"\n #include \"quote.h\"\n #include \"trace2.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"url.h\"\n #include \"write-or-die.h\"\n \ndiff --git a/remote.c b/transport/remote.c\nsimilarity index 99%\nrename from remote.c\nrename to transport/remote.c\nindex ae77c5b1db..fe7962799d 100644\n--- a/remote.c\n+++ b/transport/remote.c\n@@ -7,7 +7,7 @@\n #include \"setup/environment.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"url.h\"\n #include \"urlmatch.h\"\n #include \"refs/refs.h\"\n@@ -24,9 +24,9 @@\n #include \"strvec.h\"\n #include \"revision/commit-reach.h\"\n #include \"advice.h\"\n-#include \"connect.h\"\n+#include \"transport/connect.h\"\n #include \"parse-options.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n \n enum map_direction { FROM_SRC, FROM_DST };\n \ndiff --git a/remote.h b/transport/remote.h\nsimilarity index 100%\nrename from remote.h\nrename to transport/remote.h\ndiff --git a/send-pack.c b/transport/send-pack.c\nsimilarity index 99%\nrename from send-pack.c\nrename to transport/send-pack.c\nindex 546835b0aa..77079501b8 100644\n--- a/send-pack.c\n+++ b/transport/send-pack.c\n@@ -5,13 +5,13 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"odb/odb.h\"\n-#include \"pkt-line.h\"\n-#include \"sideband.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/sideband.h\"\n #include \"run-command.h\"\n-#include \"remote.h\"\n-#include \"connect.h\"\n-#include \"send-pack.h\"\n-#include \"transport.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/connect.h\"\n+#include \"transport/send-pack.h\"\n+#include \"transport/transport.h\"\n #include \"setup/version.h\"\n #include \"odb/oid-array.h\"\n #include \"gpg-interface.h\"\ndiff --git a/send-pack.h b/transport/send-pack.h\nsimilarity index 100%\nrename from send-pack.h\nrename to transport/send-pack.h\ndiff --git a/serve.c b/transport/serve.c\nsimilarity index 97%\nrename from serve.c\nrename to transport/serve.c\nindex 4408187c47..0f24d2f682 100644\n--- a/serve.c\n+++ b/transport/serve.c\n@@ -2,15 +2,15 @@\n #include \"setup/repository.h\"\n #include \"setup/config.h\"\n #include \"odb/hash.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"setup/version.h\"\n #include \"refs/ls-refs.h\"\n-#include \"protocol-caps.h\"\n-#include \"serve.h\"\n-#include \"upload-pack.h\"\n-#include \"bundle-uri.h\"\n+#include \"transport/protocol-caps.h\"\n+#include \"transport/serve.h\"\n+#include \"transport/upload-pack.h\"\n+#include \"transport/bundle-uri.h\"\n #include \"trace2.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n \n static int advertise_sid = -1;\n static int advertise_object_info = -1;\ndiff --git a/serve.h b/transport/serve.h\nsimilarity index 100%\nrename from serve.h\nrename to transport/serve.h\ndiff --git a/sideband.c b/transport/sideband.c\nsimilarity index 99%\nrename from sideband.c\nrename to transport/sideband.c\nindex b915fdf114..cba8394b6a 100644\n--- a/sideband.c\n+++ b/transport/sideband.c\n@@ -6,9 +6,9 @@\n #include \"setup/config.h\"\n #include \"editor.h\"\n #include \"gettext.h\"\n-#include \"sideband.h\"\n+#include \"transport/sideband.h\"\n #include \"help.h\"\n-#include \"pkt-line.h\"\n+#include \"transport/pkt-line.h\"\n #include \"write-or-die.h\"\n #include \"urlmatch.h\"\n \ndiff --git a/sideband.h b/transport/sideband.h\nsimilarity index 100%\nrename from sideband.h\nrename to transport/sideband.h\ndiff --git a/transport-helper.c b/transport/transport-helper.c\nsimilarity index 99%\nrename from transport-helper.c\nrename to transport/transport-helper.c\nindex 94d3d9ced8..63a9b80cff 100644\n--- a/transport-helper.c\n+++ b/transport/transport-helper.c\n@@ -1,7 +1,7 @@\n #define USE_THE_REPOSITORY_VARIABLE\n \n #include \"git-compat-util.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"quote.h\"\n #include \"run-command.h\"\n #include \"odb/commit.h\"\n@@ -10,15 +10,15 @@\n #include \"hex.h\"\n #include \"odb/object-name.h\"\n #include \"setup/repository.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"string-list.h\"\n #include \"thread-utils.h\"\n #include \"sigchain.h\"\n #include \"strvec.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n-#include \"transport-internal.h\"\n-#include \"protocol.h\"\n+#include \"transport/transport-internal.h\"\n+#include \"transport/protocol.h\"\n #include \"pack/packfile.h\"\n \n static int debug;\ndiff --git a/transport-internal.h b/transport/transport-internal.h\nsimilarity index 98%\nrename from transport-internal.h\nrename to transport/transport-internal.h\nindex 60db0bedcd..c3edf136b7 100644\n--- a/transport-internal.h\n+++ b/transport/transport-internal.h\n@@ -1,7 +1,7 @@\n #ifndef TRANSPORT_INTERNAL_H\n #define TRANSPORT_INTERNAL_H\n \n-#include \"connect.h\"\n+#include \"transport/connect.h\"\n \n struct ref;\n struct transport;\ndiff --git a/transport.c b/transport/transport.c\nsimilarity index 99%\nrename from transport.c\nrename to transport/transport.c\nindex 18429b78f5..dfeae250fd 100644\n--- a/transport.c\n+++ b/transport/transport.c\n@@ -5,15 +5,15 @@\n #include \"setup/config.h\"\n #include \"setup/environment.h\"\n #include \"hex.h\"\n-#include \"transport.h\"\n+#include \"transport/transport.h\"\n #include \"setup/hook.h\"\n-#include \"pkt-line.h\"\n-#include \"fetch-pack.h\"\n-#include \"fetch-object-info.h\"\n-#include \"remote.h\"\n-#include \"connect.h\"\n-#include \"send-pack.h\"\n-#include \"bundle.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/fetch-pack.h\"\n+#include \"transport/fetch-object-info.h\"\n+#include \"transport/remote.h\"\n+#include \"transport/connect.h\"\n+#include \"transport/send-pack.h\"\n+#include \"transport/bundle.h\"\n #include \"gettext.h\"\n #include \"refs/refs.h\"\n #include \"refs/refspec.h\"\n@@ -25,12 +25,12 @@\n #include \"odb/oid-array.h\"\n #include \"sigchain.h\"\n #include \"trace2.h\"\n-#include \"transport-internal.h\"\n-#include \"protocol.h\"\n+#include \"transport/transport-internal.h\"\n+#include \"transport/protocol.h\"\n #include \"odb/object-name.h\"\n #include \"color.h\"\n-#include \"bundle-uri.h\"\n-#include \"sideband.h\"\n+#include \"transport/bundle-uri.h\"\n+#include \"transport/sideband.h\"\n \n static enum git_colorbool transport_use_color = GIT_COLOR_UNKNOWN;\n static char transport_colors[][COLOR_MAXLEN] = {\ndiff --git a/transport.h b/transport/transport.h\nsimilarity index 99%\nrename from transport.h\nrename to transport/transport.h\nindex 064f4192cf..af4f1fa0db 100644\n--- a/transport.h\n+++ b/transport/transport.h\n@@ -2,10 +2,10 @@\n #define TRANSPORT_H\n \n #include \"run-command.h\"\n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"string-list.h\"\n-#include \"connect.h\"\n+#include \"transport/connect.h\"\n \n struct git_transport_options {\n \tunsigned thin : 1;\ndiff --git a/upload-pack.c b/transport/upload-pack.c\nsimilarity index 99%\nrename from upload-pack.c\nrename to transport/upload-pack.c\nindex 23c0357496..73edc8bb28 100644\n--- a/upload-pack.c\n+++ b/transport/upload-pack.c\n@@ -7,8 +7,8 @@\n #include \"gettext.h\"\n #include \"hex.h\"\n #include \"refs/refs.h\"\n-#include \"pkt-line.h\"\n-#include \"sideband.h\"\n+#include \"transport/pkt-line.h\"\n+#include \"transport/sideband.h\"\n #include \"setup/repository.h\"\n #include \"odb/odb.h\"\n #include \"odb/oid-array.h\"\n@@ -18,14 +18,14 @@\n #include \"revision/revision.h\"\n #include \"revision/list-objects-filter-options.h\"\n #include \"run-command.h\"\n-#include \"connect.h\"\n+#include \"transport/connect.h\"\n #include \"sigchain.h\"\n #include \"setup/version.h\"\n #include \"string-list.h\"\n #include \"strvec.h\"\n #include \"trace2.h\"\n-#include \"protocol.h\"\n-#include \"upload-pack.h\"\n+#include \"transport/protocol.h\"\n+#include \"transport/upload-pack.h\"\n #include \"pack/commit-graph.h\"\n #include \"revision/commit-reach.h\"\n #include \"revision/shallow.h\"\n@@ -33,7 +33,7 @@\n #include \"write-or-die.h\"\n #include \"json-writer.h\"\n #include \"strmap.h\"\n-#include \"promisor-remote.h\"\n+#include \"transport/promisor-remote.h\"\n \n /* Remember to update object flag allocation in object.h */\n #define THEY_HAVE\t(1u << 11)\ndiff --git a/upload-pack.h b/transport/upload-pack.h\nsimilarity index 100%\nrename from upload-pack.h\nrename to transport/upload-pack.h\ndiff --git a/walker.c b/transport/walker.c\nsimilarity index 99%\nrename from walker.c\nrename to transport/walker.c\nindex 079dcd378c..330b00a22c 100644\n--- a/walker.c\n+++ b/transport/walker.c\n@@ -3,7 +3,7 @@\n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n #include \"hex.h\"\n-#include \"walker.h\"\n+#include \"transport/walker.h\"\n #include \"setup/repository.h\"\n #include \"odb/odb.h\"\n #include \"odb/commit.h\"\ndiff --git a/walker.h b/transport/walker.h\nsimilarity index 97%\nrename from walker.h\nrename to transport/walker.h\nindex 25aaa3631c..3a1b822965 100644\n--- a/walker.h\n+++ b/transport/walker.h\n@@ -1,7 +1,7 @@\n #ifndef WALKER_H\n #define WALKER_H\n \n-#include \"remote.h\"\n+#include \"transport/remote.h\"\n \n struct walker {\n \tvoid *data;\n-- \n2.54.0\n\n"},{"id":"551129","messageId":"aoxQaSGaDwqkP7Tb@ugly.lan","threadId":"66210","inReplyTo":"20260823171915.2662373-8-mmontalbo@gmail.com","subject":"Re: [RFC PATCH 07/14] odb: gather the odb sources under odb/","fromName":"Oswald Buddenhagen","fromEmail":"oswald.buddenhagen@gmx.de","sentAt":"2026-08-24T14:08:41Z","receivedAt":"2026-08-24T14:08:43Z","isPatch":true,"body":"On Sun, Aug 23, 2026 at 10:18:51AM -0700, Michael Montalbo wrote:\n>Move the 23 odb C sources and 26 headers into odb/ as renames.\n>\ni for one would go with lib/odb/.\n\n>+++ b/builtin/add.c\n>-#include \"object-file.h\"\n>-#include \"odb.h\"\n>+#include \"odb/object-file.h\"\n>+#include \"odb/odb.h\"\n> \nthat's the wrong include style here.\nit was already wrong in a lot of places, but as you rewrite everything \nanyway, you could fix it just as well.\n\n"},{"id":"551132","messageId":"xmqqjypfshnh.fsf@gitster.g","threadId":"66210","inReplyTo":"aoxQaSGaDwqkP7Tb@ugly.lan","subject":"Re: [RFC PATCH 07/14] odb: gather the odb sources under odb/","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-24T14:43:46Z","receivedAt":"2026-08-24T14:43:50Z","isPatch":true,"body":"Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:\n\n> On Sun, Aug 23, 2026 at 10:18:51AM -0700, Michael Montalbo wrote:\n>>Move the 23 odb C sources and 26 headers into odb/ as renames.\n>>\n> i for one would go with lib/odb/.\n>\n>>+++ b/builtin/add.c\n>>-#include \"object-file.h\"\n>>-#include \"odb.h\"\n>>+#include \"odb/object-file.h\"\n>>+#include \"odb/odb.h\"\n>> \n> that's the wrong include style here.\n> it was already wrong in a lot of places, but as you rewrite everything \n> anyway, you could fix it just as well.\n\nI do not agree with lib/odb/ suggestion, but I am curious what you\nthink the \"right\" include stle is, because I cannot read it out of\nwhat you have written.  Please do not assume that everybody knows\nwhat you think is right or wrong.\n\nDo you mean they should not be quoted in a pair of double quotes\nbecause the behaviour of such includes is implementation-defined\n(instead use \"<>\" as we use -I<path> on the command line)?  Do you\nmean they should be alphabetical?  Something else?\n\nThanks.\n"},{"id":"551150","messageId":"aoyjpmBXUhj_PPck@ugly.lan","threadId":"66210","inReplyTo":"xmqqjypfshnh.fsf@gitster.g","subject":"Re: [RFC PATCH 07/14] odb: gather the odb sources under odb/","fromName":"Oswald Buddenhagen","fromEmail":"oswald.buddenhagen@gmx.de","sentAt":"2026-08-24T20:03:50Z","receivedAt":"2026-08-24T20:03:52Z","isPatch":true,"body":"On Mon, Aug 24, 2026 at 07:43:46AM -0700, Junio C Hamano wrote:\n>Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:\n>> On Sun, Aug 23, 2026 at 10:18:51AM -0700, Michael Montalbo wrote:\n>>>Move the 23 odb C sources and 26 headers into odb/ as renames.\n>>>\n>> i for one would go with lib/odb/.\n>>\n>I do not agree with lib/odb/ suggestion,\n>\nwhy not? it's hugely beneficial for the comprehensibility of the build \nsystem and discoverability when the physical project structure follows \nthe logical one.\n\n>>>+++ b/builtin/add.c\n>>>-#include \"object-file.h\"\n>>>-#include \"odb.h\"\n>>>+#include \"odb/object-file.h\"\n>>>+#include \"odb/odb.h\"\n>>> \n>> that's the wrong include style here.\n>> it was already wrong in a lot of places, but as you rewrite everything \n>> anyway, you could fix it just as well.\n>\n>Do you mean they should not be quoted in a pair of double quotes\n>because the behaviour of such includes is implementation-defined\n>(instead use \"<>\" as we use -I<path> on the command line)?\n>\nyes.\n(actually, i don't mind relying on the popular interpretation that \n\"\"-style means relative to the including file's containing directory.  \nthat mostly implies that \"\" is ok for in-module references when headers \nand sources live side by side.)\n\n> Something else?\n>\neverything else i can think of would require more context, so it's a \ngood first guess to assume that i didn't mean it.\n"}]}