Skip to contentSkip to conversation

git organize: record file placement and apply it

RFC PATCH In review Michael Montalbo 3 participants 18 messages Aug 23 – Aug 24 Page 2 of 3

Subsystems (3)
lore
Share & tools
lore
#13 lore raw

RFC PATCH 10/14 diff: gather the diff sources under diff/

In reply to Michael Montalbo

Move the 16 diff C sources and 7 headers into diff/ as renames. Repoint every reference to their old paths to the new ones: the #include lines across the tree, the Makefile and meson.build build entries.

---
 .gitorganize                                  | 46 +++++++++----------
 Makefile                                      | 32 ++++++-------
 add-interactive.c                             |  2 +-
 add-patch.c                                   |  2 +-
 apply.c                                       |  4 +-
 archive-zip.c                                 |  4 +-
 bisect.c                                      |  2 +-
 blame.c                                       |  4 +-
 blame.h                                       |  2 +-
 builtin/add.c                                 |  2 +-
 builtin/am.c                                  |  2 +-
 builtin/blame.c                               |  4 +-
 builtin/cat-file.c                            |  4 +-
 builtin/checkout.c                            |  4 +-
 builtin/commit.c                              |  2 +-
 builtin/describe.c                            |  2 +-
 builtin/diff-files.c                          |  4 +-
 builtin/diff-index.c                          |  4 +-
 builtin/diff-pairs.c                          |  4 +-
 builtin/diff-tree.c                           |  2 +-
 builtin/diff.c                                |  6 +--
 builtin/fast-export.c                         |  4 +-
 builtin/last-modified.c                       |  4 +-
 builtin/log.c                                 | 12 ++---
 builtin/merge-file.c                          |  4 +-
 builtin/merge-ours.c                          |  2 +-
 builtin/merge-tree.c                          |  2 +-
 builtin/merge.c                               |  6 +--
 builtin/pack-objects.c                        |  2 +-
 builtin/patch-id.c                            |  2 +-
 builtin/prune.c                               |  2 +-
 builtin/range-diff.c                          |  2 +-
 builtin/rebase.c                              |  2 +-
 builtin/rerere.c                              |  2 +-
 builtin/reset.c                               |  4 +-
 builtin/rev-list.c                            |  2 +-
 builtin/rev-parse.c                           |  2 +-
 builtin/revert.c                              |  2 +-
 builtin/shortlog.c                            |  2 +-
 builtin/stash.c                               |  2 +-
 builtin/submodule--helper.c                   |  4 +-
 builtin/tag.c                                 |  2 +-
 bundle.c                                      |  2 +-
 combine-diff.c => diff/combine-diff.c         |  8 ++--
 diff-lib.c => diff/diff-lib.c                 |  4 +-
 diff-merges.c => diff/diff-merges.c           |  2 +-
 diff-merges.h => diff/diff-merges.h           |  0
 diff-no-index.c => diff/diff-no-index.c       |  4 +-
 diff.c => diff/diff.c                         |  8 ++--
 diff.h => diff/diff.h                         |  0
 diffcore-break.c => diff/diffcore-break.c     |  2 +-
 diffcore-delta.c => diff/diffcore-delta.c     |  2 +-
 diffcore-order.c => diff/diffcore-order.c     |  4 +-
 diffcore-pickaxe.c => diff/diffcore-pickaxe.c |  6 +--
 diffcore-rename.c => diff/diffcore-rename.c   |  4 +-
 diffcore-rotate.c => diff/diffcore-rotate.c   |  4 +-
 diffcore.h => diff/diffcore.h                 |  0
 patch-ids.c => diff/patch-ids.c               |  4 +-
 patch-ids.h => diff/patch-ids.h               |  2 +-
 range-diff.c => diff/range-diff.c             |  8 ++--
 range-diff.h => diff/range-diff.h             |  2 +-
 tree-diff.c => diff/tree-diff.c               |  4 +-
 userdiff.c => diff/userdiff.c                 |  2 +-
 userdiff.h => diff/userdiff.h                 |  0
 xdiff-interface.c => diff/xdiff-interface.c   |  2 +-
 xdiff-interface.h => diff/xdiff-interface.h   |  0
 fmt-merge-msg.c                               |  4 +-
 graph.h                                       |  2 +-
 grep.c                                        |  8 ++--
 grep.h                                        |  2 +-
 http-push.c                                   |  2 +-
 line-log.c                                    |  6 +--
 line-log.h                                    |  2 +-
 line-range.c                                  |  4 +-
 list-objects-filter.c                         |  2 +-
 list-objects.c                                |  2 +-
 log-tree.c                                    |  6 +--
 merge-ll.c                                    |  2 +-
 merge-ort.c                                   |  6 +--
 meson.build                                   | 32 ++++++-------
 notes-merge.c                                 |  6 +--
 odb/commit.c                                  |  2 +-
 pack/bloom.c                                  |  4 +-
 pack/delta-islands.c                          |  2 +-
 pack/pack-bitmap-write.c                      |  2 +-
 pack/pack-bitmap.c                            |  2 +-
 pack/reachable.c                              |  2 +-
 pretty.c                                      |  2 +-
 read-cache.c                                  |  4 +-
 refs/reflog-walk.c                            |  2 +-
 remote.c                                      |  2 +-
 rerere.c                                      |  2 +-
 revision.c                                    |  6 +--
 revision.h                                    |  2 +-
 sequencer.c                                   |  2 +-
 shallow.c                                     |  2 +-
 submodule.c                                   |  4 +-
 t/helper/test-revision-walking.c              |  2 +-
 t/helper/test-userdiff.c                      |  2 +-
 upload-pack.c                                 |  2 +-
 wt-status.c                                   |  4 +-
 101 files changed, 208 insertions(+), 208 deletions(-)
 rename combine-diff.c => diff/combine-diff.c (99%)
 rename diff-lib.c => diff/diff-lib.c (99%)
 rename diff-merges.c => diff/diff-merges.c (99%)
 rename diff-merges.h => diff/diff-merges.h (100%)
 rename diff-no-index.c => diff/diff-no-index.c (99%)
 rename diff.c => diff/diff.c (99%)
 rename diff.h => diff/diff.h (100%)
 rename diffcore-break.c => diff/diffcore-break.c (99%)
 rename diffcore-delta.c => diff/diffcore-delta.c (99%)
 rename diffcore-order.c => diff/diffcore-order.c (97%)
 rename diffcore-pickaxe.c => diff/diffcore-pickaxe.c (98%)
 rename diffcore-rename.c => diff/diffcore-rename.c (99%)
 rename diffcore-rotate.c => diff/diffcore-rotate.c (95%)
 rename diffcore.h => diff/diffcore.h (100%)
 rename patch-ids.c => diff/patch-ids.c (98%)
 rename patch-ids.h => diff/patch-ids.h (98%)
 rename range-diff.c => diff/range-diff.c (99%)
 rename range-diff.h => diff/range-diff.h (98%)
 rename tree-diff.c => diff/tree-diff.c (99%)
 rename userdiff.c => diff/userdiff.c (99%)
 rename userdiff.h => diff/userdiff.h (100%)
 rename xdiff-interface.c => diff/xdiff-interface.c (99%)
 rename xdiff-interface.h => diff/xdiff-interface.h (100%)
.gitorganize +23 -23
index 533d50ed89..160365fbca 100644
@@ -62,7 +62,6 @@ color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,inde
 color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1
 column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2
 column.h component=? role=public prefix=column
-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
 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
 commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3
 common-exit.c component=? role=lib prefix=common-main
@@ -91,19 +90,29 @@ decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1
 decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1
 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
 diagnose.h component=? role=public prefix=diagnose cochange=revision:2,refs:1,transport:1
-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
-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
-diff-merges.h component=diff role=header prefix=diff-merges cochange=diff:11,revision:4,merge:1
-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
-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
-diff.h component=diff role=header prefix=diff includes=index:1,odb:1 cochange=diff:471,revision:83,index:29,submodule:18,odb:14
-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
-diffcore-delta.c component=diff role=lib prefix=diffcore-delta includes=diff:1 cochange=diff:26,revision:7,odb:4,index:2,refs:2
-diffcore-order.c component=diff role=lib prefix=diffcore-order includes=diff:2 cochange=diff:19,index:8,refs:7,revision:7,pack:5
-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
-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
-diffcore-rotate.c component=diff role=lib prefix=diff includes=diff:2 cochange=diff:14,revision:5,pack:2,merge:1,refs:1
-diffcore.h component=diff role=header prefix=diff includes=odb:1 cochange=diff:175,revision:11,merge:10,submodule:4,odb:2
+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
+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
+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
+diff/diff-merges.h component=diff role=header prefix=diff-merges cochange=diff:11,revision:4,merge:1
+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
+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
+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
+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
+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
+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
+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
+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
+diff/diffcore-rotate.c component=diff role=lib prefix=diff includes=diff:2 cochange=diff:14,revision:5,pack:2,merge:1,refs:1
+diff/diffcore.h component=diff role=header prefix=diff includes=odb:1 cochange=diff:175,revision:11,merge:10,submodule:4,odb:2
+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
+diff/patch-ids.h component=diff role=header prefix=patch-ids includes=diff:1 cochange=diff:15,revision:3,index:1
+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
+diff/range-diff.h component=diff role=header prefix=range-diff includes=diff:1 cochange=diff:13,revision:4
+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
+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
+diff/userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1
+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
+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
 dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1
 dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1
 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
@@ -321,8 +330,6 @@ parse-options.c component=? role=lib prefix=parse-options cochange=index:14,diff
 parse-options.h component=? role=public prefix=parse-options cochange=diff:7,merge:4,archive:3,index:3,refs:3
 parse.c component=? role=lib prefix=parse cochange=setup:6,index:3,pack:2,convert:1
 parse.h component=? role=public prefix=config cochange=setup:6,index:3,pack:2,convert:1
-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
-patch-ids.h component=diff role=header prefix=patch-ids includes=diff:1 cochange=diff:15,revision:3,index:1
 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
 path-walk.h component=? role=public prefix=path-walk includes=odb:1 cochange=index:2
 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
@@ -349,8 +356,6 @@ protocol.c component=transport role=lib prefix=protocol includes=setup:2,transpo
 protocol.h component=transport role=header prefix=protocol cochange=transport:5
 quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6
 quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5
-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
-range-diff.h component=diff role=header prefix=range-diff includes=diff:1 cochange=diff:13,revision:4
 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
 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
 read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2
@@ -453,7 +458,6 @@ transport-helper.c component=transport role=lib prefix=transport-helper includes
 transport-internal.h component=transport role=header prefix=transport includes=transport:1 cochange=transport:42,refs:3,odb:1,submodule:1
 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
 transport.h component=transport role=header prefix=transport includes=transport:2,revision:1 cochange=transport:249,submodule:6,odb:4,revision:2,diff:1
-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
 unicode-width.h component=? role=public prefix=unicode
 unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2,setup:1
 unix-socket.h component=? role=public prefix=unix-socket
@@ -468,8 +472,6 @@ url.h component=? role=public prefix=url cochange=transport:9,revision:4,submodu
 urlmatch.c component=? role=lib prefix=urlmatch cochange=diff:3,odb:2,revision:2,setup:2,transport:2
 urlmatch.h component=? role=public prefix=urlmatch includes=setup:1 cochange=transport:1
 usage.c component=? role=lib prefix=usage cochange=index:3,odb:2,diff:1,revision:1,setup:1
-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
-userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1
 utf8.c component=? role=lib prefix=utf8 cochange=revision:6,index:3,setup:3,transport:2,convert:1
 utf8.h component=? role=public prefix=utf8 cochange=revision:6,index:2,setup:2,transport:2,convert:1
 varint.c component=? role=lib prefix=varint cochange=index:2,transport:1
@@ -490,5 +492,3 @@ ws.c component=convert role=lib prefix=whitespace includes=convert:2 cochange=co
 ws.h component=convert role=header prefix=whitespace cochange=diff:5,convert:2,setup:2
 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
 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
-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
-xdiff-interface.h component=diff role=header prefix=xdiff-interface includes=odb:1 cochange=diff:62,index:2,notes:2,merge:1,odb:1
Makefile +16 -16
index 85d2a620a7..b96345ba0c 100644
@@ -1124,7 +1124,7 @@ LIB_OBJS += checkout.o
 LIB_OBJS += pack/chunk-format.o
 LIB_OBJS += color.o
 LIB_OBJS += column.o
-LIB_OBJS += combine-diff.o
+LIB_OBJS += diff/combine-diff.o
 LIB_OBJS += pack/commit-graph.o
 LIB_OBJS += commit-reach.o
 LIB_OBJS += odb/commit.o
@@ -1148,16 +1148,16 @@ LIB_OBJS += decorate.o
 LIB_OBJS += pack/delta-islands.o
 LIB_OBJS += diagnose.o
 LIB_OBJS += pack/diff-delta.o
-LIB_OBJS += diff-merges.o
-LIB_OBJS += diff-lib.o
-LIB_OBJS += diff-no-index.o
-LIB_OBJS += diff.o
-LIB_OBJS += diffcore-break.o
-LIB_OBJS += diffcore-delta.o
-LIB_OBJS += diffcore-order.o
-LIB_OBJS += diffcore-pickaxe.o
-LIB_OBJS += diffcore-rename.o
-LIB_OBJS += diffcore-rotate.o
+LIB_OBJS += diff/diff-merges.o
+LIB_OBJS += diff/diff-lib.o
+LIB_OBJS += diff/diff-no-index.o
+LIB_OBJS += diff/diff.o
+LIB_OBJS += diff/diffcore-break.o
+LIB_OBJS += diff/diffcore-delta.o
+LIB_OBJS += diff/diffcore-order.o
+LIB_OBJS += diff/diffcore-pickaxe.o
+LIB_OBJS += diff/diffcore-rename.o
+LIB_OBJS += diff/diffcore-rotate.o
 LIB_OBJS += dir-iterator.o
 LIB_OBJS += dir.o
 LIB_OBJS += editor.o
@@ -1257,7 +1257,7 @@ LIB_OBJS += parse.o
 LIB_OBJS += parse-options-cb.o
 LIB_OBJS += parse-options.o
 LIB_OBJS += pack/patch-delta.o
-LIB_OBJS += patch-ids.o
+LIB_OBJS += diff/patch-ids.o
 LIB_OBJS += path.o
 LIB_OBJS += path-walk.o
 LIB_OBJS += pathspec.o
@@ -1273,7 +1273,7 @@ LIB_OBJS += protocol-caps.o
 LIB_OBJS += pack/prune-packed.o
 LIB_OBJS += pack/pseudo-merge.o
 LIB_OBJS += quote.o
-LIB_OBJS += range-diff.o
+LIB_OBJS += diff/range-diff.o
 LIB_OBJS += pack/reachable.o
 LIB_OBJS += read-cache.o
 LIB_OBJS += rebase-interactive.o
@@ -1360,7 +1360,7 @@ LIB_OBJS += trace2/tr2_tmr.o
 LIB_OBJS += trailer.o
 LIB_OBJS += transport-helper.o
 LIB_OBJS += transport.o
-LIB_OBJS += tree-diff.o
+LIB_OBJS += diff/tree-diff.o
 LIB_OBJS += odb/tree-walk.o
 LIB_OBJS += odb/tree.o
 LIB_OBJS += unpack-trees.o
@@ -1368,7 +1368,7 @@ LIB_OBJS += upload-pack.o
 LIB_OBJS += url.o
 LIB_OBJS += urlmatch.o
 LIB_OBJS += usage.o
-LIB_OBJS += userdiff.o
+LIB_OBJS += diff/userdiff.o
 LIB_OBJS += utf8.o
 ifdef NO_RUST
 LIB_OBJS += varint.o
@@ -1382,7 +1382,7 @@ LIB_OBJS += wrapper.o
 LIB_OBJS += write-or-die.o
 LIB_OBJS += ws.o
 LIB_OBJS += wt-status.o
-LIB_OBJS += xdiff-interface.o
+LIB_OBJS += diff/xdiff-interface.o
 LIB_OBJS += xdiff/xdiffi.o
 LIB_OBJS += xdiff/xemit.o
 LIB_OBJS += xdiff/xhistogram.o
add-interactive.c +1 -1
index 67ee53f5cc..f656db231c 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "add-interactive.h"
 #include "color.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
add-patch.c +1 -1
index 1b4c53e4ce..c6860310c1 100644
@@ -6,7 +6,7 @@
 #include "advice.h"
 #include "odb/commit.h"
 #include "config.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "editor.h"
 #include "environment.h"
 #include "gettext.h"
apply.c +2 -2
index dbfb891b4c..b8d97d140d 100644
@@ -16,12 +16,12 @@
 #include "config.h"
 #include "odb/odb.h"
 #include "pack/delta.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "merge-ll.h"
 #include "lockfile.h"
 #include "name-hash.h"
archive-zip.c +2 -2
index 53c50ebc44..df1edadd33 100644
@@ -14,9 +14,9 @@
 #include "odb/odb.h"
 #include "odb/streaming.h"
 #include "strbuf.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "write-or-die.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "date.h"
 
 static int zip_date;
bisect.c +1 -1
index 85c5a12ed2..1f8d81b894 100644
@@ -4,7 +4,7 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
blame.c +2 -2
index cd18c09a3c..c736441f18 100644
@@ -8,8 +8,8 @@
 #include "mergesort.h"
 #include "odb/commit.h"
 #include "convert.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "gettext.h"
 #include "hex.h"
 #include "path.h"
blame.h +1 -1
index 97137099e3..30aeae2d4e 100644
@@ -2,7 +2,7 @@
 #define BLAME_H
 
 #include "odb/oidset.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "prio-queue.h"
 
 #define PICKAXE_BLAME_MOVE		01
builtin/add.c +1 -1
index 5d6dd91f70..dd5e33c7b0 100644
@@ -20,7 +20,7 @@
 #include "parse-options.h"
 #include "path.h"
 #include "preload-index.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "read-cache.h"
 #include "revision.h"
 #include "strvec.h"
builtin/am.c +1 -1
index d7e4e125d2..7bd7fde14b 100644
@@ -24,7 +24,7 @@
 #include "cache-tree.h"
 #include "refs/refs.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "unpack-trees.h"
 #include "branch.h"
 #include "odb/object-name.h"
builtin/blame.c +2 -2
index 1662bd487d..cb9f8b4ff0 100644
@@ -14,7 +14,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "quote.h"
 #include "string-list.h"
@@ -22,7 +22,7 @@
 #include "parse-options.h"
 #include "prio-queue.h"
 #include "utf8.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "line-range.h"
 #include "line-log.h"
 #include "progress.h"
builtin/cat-file.c +2 -2
index a59aa00cea..4fd1999f80 100644
@@ -10,14 +10,14 @@
 #include "builtin.h"
 #include "config.h"
 #include "convert.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "ident.h"
 #include "list-objects-filter-options.h"
 #include "parse-options.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "odb/oid-array.h"
 #include "pack/packfile.h"
 #include "odb/object-file.h"
builtin/checkout.c +2 -2
index 87c1f087b8..c35c3d92d1 100644
@@ -8,7 +8,7 @@
 #include "checkout.h"
 #include "odb/commit.h"
 #include "config.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
@@ -40,7 +40,7 @@
 #include "odb/tree-walk.h"
 #include "unpack-trees.h"
 #include "wt-status.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "entry.h"
 #include "parallel-checkout.h"
 #include "add-interactive.h"
builtin/commit.c +1 -1
index 39271d720e..d2b4ecbd40 100644
@@ -17,7 +17,7 @@
 #include "dir.h"
 #include "editor.h"
 #include "environment.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/commit.h"
 #include "add-interactive.h"
 #include "gettext.h"
builtin/describe.c +1 -1
index c16a1da092..ff44b55e9e 100644
@@ -14,7 +14,7 @@
 #include "parse-options.h"
 #include "read-cache-ll.h"
 #include "revision.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "hashmap.h"
 #include "setup.h"
 #include "strvec.h"
builtin/diff-files.c +2 -2
index c5b7548e55..39eaf9cfce 100644
@@ -9,8 +9,8 @@
 
 #include "builtin.h"
 #include "config.h"
-#include "diff.h"
-#include "diff-merges.h"
+#include "diff/diff.h"
+#include "diff/diff-merges.h"
 #include "odb/commit.h"
 #include "preload-index.h"
 #include "revision.h"
builtin/diff-index.c +2 -2
index a23f444348..799f5533ad 100644
@@ -3,8 +3,8 @@
 
 #include "builtin.h"
 #include "config.h"
-#include "diff.h"
-#include "diff-merges.h"
+#include "diff/diff.h"
+#include "diff/diff-merges.h"
 #include "odb/commit.h"
 #include "preload-index.h"
 #include "revision.h"
builtin/diff-pairs.c +2 -2
index 315fc7357a..e3350b2915 100644
@@ -1,7 +1,7 @@
 #include "builtin.h"
 #include "config.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
builtin/diff-tree.c +1 -1
index a3e1e5e020..8f2103013c 100644
@@ -2,7 +2,7 @@
 
 #include "builtin.h"
 #include "config.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/commit.h"
 #include "gettext.h"
 #include "hex.h"
builtin/diff.c +3 -3
index c9ccc7e6c5..774c12cea6 100644
@@ -15,9 +15,9 @@
 #include "odb/commit.h"
 #include "gettext.h"
 #include "odb/tag.h"
-#include "diff.h"
-#include "diff-merges.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diff-merges.h"
+#include "diff/diffcore.h"
 #include "preload-index.h"
 #include "read-cache-ll.h"
 #include "revision.h"
builtin/fast-export.c +2 -2
index 4a98f14d39..6683d49660 100644
@@ -19,8 +19,8 @@
 #include "odb/commit.h"
 #include "odb/object.h"
 #include "odb/tag.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "log-tree.h"
 #include "revision.h"
 #include "decorate.h"
builtin/last-modified.c +2 -2
index 83c5d66f36..911441a321 100644
@@ -5,8 +5,8 @@
 #include "odb/commit-slab.h"
 #include "odb/commit.h"
 #include "config.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "environment.h"
 #include "ewah/ewok.h"
 #include "hashmap.h"
builtin/log.c +6 -6
index 7099f5fcc5..a93b97858b 100644
@@ -20,16 +20,16 @@
 #include "pager.h"
 #include "color.h"
 #include "odb/commit.h"
-#include "diff.h"
-#include "diffcore.h"
-#include "diff-merges.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
+#include "diff/diff-merges.h"
 #include "revision.h"
 #include "log-tree.h"
 #include "odb/oid-array.h"
 #include "odb/oidset.h"
 #include "odb/tag.h"
 #include "refs/reflog-walk.h"
-#include "patch-ids.h"
+#include "diff/patch-ids.h"
 #include "path.h"
 #include "shortlog.h"
 #include "remote.h"
@@ -46,10 +46,10 @@
 
 #include "commit-reach.h"
 #include "promisor-remote.h"
-#include "range-diff.h"
+#include "diff/range-diff.h"
 #include "odb/tmp-objdir.h"
 #include "odb/tree.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "write-or-die.h"
 
 #define MAIL_DEFAULT_WRAP 72
builtin/merge-file.c +2 -2
index 22a6862a13..12701b1d81 100644
@@ -3,7 +3,7 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "hex.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
@@ -12,7 +12,7 @@
 #include "gettext.h"
 #include "setup.h"
 #include "xdiff/xdiff.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "parse-options.h"
 
 static const char *const merge_file_usage[] = {
builtin/merge-ours.c +1 -1
index 405b2989f7..c33e176c65 100644
@@ -12,7 +12,7 @@
 #include "builtin.h"
 #include "config.h"
 #include "environment.h"
-#include "diff.h"
+#include "diff/diff.h"
 
 static const char builtin_merge_ours_usage[] =
 	"git merge-ours <base>... -- HEAD <remote>...";
builtin/merge-tree.c +1 -1
index 27f2944ece..8217938d86 100644
@@ -3,7 +3,7 @@
 #include "builtin.h"
 #include "environment.h"
 #include "odb/tree-walk.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "help.h"
 #include "gettext.h"
 #include "hex.h"
builtin/merge.c +3 -3
index ad0c984d4b..7ec4554b0b 100644
@@ -24,12 +24,12 @@
 #include "repository.h"
 #include "run-command.h"
 #include "hook.h"
-#include "diff.h"
-#include "diff-merges.h"
+#include "diff/diff.h"
+#include "diff/diff-merges.h"
 #include "refs/refs.h"
 #include "refs/refspec.h"
 #include "odb/commit.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "path.h"
 #include "revision.h"
 #include "unpack-trees.h"
builtin/pack-objects.c +1 -1
index 37c379d3d8..17721f13ac 100644
@@ -15,7 +15,7 @@
 #include "pack/pack-revindex.h"
 #include "csum-file.h"
 #include "odb/tree-walk.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "list-objects.h"
 #include "list-objects-filter-options.h"
builtin/patch-id.c +1 -1
index e2c1375b41..7207279cef 100644
@@ -2,7 +2,7 @@
 
 #include "builtin.h"
 #include "config.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
builtin/prune.c +1 -1
index ae3505c5e5..0adf0f02d1 100644
@@ -2,7 +2,7 @@
 
 #include "builtin.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
builtin/range-diff.c +1 -1
index 7e37a00d9e..323046c696 100644
@@ -4,7 +4,7 @@
 #include "gettext.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
-#include "range-diff.h"
+#include "diff/range-diff.h"
 #include "config.h"
 #include "parse.h"
 #include "color.h"
builtin/rebase.c +1 -1
index 983dbb7ce5..8f9fdcc79b 100644
@@ -25,7 +25,7 @@
 #include "parse-options.h"
 #include "path.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "wt-status.h"
 #include "revision.h"
 #include "commit-reach.h"
builtin/rerere.c +1 -1
index a056cb791b..545ffe2715 100644
@@ -8,7 +8,7 @@
 #include "strbuf.h"
 #include "string-list.h"
 #include "xdiff/xdiff.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "pathspec.h"
 
 static const char * const rerere_usage[] = {
builtin/reset.c +2 -2
index c3bfbab7d5..f843bab823 100644
@@ -21,8 +21,8 @@
 #include "odb/object.h"
 #include "pretty.h"
 #include "refs/refs.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "odb/tree.h"
 #include "branch.h"
 #include "odb/object-name.h"
builtin/rev-list.c +1 -1
index d6bddda9d4..c0e0769aab 100644
@@ -4,7 +4,7 @@
 #include "builtin.h"
 #include "config.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
builtin/rev-parse.c +1 -1
index 2fb682d5a2..b95cdac85e 100644
@@ -22,7 +22,7 @@
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "path.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "read-cache-ll.h"
 #include "repo-settings.h"
 #include "repository.h"
builtin/revert.c +1 -1
index bedc40f368..a939c590fb 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "builtin.h"
 #include "parse-options.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "revision.h"
builtin/shortlog.c +1 -1
index cbcf2fb637..59be73a372 100644
@@ -3,7 +3,7 @@
 #include "builtin.h"
 #include "config.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "string-list.h"
builtin/stash.c +1 -1
index 62fec2f17f..c5e100746d 100644
@@ -26,7 +26,7 @@
 #include "setup.h"
 #include "sparse-index.h"
 #include "log-tree.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "refs/reflog.h"
 #include "refs/reflog-walk.h"
 #include "add-interactive.h"
builtin/submodule--helper.c +2 -2
index bf8b20247f..5711a79428 100644
@@ -24,8 +24,8 @@
 #include "refs/refs.h"
 #include "refs/refspec.h"
 #include "revision.h"
-#include "diffcore.h"
-#include "diff.h"
+#include "diff/diffcore.h"
+#include "diff/diff.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
builtin/tag.c +1 -1
index d554ae8f81..c04c2cc207 100644
@@ -23,7 +23,7 @@
 #include "path.h"
 #include "odb/tag.h"
 #include "parse-options.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "gpg-interface.h"
 #include "odb/oid-array.h"
bundle.c +1 -1
index c64b14a05a..54ec76866b 100644
@@ -11,7 +11,7 @@
 #include "repository.h"
 #include "odb/object.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "list-objects.h"
 #include "run-command.h"
diff/combine-diff.c renamed from combine-diff.c +4 -4
similarity index 99%
rename from combine-diff.c
rename to diff/combine-diff.c
index 6f16e9ea38..44f0eb5442 100644
@@ -5,18 +5,18 @@
 #include "odb/odb.h"
 #include "odb/commit.h"
 #include "convert.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "environment.h"
 #include "hex.h"
 #include "odb/object-name.h"
 #include "quote.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "xdiff/xmacros.h"
 #include "log-tree.h"
 #include "refs/refs.h"
 #include "odb/tree.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "odb/oid-array.h"
 #include "revision.h"
 
diff/diff-lib.c renamed from diff-lib.c +2 -2
similarity index 99%
rename from diff-lib.c
rename to diff/diff-lib.c
index a5072c5f6d..fb0514dcb0 100644
@@ -7,8 +7,8 @@
 
 #include "git-compat-util.h"
 #include "odb/commit.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
diff/diff-merges.c renamed from diff-merges.c +1 -1
similarity index 99%
rename from diff-merges.c
rename to diff/diff-merges.c
index 45507588a2..ca3cbf7767 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "diff-merges.h"
+#include "diff/diff-merges.h"
 
 #include "gettext.h"
 #include "revision.h"
diff/diff-merges.h renamed from diff-merges.h +0 -0
similarity index 100%
rename from diff-merges.h
rename to diff/diff-merges.h
diff/diff-no-index.c renamed from diff-no-index.c +2 -2
similarity index 99%
rename from diff-no-index.c
rename to diff/diff-no-index.c
index 552cd95679..5712e5474d 100644
@@ -10,8 +10,8 @@
 #include "abspath.h"
 #include "color.h"
 #include "odb/commit.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "gettext.h"
 #include "revision.h"
 #include "parse-options.h"
diff/diff.c renamed from diff.c +4 -4
similarity index 99%
rename from diff.c
rename to diff/diff.c
index 91addcdab7..9062f96b7b 100644
@@ -15,16 +15,16 @@
 #include "tempfile.h"
 #include "revision.h"
 #include "quote.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "pack/delta.h"
 #include "hex.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "color.h"
 #include "run-command.h"
 #include "utf8.h"
 #include "odb/odb.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "submodule.h"
 #include "hashmap.h"
 #include "mem-pool.h"
diff/diff.h renamed from diff.h +0 -0
similarity index 100%
rename from diff.h
rename to diff/diff.h
diff/diffcore-break.c renamed from diffcore-break.c +1 -1
similarity index 99%
rename from diffcore-break.c
rename to diff/diffcore-break.c
index 70860c8abc..c822a0d56d 100644
@@ -5,7 +5,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "odb/hash.h"
 #include "odb/object.h"
 #include "promisor-remote.h"
diff/diffcore-delta.c renamed from diffcore-delta.c +1 -1
similarity index 99%
rename from diffcore-delta.c
rename to diff/diffcore-delta.c
index 2b7db39983..4291662274 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 
 /*
  * Idea here is very simple.
diff/diffcore-order.c renamed from diffcore-order.c +2 -2
similarity index 97%
rename from diffcore-order.c
rename to diff/diffcore-order.c
index f91ef22471..e6a6a23aca 100644
@@ -4,8 +4,8 @@
 
 #include "git-compat-util.h"
 #include "gettext.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "wildmatch.h"
 
 static char **order;
diff/diffcore-pickaxe.c renamed from diffcore-pickaxe.c +3 -3
similarity index 98%
rename from diffcore-pickaxe.c
rename to diff/diffcore-pickaxe.c
index f7a745fb49..e7289d9a26 100644
@@ -6,9 +6,9 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "diff.h"
-#include "diffcore.h"
-#include "xdiff-interface.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
+#include "diff/xdiff-interface.h"
 #include "kwset.h"
 #include "odb/oidset.h"
 #include "pretty.h"
diff/diffcore-rename.c renamed from diffcore-rename.c +2 -2
similarity index 99%
rename from diffcore-rename.c
rename to diff/diffcore-rename.c
index 68abf77c4d..16746444d8 100644
@@ -6,8 +6,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "odb/object-file.h"
 #include "hashmap.h"
 #include "mem-pool.h"
diff/diffcore-rotate.c renamed from diffcore-rotate.c +2 -2
similarity index 95%
rename from diffcore-rotate.c
rename to diff/diffcore-rotate.c
index 67b591261a..a55d954092 100644
@@ -5,8 +5,8 @@
 
 #include "git-compat-util.h"
 #include "gettext.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 
 void diffcore_rotate(struct diff_options *opt)
 {
diff/diffcore.h renamed from diffcore.h +0 -0
similarity index 100%
rename from diffcore.h
rename to diff/diffcore.h
diff/patch-ids.c renamed from patch-ids.c +2 -2
similarity index 98%
rename from patch-ids.c
rename to diff/patch-ids.c
index 946744e7d9..de4e5702ed 100644
@@ -1,9 +1,9 @@
 #include "git-compat-util.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/commit.h"
 #include "odb/hash.h"
 #include "hex.h"
-#include "patch-ids.h"
+#include "diff/patch-ids.h"
 
 static int patch_id_defined(struct commit *commit)
 {
diff/patch-ids.h renamed from patch-ids.h +1 -1
similarity index 98%
rename from patch-ids.h
rename to diff/patch-ids.h
index 57534ee722..47291160ec 100644
@@ -1,7 +1,7 @@
 #ifndef PATCH_IDS_H
 #define PATCH_IDS_H
 
-#include "diff.h"
+#include "diff/diff.h"
 #include "hashmap.h"
 
 struct commit;
diff/range-diff.c renamed from range-diff.c +4 -4
similarity index 99%
rename from range-diff.c
rename to diff/range-diff.c
index be9f872396..2177b8ba2d 100644
@@ -4,20 +4,20 @@
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
-#include "range-diff.h"
+#include "diff/range-diff.h"
 #include "odb/object-name.h"
 #include "string-list.h"
 #include "run-command.h"
 #include "strvec.h"
 #include "hashmap.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "linear-assignment.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "odb/commit.h"
 #include "pager.h"
 #include "pretty.h"
 #include "repository.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "apply.h"
 #include "revision.h"
 
diff/range-diff.h renamed from range-diff.h +1 -1
similarity index 98%
rename from range-diff.h
rename to diff/range-diff.h
index 9b70a80009..23aae59192 100644
@@ -1,7 +1,7 @@
 #ifndef RANGE_DIFF_H
 #define RANGE_DIFF_H
 
-#include "diff.h"
+#include "diff/diff.h"
 #include "strvec.h"
 
 #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60
diff/tree-diff.c renamed from tree-diff.c +2 -2
similarity index 99%
rename from tree-diff.c
rename to diff/tree-diff.c
index b33c45b696..4b7c90f6db 100644
@@ -5,8 +5,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "odb/hash.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
diff/userdiff.c renamed from userdiff.c +1 -1
similarity index 99%
rename from userdiff.c
rename to diff/userdiff.c
index 7129bf1482..8993b622c1 100644
@@ -3,7 +3,7 @@
 
 #include "git-compat-util.h"
 #include "config.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "attr.h"
 #include "strbuf.h"
 #include "environment.h"
diff/userdiff.h renamed from userdiff.h +0 -0
similarity index 100%
rename from userdiff.h
rename to diff/userdiff.h
diff/xdiff-interface.c renamed from xdiff-interface.c +1 -1
similarity index 99%
rename from xdiff-interface.c
rename to diff/xdiff-interface.c
index af18a34ba0..2c87316caa 100644
@@ -7,7 +7,7 @@
 #include "hex.h"
 #include "odb/odb.h"
 #include "strbuf.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "xdiff/xtypes.h"
 #include "xdiff/xdiffi.h"
 #include "xdiff/xutils.h"
diff/xdiff-interface.h renamed from xdiff-interface.h +0 -0
similarity index 100%
rename from xdiff-interface.h
rename to diff/xdiff-interface.h
fmt-merge-msg.c +2 -2
index 7fa8c4cd79..34f769ae9f 100644
@@ -7,8 +7,8 @@
 #include "refs/refs.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
-#include "diff.h"
-#include "diff-merges.h"
+#include "diff/diff.h"
+#include "diff/diff-merges.h"
 #include "hex.h"
 #include "revision.h"
 #include "odb/tag.h"
graph.h +1 -1
index 1193711fb8..84a5a4b822 100644
@@ -1,6 +1,6 @@
 #ifndef GRAPH_H
 #define GRAPH_H
-#include "diff.h"
+#include "diff/diff.h"
 
 /**
  * The graph API is used to draw a text-based representation of the commit
grep.c +4 -4
index 5041c388b9..88c87ba1c9 100644
@@ -7,10 +7,10 @@
 #include "hex.h"
 #include "odb/odb.h"
 #include "pretty.h"
-#include "userdiff.h"
-#include "xdiff-interface.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/userdiff.h"
+#include "diff/xdiff-interface.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "quote.h"
 #include "help.h"
 
grep.h +1 -1
index 13e26a9318..7881f28587 100644
@@ -24,7 +24,7 @@ typedef int pcre2_general_context;
 #define PCRE2_MATCH_INVALID_UTF 0
 #endif
 #include "thread-utils.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 
 struct repository;
 
http-push.c +1 -1
index 88a8417ea4..6d38410ccb 100644
@@ -8,7 +8,7 @@
 #include "odb/tag.h"
 #include "odb/blob.h"
 #include "http.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "remote.h"
 #include "list-objects.h"
line-log.c +3 -3
index 343159d90a..78697cb377 100644
@@ -1,17 +1,17 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "line-range.h"
 #include "hex.h"
 #include "odb/tag.h"
 #include "odb/tree.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/commit.h"
 #include "decorate.h"
 #include "repository.h"
 #include "revision.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "strbuf.h"
 #include "line-log.h"
 #include "setup.h"
line-log.h +1 -1
index 99e1755ce3..3a72d84698 100644
@@ -1,7 +1,7 @@
 #ifndef LINE_LOG_H
 #define LINE_LOG_H
 
-#include "diffcore.h" /* struct range, struct range_set */
+#include "diff/diffcore.h" /* struct range, struct range_set */
 
 struct rev_info;
 struct commit;
line-range.c +2 -2
index b99f0d9895..1dbf761ecc 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "line-range.h"
-#include "xdiff-interface.h"
-#include "userdiff.h"
+#include "diff/xdiff-interface.h"
+#include "diff/userdiff.h"
 
 /*
  * Parse one item in the -L option
list-objects-filter.c +1 -1
index a34e07c061..a011cef0b5 100644
@@ -5,7 +5,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "list-objects-filter.h"
 #include "list-objects-filter-options.h"
list-objects.c +1 -1
index 1db5ba29b5..6b67f0f927 100644
@@ -7,7 +7,7 @@
 #include "hex.h"
 #include "odb/tree.h"
 #include "odb/blob.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/tree-walk.h"
 #include "revision.h"
 #include "list-objects.h"
log-tree.c +3 -3
index 116bb7ea68..ddeafedb45 100644
@@ -5,8 +5,8 @@
 #include "commit-reach.h"
 #include "odb/commit-slab.h"
 #include "config.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "environment.h"
 #include "hex.h"
 #include "odb/object-name.h"
@@ -28,7 +28,7 @@
 #include "sequencer.h"
 #include "line-log.h"
 #include "help.h"
-#include "range-diff.h"
+#include "diff/range-diff.h"
 #include "strmap.h"
 #include "odb/tree.h"
 #include "wildmatch.h"
merge-ll.c +1 -1
index ef5287dee8..2aa45bfa90 100644
@@ -11,7 +11,7 @@
 #include "config.h"
 #include "convert.h"
 #include "attr.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "run-command.h"
 #include "merge-ll.h"
 #include "quote.h"
merge-ort.c +3 -3
index a12bf62a3d..61fb855500 100644
@@ -27,8 +27,8 @@
 #include "odb/commit.h"
 #include "commit-reach.h"
 #include "config.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
@@ -51,7 +51,7 @@
 #include "trace2.h"
 #include "odb/tree.h"
 #include "unpack-trees.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 
 /*
  * We technically need USE_THE_REPOSITORY_VARIABLE above for DEFAULT_ABBREV,
meson.build +16 -16
index 238beb0dfd..87060ff883 100644
@@ -333,7 +333,7 @@ libgit_sources = [
   'pack/chunk-format.c',
   'color.c',
   'column.c',
-  'combine-diff.c',
+  'diff/combine-diff.c',
   'pack/commit-graph.c',
   'commit-reach.c',
   'odb/commit.c',
@@ -353,16 +353,16 @@ libgit_sources = [
   'pack/delta-islands.c',
   'diagnose.c',
   'pack/diff-delta.c',
-  'diff-merges.c',
-  'diff-lib.c',
-  'diff-no-index.c',
-  'diff.c',
-  'diffcore-break.c',
-  'diffcore-delta.c',
-  'diffcore-order.c',
-  'diffcore-pickaxe.c',
-  'diffcore-rename.c',
-  'diffcore-rotate.c',
+  'diff/diff-merges.c',
+  'diff/diff-lib.c',
+  'diff/diff-no-index.c',
+  'diff/diff.c',
+  'diff/diffcore-break.c',
+  'diff/diffcore-delta.c',
+  'diff/diffcore-order.c',
+  'diff/diffcore-pickaxe.c',
+  'diff/diffcore-rename.c',
+  'diff/diffcore-rotate.c',
   'dir-iterator.c',
   'dir.c',
   'editor.c',
@@ -462,7 +462,7 @@ libgit_sources = [
   'parse-options-cb.c',
   'parse-options.c',
   'pack/patch-delta.c',
-  'patch-ids.c',
+  'diff/patch-ids.c',
   'path.c',
   'path-walk.c',
   'pathspec.c',
@@ -478,7 +478,7 @@ libgit_sources = [
   'pack/prune-packed.c',
   'pack/pseudo-merge.c',
   'quote.c',
-  'range-diff.c',
+  'diff/range-diff.c',
   'pack/reachable.c',
   'read-cache.c',
   'rebase-interactive.c',
@@ -565,7 +565,7 @@ libgit_sources = [
   'trailer.c',
   'transport-helper.c',
   'transport.c',
-  'tree-diff.c',
+  'diff/tree-diff.c',
   'odb/tree-walk.c',
   'odb/tree.c',
   'unpack-trees.c',
@@ -573,7 +573,7 @@ libgit_sources = [
   'url.c',
   'urlmatch.c',
   'usage.c',
-  'userdiff.c',
+  'diff/userdiff.c',
   'utf8.c',
   'version.c',
   'versioncmp.c',
@@ -584,7 +584,7 @@ libgit_sources = [
   'write-or-die.c',
   'ws.c',
   'wt-status.c',
-  'xdiff-interface.c',
+  'diff/xdiff-interface.c',
   'xdiff/xdiffi.c',
   'xdiff/xemit.c',
   'xdiff/xhistogram.c',
notes-merge.c +3 -3
index 72a3b9479c..ff14b7dfcc 100644
@@ -11,10 +11,10 @@
 #include "odb/odb.h"
 #include "path.h"
 #include "repository.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "hex.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "merge-ll.h"
 #include "dir.h"
 #include "notes.h"
odb/commit.c +1 -1
index 06daa8c6a0..b78cd28013 100644
@@ -11,7 +11,7 @@
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "utf8.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "notes.h"
 #include "odb/alloc.h"
pack/bloom.c +2 -2
index 874e011530..3fdbbf3aba 100644
@@ -2,8 +2,8 @@
 
 #include "git-compat-util.h"
 #include "pack/bloom.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "hashmap.h"
 #include "pack/commit-graph.h"
 #include "odb/commit.h"
pack/delta-islands.c +1 -1
index 3d015719a5..7c48204384 100644
@@ -9,7 +9,7 @@
 #include "odb/tree.h"
 #include "pack/pack.h"
 #include "odb/tree-walk.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "progress.h"
 #include "refs/refs.h"
 #include "khash.h"
pack/pack-bitmap-write.c +1 -1
index 6ef5fb4629..22ee370bde 100644
@@ -6,7 +6,7 @@
 #include "hex.h"
 #include "odb/odb.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "progress.h"
 #include "pack/pack.h"
pack/pack-bitmap.c +1 -1
index 80f853f355..3adb5d0563 100644
@@ -6,7 +6,7 @@
 #include "hex.h"
 #include "strbuf.h"
 #include "odb/tag.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "progress.h"
 #include "list-objects.h"
pack/reachable.c +1 -1
index 51c13b552f..7989f7327a 100644
@@ -6,7 +6,7 @@
 #include "refs/refs.h"
 #include "odb/commit.h"
 #include "odb/blob.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "pack/reachable.h"
 #include "cache-tree.h"
pretty.c +1 -1
index 4575f3fde6..3444617506 100644
@@ -9,7 +9,7 @@
 #include "odb/hash.h"
 #include "hex.h"
 #include "utf8.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "pager.h"
 #include "revision.h"
 #include "string-list.h"
read-cache.c +2 -2
index 148a93f10e..5bca3fda12 100644
@@ -10,8 +10,8 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "date.h"
-#include "diff.h"
-#include "diffcore.h"
+#include "diff/diff.h"
+#include "diff/diffcore.h"
 #include "hex.h"
 #include "tempfile.h"
 #include "lockfile.h"
refs/reflog-walk.c +1 -1
index 711b71be66..f9eee9a76f 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "odb/commit.h"
 #include "refs/refs.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "repository.h"
 #include "revision.h"
 #include "string-list.h"
remote.c +1 -1
index 39e9f58cba..c619009d30 100644
@@ -16,7 +16,7 @@
 #include "odb/odb.h"
 #include "path.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "dir.h"
 #include "setup.h"
rerere.c +1 -1
index 6ff20d0692..3055989a41 100644
@@ -12,7 +12,7 @@
 #include "string-list.h"
 #include "read-cache-ll.h"
 #include "rerere.h"
-#include "xdiff-interface.h"
+#include "diff/xdiff-interface.h"
 #include "dir.h"
 #include "resolve-undo.h"
 #include "merge-ll.h"
revision.c +3 -3
index f92a6482f1..249a1736fd 100644
@@ -14,15 +14,15 @@
 #include "odb/blob.h"
 #include "odb/tree.h"
 #include "odb/commit.h"
-#include "diff.h"
-#include "diff-merges.h"
+#include "diff/diff.h"
+#include "diff/diff-merges.h"
 #include "refs/refs.h"
 #include "revision.h"
 #include "repository.h"
 #include "graph.h"
 #include "grep.h"
 #include "refs/reflog-walk.h"
-#include "patch-ids.h"
+#include "diff/patch-ids.h"
 #include "decorate.h"
 #include "string-list.h"
 #include "line-log.h"
revision.h +1 -1
index e0ff7aa0f2..64d9a47091 100644
@@ -7,7 +7,7 @@
 #include "odb/object-name.h"
 #include "odb/oidset.h"
 #include "pretty.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/commit-slab-decl.h"
 #include "decorate.h"
 #include "ident.h"
sequencer.c +1 -1
index d13721ab1f..551e4529c4 100644
@@ -22,7 +22,7 @@
 #include "hook.h"
 #include "utf8.h"
 #include "cache-tree.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "path.h"
 #include "revision.h"
 #include "rerere.h"
shallow.c +1 -1
index daa6db8e0d..fa16834aff 100644
@@ -12,7 +12,7 @@
 #include "refs/refs.h"
 #include "odb/oid-array.h"
 #include "path.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "odb/commit-slab.h"
 #include "list-objects.h"
submodule.c +2 -2
index 32af65e6b8..a9137aa180 100644
@@ -8,14 +8,14 @@
 #include "submodule-config.h"
 #include "submodule.h"
 #include "dir.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "odb/commit.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "revision.h"
 #include "run-command.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "refs/refs.h"
 #include "string-list.h"
 #include "odb/oid-array.h"
t/helper/test-revision-walking.c +1 -1
index 1b7f569f01..7c66b8566f 100644
@@ -12,7 +12,7 @@
 
 #include "test-tool.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "line-log.h"
 #include "odb/object-name.h"
 #include "repository.h"
t/helper/test-userdiff.c +1 -1
index fc34c589b3..ee829e0868 100644
@@ -2,7 +2,7 @@
 
 #include "test-tool.h"
 #include "setup.h"
-#include "userdiff.h"
+#include "diff/userdiff.h"
 #include "config.h"
 
 static int driver_cb(struct userdiff_driver *driver,
upload-pack.c +1 -1
index d145a89c7b..acd381ebf1 100644
@@ -14,7 +14,7 @@
 #include "odb/oid-array.h"
 #include "odb/object.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "revision.h"
 #include "list-objects-filter-options.h"
 #include "run-command.h"
wt-status.c +2 -2
index 708366b973..28a0c72a51 100644
@@ -7,7 +7,7 @@
 #include "odb/object.h"
 #include "dir.h"
 #include "odb/commit.h"
-#include "diff.h"
+#include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
@@ -15,7 +15,7 @@
 #include "odb/object-name.h"
 #include "path.h"
 #include "revision.h"
-#include "diffcore.h"
+#include "diff/diffcore.h"
 #include "quote.h"
 #include "repository.h"
 #include "run-command.h"
Signature · 1 line
2.54.0
#14 lore raw

RFC PATCH 11/14 revision: gather the revision sources under revision/

In reply to Michael Montalbo

Move the 14 revision C sources and 15 headers into revision/ as renames. Repoint every reference to their old paths to the new ones: the #include lines across the tree, the Makefile and meson.build build entries, and the tutorial #include examples.

---
 .gitorganize                                  | 58 +++++++++----------
 Documentation/MyFirstContribution.adoc        |  2 +-
 Documentation/MyFirstObjectWalk.adoc          |  6 +-
 Makefile                                      | 28 ++++-----
 add-interactive.c                             |  2 +-
 archive.c                                     |  2 +-
 attr.c                                        |  2 +-
 builtin/add.c                                 |  2 +-
 builtin/am.c                                  |  6 +-
 builtin/backfill.c                            |  2 +-
 builtin/bisect.c                              |  4 +-
 builtin/blame.c                               |  8 +--
 builtin/branch.c                              |  2 +-
 builtin/cat-file.c                            |  2 +-
 builtin/checkout.c                            |  2 +-
 builtin/clone.c                               |  2 +-
 builtin/commit.c                              |  6 +-
 builtin/describe.c                            |  4 +-
 builtin/diff-files.c                          |  2 +-
 builtin/diff-index.c                          |  2 +-
 builtin/diff-pairs.c                          |  2 +-
 builtin/diff-tree.c                           |  4 +-
 builtin/diff.c                                |  4 +-
 builtin/fast-export.c                         |  6 +-
 builtin/fast-import.c                         |  2 +-
 builtin/fetch.c                               |  6 +-
 builtin/gc.c                                  |  2 +-
 builtin/history.c                             |  4 +-
 builtin/last-modified.c                       |  2 +-
 builtin/log.c                                 |  8 +--
 builtin/merge-base.c                          |  2 +-
 builtin/merge-tree.c                          |  2 +-
 builtin/merge.c                               |  4 +-
 builtin/name-rev.c                            |  4 +-
 builtin/notes.c                               |  2 +-
 builtin/pack-objects.c                        | 10 ++--
 builtin/prune.c                               |  4 +-
 builtin/pull.c                                |  2 +-
 builtin/rebase.c                              |  4 +-
 builtin/receive-pack.c                        |  4 +-
 builtin/reflog.c                              |  2 +-
 builtin/remote.c                              |  2 +-
 builtin/repack.c                              |  2 +-
 builtin/replay.c                              |  2 +-
 builtin/repo.c                                |  4 +-
 builtin/reset.c                               |  2 +-
 builtin/rev-list.c                            | 14 ++---
 builtin/rev-parse.c                           |  8 +--
 builtin/revert.c                              |  2 +-
 builtin/shortlog.c                            |  2 +-
 builtin/show-branch.c                         |  2 +-
 builtin/stash.c                               |  4 +-
 builtin/submodule--helper.c                   |  4 +-
 builtin/tag.c                                 |  2 +-
 builtin/unpack-objects.c                      |  2 +-
 bundle.c                                      |  6 +-
 bundle.h                                      |  2 +-
 chdir-notify.c                                |  2 +-
 diff/combine-diff.c                           |  4 +-
 diff/diff-lib.c                               |  4 +-
 diff/diff-merges.c                            |  2 +-
 diff/diff-no-index.c                          |  2 +-
 diff/diff.c                                   |  4 +-
 diff/diffcore-pickaxe.c                       |  2 +-
 diff/range-diff.c                             |  4 +-
 fetch-pack.c                                  |  4 +-
 fetch-pack.h                                  |  2 +-
 fmt-merge-msg.c                               |  4 +-
 git.c                                         |  2 +-
 grep.c                                        |  2 +-
 http-push.c                                   |  6 +-
 http-walker.c                                 |  2 +-
 merge-ort.c                                   |  4 +-
 meson.build                                   | 28 ++++-----
 notes-cache.c                                 |  2 +-
 notes-merge.c                                 |  2 +-
 odb/commit.c                                  |  6 +-
 odb/object-name.c                             |  4 +-
 odb/source-packed.c                           |  2 +-
 pack/commit-graph.c                           |  2 +-
 pack/midx-write.c                             |  4 +-
 pack/pack-bitmap-write.c                      |  4 +-
 pack/pack-bitmap.c                            |  6 +-
 pack/packfile.c                               |  2 +-
 pack/packfile.h                               |  2 +-
 pack/reachable.c                              |  4 +-
 pack/repack.h                                 |  2 +-
 path-walk.c                                   |  6 +-
 read-cache.c                                  |  2 +-
 refs/files-backend.c                          |  2 +-
 refs/pack-refs.c                              |  2 +-
 refs/ref-filter.c                             |  4 +-
 refs/ref-filter.h                             |  2 +-
 refs/reflog-walk.c                            |  2 +-
 refs/reflog.c                                 |  2 +-
 remote.c                                      |  4 +-
 replay.c                                      |  2 +-
 bisect.c => revision/bisect.c                 | 10 ++--
 bisect.h => revision/bisect.h                 |  0
 blame.c => revision/blame.c                   |  4 +-
 blame.h => revision/blame.h                   |  0
 commit-reach.c => revision/commit-reach.c     |  6 +-
 commit-reach.h => revision/commit-reach.h     |  0
 decorate.c => revision/decorate.c             |  2 +-
 decorate.h => revision/decorate.h             |  0
 graph.c => revision/graph.c                   |  4 +-
 graph.h => revision/graph.h                   |  0
 line-log.c => revision/line-log.c             |  8 +--
 line-log.h => revision/line-log.h             |  0
 line-range.c => revision/line-range.c         |  2 +-
 line-range.h => revision/line-range.h         |  0
 .../list-objects-filter-options.c             |  2 +-
 .../list-objects-filter-options.h             |  0
 .../list-objects-filter.c                     |  6 +-
 .../list-objects-filter.h                     |  0
 list-objects.c => revision/list-objects.c     |  8 +--
 list-objects.h => revision/list-objects.h     |  0
 list.h => revision/list.h                     |  0
 log-tree.c => revision/log-tree.c             | 10 ++--
 log-tree.h => revision/log-tree.h             |  0
 pretty.c => revision/pretty.c                 |  4 +-
 pretty.h => revision/pretty.h                 |  0
 revision.c => revision/revision.c             | 16 ++---
 revision.h => revision/revision.h             |  6 +-
 shallow.c => revision/shallow.c               |  8 +--
 shallow.h => revision/shallow.h               |  0
 send-pack.c                                   |  2 +-
 sequencer.c                                   |  6 +-
 setup.c                                       |  2 +-
 submodule.c                                   |  4 +-
 t/helper/test-path-walk.c                     |  6 +-
 t/helper/test-reach.c                         |  2 +-
 t/helper/test-ref-store.c                     |  2 +-
 t/helper/test-revision-walking.c              |  4 +-
 t/unit-tests/u-example-decorate.c             |  2 +-
 t/unit-tests/u-list-objects-filter-options.c  |  2 +-
 tempfile.h                                    |  2 +-
 trailer.c                                     |  2 +-
 trailer.h                                     |  2 +-
 transport.h                                   |  2 +-
 upload-pack.c                                 |  8 +--
 wt-status.c                                   |  2 +-
 142 files changed, 289 insertions(+), 289 deletions(-)
 rename bisect.c => revision/bisect.c (99%)
 rename bisect.h => revision/bisect.h (100%)
 rename blame.c => revision/blame.c (99%)
 rename blame.h => revision/blame.h (100%)
 rename commit-reach.c => revision/commit-reach.c (99%)
 rename commit-reach.h => revision/commit-reach.h (100%)
 rename decorate.c => revision/decorate.c (98%)
 rename decorate.h => revision/decorate.h (100%)
 rename graph.c => revision/graph.c (99%)
 rename graph.h => revision/graph.h (100%)
 rename line-log.c => revision/line-log.c (99%)
 rename line-log.h => revision/line-log.h (100%)
 rename line-range.c => revision/line-range.c (99%)
 rename line-range.h => revision/line-range.h (100%)
 rename list-objects-filter-options.c => revision/list-objects-filter-options.c (99%)
 rename list-objects-filter-options.h => revision/list-objects-filter-options.h (100%)
 rename list-objects-filter.c => revision/list-objects-filter.c (99%)
 rename list-objects-filter.h => revision/list-objects-filter.h (100%)
 rename list-objects.c => revision/list-objects.c (98%)
 rename list-objects.h => revision/list-objects.h (100%)
 rename list.h => revision/list.h (100%)
 rename log-tree.c => revision/log-tree.c (99%)
 rename log-tree.h => revision/log-tree.h (100%)
 rename pretty.c => revision/pretty.c (99%)
 rename pretty.h => revision/pretty.h (100%)
 rename revision.c => revision/revision.c (99%)
 rename revision.h => revision/revision.h (99%)
 rename shallow.c => revision/shallow.c (99%)
 rename shallow.h => revision/shallow.h (100%)
.gitorganize +29 -29
index 160365fbca..d62d0a2240 100644
@@ -41,10 +41,6 @@ attr.h component=convert role=header prefix=attr cochange=convert:50,index:13,di
 banned.h component=? role=public prefix=banned
 base85.c component=? role=lib prefix=base85 cochange=diff:4,pack:2,convert:1,transport:1
 base85.h component=? role=public prefix=base85 cochange=diff:1
-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
-bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2
-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
-blame.h component=revision role=header prefix=blame includes=diff:1,odb:1 cochange=revision:19,odb:7,diff:4,archive:1,index:1
 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
 branch.h component=? role=public prefix=branch cochange=setup:8,refs:4,submodule:4
 builtin.h component=? role=public prefix=builtin includes=setup:1 cochange=diff:15,index:15,transport:12,odb:6,notes:5
@@ -62,8 +58,6 @@ color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,inde
 color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1
 column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2
 column.h component=? role=public prefix=column
-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
-commit-reach.h component=revision role=header prefix=commit-reach includes=odb:2 cochange=revision:32,odb:9,transport:8,pack:3,refs:3
 common-exit.c component=? role=lib prefix=common-main
 common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1
 common-init.h component=? role=public prefix=common-main
@@ -86,8 +80,6 @@ ctype.c component=? role=lib prefix=ctype cochange=setup:3,index:2,odb:1,pack:1,
 daemon.c component=? role=program prefix=daemon includes=setup:3,transport:2 cochange=transport:77,index:14,setup:13,diff:7,refs:5
 date.c component=? role=lib prefix=date cochange=revision:17,odb:16,refs:14,setup:9,diff:7
 date.h component=? role=public prefix=date cochange=refs:7,revision:4,setup:2,archive:1,odb:1
-decorate.c component=revision role=lib prefix=decorate includes=odb:1,revision:1 cochange=diff:6,odb:5,revision:5,pack:2,transport:2
-decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1
 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
 diagnose.h component=? role=public prefix=diagnose cochange=revision:2,refs:1,transport:1
 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
@@ -152,8 +144,6 @@ git-zlib.h component=? role=public prefix=git-zlib cochange=archive:3,setup:2,od
 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
 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
 gpg-interface.h component=? role=public prefix=gpg-interface cochange=odb:22,revision:15,merge:4,transport:3,refs:1
-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
-graph.h component=revision role=header prefix=graph includes=diff:1 cochange=revision:19,diff:2,odb:1
 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
 grep.h component=? role=public prefix=grep includes=diff:1 cochange=revision:23,diff:10,transport:4,index:2,refs:2
 hashmap.c component=? role=lib prefix=hashmap cochange=diff:33,revision:19,index:17,refs:13,submodule:13
@@ -183,23 +173,10 @@ kwset.c component=? role=lib prefix=kwset cochange=convert:2,diff:1,pack:1,revis
 kwset.h component=? role=public prefix=kwset
 levenshtein.c component=? role=lib prefix=? cochange=diff:2,revision:2,odb:1
 levenshtein.h component=? role=public prefix=? cochange=transport:2,diff:1,refs:1,setup:1
-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
-line-log.h component=revision role=header prefix=line-log includes=diff:1 cochange=revision:20,odb:3,diff:2,setup:1,submodule:1
-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
-line-range.h component=revision role=header prefix=line-range cochange=revision:13
 linear-assignment.c component=? role=lib prefix=linear-assignment cochange=diff:1,revision:1
 linear-assignment.h component=? role=public prefix=linear-assignment
-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
-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
-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
-list-objects-filter.h component=revision role=header prefix=list-objects cochange=revision:16,odb:1
-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
-list-objects.h component=revision role=header prefix=list-objects cochange=revision:32,pack:13,transport:4,odb:1
-list.h component=revision role=header prefix=list cochange=submodule:2,transport:2,index:1,revision:1
 lockfile.c component=? role=lib prefix=lockfile includes=setup:1 cochange=refs:18,index:13,setup:9,diff:8,merge:3
 lockfile.h component=? role=public prefix=lockfile cochange=index:5,revision:4,diff:3,refs:3,odb:2
-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
-log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2
 mailinfo.c component=? role=lib prefix=mailinfo includes=setup:2 cochange=transport:5,index:3,notes:3,odb:3,revision:3
 mailinfo.h component=? role=public prefix=mailinfo
 mailmap.c component=? role=lib prefix=mailmap includes=setup:3,odb:2 cochange=setup:13,transport:11,refs:10,index:8,revision:5
@@ -340,8 +317,6 @@ pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 coc
 pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1
 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
 preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1
-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
-pretty.h component=revision role=header prefix=pretty cochange=revision:26,refs:7,diff:5,odb:5,archive:4
 prio-queue.c component=? role=lib prefix=prio-queue cochange=odb:5,revision:5,diff:2,pack:2,transport:2
 prio-queue.h component=? role=public prefix=prio-queue cochange=odb:3,revision:2,transport:2,pack:1
 progress.c component=? role=lib prefix=progress includes=setup:1 cochange=index:11,diff:6,setup:6,pack:4,revision:2
@@ -394,8 +369,35 @@ reset.c component=? role=lib prefix=reset includes=odb:3,index:2,refs:1,setup:1
 reset.h component=? role=public prefix=reset includes=odb:1,setup:1
 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
 resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1
-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
-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
+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
+revision/bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2
+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
+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
+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
+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
+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
+revision/decorate.h component=revision role=header prefix=decorate cochange=revision:4,odb:1
+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
+revision/graph.h component=revision role=header prefix=graph includes=diff:1 cochange=revision:19,diff:2,odb:1
+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
+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
+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
+revision/line-range.h component=revision role=header prefix=line-range cochange=revision:13
+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
+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
+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
+revision/list-objects-filter.h component=revision role=header prefix=list-objects cochange=revision:16,odb:1
+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
+revision/list-objects.h component=revision role=header prefix=list-objects cochange=revision:32,pack:13,transport:4,odb:1
+revision/list.h component=revision role=header prefix=list cochange=submodule:2,transport:2,index:1,revision:1
+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
+revision/log-tree.h component=revision role=header prefix=format-patch cochange=revision:64,diff:11,refs:3,odb:2,transport:2
+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
+revision/pretty.h component=revision role=header prefix=pretty cochange=revision:26,refs:7,diff:5,odb:5,archive:4
+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
+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
+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
+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
 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
 run-command.h component=? role=public prefix=run-command cochange=transport:21,setup:8,odb:6,submodule:5,refs:4
 sane-ctype.h component=? role=public prefix=sane-ctype
@@ -411,8 +413,6 @@ setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:
 sh-i18n--envsubst.c component=? role=program prefix=sh-i18n--envsubst cochange=index:3,diff:1,transport:1
 sha1dc_git.c component=? role=lib prefix=sha1dc cochange=diff:3,odb:2,revision:2,setup:1
 sha1dc_git.h component=? role=public prefix=sha1dc cochange=odb:2
-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
-shallow.h component=revision role=header prefix=shallow includes=odb:2,setup:1 cochange=revision:10,transport:7,odb:5,diff:3,index:2
 shell.c component=? role=program prefix=shell includes=setup:1 cochange=transport:10,setup:4,revision:2
 shortlog.h component=? role=public prefix=shortlog cochange=revision:2
 sideband.c component=transport role=lib prefix=sideband includes=transport:2,setup:1 cochange=transport:51,revision:6,diff:5,index:5,refs:4
Documentation/MyFirstContribution.adoc +1 -1
index 4b50aaa40e..2da56ca8fc 100644
@@ -429,7 +429,7 @@ Add the following includes:
 
 ----
 #include "odb/commit.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "strbuf.h"
 ----
 
Documentation/MyFirstObjectWalk.adoc +3 -3
index 87b2433b2c..7fb63e6861 100644
@@ -259,7 +259,7 @@ Add the `struct rev_info` and the `repo_init_revisions()` call.
 We'll also need to include the `revision.h` header:
 
 ----
-#include "revision.h"
+#include "revision/revision.h"
 
 ...
 
@@ -359,7 +359,7 @@ the walk loop below the `prepare_revision_walk()` call within your
 `walken_commit_walk()`:
 
 ----
-#include "pretty.h"
+#include "revision/pretty.h"
 
 ...
 
@@ -668,7 +668,7 @@ Complete your implementation of `walken_object_walk()`.
 We'll also need to include the `list-objects.h` header.
 
 ----
-#include "list-objects.h"
+#include "revision/list-objects.h"
 
 ...
 
Makefile +14 -14
index b96345ba0c..74013e8380 100644
@@ -1110,8 +1110,8 @@ LIB_OBJS += archive-zip.o
 LIB_OBJS += archive.o
 LIB_OBJS += attr.o
 LIB_OBJS += base85.o
-LIB_OBJS += bisect.o
-LIB_OBJS += blame.o
+LIB_OBJS += revision/bisect.o
+LIB_OBJS += revision/blame.o
 LIB_OBJS += odb/blob.o
 LIB_OBJS += pack/bloom.o
 LIB_OBJS += branch.o
@@ -1126,7 +1126,7 @@ LIB_OBJS += color.o
 LIB_OBJS += column.o
 LIB_OBJS += diff/combine-diff.o
 LIB_OBJS += pack/commit-graph.o
-LIB_OBJS += commit-reach.o
+LIB_OBJS += revision/commit-reach.o
 LIB_OBJS += odb/commit.o
 LIB_OBJS += common-exit.o
 LIB_OBJS += common-init.o
@@ -1144,7 +1144,7 @@ LIB_OBJS += credential.o
 LIB_OBJS += csum-file.o
 LIB_OBJS += ctype.o
 LIB_OBJS += date.o
-LIB_OBJS += decorate.o
+LIB_OBJS += revision/decorate.o
 LIB_OBJS += pack/delta-islands.o
 LIB_OBJS += diagnose.o
 LIB_OBJS += pack/diff-delta.o
@@ -1179,7 +1179,7 @@ LIB_OBJS += fsmonitor-settings.o
 LIB_OBJS += gettext.o
 LIB_OBJS += git-zlib.o
 LIB_OBJS += gpg-interface.o
-LIB_OBJS += graph.o
+LIB_OBJS += revision/graph.o
 LIB_OBJS += grep.o
 LIB_OBJS += odb/hash-lookup.o
 LIB_OBJS += odb/hash.o
@@ -1192,14 +1192,14 @@ LIB_OBJS += ident.o
 LIB_OBJS += json-writer.o
 LIB_OBJS += kwset.o
 LIB_OBJS += levenshtein.o
-LIB_OBJS += line-log.o
-LIB_OBJS += line-range.o
+LIB_OBJS += revision/line-log.o
+LIB_OBJS += revision/line-range.o
 LIB_OBJS += linear-assignment.o
-LIB_OBJS += list-objects-filter-options.o
-LIB_OBJS += list-objects-filter.o
-LIB_OBJS += list-objects.o
+LIB_OBJS += revision/list-objects-filter-options.o
+LIB_OBJS += revision/list-objects-filter.o
+LIB_OBJS += revision/list-objects.o
 LIB_OBJS += lockfile.o
-LIB_OBJS += log-tree.o
+LIB_OBJS += revision/log-tree.o
 LIB_OBJS += odb/loose.o
 LIB_OBJS += refs/ls-refs.o
 LIB_OBJS += mailinfo.o
@@ -1263,7 +1263,7 @@ LIB_OBJS += path-walk.o
 LIB_OBJS += pathspec.o
 LIB_OBJS += pkt-line.o
 LIB_OBJS += preload-index.o
-LIB_OBJS += pretty.o
+LIB_OBJS += revision/pretty.o
 LIB_OBJS += prio-queue.o
 LIB_OBJS += progress.o
 LIB_OBJS += promisor-remote.o
@@ -1317,14 +1317,14 @@ LIB_OBJS += repository.o
 LIB_OBJS += rerere.o
 LIB_OBJS += reset.o
 LIB_OBJS += resolve-undo.o
-LIB_OBJS += revision.o
+LIB_OBJS += revision/revision.o
 LIB_OBJS += run-command.o
 LIB_OBJS += send-pack.o
 LIB_OBJS += sequencer.o
 LIB_OBJS += serve.o
 LIB_OBJS += pack/server-info.o
 LIB_OBJS += setup.o
-LIB_OBJS += shallow.o
+LIB_OBJS += revision/shallow.o
 LIB_OBJS += sideband.o
 LIB_OBJS += sigchain.o
 LIB_OBJS += sparse-index.o
add-interactive.c +1 -1
index f656db231c..7bfc410361 100644
@@ -10,7 +10,7 @@
 #include "preload-index.h"
 #include "read-cache-ll.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "refs/refs.h"
 #include "string-list.h"
 #include "lockfile.h"
archive.c +1 -1
index 53820bd859..a2402fb7e6 100644
@@ -11,7 +11,7 @@
 #include "hex.h"
 #include "odb/object-name.h"
 #include "path.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "setup.h"
 #include "refs/refs.h"
 #include "odb/odb.h"
attr.c +1 -1
index e7c6562bee..e7d364d490 100644
@@ -21,7 +21,7 @@
 #include "quote.h"
 #include "read-cache-ll.h"
 #include "refs/refs.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "odb/odb.h"
 #include "setup.h"
 #include "thread-utils.h"
builtin/add.c +1 -1
index dd5e33c7b0..4dbdccd928 100644
@@ -22,7 +22,7 @@
 #include "preload-index.h"
 #include "diff/diff.h"
 #include "read-cache.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "strvec.h"
 #include "submodule.h"
 #include "add-interactive.h"
builtin/am.c +3 -3
index 7bd7fde14b..5dbe1f171b 100644
@@ -30,9 +30,9 @@
 #include "odb/object-name.h"
 #include "preload-index.h"
 #include "sequencer.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "merge-ort-wrappers.h"
-#include "log-tree.h"
+#include "revision/log-tree.h"
 #include "notes-utils.h"
 #include "rerere.h"
 #include "mailinfo.h"
@@ -40,7 +40,7 @@
 #include "string-list.h"
 #include "pager.h"
 #include "path.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 
 /**
  * Returns the length of the first line of msg.
builtin/backfill.c +1 -1
index c42226d3e8..d2ef39bc58 100644
@@ -19,7 +19,7 @@
 #include "promisor-remote.h"
 #include "strmap.h"
 #include "string-list.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "trace2.h"
 #include "progress.h"
 #include "pack/packfile.h"
builtin/bisect.c +2 -2
index 51e2e949cc..cfb0741d22 100644
@@ -8,7 +8,7 @@
 #include "hex.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
-#include "bisect.h"
+#include "revision/bisect.h"
 #include "refs/refs.h"
 #include "strvec.h"
 #include "run-command.h"
@@ -16,7 +16,7 @@
 #include "path.h"
 #include "prompt.h"
 #include "quote.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
 static GIT_PATH_FUNC(git_path_bisect_ancestors_ok, "BISECT_ANCESTORS_OK")
builtin/blame.c +4 -4
index cb9f8b4ff0..9e5776e31b 100644
@@ -15,7 +15,7 @@
 #include "hex.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "quote.h"
 #include "string-list.h"
 #include "mailmap.h"
@@ -23,13 +23,13 @@
 #include "prio-queue.h"
 #include "utf8.h"
 #include "diff/userdiff.h"
-#include "line-range.h"
-#include "line-log.h"
+#include "revision/line-range.h"
+#include "revision/line-log.h"
 #include "progress.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "pager.h"
-#include "blame.h"
+#include "revision/blame.h"
 #include "refs/refs.h"
 #include "setup.h"
 #include "odb/tag.h"
builtin/branch.c +1 -1
index 7909f250aa..c80df76d36 100644
@@ -28,7 +28,7 @@
 #include "refs/worktree.h"
 #include "help.h"
 #include "advice.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 
 static const char * const builtin_branch_usage[] = {
 	N_("git branch [<options>] [-r | -a] [--merged] [--no-merged] [(--forked <branch>)...]"),
builtin/cat-file.c +1 -1
index 4fd1999f80..94979a2683 100644
@@ -15,7 +15,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "ident.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "parse-options.h"
 #include "diff/userdiff.h"
 #include "odb/oid-array.h"
builtin/checkout.c +1 -1
index c35c3d92d1..286fcdc1ba 100644
@@ -28,7 +28,7 @@
 #include "remote.h"
 #include "repo-settings.h"
 #include "resolve-undo.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "sequencer.h"
 #include "setup.h"
 #include "sparse-index.h"
builtin/clone.c +1 -1
index 7b5274e884..8ed07e1a15 100644
@@ -43,7 +43,7 @@
 #include "pack/packfile.h"
 #include "path.h"
 #include "pkt-line.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "hook.h"
 #include "bundle.h"
 #include "bundle-uri.h"
builtin/commit.c +3 -3
index d2b4ecbd40..aa89e0dc52 100644
@@ -21,7 +21,7 @@
 #include "odb/commit.h"
 #include "add-interactive.h"
 #include "gettext.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "wt-status.h"
 #include "run-command.h"
 #include "strbuf.h"
@@ -39,9 +39,9 @@
 #include "sparse-index.h"
 #include "mailmap.h"
 #include "help.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "pack/commit-graph.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "trailer.h"
 
 static const char * const builtin_commit_usage[] = {
builtin/describe.c +2 -2
index ff44b55e9e..bbeba1e465 100644
@@ -13,14 +13,14 @@
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "read-cache-ll.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "diff/diff.h"
 #include "hashmap.h"
 #include "setup.h"
 #include "strvec.h"
 #include "run-command.h"
 #include "odb/odb.h"
-#include "list-objects.h"
+#include "revision/list-objects.h"
 #include "odb/commit-slab.h"
 #include "wildmatch.h"
 #include "prio-queue.h"
builtin/diff-files.c +1 -1
index 39eaf9cfce..d1e8d2b462 100644
@@ -13,7 +13,7 @@
 #include "diff/diff-merges.h"
 #include "odb/commit.h"
 #include "preload-index.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 static const char diff_files_usage[] =
 "git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]"
builtin/diff-index.c +1 -1
index 799f5533ad..f3b2eadda0 100644
@@ -7,7 +7,7 @@
 #include "diff/diff-merges.h"
 #include "odb/commit.h"
 #include "preload-index.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "setup.h"
 
 static const char diff_cache_usage[] =
builtin/diff-pairs.c +1 -1
index e3350b2915..df5630be47 100644
@@ -7,7 +7,7 @@
 #include "hex.h"
 #include "odb/object.h"
 #include "parse-options.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "strbuf.h"
 
 static unsigned parse_mode_or_die(const char *mode, const char **end)
builtin/diff-tree.c +2 -2
index 8f2103013c..2bd5ed4004 100644
@@ -6,9 +6,9 @@
 #include "odb/commit.h"
 #include "gettext.h"
 #include "hex.h"
-#include "log-tree.h"
+#include "revision/log-tree.h"
 #include "read-cache-ll.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "odb/tmp-objdir.h"
 #include "odb/tree.h"
 
builtin/diff.c +2 -2
index 774c12cea6..e4487901d3 100644
@@ -20,8 +20,8 @@
 #include "diff/diffcore.h"
 #include "preload-index.h"
 #include "read-cache-ll.h"
-#include "revision.h"
-#include "log-tree.h"
+#include "revision/revision.h"
+#include "revision/log-tree.h"
 #include "setup.h"
 #include "odb/oid-array.h"
 #include "odb/tree.h"
builtin/fast-export.c +3 -3
index 6683d49660..565cdccb40 100644
@@ -21,9 +21,9 @@
 #include "odb/tag.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
-#include "log-tree.h"
-#include "revision.h"
-#include "decorate.h"
+#include "revision/log-tree.h"
+#include "revision/revision.h"
+#include "revision/decorate.h"
 #include "string-list.h"
 #include "utf8.h"
 #include "parse-options.h"
builtin/fast-import.c +1 -1
index 3b7d650e24..f3af94307f 100644
@@ -26,7 +26,7 @@
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "mem-pool.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "khash.h"
 #include "date.h"
 #include "gpg-interface.h"
builtin/fetch.c +3 -3
index b14b96ce5c..2f744ac8b8 100644
@@ -32,12 +32,12 @@
 #include "pager.h"
 #include "path.h"
 #include "pkt-line.h"
-#include "list-objects-filter-options.h"
-#include "commit-reach.h"
+#include "revision/list-objects-filter-options.h"
+#include "revision/commit-reach.h"
 #include "branch.h"
 #include "promisor-remote.h"
 #include "pack/commit-graph.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "trace.h"
 #include "trace2.h"
 #include "bundle-uri.h"
builtin/gc.c +1 -1
index bdf3d43108..c340489c64 100644
@@ -34,7 +34,7 @@
 #include "path.h"
 #include "refs/reflog.h"
 #include "rerere.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "refs/refs.h"
 #include "remote.h"
 #include "exec-cmd.h"
builtin/history.c +2 -2
index 56b5015bc0..73a31ce152 100644
@@ -3,7 +3,7 @@
 #include "builtin.h"
 #include "cache-tree.h"
 #include "odb/commit.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "config.h"
 #include "editor.h"
 #include "environment.h"
@@ -18,7 +18,7 @@
 #include "refs/refs.h"
 #include "replay.h"
 #include "reset.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "sequencer.h"
 #include "strvec.h"
 #include "odb/tree.h"
builtin/last-modified.c +1 -1
index 911441a321..88e122db9b 100644
@@ -17,7 +17,7 @@
 #include "prio-queue.h"
 #include "quote.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 /* Remember to update object flag allocation in object.h */
 #define PARENT1 (1u<<16) /* used instead of SEEN */
builtin/log.c +4 -4
index a93b97858b..82144cf2b6 100644
@@ -23,8 +23,8 @@
 #include "diff/diff.h"
 #include "diff/diffcore.h"
 #include "diff/diff-merges.h"
-#include "revision.h"
-#include "log-tree.h"
+#include "revision/revision.h"
+#include "revision/log-tree.h"
 #include "odb/oid-array.h"
 #include "odb/oidset.h"
 #include "odb/tag.h"
@@ -35,7 +35,7 @@
 #include "remote.h"
 #include "string-list.h"
 #include "parse-options.h"
-#include "line-log.h"
+#include "revision/line-log.h"
 #include "branch.h"
 #include "version.h"
 #include "mailmap.h"
@@ -44,7 +44,7 @@
 #include "advice.h"
 #include "utf8.h"
 
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "promisor-remote.h"
 #include "diff/range-diff.h"
 #include "odb/tmp-objdir.h"
builtin/merge-base.c +1 -1
index 191e4e7fa0..7eec05ae7b 100644
@@ -7,7 +7,7 @@
 #include "hex.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 
 static int show_merge_base(struct commit **rev, size_t rev_nr, int show_all)
 {
builtin/merge-tree.c +1 -1
index 8217938d86..41d8bbcbc1 100644
@@ -8,7 +8,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "odb/commit.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "merge-ort.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
builtin/merge.c +2 -2
index 7ec4554b0b..268ffc4855 100644
@@ -31,7 +31,7 @@
 #include "odb/commit.h"
 #include "diff/diffcore.h"
 #include "path.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "unpack-trees.h"
 #include "cache-tree.h"
 #include "dir.h"
@@ -48,7 +48,7 @@
 #include "odb/tag.h"
 #include "alias.h"
 #include "branch.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "wt-status.h"
 #include "pack/commit-graph.h"
 
builtin/name-rev.c +2 -2
index f3f4714c1d..31bc960b34 100644
@@ -17,8 +17,8 @@
 #include "pack/commit-graph.h"
 #include "wildmatch.h"
 #include "mem-pool.h"
-#include "pretty.h"
-#include "revision.h"
+#include "revision/pretty.h"
+#include "revision/revision.h"
 #include "notes.h"
 #include "write-or-die.h"
 
builtin/notes.c +1 -1
index 6ebb5db39c..61087b0fa5 100644
@@ -19,7 +19,7 @@
 #include "odb/odb.h"
 #include "path.h"
 
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "refs/refs.h"
 #include "exec-cmd.h"
 #include "run-command.h"
builtin/pack-objects.c +5 -5
index 17721f13ac..3b025a08e9 100644
@@ -16,9 +16,9 @@
 #include "csum-file.h"
 #include "odb/tree-walk.h"
 #include "diff/diff.h"
-#include "revision.h"
-#include "list-objects.h"
-#include "list-objects-filter-options.h"
+#include "revision/revision.h"
+#include "revision/list-objects.h"
+#include "revision/list-objects-filter-options.h"
 #include "pack/pack-objects.h"
 #include "progress.h"
 #include "refs/refs.h"
@@ -29,7 +29,7 @@
 #include "odb/oid-array.h"
 #include "strvec.h"
 #include "strmap.h"
-#include "list.h"
+#include "revision/list.h"
 #include "pack/packfile.h"
 #include "odb/object-file.h"
 #include "odb/object-file-convert.h"
@@ -39,7 +39,7 @@
 #include "dir.h"
 #include "pack/midx.h"
 #include "trace2.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "promisor-remote.h"
 #include "pack/pack-mtimes.h"
 #include "parse-options.h"
builtin/prune.c +2 -2
index 0adf0f02d1..ba7b1303b3 100644
@@ -7,7 +7,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "pack/reachable.h"
 #include "parse-options.h"
 #include "path.h"
@@ -17,7 +17,7 @@
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 
 static const char * const prune_usage[] = {
 	N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
builtin/pull.c +1 -1
index bc8dcde318..af120a7e1b 100644
@@ -29,7 +29,7 @@
 #include "submodule.h"
 #include "submodule-config.h"
 #include "wt-status.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "sequencer.h"
 
 /**
builtin/rebase.c +2 -2
index 8f9fdcc79b..a14a31d60e 100644
@@ -27,8 +27,8 @@
 #include "odb/commit.h"
 #include "diff/diff.h"
 #include "wt-status.h"
-#include "revision.h"
-#include "commit-reach.h"
+#include "revision/revision.h"
+#include "revision/commit-reach.h"
 #include "rerere.h"
 #include "branch.h"
 #include "sequencer.h"
builtin/receive-pack.c +2 -2
index f01cc1a188..9a816f1e86 100644
@@ -4,7 +4,7 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "odb/commit.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "config.h"
 #include "connect.h"
 #include "connected.h"
@@ -32,7 +32,7 @@
 #include "run-command.h"
 #include "pack/server-info.h"
 #include "setup.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "sideband.h"
 #include "sigchain.h"
 #include "string-list.h"
builtin/reflog.c +1 -1
index d227104063..d8d1cb2c6a 100644
@@ -5,7 +5,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "odb/odb.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "pack/reachable.h"
 #include "wildmatch.h"
 #include "refs/worktree.h"
builtin/remote.c +1 -1
index 9a5df99c11..3f6cee14ff 100644
@@ -18,7 +18,7 @@
 #include "refs/refspec.h"
 #include "odb/odb.h"
 #include "strvec.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "progress.h"
 
 static const char * const builtin_remote_usage[] = {
builtin/repack.c +1 -1
index 5927a0dfdb..aa74f2161a 100644
@@ -13,7 +13,7 @@
 #include "pack/prune-packed.h"
 #include "promisor-remote.h"
 #include "pack/repack.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 
 #define ALL_INTO_ONE 1
 #define LOOSEN_UNREACHABLE 2
builtin/replay.c +1 -1
index 83b136a13e..4f5515a314 100644
@@ -11,7 +11,7 @@
 #include "parse-options.h"
 #include "refs/refs.h"
 #include "replay.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 enum ref_action_mode {
 	REF_ACTION_UPDATE,
builtin/repo.c +2 -2
index e052e6c0ba..b296e2cda7 100644
@@ -13,11 +13,11 @@
 #include "quote.h"
 #include "refs/ref-filter.h"
 #include "refs/refs.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "setup.h"
 #include "strbuf.h"
 #include "string-list.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
 #include "utf8.h"
builtin/reset.c +1 -1
index f843bab823..eed0d0ea0b 100644
@@ -19,7 +19,7 @@
 #include "hex.h"
 #include "lockfile.h"
 #include "odb/object.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "refs/refs.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
builtin/rev-list.c +7 -7
index c0e0769aab..21d7b8aa81 100644
@@ -8,24 +8,24 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "revision.h"
-#include "list-objects.h"
-#include "list-objects-filter-options.h"
+#include "revision/revision.h"
+#include "revision/list-objects.h"
+#include "revision/list-objects-filter-options.h"
 #include "odb/object.h"
 #include "odb/object-name.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "pack/pack-bitmap.h"
 #include "parse-options.h"
-#include "log-tree.h"
-#include "graph.h"
-#include "bisect.h"
+#include "revision/log-tree.h"
+#include "revision/graph.h"
+#include "revision/bisect.h"
 #include "progress.h"
 #include "refs/reflog-walk.h"
 #include "odb/oidset.h"
 #include "odb/oidmap.h"
 #include "pack/packfile.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "quote.h"
 #include "strbuf.h"
 
builtin/rev-parse.c +4 -4
index b95cdac85e..ef4b6795dd 100644
@@ -10,7 +10,7 @@
 #include "builtin.h"
 
 #include "abspath.h"
-#include "bisect.h"
+#include "revision/bisect.h"
 #include "config.h"
 #include "odb/commit.h"
 #include "environment.h"
@@ -26,12 +26,12 @@
 #include "read-cache-ll.h"
 #include "repo-settings.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "setup.h"
 #include "split-index.h"
 #include "submodule.h"
-#include "commit-reach.h"
-#include "shallow.h"
+#include "revision/commit-reach.h"
+#include "revision/shallow.h"
 #include "odb/object-file-convert.h"
 
 #define DO_REVS		1
builtin/revert.c +1 -1
index a939c590fb..ae3f186f12 100644
@@ -6,7 +6,7 @@
 #include "diff/diff.h"
 #include "environment.h"
 #include "gettext.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "rerere.h"
 #include "sequencer.h"
 #include "branch.h"
builtin/shortlog.c +1 -1
index 59be73a372..2fe86d6f46 100644
@@ -7,7 +7,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "string-list.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "utf8.h"
 #include "mailmap.h"
 #include "setup.h"
builtin/show-branch.c +1 -1
index 4da3330a26..8db11f6e4c 100644
@@ -7,7 +7,7 @@
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "refs/refs.h"
 #include "color.h"
 #include "strvec.h"
builtin/stash.c +2 -2
index c5e100746d..6458e3a2d6 100644
@@ -22,10 +22,10 @@
 #include "read-cache.h"
 #include "repository.h"
 #include "rerere.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "setup.h"
 #include "sparse-index.h"
-#include "log-tree.h"
+#include "revision/log-tree.h"
 #include "diff/diffcore.h"
 #include "refs/reflog.h"
 #include "refs/reflog-walk.h"
builtin/submodule--helper.c +2 -2
index 5711a79428..0e061827f9 100644
@@ -23,7 +23,7 @@
 #include "remote.h"
 #include "refs/refs.h"
 #include "refs/refspec.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "diff/diffcore.h"
 #include "diff/diff.h"
 #include "odb/object-file.h"
@@ -32,7 +32,7 @@
 #include "odb/source.h"
 #include "advice.h"
 #include "branch.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "wildmatch.h"
 #include "strbuf.h"
 #include "url.h"
builtin/tag.c +1 -1
index c04c2cc207..46df0f7c27 100644
@@ -24,7 +24,7 @@
 #include "odb/tag.h"
 #include "parse-options.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "gpg-interface.h"
 #include "odb/oid-array.h"
 #include "column.h"
builtin/unpack-objects.c +1 -1
index 93caca20ef..fb724e46ea 100644
@@ -18,7 +18,7 @@
 #include "odb/replace-object.h"
 #include "strbuf.h"
 #include "progress.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 #include "odb/fsck.h"
 #include "pack/packfile.h"
 
bundle.c +3 -3
index 54ec76866b..dc50661bdd 100644
@@ -12,12 +12,12 @@
 #include "odb/object.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "revision.h"
-#include "list-objects.h"
+#include "revision/revision.h"
+#include "revision/list-objects.h"
 #include "run-command.h"
 #include "refs/refs.h"
 #include "strvec.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "connected.h"
 #include "write-or-die.h"
 
bundle.h +1 -1
index d664b2f2d6..fc78766902 100644
@@ -3,7 +3,7 @@
 
 #include "strvec.h"
 #include "string-list.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 
 struct bundle_header {
 	unsigned version;
chdir-notify.c +1 -1
index 1237a45e2e..3d1d5ee3d2 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "chdir-notify.h"
-#include "list.h"
+#include "revision/list.h"
 #include "path.h"
 #include "strbuf.h"
 #include "trace.h"
diff/combine-diff.c +2 -2
index 44f0eb5442..8e03062f39 100644
@@ -13,12 +13,12 @@
 #include "quote.h"
 #include "diff/xdiff-interface.h"
 #include "xdiff/xmacros.h"
-#include "log-tree.h"
+#include "revision/log-tree.h"
 #include "refs/refs.h"
 #include "odb/tree.h"
 #include "diff/userdiff.h"
 #include "odb/oid-array.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 static int compare_paths(const struct combine_diff_path *one,
 			  const struct diff_filespec *two)
diff/diff-lib.c +2 -2
index fb0514dcb0..d48196f7c7 100644
@@ -14,7 +14,7 @@
 #include "hex.h"
 #include "odb/object-name.h"
 #include "read-cache.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "cache-tree.h"
 #include "unpack-trees.h"
 #include "refs/refs.h"
@@ -24,7 +24,7 @@
 #include "trace.h"
 #include "dir.h"
 #include "fsmonitor.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 
 /*
  * diff-files
diff/diff-merges.c +1 -1
index ca3cbf7767..8300d21a4f 100644
@@ -2,7 +2,7 @@
 #include "diff/diff-merges.h"
 
 #include "gettext.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 typedef void (*diff_merges_setup_func_t)(struct rev_info *);
 static void set_separate(struct rev_info *revs);
diff/diff-no-index.c +1 -1
index 5712e5474d..19cb90d121 100644
@@ -13,7 +13,7 @@
 #include "diff/diff.h"
 #include "diff/diffcore.h"
 #include "gettext.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "parse-options.h"
 #include "pathspec.h"
 #include "string-list.h"
diff/diff.c +2 -2
index 9062f96b7b..2b87f27238 100644
@@ -13,7 +13,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "tempfile.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "quote.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
@@ -32,7 +32,7 @@
 #include "string-list.h"
 #include "strvec.h"
 #include "odb/tmp-objdir.h"
-#include "graph.h"
+#include "revision/graph.h"
 #include "odb/oid-array.h"
 #include "pack/packfile.h"
 #include "pager.h"
diff/diffcore-pickaxe.c +1 -1
index e7289d9a26..d851afe3db 100644
@@ -11,7 +11,7 @@
 #include "diff/xdiff-interface.h"
 #include "kwset.h"
 #include "odb/oidset.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "quote.h"
 
 typedef int (*pickaxe_fn)(mmfile_t *one, mmfile_t *two,
diff/range-diff.c +2 -2
index 2177b8ba2d..281c043480 100644
@@ -15,11 +15,11 @@
 #include "diff/diffcore.h"
 #include "odb/commit.h"
 #include "pager.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "repository.h"
 #include "diff/userdiff.h"
 #include "apply.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 struct patch_util {
 	/* For the search for an exact match */
fetch-pack.c +2 -2
index b19cb3239e..d27a28502f 100644
@@ -30,8 +30,8 @@
 #include "connected.h"
 #include "fetch-negotiator.h"
 #include "odb/fsck.h"
-#include "shallow.h"
-#include "commit-reach.h"
+#include "revision/shallow.h"
+#include "revision/commit-reach.h"
 #include "pack/commit-graph.h"
 #include "sigchain.h"
 #include "mergesort.h"
fetch-pack.h +1 -1
index 14e4ba1079..42922616be 100644
@@ -3,7 +3,7 @@
 
 #include "string-list.h"
 #include "protocol.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "odb/oidset.h"
 
 struct oid_array;
fmt-merge-msg.c +2 -2
index 34f769ae9f..4993cc4a02 100644
@@ -10,12 +10,12 @@
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "hex.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "odb/tag.h"
 #include "string-list.h"
 #include "branch.h"
 #include "fmt-merge-msg.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "gpg-interface.h"
 #include "wildmatch.h"
 
git.c +1 -1
index 619219afef..9dace05858 100644
@@ -14,7 +14,7 @@
 #include "odb/replace-object.h"
 #include "setup.h"
 #include "attr.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "trace.h"
 #include "trace2.h"
 
grep.c +1 -1
index 88c87ba1c9..c4eb18ccd7 100644
@@ -6,7 +6,7 @@
 #include "grep.h"
 #include "hex.h"
 #include "odb/odb.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "diff/userdiff.h"
 #include "diff/xdiff-interface.h"
 #include "diff/diff.h"
http-push.c +3 -3
index 6d38410ccb..d45daee9e0 100644
@@ -9,9 +9,9 @@
 #include "odb/blob.h"
 #include "http.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "remote.h"
-#include "list-objects.h"
+#include "revision/list-objects.h"
 #include "setup.h"
 #include "sigchain.h"
 #include "strvec.h"
@@ -21,7 +21,7 @@
 #include "pack/packfile.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 
 #ifdef EXPAT_NEEDS_XMLPARSE_H
 #include <xmlparse.h>
http-walker.c +1 -1
index e73c3677d1..8df0c5329b 100644
@@ -6,7 +6,7 @@
 #include "hex.h"
 #include "walker.h"
 #include "http.h"
-#include "list.h"
+#include "revision/list.h"
 #include "transport.h"
 #include "pack/packfile.h"
 #include "odb/object-file.h"
merge-ort.c +2 -2
index 61fb855500..71274c24bf 100644
@@ -25,7 +25,7 @@
 #include "attr.h"
 #include "cache-tree.h"
 #include "odb/commit.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "config.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
@@ -45,7 +45,7 @@
 #include "promisor-remote.h"
 #include "read-cache-ll.h"
 #include "refs/refs.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "sparse-index.h"
 #include "strmap.h"
 #include "trace2.h"
meson.build +14 -14
index 87060ff883..65be53078d 100644
@@ -319,8 +319,8 @@ libgit_sources = [
   'archive.c',
   'attr.c',
   'base85.c',
-  'bisect.c',
-  'blame.c',
+  'revision/bisect.c',
+  'revision/blame.c',
   'odb/blob.c',
   'pack/bloom.c',
   'branch.c',
@@ -335,7 +335,7 @@ libgit_sources = [
   'column.c',
   'diff/combine-diff.c',
   'pack/commit-graph.c',
-  'commit-reach.c',
+  'revision/commit-reach.c',
   'odb/commit.c',
   'common-exit.c',
   'common-init.c',
@@ -349,7 +349,7 @@ libgit_sources = [
   'csum-file.c',
   'ctype.c',
   'date.c',
-  'decorate.c',
+  'revision/decorate.c',
   'pack/delta-islands.c',
   'diagnose.c',
   'pack/diff-delta.c',
@@ -384,7 +384,7 @@ libgit_sources = [
   'gettext.c',
   'git-zlib.c',
   'gpg-interface.c',
-  'graph.c',
+  'revision/graph.c',
   'grep.c',
   'odb/hash-lookup.c',
   'odb/hash.c',
@@ -397,14 +397,14 @@ libgit_sources = [
   'json-writer.c',
   'kwset.c',
   'levenshtein.c',
-  'line-log.c',
-  'line-range.c',
+  'revision/line-log.c',
+  'revision/line-range.c',
   'linear-assignment.c',
-  'list-objects-filter-options.c',
-  'list-objects-filter.c',
-  'list-objects.c',
+  'revision/list-objects-filter-options.c',
+  'revision/list-objects-filter.c',
+  'revision/list-objects.c',
   'lockfile.c',
-  'log-tree.c',
+  'revision/log-tree.c',
   'odb/loose.c',
   'refs/ls-refs.c',
   'mailinfo.c',
@@ -468,7 +468,7 @@ libgit_sources = [
   'pathspec.c',
   'pkt-line.c',
   'preload-index.c',
-  'pretty.c',
+  'revision/pretty.c',
   'prio-queue.c',
   'progress.c',
   'promisor-remote.c',
@@ -522,14 +522,14 @@ libgit_sources = [
   'rerere.c',
   'reset.c',
   'resolve-undo.c',
-  'revision.c',
+  'revision/revision.c',
   'run-command.c',
   'send-pack.c',
   'sequencer.c',
   'serve.c',
   'pack/server-info.c',
   'setup.c',
-  'shallow.c',
+  'revision/shallow.c',
   'sideband.c',
   'sigchain.c',
   'sparse-index.c',
notes-cache.c +1 -1
index 02fb418c6f..1e734c5c19 100644
@@ -4,7 +4,7 @@
 #include "notes-cache.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "repository.h"
 #include "odb/commit.h"
 #include "refs/refs.h"
notes-merge.c +1 -1
index ff14b7dfcc..53f42ba863 100644
@@ -22,7 +22,7 @@
 #include "strbuf.h"
 #include "trace.h"
 #include "notes-utils.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 
 struct notes_merge_pair {
 	struct object_id obj, base, local, remote;
odb/commit.c +3 -3
index b78cd28013..1b0703a9ef 100644
@@ -12,7 +12,7 @@
 #include "odb/odb.h"
 #include "utf8.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "notes.h"
 #include "odb/alloc.h"
 #include "gpg-interface.h"
@@ -23,9 +23,9 @@
 #include "wt-status.h"
 #include "advice.h"
 #include "refs/refs.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "setup.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "odb/tree.h"
 #include "hook.h"
 #include "parse.h"
odb/object-name.c +2 -2
index ff61d55590..825fc717bf 100644
@@ -17,13 +17,13 @@
 #include "dir.h"
 #include "odb/odb.h"
 #include "odb/oid-array.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "read-cache-ll.h"
 #include "repo-settings.h"
 #include "repository.h"
 #include "setup.h"
 #include "pack/midx.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "date.h"
 #include "odb/object-file-convert.h"
 #include "prio-queue.h"
odb/source-packed.c +1 -1
index 0e391f6fcf..c1e2756471 100644
@@ -3,7 +3,7 @@
 #include "chdir-notify.h"
 #include "dir.h"
 #include "git-zlib.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "mergesort.h"
 #include "pack/midx.h"
 #include "odb/source-packed.h"
pack/commit-graph.c +1 -1
index afc04d74a5..d5537a9ee8 100644
@@ -22,7 +22,7 @@
 #include "progress.h"
 #include "pack/bloom.h"
 #include "odb/commit-slab.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "json-writer.h"
 #include "trace2.h"
 #include "odb/tree.h"
pack/midx-write.c +2 -2
index 1f8f24410a..1d5a6525a6 100644
@@ -13,8 +13,8 @@
 #include "pack/chunk-format.h"
 #include "pack/pack-bitmap.h"
 #include "refs/refs.h"
-#include "revision.h"
-#include "list-objects.h"
+#include "revision/revision.h"
+#include "revision/list-objects.h"
 #include "path.h"
 #include "pack/pack-revindex.h"
 
pack/pack-bitmap-write.c +2 -2
index 22ee370bde..3b7b41c5d7 100644
@@ -7,14 +7,14 @@
 #include "odb/odb.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "progress.h"
 #include "pack/pack.h"
 #include "pack/pack-bitmap.h"
 #include "odb/hash-lookup.h"
 #include "pack/pack-objects.h"
 #include "path.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "prio-queue.h"
 #include "trace2.h"
 #include "odb/tree.h"
pack/pack-bitmap.c +3 -3
index 3adb5d0563..7cd24a37f5 100644
@@ -7,9 +7,9 @@
 #include "strbuf.h"
 #include "odb/tag.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "progress.h"
-#include "list-objects.h"
+#include "revision/list-objects.h"
 #include "pack/pack.h"
 #include "pack/pack-bitmap.h"
 #include "pack/pack-revindex.h"
@@ -18,7 +18,7 @@
 #include "repository.h"
 #include "trace2.h"
 #include "odb/odb.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "pack/midx.h"
 #include "config.h"
 #include "pack/pseudo-merge.h"
pack/packfile.c +1 -1
index 0426bee827..72252faffe 100644
@@ -4,7 +4,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "list.h"
+#include "revision/list.h"
 #include "pack/pack.h"
 #include "repository.h"
 #include "dir.h"
pack/packfile.h +1 -1
index 55dc02539b..1e6e69fb77 100644
@@ -1,7 +1,7 @@
 #ifndef PACKFILE_H
 #define PACKFILE_H
 
-#include "list.h"
+#include "revision/list.h"
 #include "odb/object.h"
 #include "odb/odb.h"
 #include "odb/source-files.h"
pack/reachable.c +2 -2
index 7989f7327a..f61525308e 100644
@@ -7,11 +7,11 @@
 #include "odb/commit.h"
 #include "odb/blob.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "pack/reachable.h"
 #include "cache-tree.h"
 #include "progress.h"
-#include "list-objects.h"
+#include "revision/list-objects.h"
 #include "pack/packfile.h"
 #include "refs/worktree.h"
 #include "odb/object-file.h"
pack/repack.h +1 -1
index f9fbc895f0..6248e7deac 100644
@@ -1,7 +1,7 @@
 #ifndef REPACK_H
 #define REPACK_H
 
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "string-list.h"
 
 struct pack_objects_args {
path-walk.c +3 -3
index ed4d3211d2..4b8ddb2a28 100644
@@ -8,8 +8,8 @@
 #include "dir.h"
 #include "hashmap.h"
 #include "hex.h"
-#include "list-objects.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects.h"
+#include "revision/list-objects-filter-options.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "odb/object.h"
@@ -17,7 +17,7 @@
 #include "path.h"
 #include "prio-queue.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "string-list.h"
 #include "strmap.h"
 #include "odb/tag.h"
read-cache.c +1 -1
index 5bca3fda12..a970eb1b6a 100644
@@ -34,7 +34,7 @@
 #include "read-cache.h"
 #include "repository.h"
 #include "resolve-undo.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "strbuf.h"
 #include "trace2.h"
 #include "varint.h"
refs/files-backend.c +1 -1
index 35acc13ccc..a792297d8f 100644
@@ -25,7 +25,7 @@
 #include "refs/worktree.h"
 #include "../wrapper.h"
 #include "../write-or-die.h"
-#include "../revision.h"
+#include "revision/revision.h"
 #include <wildmatch.h>
 
 /* So that we can drop `USE_THE_REPOSITORY_VARIABLE`. */
refs/pack-refs.c +1 -1
index c9f36872cc..d6c41d64f1 100644
@@ -4,7 +4,7 @@
 #include "refs/pack-refs.h"
 #include "parse-options.h"
 #include "refs/refs.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 int pack_refs_core(int argc,
 		   const char **argv,
refs/ref-filter.c +2 -2
index e3de16b7a7..7635e13f88 100644
@@ -24,13 +24,13 @@
 #include "odb/tag.h"
 #include "quote.h"
 #include "refs/ref-filter.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "utf8.h"
 #include "versioncmp.h"
 #include "trailer.h"
 #include "wt-status.h"
 #include "odb/commit-slab.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "refs/worktree.h"
 #include "hashmap.h"
 
refs/ref-filter.h +1 -1
index 11180f9570..0f4f80ec20 100644
@@ -6,7 +6,7 @@
 #include "odb/commit.h"
 #include "string-list.h"
 #include "strvec.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 
 /* Quoting styles */
 #define QUOTE_NONE 0
refs/reflog-walk.c +1 -1
index f9eee9a76f..4c321fb3a8 100644
@@ -5,7 +5,7 @@
 #include "refs/refs.h"
 #include "diff/diff.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "string-list.h"
 #include "refs/reflog-walk.h"
 
refs/reflog.c +1 -1
index 751485f885..1050ae6301 100644
@@ -9,7 +9,7 @@
 #include "odb/odb.h"
 #include "refs/reflog.h"
 #include "refs/refs.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
 #include "wildmatch.h"
remote.c +2 -2
index c619009d30..8a65967fb0 100644
@@ -17,12 +17,12 @@
 #include "path.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "dir.h"
 #include "setup.h"
 #include "string-list.h"
 #include "strvec.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "advice.h"
 #include "connect.h"
 #include "parse-options.h"
replay.c +1 -1
index 8dd7b99502..6922a1f137 100644
@@ -7,7 +7,7 @@
 #include "odb/object-name.h"
 #include "refs/refs.h"
 #include "replay.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "sequencer.h"
 #include "strmap.h"
 #include "odb/tree.h"
revision/bisect.c renamed from bisect.c +5 -5
similarity index 99%
rename from bisect.c
rename to revision/bisect.c
index 1f8d81b894..696e365310 100644
@@ -8,17 +8,17 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "refs/refs.h"
-#include "list-objects.h"
+#include "revision/list-objects.h"
 #include "quote.h"
 #include "run-command.h"
-#include "log-tree.h"
-#include "bisect.h"
+#include "revision/log-tree.h"
+#include "revision/bisect.h"
 #include "odb/oid-array.h"
 #include "strvec.h"
 #include "odb/commit-slab.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "path.h"
revision/bisect.h renamed from bisect.h +0 -0
similarity index 100%
rename from bisect.h
rename to revision/bisect.h
revision/blame.c renamed from blame.c +2 -2
similarity index 99%
rename from blame.c
rename to revision/blame.c
index c736441f18..54284ed8da 100644
@@ -14,11 +14,11 @@
 #include "hex.h"
 #include "path.h"
 #include "read-cache.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "setup.h"
 #include "odb/tag.h"
 #include "trace2.h"
-#include "blame.h"
+#include "revision/blame.h"
 #include "odb/alloc.h"
 #include "odb/commit-slab.h"
 #include "pack/bloom.h"
revision/blame.h renamed from blame.h +0 -0
similarity index 100%
rename from blame.h
rename to revision/blame.h
revision/commit-reach.c renamed from commit-reach.c +3 -3
similarity index 99%
rename from commit-reach.c
rename to revision/commit-reach.c
index 0b59c9ba29..e1e1b71819 100644
@@ -3,13 +3,13 @@
 #include "git-compat-util.h"
 #include "odb/commit.h"
 #include "pack/commit-graph.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 #include "hex.h"
 #include "prio-queue.h"
 #include "refs/ref-filter.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "odb/tag.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "ewah/ewok.h"
 
 /* Remember to update object flag allocation in object.h */
revision/commit-reach.h renamed from commit-reach.h +0 -0
similarity index 100%
rename from commit-reach.h
rename to revision/commit-reach.h
revision/decorate.c renamed from decorate.c +1 -1
similarity index 98%
rename from decorate.c
rename to revision/decorate.c
index 262c9198eb..eeba03ec83 100644
@@ -5,7 +5,7 @@
 
 #include "git-compat-util.h"
 #include "odb/object.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 
 static unsigned int hash_obj(const struct object *obj, unsigned int n)
 {
revision/decorate.h renamed from decorate.h +0 -0
similarity index 100%
rename from decorate.h
rename to revision/decorate.h
revision/graph.c renamed from graph.c +2 -2
similarity index 99%
rename from graph.c
rename to revision/graph.c
index 66c2be423e..c6f10398a2 100644
@@ -5,8 +5,8 @@
 #include "config.h"
 #include "odb/commit.h"
 #include "color.h"
-#include "graph.h"
-#include "revision.h"
+#include "revision/graph.h"
+#include "revision/revision.h"
 #include "strvec.h"
 
 /* Internal API */
revision/graph.h renamed from graph.h +0 -0
similarity index 100%
rename from graph.h
rename to revision/graph.h
revision/line-log.c renamed from line-log.c +4 -4
similarity index 99%
rename from line-log.c
rename to revision/line-log.c
index 78697cb377..3da7af2340 100644
@@ -2,18 +2,18 @@
 
 #include "git-compat-util.h"
 #include "diff/diffcore.h"
-#include "line-range.h"
+#include "revision/line-range.h"
 #include "hex.h"
 #include "odb/tag.h"
 #include "odb/tree.h"
 #include "diff/diff.h"
 #include "odb/commit.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "diff/xdiff-interface.h"
 #include "strbuf.h"
-#include "line-log.h"
+#include "revision/line-log.h"
 #include "setup.h"
 #include "strvec.h"
 #include "pack/bloom.h"
revision/line-log.h renamed from line-log.h +0 -0
similarity index 100%
rename from line-log.h
rename to revision/line-log.h
revision/line-range.c renamed from line-range.c +1 -1
similarity index 99%
rename from line-range.c
rename to revision/line-range.c
index 1dbf761ecc..419d90d863 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "line-range.h"
+#include "revision/line-range.h"
 #include "diff/xdiff-interface.h"
 #include "diff/userdiff.h"
 
revision/line-range.h renamed from line-range.h +0 -0
similarity index 100%
rename from line-range.h
rename to revision/line-range.h
revision/list-objects-filter-options.c renamed from list-objects-filter-options.c +1 -1
similarity index 99%
rename from list-objects-filter-options.c
rename to revision/list-objects-filter-options.c
index bc5d98f9e6..6730808896 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "gettext.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "promisor-remote.h"
 #include "trace.h"
 #include "url.h"
revision/list-objects-filter-options.h renamed from list-objects-filter-options.h +0 -0
similarity index 100%
rename from list-objects-filter-options.h
rename to revision/list-objects-filter-options.h
revision/list-objects-filter.c renamed from list-objects-filter.c +3 -3
similarity index 99%
rename from list-objects-filter.c
rename to revision/list-objects-filter.c
index a011cef0b5..0ea4cb826e 100644
@@ -6,9 +6,9 @@
 #include "hex.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "revision.h"
-#include "list-objects-filter.h"
-#include "list-objects-filter-options.h"
+#include "revision/revision.h"
+#include "revision/list-objects-filter.h"
+#include "revision/list-objects-filter-options.h"
 #include "odb/oidmap.h"
 #include "odb/oidset.h"
 #include "odb/object-name.h"
revision/list-objects-filter.h renamed from list-objects-filter.h +0 -0
similarity index 100%
rename from list-objects-filter.h
rename to revision/list-objects-filter.h
revision/list-objects.c renamed from list-objects.c +4 -4
similarity index 98%
rename from list-objects.c
rename to revision/list-objects.c
index 6b67f0f927..fdf98b629f 100644
@@ -9,10 +9,10 @@
 #include "odb/blob.h"
 #include "diff/diff.h"
 #include "odb/tree-walk.h"
-#include "revision.h"
-#include "list-objects.h"
-#include "list-objects-filter.h"
-#include "list-objects-filter-options.h"
+#include "revision/revision.h"
+#include "revision/list-objects.h"
+#include "revision/list-objects-filter.h"
+#include "revision/list-objects-filter-options.h"
 #include "pack/packfile.h"
 #include "odb/odb.h"
 #include "trace.h"
revision/list-objects.h renamed from list-objects.h +0 -0
similarity index 100%
rename from list-objects.h
rename to revision/list-objects.h
revision/list.h renamed from list.h +0 -0
similarity index 100%
rename from list.h
rename to revision/list.h
revision/log-tree.c renamed from log-tree.c +5 -5
similarity index 99%
rename from log-tree.c
rename to revision/log-tree.c
index ddeafedb45..e555d07072 100644
@@ -2,7 +2,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "odb/commit-slab.h"
 #include "config.h"
 #include "diff/diff.h"
@@ -15,18 +15,18 @@
 #include "odb/tmp-objdir.h"
 #include "odb/commit.h"
 #include "odb/tag.h"
-#include "graph.h"
-#include "log-tree.h"
+#include "revision/graph.h"
+#include "revision/log-tree.h"
 #include "merge-ort.h"
 #include "refs/reflog-walk.h"
 #include "refs/refs.h"
 #include "odb/replace-object.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "string-list.h"
 #include "color.h"
 #include "gpg-interface.h"
 #include "sequencer.h"
-#include "line-log.h"
+#include "revision/line-log.h"
 #include "help.h"
 #include "diff/range-diff.h"
 #include "strmap.h"
revision/log-tree.h renamed from log-tree.h +0 -0
similarity index 100%
rename from log-tree.h
rename to revision/log-tree.h
revision/pretty.c renamed from pretty.c +2 -2
similarity index 99%
rename from pretty.c
rename to revision/pretty.c
index 3444617506..cdf63ded49 100644
@@ -11,10 +11,10 @@
 #include "utf8.h"
 #include "diff/diff.h"
 #include "pager.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "string-list.h"
 #include "mailmap.h"
-#include "log-tree.h"
+#include "revision/log-tree.h"
 #include "notes.h"
 #include "color.h"
 #include "refs/reflog-walk.h"
revision/pretty.h renamed from pretty.h +0 -0
similarity index 100%
rename from pretty.h
rename to revision/pretty.h
revision/revision.c renamed from revision.c +8 -8
similarity index 99%
rename from revision.c
rename to revision/revision.c
index 249a1736fd..9a19a5654a 100644
@@ -17,20 +17,20 @@
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "refs/refs.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "repository.h"
-#include "graph.h"
+#include "revision/graph.h"
 #include "grep.h"
 #include "refs/reflog-walk.h"
 #include "diff/patch-ids.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 #include "string-list.h"
-#include "line-log.h"
-#include "log-tree.h"
+#include "revision/line-log.h"
+#include "revision/log-tree.h"
 #include "mailmap.h"
 #include "odb/commit-slab.h"
 #include "cache-tree.h"
-#include "bisect.h"
+#include "revision/bisect.h"
 #include "pack/packfile.h"
 #include "refs/worktree.h"
 #include "path.h"
@@ -39,14 +39,14 @@
 #include "sparse-index.h"
 #include "strvec.h"
 #include "trace2.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "pack/commit-graph.h"
 #include "prio-queue.h"
 #include "hashmap.h"
 #include "utf8.h"
 #include "pack/bloom.h"
 #include "json-writer.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "resolve-undo.h"
 #include "parse-options.h"
 #include "wildmatch.h"
revision/revision.h renamed from revision.h +3 -3
similarity index 99%
rename from revision.h
rename to revision/revision.h
index 64d9a47091..9cb9419b22 100644
@@ -6,12 +6,12 @@
 #include "notes.h"
 #include "odb/object-name.h"
 #include "odb/oidset.h"
-#include "pretty.h"
+#include "revision/pretty.h"
 #include "diff/diff.h"
 #include "odb/commit-slab-decl.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 #include "ident.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "prio-queue.h"
 #include "strvec.h"
 
revision/shallow.c renamed from shallow.c +4 -4
similarity index 99%
rename from shallow.c
rename to revision/shallow.c
index fa16834aff..51ba602971 100644
@@ -13,11 +13,11 @@
 #include "odb/oid-array.h"
 #include "path.h"
 #include "diff/diff.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "odb/commit-slab.h"
-#include "list-objects.h"
-#include "commit-reach.h"
-#include "shallow.h"
+#include "revision/list-objects.h"
+#include "revision/commit-reach.h"
+#include "revision/shallow.h"
 #include "statinfo.h"
 #include "trace.h"
 
revision/shallow.h renamed from shallow.h +0 -0
similarity index 100%
rename from shallow.h
rename to revision/shallow.h
send-pack.c +1 -1
index 97dcfac586..f59686f971 100644
@@ -15,7 +15,7 @@
 #include "version.h"
 #include "odb/oid-array.h"
 #include "gpg-interface.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "parse-options.h"
 #include "trace2.h"
 #include "write-or-die.h"
sequencer.c +3 -3
index 551e4529c4..d5b1eb9719 100644
@@ -24,7 +24,7 @@
 #include "cache-tree.h"
 #include "diff/diff.h"
 #include "path.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "rerere.h"
 #include "merge.h"
 #include "merge-ort.h"
@@ -34,7 +34,7 @@
 #include "strvec.h"
 #include "quote.h"
 #include "trailer.h"
-#include "log-tree.h"
+#include "revision/log-tree.h"
 #include "wt-status.h"
 #include "hashmap.h"
 #include "notes-utils.h"
@@ -44,7 +44,7 @@
 #include "odb/oidset.h"
 #include "odb/commit-slab.h"
 #include "alias.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "rebase-interactive.h"
 #include "reset.h"
 #include "branch.h"
setup.c +1 -1
index 925a600dba..62fbda948d 100644
@@ -14,7 +14,7 @@
 #include "config.h"
 #include "dir.h"
 #include "setup.h"
-#include "shallow.h"
+#include "revision/shallow.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "chdir-notify.h"
submodule.c +2 -2
index a9137aa180..16f4d30b82 100644
@@ -13,7 +13,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "run-command.h"
 #include "diff/diffcore.h"
 #include "refs/refs.h"
@@ -28,7 +28,7 @@
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "read-cache-ll.h"
 #include "setup.h"
 #include "advice.h"
t/helper/test-path-walk.c +3 -3
index f41c6be2c6..71d052d504 100644
@@ -4,11 +4,11 @@
 #include "dir.h"
 #include "environment.h"
 #include "hex.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "odb/object-name.h"
 #include "odb/object.h"
-#include "pretty.h"
-#include "revision.h"
+#include "revision/pretty.h"
+#include "revision/revision.h"
 #include "setup.h"
 #include "parse-options.h"
 #include "strbuf.h"
t/helper/test-reach.c +1 -1
index df1c677b9f..7f00cc7d9c 100644
@@ -2,7 +2,7 @@
 
 #include "test-tool.h"
 #include "odb/commit.h"
-#include "commit-reach.h"
+#include "revision/commit-reach.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
t/helper/test-ref-store.c +1 -1
index 8c2fb0aad7..582e8b4d97 100644
@@ -9,7 +9,7 @@
 #include "path.h"
 #include "repository.h"
 #include "strbuf.h"
-#include "revision.h"
+#include "revision/revision.h"
 
 struct flag_definition {
 	const char *name;
t/helper/test-revision-walking.c +2 -2
index 7c66b8566f..57e0bcea63 100644
@@ -13,10 +13,10 @@
 #include "test-tool.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "line-log.h"
+#include "revision/line-log.h"
 #include "odb/object-name.h"
 #include "repository.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "setup.h"
 #include "string-list.h"
 
t/unit-tests/u-example-decorate.c +1 -1
index 2f01340c21..85d0277ee2 100644
@@ -2,7 +2,7 @@
 
 #include "unit-test.h"
 #include "odb/object.h"
-#include "decorate.h"
+#include "revision/decorate.h"
 #include "repository.h"
 
 struct test_vars {
t/unit-tests/u-list-objects-filter-options.c +1 -1
index f7d73701b5..cbcae66fa5 100644
@@ -1,5 +1,5 @@
 #include "unit-test.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "strbuf.h"
 
 /* Helper to test gently_parse_list_objects_filter() */
tempfile.h +1 -1
index f571f3c609..40d8d230de 100644
@@ -1,7 +1,7 @@
 #ifndef TEMPFILE_H
 #define TEMPFILE_H
 
-#include "list.h"
+#include "revision/list.h"
 #include "strbuf.h"
 
 struct repository;
trailer.c +1 -1
index 33fd1df188..7723c5cf52 100644
@@ -9,7 +9,7 @@
 #include "odb/commit.h"
 #include "strvec.h"
 #include "trailer.h"
-#include "list.h"
+#include "revision/list.h"
 #include "tempfile.h"
 
 /*
trailer.h +1 -1
index b49338858c..5afc1775f2 100644
@@ -1,7 +1,7 @@
 #ifndef TRAILER_H
 #define TRAILER_H
 
-#include "list.h"
+#include "revision/list.h"
 #include "strbuf.h"
 
 struct trailer_block;
transport.h +1 -1
index a7869d18e0..064f4192cf 100644
@@ -3,7 +3,7 @@
 
 #include "run-command.h"
 #include "remote.h"
-#include "list-objects-filter-options.h"
+#include "revision/list-objects-filter-options.h"
 #include "string-list.h"
 #include "connect.h"
 
upload-pack.c +4 -4
index acd381ebf1..09a986e486 100644
@@ -15,8 +15,8 @@
 #include "odb/object.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "revision.h"
-#include "list-objects-filter-options.h"
+#include "revision/revision.h"
+#include "revision/list-objects-filter-options.h"
 #include "run-command.h"
 #include "connect.h"
 #include "sigchain.h"
@@ -27,8 +27,8 @@
 #include "protocol.h"
 #include "upload-pack.h"
 #include "pack/commit-graph.h"
-#include "commit-reach.h"
-#include "shallow.h"
+#include "revision/commit-reach.h"
+#include "revision/shallow.h"
 #include "trace.h"
 #include "write-or-die.h"
 #include "json-writer.h"
wt-status.c +1 -1
index 28a0c72a51..83fdf5334f 100644
@@ -14,7 +14,7 @@
 #include "hex.h"
 #include "odb/object-name.h"
 #include "path.h"
-#include "revision.h"
+#include "revision/revision.h"
 #include "diff/diffcore.h"
 #include "quote.h"
 #include "repository.h"
Signature · 1 line
2.54.0
#15 lore raw

RFC PATCH 12/14 index: gather the index sources under index/

In reply to Michael Montalbo

Move the 20 index C sources and 24 headers into index/ as renames. Repoint every reference to their old paths to the new ones: the #include lines across the tree, the Makefile and meson.build build entries, and the tutorial #include examples.

---
 .gitorganize                                  | 88 +++++++++----------
 Documentation/MyFirstContribution.adoc        |  2 +-
 Makefile                                      | 42 ++++-----
 add-interactive.c                             |  6 +-
 add-patch.c                                   |  4 +-
 apply.c                                       | 10 +--
 archive.c                                     |  2 +-
 archive.h                                     |  2 +-
 attr.c                                        |  4 +-
 builtin/add.c                                 |  8 +-
 builtin/am.c                                  |  8 +-
 builtin/backfill.c                            |  2 +-
 builtin/check-ignore.c                        |  4 +-
 builtin/checkout--worker.c                    |  6 +-
 builtin/checkout-index.c                      | 10 +--
 builtin/checkout.c                            | 24 ++---
 builtin/clean.c                               |  6 +-
 builtin/clone.c                               |  6 +-
 builtin/commit.c                              | 14 +--
 builtin/count-objects.c                       |  2 +-
 builtin/describe.c                            |  2 +-
 builtin/diff-files.c                          |  2 +-
 builtin/diff-index.c                          |  2 +-
 builtin/diff-tree.c                           |  2 +-
 builtin/diff.c                                |  4 +-
 builtin/difftool.c                            |  8 +-
 builtin/fast-import.c                         |  4 +-
 builtin/fsck.c                                |  8 +-
 builtin/fsmonitor--daemon.c                   | 10 +--
 builtin/gc.c                                  |  2 +-
 builtin/grep.c                                |  6 +-
 builtin/history.c                             |  8 +-
 builtin/ls-files.c                            | 10 +--
 builtin/ls-tree.c                             |  2 +-
 builtin/merge-index.c                         |  4 +-
 builtin/merge.c                               | 10 +--
 builtin/mv.c                                  | 12 +--
 builtin/pack-objects.c                        |  2 +-
 builtin/prune.c                               |  2 +-
 builtin/pull.c                                |  6 +-
 builtin/push.c                                |  2 +-
 builtin/read-tree.c                           |  8 +-
 builtin/rebase.c                              |  6 +-
 builtin/rerere.c                              |  2 +-
 builtin/reset.c                               |  8 +-
 builtin/rev-parse.c                           |  4 +-
 builtin/rm.c                                  |  8 +-
 builtin/show-branch.c                         |  2 +-
 builtin/sparse-checkout.c                     |  8 +-
 builtin/stash.c                               | 14 +--
 builtin/submodule--helper.c                   | 10 +--
 builtin/update-index.c                        | 18 ++--
 builtin/worktree.c                            |  6 +-
 builtin/write-tree.c                          |  2 +-
 compat/fsmonitor/fsm-health-darwin.c          |  4 +-
 compat/fsmonitor/fsm-health-linux.c           |  4 +-
 compat/fsmonitor/fsm-health-win32.c           |  4 +-
 compat/fsmonitor/fsm-ipc-unix.c               |  6 +-
 compat/fsmonitor/fsm-ipc-win32.c              |  2 +-
 compat/fsmonitor/fsm-listen-darwin.c          |  6 +-
 compat/fsmonitor/fsm-listen-linux.c           |  8 +-
 compat/fsmonitor/fsm-listen-win32.c           |  4 +-
 compat/fsmonitor/fsm-path-utils-darwin.c      |  4 +-
 compat/fsmonitor/fsm-path-utils-linux.c       |  4 +-
 compat/fsmonitor/fsm-path-utils-win32.c       |  4 +-
 compat/fsmonitor/fsm-settings-unix.c          |  8 +-
 compat/fsmonitor/fsm-settings-win32.c         |  6 +-
 compat/mingw.c                                |  4 +-
 config.c                                      |  2 +-
 convert.c                                     |  2 +-
 diagnose.c                                    |  2 +-
 diff/diff-lib.c                               | 12 +--
 diff/diff-no-index.c                          |  4 +-
 diff/diff.c                                   |  4 +-
 diff/diff.h                                   |  2 +-
 diff/tree-diff.c                              |  2 +-
 git.c                                         |  2 +-
 gpg-interface.c                               |  2 +-
 help.c                                        |  2 +-
 cache-tree.c => index/cache-tree.c            |  4 +-
 cache-tree.h => index/cache-tree.h            |  0
 checkout.c => index/checkout.c                |  2 +-
 checkout.h => index/checkout.h                |  0
 dir-iterator.c => index/dir-iterator.c        |  4 +-
 dir-iterator.h => index/dir-iterator.h        |  0
 dir.c => index/dir.c                          | 14 +--
 dir.h => index/dir.h                          |  4 +-
 entry.c => index/entry.c                      | 14 +--
 entry.h => index/entry.h                      |  0
 .../fsmonitor--daemon.h                       |  2 +-
 fsmonitor-ipc.c => index/fsmonitor-ipc.c      |  2 +-
 fsmonitor-ipc.h => index/fsmonitor-ipc.h      |  0
 fsmonitor-ll.h => index/fsmonitor-ll.h        |  0
 .../fsmonitor-path-utils.h                    |  0
 .../fsmonitor-settings.c                      |  6 +-
 .../fsmonitor-settings.h                      |  0
 fsmonitor.c => index/fsmonitor.c              |  8 +-
 fsmonitor.h => index/fsmonitor.h              |  8 +-
 name-hash.c => index/name-hash.c              |  6 +-
 name-hash.h => index/name-hash.h              |  0
 .../parallel-checkout.c                       |  8 +-
 .../parallel-checkout.h                       |  0
 pathspec.c => index/pathspec.c                |  8 +-
 pathspec.h => index/pathspec.h                |  0
 preload-index.c => index/preload-index.c      | 12 +--
 preload-index.h => index/preload-index.h      |  0
 read-cache-ll.h => index/read-cache-ll.h      |  2 +-
 read-cache.c => index/read-cache.c            | 20 ++---
 read-cache.h => index/read-cache.h            |  4 +-
 resolve-undo.c => index/resolve-undo.c        |  8 +-
 resolve-undo.h => index/resolve-undo.h        |  0
 sparse-index.c => index/sparse-index.c        | 14 +--
 sparse-index.h => index/sparse-index.h        |  0
 split-index.c => index/split-index.c          |  4 +-
 split-index.h => index/split-index.h          |  0
 statinfo.c => index/statinfo.c                |  2 +-
 statinfo.h => index/statinfo.h                |  0
 symlinks.c => index/symlinks.c                |  2 +-
 symlinks.h => index/symlinks.h                |  0
 unpack-trees.c => index/unpack-trees.c        | 22 ++---
 unpack-trees.h => index/unpack-trees.h        |  2 +-
 wt-status.c => index/wt-status.c              |  8 +-
 wt-status.h => index/wt-status.h              |  2 +-
 merge-ort-wrappers.c                          |  2 +-
 merge-ort.c                                   | 12 +--
 merge.c                                       |  4 +-
 meson.build                                   | 40 ++++-----
 notes-merge.c                                 |  2 +-
 odb/commit.c                                  |  2 +-
 odb/fsck.c                                    |  2 +-
 odb/hash-lookup.c                             |  2 +-
 odb/object-file.c                             |  4 +-
 odb/object-name.c                             |  4 +-
 odb/object.c                                  |  2 +-
 odb/odb.c                                     |  2 +-
 odb/source-packed.c                           |  2 +-
 odb/tmp-objdir.c                              |  2 +-
 odb/tree-walk.c                               |  6 +-
 organize/gitorganize-format.c                 |  2 +-
 organize/organize.c                           |  6 +-
 pack/midx.c                                   |  2 +-
 pack/packfile.c                               |  2 +-
 pack/reachable.c                              |  2 +-
 pack/repack.c                                 |  2 +-
 pack/server-info.c                            |  2 +-
 path-walk.c                                   |  2 +-
 path.c                                        |  2 +-
 rebase-interactive.c                          |  2 +-
 refs/files-backend.c                          |  4 +-
 refs/packed-backend.c                         |  4 +-
 refs/ref-filter.c                             |  2 +-
 refs/reftable-backend.c                       |  2 +-
 refs/worktree.c                               |  4 +-
 remote.c                                      |  2 +-
 repository.c                                  |  4 +-
 rerere.c                                      |  8 +-
 reset.c                                       |  4 +-
 revision/bisect.c                             |  2 +-
 revision/blame.c                              |  4 +-
 revision/list-objects-filter.c                |  2 +-
 revision/revision.c                           |  8 +-
 revision/shallow.c                            |  2 +-
 run-command.c                                 |  2 +-
 scalar.c                                      |  6 +-
 sequencer.c                                   | 10 +--
 sequencer.h                                   |  2 +-
 setup.c                                       |  2 +-
 submodule-config.c                            |  2 +-
 submodule.c                                   |  4 +-
 t/helper/test-cache-tree.c                    |  4 +-
 t/helper/test-dir-iterator.c                  |  2 +-
 t/helper/test-dump-cache-tree.c               |  4 +-
 t/helper/test-dump-fsmonitor.c                |  2 +-
 t/helper/test-dump-split-index.c              |  4 +-
 t/helper/test-dump-untracked-cache.c          |  4 +-
 t/helper/test-fsmonitor-client.c              |  4 +-
 t/helper/test-lazy-init-name-hash.c           |  4 +-
 t/helper/test-parse-pathspec-file.c           |  2 +-
 t/helper/test-path-utils.c                    |  2 +-
 t/helper/test-path-walk.c                     |  2 +-
 t/helper/test-read-cache.c                    |  2 +-
 t/helper/test-scrap-cache-tree.c              |  4 +-
 t/helper/test-write-cache.c                   |  2 +-
 t/unit-tests/test-lib.c                       |  2 +-
 t/unit-tests/u-dir.c                          |  2 +-
 t/unit-tests/u-reftable-stack.c               |  2 +-
 t/unit-tests/u-strcmp-offset.c                |  2 +-
 trace2/tr2_sysenv.c                           |  2 +-
 188 files changed, 497 insertions(+), 497 deletions(-)
 rename cache-tree.c => index/cache-tree.c (99%)
 rename cache-tree.h => index/cache-tree.h (100%)
 rename checkout.c => index/checkout.c (98%)
 rename checkout.h => index/checkout.h (100%)
 rename dir-iterator.c => index/dir-iterator.c (99%)
 rename dir-iterator.h => index/dir-iterator.h (100%)
 rename dir.c => index/dir.c (99%)
 rename dir.h => index/dir.h (99%)
 rename entry.c => index/entry.c (98%)
 rename entry.h => index/entry.h (100%)
 rename fsmonitor--daemon.h => index/fsmonitor--daemon.h (99%)
 rename fsmonitor-ipc.c => index/fsmonitor-ipc.c (99%)
 rename fsmonitor-ipc.h => index/fsmonitor-ipc.h (100%)
 rename fsmonitor-ll.h => index/fsmonitor-ll.h (100%)
 rename fsmonitor-path-utils.h => index/fsmonitor-path-utils.h (100%)
 rename fsmonitor-settings.c => index/fsmonitor-settings.c (98%)
 rename fsmonitor-settings.h => index/fsmonitor-settings.h (100%)
 rename fsmonitor.c => index/fsmonitor.c (99%)
 rename fsmonitor.h => index/fsmonitor.h (95%)
 rename name-hash.c => index/name-hash.c (99%)
 rename name-hash.h => index/name-hash.h (100%)
 rename parallel-checkout.c => index/parallel-checkout.c (99%)
 rename parallel-checkout.h => index/parallel-checkout.h (100%)
 rename pathspec.c => index/pathspec.c (99%)
 rename pathspec.h => index/pathspec.h (100%)
 rename preload-index.c => index/preload-index.c (96%)
 rename preload-index.h => index/preload-index.h (100%)
 rename read-cache-ll.h => index/read-cache-ll.h (99%)
 rename read-cache.c => index/read-cache.c (99%)
 rename read-cache.h => index/read-cache.h (95%)
 rename resolve-undo.c => index/resolve-undo.c (97%)
 rename resolve-undo.h => index/resolve-undo.h (100%)
 rename sparse-index.c => index/sparse-index.c (99%)
 rename sparse-index.h => index/sparse-index.h (100%)
 rename split-index.c => index/split-index.c (99%)
 rename split-index.h => index/split-index.h (100%)
 rename statinfo.c => index/statinfo.c (99%)
 rename statinfo.h => index/statinfo.h (100%)
 rename symlinks.c => index/symlinks.c (99%)
 rename symlinks.h => index/symlinks.h (100%)
 rename unpack-trees.c => index/unpack-trees.c (99%)
 rename unpack-trees.h => index/unpack-trees.h (99%)
 rename wt-status.c => index/wt-status.c (99%)
 rename wt-status.h => index/wt-status.h (99%)
.gitorganize +44 -44
index d62d0a2240..fe81c40f09 100644
@@ -48,12 +48,8 @@ bundle-uri.c component=transport role=lib prefix=bundle-uri includes=transport:5
 bundle-uri.h component=transport role=header prefix=bundle-uri cochange=transport:14
 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
 bundle.h component=transport role=header prefix=bundle includes=revision:1 cochange=transport:37,revision:5
-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
-cache-tree.h component=index role=header prefix=cache-tree includes=odb:2 cochange=index:42,diff:4,revision:4,odb:3,refs:1
 chdir-notify.c component=? role=lib prefix=chdir-notify includes=revision:1 cochange=index:2,archive:1,merge:1,revision:1
 chdir-notify.h component=? role=public prefix=chdir-notify
-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
-checkout.h component=index role=header prefix=checkout includes=odb:1 cochange=index:4,diff:1,odb:1,refs:1,revision:1
 color.c component=? role=lib prefix=color includes=setup:1 cochange=diff:21,index:14,revision:13,setup:7,transport:7
 color.h component=? role=public prefix=color cochange=diff:18,index:12,revision:12,transport:2,odb:1
 column.c component=? role=lib prefix=column includes=setup:1 cochange=transport:6,setup:5,diff:4,revision:3,index:2
@@ -105,14 +101,8 @@ diff/userdiff.c component=diff role=lib prefix=userdiff includes=setup:2,convert
 diff/userdiff.h component=diff role=header prefix=diff includes=notes:1 cochange=diff:40,notes:2,archive:1,merge:1,revision:1
 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
 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
-dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1
-dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1
-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
-dir.h component=index role=header prefix=dir includes=index:2,odb:1 cochange=index:236,odb:13,setup:12,submodule:11,convert:10
 editor.c component=? role=lib prefix=editor includes=setup:2 cochange=transport:20,setup:12,index:8,odb:4,submodule:4
 editor.h component=? role=public prefix=editor cochange=transport:1
-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
-entry.h component=index role=header prefix=entry includes=convert:1 cochange=index:18,submodule:4,revision:3,transport:2,convert:1
 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
 environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9
 exec-cmd.c component=? role=lib prefix=strvec includes=setup:1
@@ -126,15 +116,6 @@ fetch-pack.h component=transport role=header prefix=fetch-pack includes=odb:1,re
 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
 fmt-merge-msg.h component=merge role=header prefix=fmt-merge-msg cochange=merge:3,setup:2
 for-each-ref.h component=? role=public prefix=?
-fsmonitor--daemon.h component=index role=header prefix=fsmonitor--daemon includes=index:1 cochange=index:1
-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
-fsmonitor-ipc.h component=index role=header prefix=fsmonitor cochange=index:2
-fsmonitor-ll.h component=index role=header prefix=fsmonitor-ll cochange=index:4
-fsmonitor-path-utils.h component=index role=header prefix=fsmonitor cochange=index:2
-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
-fsmonitor-settings.h component=index role=header prefix=fsmonitor-settings cochange=index:11,setup:4
-fsmonitor.c component=index role=lib prefix=fsmonitor includes=index:4,setup:3 cochange=index:37,setup:16,transport:4,merge:2,refs:2
-fsmonitor.h component=index role=header prefix=fsmonitor includes=index:4,odb:1 cochange=index:24,setup:7,diff:3,submodule:1
 gettext.c component=? role=lib prefix=gettext includes=setup:1 cochange=pack:5,refs:3,setup:2,transport:2,merge:1
 gettext.h component=? role=public prefix=i18n cochange=transport:2,setup:1
 git-compat-util.h component=? role=public prefix=git-compat-util cochange=setup:48,index:35,odb:22,pack:21,diff:17
@@ -165,6 +146,50 @@ http.h component=transport role=header prefix=http includes=transport:1 cochange
 ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4
 ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1
 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
+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
+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
+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
+index/checkout.h component=index role=header prefix=checkout includes=odb:1 cochange=index:4,diff:1,odb:1,refs:1,revision:1
+index/dir-iterator.c component=index role=lib prefix=dir-iterator includes=index:2 cochange=index:7,refs:1
+index/dir-iterator.h component=index role=header prefix=dir-iterator cochange=index:7,refs:1
+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
+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
+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
+index/entry.h component=index role=header prefix=entry includes=convert:1 cochange=index:18,submodule:4,revision:3,transport:2,convert:1
+index/fsmonitor--daemon.h component=index role=header prefix=fsmonitor--daemon includes=index:1 cochange=index:1
+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
+index/fsmonitor-ipc.h component=index role=header prefix=fsmonitor cochange=index:2
+index/fsmonitor-ll.h component=index role=header prefix=fsmonitor-ll cochange=index:4
+index/fsmonitor-path-utils.h component=index role=header prefix=fsmonitor cochange=index:2
+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
+index/fsmonitor-settings.h component=index role=header prefix=fsmonitor-settings cochange=index:11,setup:4
+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
+index/fsmonitor.h component=index role=header prefix=fsmonitor includes=index:4,odb:1 cochange=index:24,setup:7,diff:3,submodule:1
+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
+index/name-hash.h component=index role=header prefix=name-hash cochange=index:7
+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
+index/parallel-checkout.h component=index role=header prefix=parallel-checkout includes=convert:1 cochange=index:12,convert:1
+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
+index/pathspec.h component=index role=header prefix=pathspec cochange=index:67,diff:11,odb:9,convert:6,submodule:4
+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
+index/preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1
+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
+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
+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
+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
+index/resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1
+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
+index/sparse-index.h component=index role=header prefix=sparse-index cochange=index:16,setup:4,merge:1,revision:1
+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
+index/split-index.h component=index role=header prefix=split-index includes=odb:1 cochange=index:21,archive:1,merge:1,revision:1
+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
+index/statinfo.h component=index role=header prefix=statinfo cochange=index:8,odb:1,revision:1
+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
+index/symlinks.h component=index role=header prefix=symlinks cochange=index:9,diff:1
+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
+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
+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
+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
 iterator.h component=? role=public prefix=refs cochange=index:2,refs:2
 json-writer.c component=? role=lib prefix=json-writer
 json-writer.h component=? role=public prefix=json-writer cochange=transport:1
@@ -194,8 +219,6 @@ merge-ort.h component=merge role=header prefix=merge-ort includes=odb:1 cochange
 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
 merge.h component=merge role=header prefix=merge cochange=merge:1
 mergesort.h component=? role=public prefix=mergesort cochange=odb:1
-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
-name-hash.h component=index role=header prefix=name-hash cochange=index:7
 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
 notes-cache.h component=notes role=header prefix=notes-cache includes=notes:1 cochange=diff:7,notes:3
 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
@@ -300,8 +323,6 @@ pack/server-info.c component=pack role=lib prefix=server-info includes=odb:5,pac
 pack/server-info.h component=pack role=header prefix=server-info cochange=pack:2
 pager.c component=? role=lib prefix=pager includes=setup:4 cochange=setup:23,diff:9,transport:7,revision:3,submodule:3
 pager.h component=? role=public prefix=pager cochange=diff:3,setup:2,revision:1
-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
-parallel-checkout.h component=index role=header prefix=parallel-checkout includes=convert:1 cochange=index:12,convert:1
 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
 parse-options.c component=? role=lib prefix=parse-options cochange=index:14,diff:12,setup:10,transport:10,odb:6
 parse-options.h component=? role=public prefix=parse-options cochange=diff:7,merge:4,archive:3,index:3,refs:3
@@ -311,12 +332,8 @@ path-walk.c component=? role=lib prefix=path-walk includes=odb:9,revision:3,inde
 path-walk.h component=? role=public prefix=path-walk includes=odb:1 cochange=index:2
 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
 path.h component=? role=public prefix=path includes=setup:1 cochange=setup:23,refs:13,odb:11,index:10,pack:8
-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
-pathspec.h component=index role=header prefix=pathspec cochange=index:67,diff:11,odb:9,convert:6,submodule:4
 pkt-line.c component=transport role=lib prefix=pkt-line includes=transport:2 cochange=transport:102,pack:6,convert:5,diff:5,odb:3
 pkt-line.h component=transport role=header prefix=pkt-line cochange=transport:94,pack:5,convert:4,odb:2,diff:1
-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
-preload-index.h component=index role=header prefix=preload-index cochange=index:2,setup:1
 prio-queue.c component=? role=lib prefix=prio-queue cochange=odb:5,revision:5,diff:2,pack:2,transport:2
 prio-queue.h component=? role=public prefix=prio-queue cochange=odb:3,revision:2,transport:2,pack:1
 progress.c component=? role=lib prefix=progress includes=setup:1 cochange=index:11,diff:6,setup:6,pack:4,revision:2
@@ -331,9 +348,6 @@ protocol.c component=transport role=lib prefix=protocol includes=setup:2,transpo
 protocol.h component=transport role=header prefix=protocol cochange=transport:5
 quote.c component=? role=lib prefix=quote cochange=index:15,diff:12,transport:7,odb:6,revision:6
 quote.h component=? role=public prefix=quote cochange=diff:8,transport:6,index:5,odb:5,refs:5
-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
-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
-read-cache.h component=index role=header prefix=read-cache includes=index:2,odb:1,setup:1 cochange=index:4,setup:4,diff:2
 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
 rebase-interactive.h component=? role=public prefix=rebase-interactive
 rebase.c component=? role=lib prefix=rebase cochange=index:3,pack:3,setup:2,convert:1,diff:1
@@ -367,8 +381,6 @@ rerere.c component=merge role=lib prefix=rerere includes=index:4,merge:2,odb:2,s
 rerere.h component=merge role=header prefix=rerere cochange=merge:16,odb:1
 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
 reset.h component=? role=public prefix=reset includes=odb:1,setup:1
-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
-resolve-undo.h component=index role=header prefix=resolve-undo includes=odb:1 cochange=index:12,merge:3,archive:1,revision:1
 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
 revision/bisect.h component=revision role=header prefix=bisect cochange=revision:29,odb:2
 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
@@ -420,13 +432,7 @@ sideband.h component=transport role=header prefix=sideband cochange=transport:23
 sigchain.c component=? role=lib prefix=sigchain cochange=diff:2,transport:1
 sigchain.h component=? role=public prefix=sigchain cochange=diff:2
 simple-ipc.h component=? role=public prefix=simple-ipc includes=transport:1 cochange=submodule:1
-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
-sparse-index.h component=index role=header prefix=sparse-index cochange=index:16,setup:4,merge:1,revision:1
-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
-split-index.h component=index role=header prefix=split-index includes=odb:1 cochange=index:21,archive:1,merge:1,revision:1
 stable-qsort.c component=? role=lib prefix=stable-qsort
-statinfo.c component=index role=lib prefix=environment includes=setup:2,index:1 cochange=index:9,setup:6,diff:2,odb:1,revision:1
-statinfo.h component=index role=header prefix=statinfo cochange=index:8,odb:1,revision:1
 strbuf.c component=? role=lib prefix=strbuf cochange=index:16,odb:12,setup:11,revision:10,transport:10
 strbuf.h component=? role=public prefix=strbuf cochange=revision:15,index:14,odb:14,diff:7,setup:7
 string-list.c component=? role=lib prefix=string-list cochange=transport:14,index:8,notes:7,refs:7,diff:5
@@ -441,8 +447,6 @@ submodule-config.c component=submodule role=lib prefix=submodule-config includes
 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
 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
 submodule.h component=submodule role=header prefix=submodule cochange=submodule:128,index:22,diff:21,transport:17,setup:6
-symlinks.c component=index role=lib prefix=symlinks includes=index:1,setup:1 cochange=index:23,diff:3,archive:2,convert:1,revision:1
-symlinks.h component=index role=header prefix=symlinks cochange=index:9,diff:1
 tar.h component=? role=public prefix=tar-tree
 tempfile.c component=? role=lib prefix=tempfile cochange=pack:5,setup:4,index:3,odb:3,revision:3
 tempfile.h component=? role=public prefix=tempfile includes=revision:1 cochange=revision:3,diff:2,index:2,setup:2
@@ -463,8 +467,6 @@ unix-socket.c component=? role=lib prefix=unix-socket cochange=diff:3,revision:2
 unix-socket.h component=? role=public prefix=unix-socket
 unix-stream-server.c component=? role=lib prefix=unix-stream-server
 unix-stream-server.h component=? role=public prefix=unix-stream-server
-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
-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
 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
 upload-pack.h component=transport role=header prefix=upload-pack cochange=transport:18,refs:5,submodule:1
 url.c component=? role=lib prefix=url cochange=transport:12,revision:8,diff:6,index:2,refs:2
@@ -490,5 +492,3 @@ write-or-die.c component=? role=lib prefix=write-or-die cochange=pack:6,setup:6,
 write-or-die.h component=? role=public prefix=write-or-die
 ws.c component=convert role=lib prefix=whitespace includes=convert:2 cochange=convert:24,diff:18,archive:9,index:5,setup:5
 ws.h component=convert role=header prefix=whitespace cochange=diff:5,convert:2,setup:2
-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
-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
Documentation/MyFirstContribution.adoc +1 -1
index 2da56ca8fc..63468494c1 100644
@@ -390,7 +390,7 @@ to `repo_config()`. Let's modify the code we wrote in the previous commit.
 Be sure to include the header to allow you to use `struct wt_status`:
 
 ----
-#include "wt-status.h"
+#include "index/wt-status.h"
 ----
 
 Then modify your `cmd_psuh` implementation to declare your `struct wt_status`,
Makefile +21 -21

125 lines not on this page · raw message

add-interactive.c +3 -3
index 7bfc410361..5f4d379910 100644
@@ -7,14 +7,14 @@
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
-#include "preload-index.h"
-#include "read-cache-ll.h"
+#include "index/preload-index.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "revision/revision.h"
 #include "refs/refs.h"
 #include "string-list.h"
 #include "lockfile.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "run-command.h"
 #include "prompt.h"
 #include "odb/tree.h"
add-patch.c +2 -2
index c6860310c1..0499152dbc 100644
@@ -13,13 +13,13 @@
 #include "hex.h"
 #include "odb/object-name.h"
 #include "pager.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "strbuf.h"
 #include "sigchain.h"
 #include "run-command.h"
 #include "strvec.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "color.h"
 #include "compat/terminal.h"
 #include "prompt.h"
apply.c +5 -5
index b8d97d140d..70d5461fbe 100644
@@ -17,26 +17,26 @@
 #include "odb/odb.h"
 #include "pack/delta.h"
 #include "diff/diff.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "diff/xdiff-interface.h"
 #include "merge-ll.h"
 #include "lockfile.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "odb/object-name.h"
 #include "odb/object-file.h"
 #include "parse-options.h"
 #include "path.h"
 #include "quote.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "repository.h"
 #include "rerere.h"
 #include "apply.h"
-#include "entry.h"
+#include "index/entry.h"
 #include "setup.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "wildmatch.h"
 #include "ws.h"
 
archive.c +1 -1
index a2402fb7e6..e6fdd2ea8f 100644
@@ -21,7 +21,7 @@
 #include "attr.h"
 #include "archive.h"
 #include "parse-options.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "quote.h"
 
 static char const * const archive_usage[] = {
archive.h +1 -1
index bbe65ba0f9..d1496a485b 100644
@@ -1,7 +1,7 @@
 #ifndef ARCHIVE_H
 #define ARCHIVE_H
 
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "string-list.h"
 
 struct repository;
attr.c +2 -2
index e7d364d490..841d2f23ae 100644
@@ -14,12 +14,12 @@
 #include "environment.h"
 #include "exec-cmd.h"
 #include "attr.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "gettext.h"
 #include "path.h"
 #include "utf8.h"
 #include "quote.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "refs/refs.h"
 #include "revision/revision.h"
 #include "odb/odb.h"
builtin/add.c +4 -4
index 4dbdccd928..e544220eb2 100644
@@ -10,18 +10,18 @@
 #include "environment.h"
 #include "lockfile.h"
 #include "editor.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "gettext.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "run-command.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "odb/transaction.h"
 #include "parse-options.h"
 #include "path.h"
-#include "preload-index.h"
+#include "index/preload-index.h"
 #include "diff/diff.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "revision/revision.h"
 #include "strvec.h"
 #include "submodule.h"
builtin/am.c +4 -4
index 5dbe1f171b..0b6d77004f 100644
@@ -15,20 +15,20 @@
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "run-command.h"
 #include "hook.h"
 #include "quote.h"
 #include "tempfile.h"
 #include "lockfile.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "refs/refs.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "branch.h"
 #include "odb/object-name.h"
-#include "preload-index.h"
+#include "index/preload-index.h"
 #include "sequencer.h"
 #include "revision/revision.h"
 #include "merge-ort-wrappers.h"
builtin/backfill.c +1 -1
index d2ef39bc58..b8e21c844c 100644
@@ -7,7 +7,7 @@
 #include "parse-options.h"
 #include "repository.h"
 #include "odb/commit.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "hex.h"
 #include "odb/tree.h"
builtin/check-ignore.c +2 -2
index 644c9a414f..1d2c3cb8db 100644
@@ -1,11 +1,11 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "quote.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "parse-options.h"
 #include "submodule.h"
 #include "write-or-die.h"
builtin/checkout--worker.c +3 -3
index e0772b718b..9c49474753 100644
@@ -3,13 +3,13 @@
 
 #include "builtin.h"
 #include "config.h"
-#include "entry.h"
+#include "index/entry.h"
 #include "environment.h"
 #include "gettext.h"
-#include "parallel-checkout.h"
+#include "index/parallel-checkout.h"
 #include "parse-options.h"
 #include "pkt-line.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 
 static void packet_to_pc_item(const char *buffer, int len,
 			      struct parallel_checkout_item *pc_item)
builtin/checkout-index.c +5 -5
index 311b94ff31..c659e5c764 100644
@@ -13,13 +13,13 @@
 #include "gettext.h"
 #include "lockfile.h"
 #include "quote.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "parse-options.h"
-#include "entry.h"
-#include "parallel-checkout.h"
-#include "read-cache-ll.h"
+#include "index/entry.h"
+#include "index/parallel-checkout.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 
 #define CHECKOUT_ALL 4
 static int nul_term_line;
builtin/checkout.c +12 -12
index 286fcdc1ba..48882b0f8e 100644
@@ -4,12 +4,12 @@
 #include "builtin.h"
 #include "advice.h"
 #include "branch.h"
-#include "cache-tree.h"
-#include "checkout.h"
+#include "index/cache-tree.h"
+#include "index/checkout.h"
 #include "odb/commit.h"
 #include "config.h"
 #include "diff/diff.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -22,27 +22,27 @@
 #include "odb/odb.h"
 #include "parse-options.h"
 #include "path.h"
-#include "preload-index.h"
-#include "read-cache.h"
+#include "index/preload-index.h"
+#include "index/read-cache.h"
 #include "refs/refs.h"
 #include "remote.h"
 #include "repo-settings.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "revision/revision.h"
 #include "sequencer.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "strvec.h"
 #include "submodule.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "trace2.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "unpack-trees.h"
-#include "wt-status.h"
+#include "index/unpack-trees.h"
+#include "index/wt-status.h"
 #include "diff/xdiff-interface.h"
-#include "entry.h"
-#include "parallel-checkout.h"
+#include "index/entry.h"
+#include "index/parallel-checkout.h"
 #include "add-interactive.h"
 
 struct checkout_opts {
builtin/clean.c +3 -3
index 1d5e7e5366..81b3b86491 100644
@@ -12,18 +12,18 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
 #include "string-list.h"
 #include "quote.h"
 #include "column.h"
 #include "color.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "help.h"
 #include "prompt.h"
 
builtin/clone.c +3 -3
index 8ed07e1a15..58cf9761a0 100644
@@ -28,11 +28,11 @@
 #include "odb/odb.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "transport.h"
 #include "strbuf.h"
-#include "dir.h"
-#include "dir-iterator.h"
+#include "index/dir.h"
+#include "index/dir-iterator.h"
 #include "iterator.h"
 #include "sigchain.h"
 #include "branch.h"
builtin/commit.c +7 -7
index aa89e0dc52..85ab748ff0 100644
@@ -12,9 +12,9 @@
 #include "advice.h"
 #include "config.h"
 #include "lockfile.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "color.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "editor.h"
 #include "environment.h"
 #include "diff/diff.h"
@@ -22,21 +22,21 @@
 #include "add-interactive.h"
 #include "gettext.h"
 #include "revision/revision.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "path.h"
-#include "preload-index.h"
-#include "read-cache.h"
+#include "index/preload-index.h"
+#include "index/read-cache.h"
 #include "repository.h"
 #include "string-list.h"
 #include "rerere.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "column.h"
 #include "sequencer.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "mailmap.h"
 #include "help.h"
 #include "revision/commit-reach.h"
builtin/count-objects.c +1 -1
index 45a7a61cd3..cf10ddcae1 100644
@@ -6,7 +6,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "path.h"
builtin/describe.c +1 -1
index bbeba1e465..c22158d157 100644
@@ -12,7 +12,7 @@
 #include "refs/refs.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "revision/revision.h"
 #include "diff/diff.h"
 #include "hashmap.h"
builtin/diff-files.c +1 -1
index d1e8d2b462..1f67480362 100644
@@ -12,7 +12,7 @@
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "odb/commit.h"
-#include "preload-index.h"
+#include "index/preload-index.h"
 #include "revision/revision.h"
 
 static const char diff_files_usage[] =
builtin/diff-index.c +1 -1
index f3b2eadda0..dac8099081 100644
@@ -6,7 +6,7 @@
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "odb/commit.h"
-#include "preload-index.h"
+#include "index/preload-index.h"
 #include "revision/revision.h"
 #include "setup.h"
 
builtin/diff-tree.c +1 -1
index 2bd5ed4004..8f7f48ac67 100644
@@ -7,7 +7,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "revision/log-tree.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "revision/revision.h"
 #include "odb/tmp-objdir.h"
 #include "odb/tree.h"
builtin/diff.c +2 -2
index e4487901d3..0e8c488408 100644
@@ -18,8 +18,8 @@
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "diff/diffcore.h"
-#include "preload-index.h"
-#include "read-cache-ll.h"
+#include "index/preload-index.h"
+#include "index/read-cache-ll.h"
 #include "revision/revision.h"
 #include "revision/log-tree.h"
 #include "setup.h"
builtin/difftool.c +4 -4
index 075112d344..1d3fae8793 100644
@@ -23,16 +23,16 @@
 #include "hex.h"
 #include "parse-options.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "strvec.h"
 #include "strbuf.h"
 #include "lockfile.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
-#include "dir.h"
-#include "entry.h"
+#include "index/dir.h"
+#include "index/entry.h"
 #include "setup.h"
 
 static const char *const builtin_difftool_usage[] = {
builtin/fast-import.c +2 -2
index f3af94307f..da586c7c63 100644
@@ -15,11 +15,11 @@
 #include "pack/delta.h"
 #include "pack/pack.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "refs/refs.h"
 #include "csum-file.h"
 #include "quote.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "run-command.h"
 #include "pack/packfile.h"
 #include "odb/object-file.h"
builtin/fsck.c +4 -4
index a00ca35703..6e8fd0e828 100644
@@ -8,7 +8,7 @@
 #include "odb/tag.h"
 #include "refs/refs.h"
 #include "pack/pack.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "odb/fsck.h"
 #include "parse-options.h"
 #include "progress.h"
@@ -18,11 +18,11 @@
 #include "odb/odb.h"
 #include "odb/streaming.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "odb/replace-object.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "run-command.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "refs/worktree.h"
 #include "pack/pack-revindex.h"
 #include "pack/pack-bitmap.h"
builtin/fsmonitor--daemon.c +5 -5
index 4161dd8282..49b492fba0 100644
@@ -4,16 +4,16 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "parse-options.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-ipc.h"
-#include "fsmonitor-settings.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/fsmonitor-settings.h"
 #include "compat/fsmonitor/fsm-health.h"
 #include "compat/fsmonitor/fsm-listen.h"
-#include "fsmonitor--daemon.h"
+#include "index/fsmonitor--daemon.h"
 
 #include "simple-ipc.h"
 #include "strmap.h"
builtin/gc.c +1 -1
index c340489c64..0243b34e3e 100644
@@ -16,7 +16,7 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "date.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "hex.h"
 #include "config.h"
builtin/grep.c +3 -3
index d13858caec..20cd821af7 100644
@@ -20,8 +20,8 @@
 #include "run-command.h"
 #include "grep.h"
 #include "quote.h"
-#include "dir.h"
-#include "pathspec.h"
+#include "index/dir.h"
+#include "index/pathspec.h"
 #include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
@@ -33,7 +33,7 @@
 #include "pager.h"
 #include "path.h"
 #include "promisor-remote.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "write-or-die.h"
 
 static const char *grep_prefix;
builtin/history.c +4 -4
index 73a31ce152..c817745f30 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "odb/commit.h"
 #include "revision/commit-reach.h"
 #include "config.h"
@@ -14,7 +14,7 @@
 #include "odb/oidmap.h"
 #include "parse-options.h"
 #include "path.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "refs/refs.h"
 #include "replay.h"
 #include "reset.h"
@@ -23,8 +23,8 @@
 #include "strvec.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "unpack-trees.h"
-#include "wt-status.h"
+#include "index/unpack-trees.h"
+#include "index/wt-status.h"
 
 #define GIT_HISTORY_DROP_USAGE \
 	N_("git history drop <commit> [--dry-run] [--update-refs=(branches|head)] [--empty=(drop|keep|abort)]")
builtin/ls-files.c +5 -5
index fc3f8f4a72..49e8a685e3 100644
@@ -13,18 +13,18 @@
 #include "convert.h"
 #include "environment.h"
 #include "quote.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "gettext.h"
 #include "odb/object-name.h"
 #include "strbuf.h"
 #include "parse-options.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "string-list.h"
 #include "path.h"
-#include "pathspec.h"
-#include "read-cache.h"
+#include "index/pathspec.h"
+#include "index/read-cache.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
 #include "odb/odb.h"
 #include "hex.h"
builtin/ls-tree.c +1 -1
index 4f7d1d2b6d..b59c186a21 100644
@@ -16,7 +16,7 @@
 #include "path.h"
 #include "quote.h"
 #include "parse-options.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 
 static const char * const ls_tree_usage[] = {
 	N_("git ls-tree [<options>] <tree-ish> [<path>...]"),
builtin/merge-index.c +2 -2
index 3314fb1336..a0dafe16dc 100644
@@ -3,9 +3,9 @@
 
 #include "builtin.h"
 #include "hex.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "run-command.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 
 static const char *pgm;
 static int one_shot, quiet;
builtin/merge.c +5 -5
index 268ffc4855..da37fb11eb 100644
@@ -32,15 +32,15 @@
 #include "diff/diffcore.h"
 #include "path.h"
 #include "revision/revision.h"
-#include "unpack-trees.h"
-#include "cache-tree.h"
-#include "dir.h"
+#include "index/unpack-trees.h"
+#include "index/cache-tree.h"
+#include "index/dir.h"
 #include "color.h"
 #include "rerere.h"
 #include "help.h"
 #include "merge.h"
 #include "merge-ort-wrappers.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "remote.h"
 #include "fmt-merge-msg.h"
 #include "sequencer.h"
@@ -49,7 +49,7 @@
 #include "alias.h"
 #include "branch.h"
 #include "revision/commit-reach.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "pack/commit-graph.h"
 
 #define DEFAULT_TWOHEAD (1<<0)
builtin/mv.c +6 -6
index e347c100c0..f49eec035e 100644
@@ -13,21 +13,21 @@
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "odb/object-file.h"
 #include "path.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "lockfile.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "string-list.h"
 #include "parse-options.h"
-#include "read-cache-ll.h"
-#include "symlinks.h"
+#include "index/read-cache-ll.h"
+#include "index/symlinks.h"
 
 #include "setup.h"
 #include "strvec.h"
 #include "submodule.h"
-#include "entry.h"
+#include "index/entry.h"
 
 static const char * const builtin_mv_usage[] = {
 	N_("git mv [-v] [-f] [-n] [-k] <source> <destination>"),
builtin/pack-objects.c +1 -1
index 3b025a08e9..b611b27573 100644
@@ -36,7 +36,7 @@
 #include "odb/odb.h"
 #include "odb/streaming.h"
 #include "odb/replace-object.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "pack/midx.h"
 #include "trace2.h"
 #include "revision/shallow.h"
builtin/prune.c +1 -1
index ba7b1303b3..d2d5bd2619 100644
@@ -3,7 +3,7 @@
 #include "builtin.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
builtin/pull.c +3 -3
index af120a7e1b..818ddbf956 100644
@@ -20,15 +20,15 @@
 #include "run-command.h"
 #include "odb/oid-array.h"
 #include "remote.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "rebase.h"
 #include "refs/refs.h"
 #include "refs/refspec.h"
 #include "submodule.h"
 #include "submodule-config.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "revision/commit-reach.h"
 #include "sequencer.h"
 
builtin/push.c +1 -1
index 39b6ff4b8b..280cfd289f 100644
@@ -8,7 +8,7 @@
 #include "advice.h"
 #include "branch.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
builtin/read-tree.c +4 -4
index 8898354baa..2bc2f43729 100644
@@ -14,12 +14,12 @@
 #include "odb/object-name.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "cache-tree.h"
-#include "unpack-trees.h"
+#include "index/cache-tree.h"
+#include "index/unpack-trees.h"
 #include "parse-options.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
 
 static int nr_trees;
builtin/rebase.c +3 -3
index a14a31d60e..62b58da192 100644
@@ -15,10 +15,10 @@
 #include "hex.h"
 #include "run-command.h"
 #include "strvec.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "refs/refs.h"
 #include "config.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "lockfile.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
@@ -26,7 +26,7 @@
 #include "path.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "revision/revision.h"
 #include "revision/commit-reach.h"
 #include "rerere.h"
builtin/rerere.c +1 -1
index 545ffe2715..4b1b7d49ce 100644
@@ -9,7 +9,7 @@
 #include "string-list.h"
 #include "xdiff/xdiff.h"
 #include "diff/xdiff-interface.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 
 static const char * const rerere_usage[] = {
 	N_("git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"),
builtin/reset.c +4 -4
index eed0d0ea0b..96c7bf9cf1 100644
@@ -29,14 +29,14 @@
 #include "parse-options.h"
 #include "path.h"
 #include "repository.h"
-#include "unpack-trees.h"
-#include "cache-tree.h"
+#include "index/unpack-trees.h"
+#include "index/cache-tree.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
 #include "trace.h"
 #include "trace2.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "add-interactive.h"
 
 #define REFRESH_INDEX_DELAY_WARNING_IN_MS (2 * 1000)
builtin/rev-parse.c +2 -2
index ef4b6795dd..1d97c4869b 100644
@@ -23,12 +23,12 @@
 #include "parse-options.h"
 #include "path.h"
 #include "diff/diff.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repo-settings.h"
 #include "repository.h"
 #include "revision/revision.h"
 #include "setup.h"
-#include "split-index.h"
+#include "index/split-index.h"
 #include "submodule.h"
 #include "revision/commit-reach.h"
 #include "revision/shallow.h"
builtin/rm.c +4 -4
index c856b88d09..4f7194f541 100644
@@ -11,19 +11,19 @@
 #include "config.h"
 #include "environment.h"
 #include "lockfile.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "odb/tree-walk.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 
 #include "string-list.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 
 static const char * const builtin_rm_usage[] = {
 	N_("git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
builtin/show-branch.c +1 -1
index 8db11f6e4c..e0e912439c 100644
@@ -14,7 +14,7 @@
 #include "odb/object-name.h"
 #include "parse-options.h"
 
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/commit-slab.h"
 #include "date.h"
 #include "wildmatch.h"
builtin/sparse-checkout.c +4 -4
index 9b4cad87a5..efe6f7897e 100644
@@ -4,21 +4,21 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "path.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "lockfile.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "quote.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "refs/worktree.h"
 
 static const char *empty_base = "";
builtin/stash.c +7 -7
index 6458e3a2d6..a8337ffdc4 100644
@@ -11,20 +11,20 @@
 #include "parse-options.h"
 #include "refs/refs.h"
 #include "lockfile.h"
-#include "cache-tree.h"
-#include "unpack-trees.h"
+#include "index/cache-tree.h"
+#include "index/unpack-trees.h"
 #include "merge-ort-wrappers.h"
 #include "strvec.h"
 #include "run-command.h"
-#include "dir.h"
-#include "entry.h"
-#include "preload-index.h"
-#include "read-cache.h"
+#include "index/dir.h"
+#include "index/entry.h"
+#include "index/preload-index.h"
+#include "index/read-cache.h"
 #include "repository.h"
 #include "rerere.h"
 #include "revision/revision.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "revision/log-tree.h"
 #include "diff/diffcore.h"
 #include "refs/reflog.h"
builtin/submodule--helper.c +5 -5
index 0e061827f9..5226a5f331 100644
@@ -10,12 +10,12 @@
 #include "parse-options.h"
 #include "quote.h"
 #include "path.h"
-#include "pathspec.h"
-#include "preload-index.h"
-#include "dir.h"
-#include "read-cache.h"
+#include "index/pathspec.h"
+#include "index/preload-index.h"
+#include "index/dir.h"
+#include "index/read-cache.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "string-list.h"
builtin/update-index.c +9 -9
index 54741c3241..b5c8fae02c 100644
@@ -15,22 +15,22 @@
 #include "hex.h"
 #include "lockfile.h"
 #include "quote.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "odb/tree-walk.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "odb/transaction.h"
 #include "refs/refs.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "parse-options.h"
-#include "pathspec.h"
-#include "dir.h"
-#include "read-cache.h"
+#include "index/pathspec.h"
+#include "index/dir.h"
+#include "index/read-cache.h"
 #include "setup.h"
-#include "sparse-index.h"
-#include "split-index.h"
-#include "symlinks.h"
-#include "fsmonitor.h"
+#include "index/sparse-index.h"
+#include "index/split-index.h"
+#include "index/symlinks.h"
+#include "index/fsmonitor.h"
 #include "write-or-die.h"
 
 /*
builtin/worktree.c +3 -3
index 90af2193c1..c4068b45d6 100644
@@ -4,10 +4,10 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
-#include "checkout.h"
+#include "index/checkout.h"
 #include "config.h"
 #include "copy.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -17,7 +17,7 @@
 #include "path.h"
 #include "strvec.h"
 #include "branch.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "refs/refs.h"
 #include "remote.h"
 #include "run-command.h"
builtin/write-tree.c +1 -1
index 2e463ab394..4a2b1ceb58 100644
@@ -10,7 +10,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "odb/tree.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "parse-options.h"
 
 static const char * const write_tree_usage[] = {
compat/fsmonitor/fsm-health-darwin.c +2 -2
index c2afcbe6c8..f24d56b3d2 100644
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor-ll.h"
+#include "index/fsmonitor-ll.h"
 #include "fsm-health.h"
-#include "fsmonitor--daemon.h"
+#include "index/fsmonitor--daemon.h"
 
 int fsm_health__ctor(struct fsmonitor_daemon_state *state UNUSED)
 {
compat/fsmonitor/fsm-health-linux.c +2 -2
index 43d67c4b8b..7be822fb1c 100644
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor-ll.h"
+#include "index/fsmonitor-ll.h"
 #include "fsm-health.h"
-#include "fsmonitor--daemon.h"
+#include "index/fsmonitor--daemon.h"
 
 /*
  * The Linux fsmonitor implementation uses inotify which has its own
compat/fsmonitor/fsm-health-win32.c +2 -2
index 2aa8c219ac..09dee50777 100644
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor-ll.h"
+#include "index/fsmonitor-ll.h"
 #include "fsm-health.h"
-#include "fsmonitor--daemon.h"
+#include "index/fsmonitor--daemon.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 
compat/fsmonitor/fsm-ipc-unix.c +3 -3
index fe149a1b37..ffd864ae92 100644
@@ -7,9 +7,9 @@
 #include "path.h"
 #include "repository.h"
 #include "strbuf.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-ipc.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/fsmonitor-path-utils.h"
 
 static GIT_PATH_FUNC(fsmonitor_ipc__get_default_path, "fsmonitor--daemon.ipc")
 
compat/fsmonitor/fsm-ipc-win32.c +1 -1
index 41984ea48e..bc92e1fd20 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor-ipc.h"
+#include "index/fsmonitor-ipc.h"
 #include "path.h"
 
 const char *fsmonitor_ipc__get_path(struct repository *r) {
compat/fsmonitor/fsm-listen-darwin.c +3 -3
index 43c3a915a0..fac5256a74 100644
@@ -24,10 +24,10 @@
 #endif
 
 #include "git-compat-util.h"
-#include "fsmonitor-ll.h"
+#include "index/fsmonitor-ll.h"
 #include "fsm-listen.h"
-#include "fsmonitor--daemon.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor--daemon.h"
+#include "index/fsmonitor-path-utils.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "string-list.h"
compat/fsmonitor/fsm-listen-linux.c +4 -4
index e3dca14b62..0208a6d942 100644
@@ -1,9 +1,9 @@
 #include "git-compat-util.h"
-#include "dir.h"
-#include "fsmonitor-ll.h"
+#include "index/dir.h"
+#include "index/fsmonitor-ll.h"
 #include "fsm-listen.h"
-#include "fsmonitor--daemon.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor--daemon.h"
+#include "index/fsmonitor-path-utils.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "string-list.h"
compat/fsmonitor/fsm-listen-win32.c +2 -2
index 9a6efc9bea..c8cbdf4a97 100644
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor-ll.h"
+#include "index/fsmonitor-ll.h"
 #include "fsm-listen.h"
-#include "fsmonitor--daemon.h"
+#include "index/fsmonitor--daemon.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "trace2.h"
compat/fsmonitor/fsm-path-utils-darwin.c +2 -2
index 049f97eaaf..b67b1262c0 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-path-utils.h"
 #include "gettext.h"
 #include "trace.h"
 #include <dirent.h>
compat/fsmonitor/fsm-path-utils-linux.c +2 -2
index c9866b1b24..da62f0b167 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-path-utils.h"
 #include "gettext.h"
 #include "trace.h"
 
compat/fsmonitor/fsm-path-utils-win32.c +2 -2
index f4f9cc1f33..112149cf81 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-path-utils.h"
 #include "gettext.h"
 #include "trace.h"
 
compat/fsmonitor/fsm-settings-unix.c +4 -4
index a382590635..41106355b1 100644
@@ -1,9 +1,9 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-ipc.h"
-#include "fsmonitor-settings.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/fsmonitor-settings.h"
+#include "index/fsmonitor-path-utils.h"
 
  /*
  * For the builtin FSMonitor, we create the Unix domain socket for the
compat/fsmonitor/fsm-settings-win32.c +3 -3
index 0f2aa321f6..5b2872a4f1 100644
@@ -1,9 +1,9 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "repository.h"
-#include "fsmonitor-ll.h"
-#include "fsmonitor-settings.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ll.h"
+#include "index/fsmonitor-settings.h"
+#include "index/fsmonitor-path-utils.h"
 
 /*
  * VFS for Git is incompatible with FSMonitor.
compat/mingw.c +2 -2
index 785de5beb7..64814ac35d 100644
@@ -5,13 +5,13 @@
 #include "abspath.h"
 #include "odb/alloc.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "repository.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "strbuf.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "trace2.h"
 #include "win32.h"
 #include "win32/exit-process.h"
config.c +1 -1
index 3f335dbec1..59c6029654 100644
@@ -12,7 +12,7 @@
 #include "date.h"
 #include "branch.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "parse.h"
 #include "convert.h"
 #include "environment.h"
convert.c +1 -1
index 25c800eea2..f71d6dcefd 100644
@@ -12,7 +12,7 @@
 #include "attr.h"
 #include "run-command.h"
 #include "quote.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "sigchain.h"
 #include "pkt-line.h"
 #include "sub-process.h"
diagnose.c +1 -1
index 716dabf05c..0bac203282 100644
@@ -2,7 +2,7 @@
 #include "diagnose.h"
 #include "compat/disk.h"
 #include "archive.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "help.h"
 #include "gettext.h"
 #include "hex.h"
diff/diff-lib.c +6 -6
index d48196f7c7..4a932f9067 100644
@@ -13,17 +13,17 @@
 #include "odb/hash.h"
 #include "hex.h"
 #include "odb/object-name.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "revision/revision.h"
-#include "cache-tree.h"
-#include "unpack-trees.h"
+#include "index/cache-tree.h"
+#include "index/unpack-trees.h"
 #include "refs/refs.h"
 #include "repository.h"
 #include "submodule.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "trace.h"
-#include "dir.h"
-#include "fsmonitor.h"
+#include "index/dir.h"
+#include "index/fsmonitor.h"
 #include "revision/commit-reach.h"
 
 /*
diff/diff-no-index.c +2 -2
index 19cb90d121..12a793096b 100644
@@ -15,9 +15,9 @@
 #include "gettext.h"
 #include "revision/revision.h"
 #include "parse-options.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "string-list.h"
-#include "dir.h"
+#include "index/dir.h"
 
 static int read_directory_contents(const char *path, struct string_list *list,
 				   const struct pathspec *pathspec,
diff/diff.c +2 -2
index 2b87f27238..c00b87cca2 100644
@@ -39,10 +39,10 @@
 #include "parse-options.h"
 #include "help.h"
 #include "promisor-remote.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
 #include "strmap.h"
 #include "ws.h"
diff/diff.h +1 -1
index 502bf24432..2ef74733b9 100644
@@ -5,7 +5,7 @@
 #define DIFF_H
 
 #include "odb/hash.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "strbuf.h"
 #include "color.h"
 
diff/tree-diff.c +1 -1
index 4b7c90f6db..a34559daa5 100644
@@ -11,7 +11,7 @@
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
 #include "repository.h"
-#include "dir.h"
+#include "index/dir.h"
 
 /*
  * Some mode bits are also used internally for computations.
git.c +1 -1
index 9dace05858..f01a80867b 100644
@@ -8,7 +8,7 @@
 #include "help.h"
 #include "odb/object-file.h"
 #include "pager.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "run-command.h"
 #include "alias.h"
 #include "odb/replace-object.h"
gpg-interface.c +1 -1
index 034bed7aaa..45a922496b 100644
@@ -7,7 +7,7 @@
 #include "gettext.h"
 #include "run-command.h"
 #include "strbuf.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "ident.h"
 #include "gpg-interface.h"
 #include "path.h"
help.c +1 -1
index 96f98ec621..f7a0950f6c 100644
@@ -18,7 +18,7 @@
 #include "refs/refs.h"
 #include "parse-options.h"
 #include "prompt.h"
-#include "fsmonitor-ipc.h"
+#include "index/fsmonitor-ipc.h"
 #include "repository.h"
 #include "alias.h"
 #include "utf8.h"
index/cache-tree.c renamed from cache-tree.c +2 -2
similarity index 99%
rename from cache-tree.c
rename to index/cache-tree.c
index 1c4295761a..e7c4bfe45c 100644
@@ -7,11 +7,11 @@
 #include "lockfile.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "odb/transaction.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "odb/replace-object.h"
 #include "repository.h"
 #include "promisor-remote.h"
index/cache-tree.h renamed from cache-tree.h +0 -0
similarity index 100%
rename from cache-tree.h
rename to index/cache-tree.h
index/checkout.c renamed from checkout.c +1 -1
similarity index 98%
rename from checkout.c
rename to index/checkout.c
index e3b4d341da..13d8895032 100644
@@ -5,7 +5,7 @@
 #include "remote.h"
 #include "refs/refspec.h"
 #include "repository.h"
-#include "checkout.h"
+#include "index/checkout.h"
 #include "config.h"
 #include "strbuf.h"
 
index/checkout.h renamed from checkout.h +0 -0
similarity index 100%
rename from checkout.h
rename to index/checkout.h
index/dir-iterator.c renamed from dir-iterator.c +2 -2
similarity index 99%
rename from dir-iterator.c
rename to index/dir-iterator.c
index 857e1d9bda..382bd4325c 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "iterator.h"
-#include "dir-iterator.h"
+#include "index/dir-iterator.h"
 #include "string-list.h"
 
 struct dir_iterator_level {
index/dir-iterator.h renamed from dir-iterator.h +0 -0
similarity index 100%
rename from dir-iterator.h
rename to index/dir-iterator.h
index/dir.c renamed from dir.c +7 -7
similarity index 99%
rename from dir.c
rename to index/dir.c
index d230ecdec1..6f74a3e87c 100644
@@ -13,26 +13,26 @@
 #include "abspath.h"
 #include "config.h"
 #include "convert.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "odb/object-file.h"
 #include "path.h"
 #include "refs/refs.h"
 #include "repository.h"
 #include "wildmatch.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "utf8.h"
 #include "varint.h"
 #include "ewah/ewok.h"
-#include "fsmonitor-ll.h"
-#include "read-cache-ll.h"
+#include "index/fsmonitor-ll.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "strbuf.h"
 #include "submodule-config.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "trace2.h"
 #include "odb/tree.h"
 #include "hex.h"
index/dir.h renamed from dir.h +2 -2
similarity index 99%
rename from dir.h
rename to index/dir.h
index 239c7efb1e..c44cff5bdd 100644
@@ -3,8 +3,8 @@
 
 #include "odb/hash.h"
 #include "hashmap.h"
-#include "pathspec.h"
-#include "statinfo.h"
+#include "index/pathspec.h"
+#include "index/statinfo.h"
 #include "strbuf.h"
 
 struct repository;
index/entry.c renamed from entry.c +7 -7
similarity index 98%
rename from entry.c
rename to index/entry.c
index 823a433539..5b89ad2294 100644
@@ -3,18 +3,18 @@
 #include "git-compat-util.h"
 #include "odb/odb.h"
 #include "odb/streaming.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "name-hash.h"
-#include "sparse-index.h"
+#include "index/name-hash.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "progress.h"
-#include "fsmonitor.h"
-#include "entry.h"
-#include "parallel-checkout.h"
+#include "index/fsmonitor.h"
+#include "index/entry.h"
+#include "index/parallel-checkout.h"
 
 static void create_directories(const char *path, int path_len,
 			       const struct checkout *state)
index/entry.h renamed from entry.h +0 -0
similarity index 100%
rename from entry.h
rename to index/entry.h
index/fsmonitor--daemon.h renamed from fsmonitor--daemon.h +1 -1
similarity index 99%
rename from fsmonitor--daemon.h
rename to index/fsmonitor--daemon.h
index 5cbbec8d94..9a542198cd 100644
@@ -5,7 +5,7 @@
 
 #include "hashmap.h"
 #include "thread-utils.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-path-utils.h"
 
 struct fsmonitor_batch;
 struct fsmonitor_token_data;
index/fsmonitor-ipc.c renamed from fsmonitor-ipc.c +1 -1
similarity index 99%
rename from fsmonitor-ipc.c
rename to index/fsmonitor-ipc.c
index 6112d13064..7c213245a1 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "simple-ipc.h"
-#include "fsmonitor-ipc.h"
+#include "index/fsmonitor-ipc.h"
 #include "repository.h"
 #include "run-command.h"
 #include "strbuf.h"
index/fsmonitor-ipc.h renamed from fsmonitor-ipc.h +0 -0
similarity index 100%
rename from fsmonitor-ipc.h
rename to index/fsmonitor-ipc.h
index/fsmonitor-ll.h renamed from fsmonitor-ll.h +0 -0
similarity index 100%
rename from fsmonitor-ll.h
rename to index/fsmonitor-ll.h
index/fsmonitor-path-utils.h renamed from fsmonitor-path-utils.h +0 -0
similarity index 100%
rename from fsmonitor-path-utils.h
rename to index/fsmonitor-path-utils.h
index/fsmonitor-settings.c renamed from fsmonitor-settings.c +3 -3
similarity index 98%
rename from fsmonitor-settings.c
rename to index/fsmonitor-settings.c
index a6587a8972..883b5902a9 100644
@@ -2,9 +2,9 @@
 #include "config.h"
 #include "gettext.h"
 #include "repository.h"
-#include "fsmonitor-ipc.h"
-#include "fsmonitor-settings.h"
-#include "fsmonitor-path-utils.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/fsmonitor-settings.h"
+#include "index/fsmonitor-path-utils.h"
 
 /*
  * We keep this structure definition private and have getters
index/fsmonitor-settings.h renamed from fsmonitor-settings.h +0 -0
similarity index 100%
rename from fsmonitor-settings.h
rename to index/fsmonitor-settings.h
index/fsmonitor.c renamed from fsmonitor.c +4 -4
similarity index 99%
rename from fsmonitor.c
rename to index/fsmonitor.c
index 107767527e..606a59d36d 100644
@@ -3,12 +3,12 @@
 
 #include "git-compat-util.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "ewah/ewok.h"
-#include "fsmonitor.h"
-#include "fsmonitor-ipc.h"
-#include "name-hash.h"
+#include "index/fsmonitor.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/name-hash.h"
 #include "repository.h"
 #include "run-command.h"
 #include "strbuf.h"
index/fsmonitor.h renamed from fsmonitor.h +4 -4
similarity index 95%
rename from fsmonitor.h
rename to index/fsmonitor.h
index 59591ee49e..95f4eaefa4 100644
@@ -1,11 +1,11 @@
 #ifndef FSMONITOR_H
 #define FSMONITOR_H
 
-#include "fsmonitor-ll.h"
-#include "dir.h"
-#include "fsmonitor-settings.h"
+#include "index/fsmonitor-ll.h"
+#include "index/dir.h"
+#include "index/fsmonitor-settings.h"
 #include "odb/object.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "trace.h"
 
 /*
index/name-hash.c renamed from name-hash.c +3 -3
similarity index 99%
rename from name-hash.c
rename to index/name-hash.c
index 1464b6d066..5d126bc1a3 100644
@@ -12,13 +12,13 @@
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "odb/object.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "thread-utils.h"
 #include "trace.h"
 #include "trace2.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 
 struct dir_entry {
 	struct hashmap_entry ent;
index/name-hash.h renamed from name-hash.h +0 -0
similarity index 100%
rename from name-hash.h
rename to index/name-hash.h
index/parallel-checkout.c renamed from parallel-checkout.c +4 -4
similarity index 99%
rename from parallel-checkout.c
rename to index/parallel-checkout.c
index 85d1c25a81..971c4b33fa 100644
@@ -3,18 +3,18 @@
 
 #include "git-compat-util.h"
 #include "config.h"
-#include "entry.h"
+#include "index/entry.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
-#include "parallel-checkout.h"
+#include "index/parallel-checkout.h"
 #include "pkt-line.h"
 #include "progress.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "odb/streaming.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "thread-utils.h"
 #include "trace2.h"
 
index/parallel-checkout.h renamed from parallel-checkout.h +0 -0
similarity index 100%
rename from parallel-checkout.h
rename to index/parallel-checkout.h
index/pathspec.c renamed from pathspec.c +4 -4
similarity index 99%
rename from pathspec.c
rename to index/pathspec.c
index 281858f21f..7a0c152fb9 100644
@@ -3,16 +3,16 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "parse.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "attr.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "repository.h"
 #include "setup.h"
 #include "strvec.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "quote.h"
 #include "wildmatch.h"
 
index/pathspec.h renamed from pathspec.h +0 -0
similarity index 100%
rename from pathspec.h
rename to index/pathspec.h
index/preload-index.c renamed from preload-index.c +6 -6
similarity index 96%
rename from preload-index.c
rename to index/preload-index.c
index b222821b44..eab3bfc602 100644
@@ -5,18 +5,18 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "pathspec.h"
-#include "dir.h"
+#include "index/pathspec.h"
+#include "index/dir.h"
 #include "environment.h"
-#include "fsmonitor.h"
+#include "index/fsmonitor.h"
 #include "gettext.h"
 #include "parse.h"
-#include "preload-index.h"
+#include "index/preload-index.h"
 #include "progress.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "thread-utils.h"
 #include "repository.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "trace2.h"
 #include "config.h"
 
index/preload-index.h renamed from preload-index.h +0 -0
similarity index 100%
rename from preload-index.h
rename to index/preload-index.h
index/read-cache-ll.h renamed from read-cache-ll.h +1 -1
similarity index 99%
rename from read-cache-ll.h
rename to index/read-cache-ll.h
index 312e65ff3c..450de019b4 100644
@@ -3,7 +3,7 @@
 
 #include "odb/hash.h"
 #include "hashmap.h"
-#include "statinfo.h"
+#include "index/statinfo.h"
 
 /*
  * Basic data structures for the directory cache
index/read-cache.c renamed from read-cache.c +10 -10
similarity index 99%
rename from read-cache.c
rename to index/read-cache.c
index a970eb1b6a..9c62ae5ee8 100644
@@ -15,9 +15,9 @@
 #include "hex.h"
 #include "tempfile.h"
 #include "lockfile.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "refs/refs.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "odb/transaction.h"
@@ -27,24 +27,24 @@
 #include "environment.h"
 #include "gettext.h"
 #include "mem-pool.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "odb/object-name.h"
 #include "path.h"
-#include "preload-index.h"
-#include "read-cache.h"
+#include "index/preload-index.h"
+#include "index/read-cache.h"
 #include "repository.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "revision/revision.h"
 #include "strbuf.h"
 #include "trace2.h"
 #include "varint.h"
-#include "split-index.h"
-#include "symlinks.h"
+#include "index/split-index.h"
+#include "index/symlinks.h"
 #include "utf8.h"
-#include "fsmonitor.h"
+#include "index/fsmonitor.h"
 #include "thread-utils.h"
 #include "progress.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "csum-file.h"
 #include "promisor-remote.h"
 #include "hook.h"
index/read-cache.h renamed from read-cache.h +2 -2
similarity index 95%
rename from read-cache.h
rename to index/read-cache.h
index 69a7118a66..d8519c7b36 100644
@@ -1,9 +1,9 @@
 #ifndef READ_CACHE_H
 #define READ_CACHE_H
 
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "odb/object.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "environment.h"
 
 /*
index/resolve-undo.c renamed from resolve-undo.c +4 -4
similarity index 97%
rename from resolve-undo.c
rename to index/resolve-undo.c
index a54b6c0f79..b94d8b403c 100644
@@ -1,11 +1,11 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/hash.h"
-#include "read-cache.h"
-#include "resolve-undo.h"
-#include "sparse-index.h"
+#include "index/read-cache.h"
+#include "index/resolve-undo.h"
+#include "index/sparse-index.h"
 #include "string-list.h"
 
 /* The only error case is to run out of memory in string-list */
index/resolve-undo.h renamed from resolve-undo.h +0 -0
similarity index 100%
rename from resolve-undo.h
rename to index/resolve-undo.h
index/sparse-index.c renamed from sparse-index.c +7 -7
similarity index 99%
rename from sparse-index.c
rename to index/sparse-index.c
index 8e00862442..0a061a7658 100644
@@ -5,17 +5,17 @@
 #include "environment.h"
 #include "ewah/ewok.h"
 #include "gettext.h"
-#include "name-hash.h"
-#include "read-cache-ll.h"
+#include "index/name-hash.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "odb/tree.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "trace2.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "config.h"
-#include "dir.h"
-#include "fsmonitor-ll.h"
+#include "index/dir.h"
+#include "index/fsmonitor-ll.h"
 #include "advice.h"
 
 /**
index/sparse-index.h renamed from sparse-index.h +0 -0
similarity index 100%
rename from sparse-index.h
rename to index/sparse-index.h
index/split-index.c renamed from split-index.c +2 -2
similarity index 99%
rename from split-index.c
rename to index/split-index.c
index 2737cc6118..02a5b011c5 100644
@@ -4,9 +4,9 @@
 #include "gettext.h"
 #include "odb/hash.h"
 #include "mem-pool.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
-#include "split-index.h"
+#include "index/split-index.h"
 #include "strbuf.h"
 #include "ewah/ewok.h"
 
index/split-index.h renamed from split-index.h +0 -0
similarity index 100%
rename from split-index.h
rename to index/split-index.h
index/statinfo.c renamed from statinfo.c +1 -1
similarity index 99%
rename from statinfo.c
rename to index/statinfo.c
index 5e00af127d..4a22923009 100644
@@ -2,7 +2,7 @@
 
 #include "git-compat-util.h"
 #include "environment.h"
-#include "statinfo.h"
+#include "index/statinfo.h"
 #include "repository.h"
 
 /*
index/statinfo.h renamed from statinfo.h +0 -0
similarity index 100%
rename from statinfo.h
rename to index/statinfo.h
index/symlinks.c renamed from symlinks.c +1 -1
similarity index 99%
rename from symlinks.c
rename to index/symlinks.c
index 9e01ab3bc8..18fadf3f75 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "setup.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 
 static int threaded_check_leading_path(struct cache_def *cache, const char *name,
 				       int len, int warn_on_lstat_err);
index/symlinks.h renamed from symlinks.h +0 -0
similarity index 100%
rename from symlinks.h
rename to index/symlinks.h
index/unpack-trees.c renamed from unpack-trees.c +11 -11
similarity index 99%
rename from unpack-trees.c
rename to index/unpack-trees.c
index b911700d74..68d85f622e 100644
@@ -6,30 +6,30 @@
 #include "strvec.h"
 #include "repository.h"
 #include "parse.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "cache-tree.h"
-#include "unpack-trees.h"
+#include "index/cache-tree.h"
+#include "index/unpack-trees.h"
 #include "progress.h"
 #include "refs/refs.h"
 #include "attr.h"
-#include "read-cache.h"
-#include "split-index.h"
-#include "sparse-index.h"
+#include "index/read-cache.h"
+#include "index/split-index.h"
+#include "index/sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "trace2.h"
-#include "fsmonitor.h"
+#include "index/fsmonitor.h"
 #include "odb/odb.h"
 #include "promisor-remote.h"
-#include "entry.h"
-#include "parallel-checkout.h"
+#include "index/entry.h"
+#include "index/parallel-checkout.h"
 #include "setup.h"
 
 /*
index/unpack-trees.h renamed from unpack-trees.h +1 -1
similarity index 99%
rename from unpack-trees.h
rename to index/unpack-trees.h
index d9d3ce09fd..f652a43f11 100644
@@ -2,7 +2,7 @@
 #define UNPACK_TREES_H
 
 #include "convert.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "strvec.h"
 #include "string-list.h"
 #include "odb/tree-walk.h"
index/wt-status.c renamed from wt-status.c +4 -4
similarity index 99%
rename from wt-status.c
rename to index/wt-status.c
index 83fdf5334f..3381a40e75 100644
@@ -3,9 +3,9 @@
 
 #include "git-compat-util.h"
 #include "advice.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "odb/object.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
 #include "environment.h"
@@ -24,7 +24,7 @@
 #include "refs/refs.h"
 #include "submodule.h"
 #include "column.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "setup.h"
 #include "strbuf.h"
 #include "trace.h"
@@ -34,7 +34,7 @@
 #include "refs/worktree.h"
 #include "lockfile.h"
 #include "sequencer.h"
-#include "fsmonitor-settings.h"
+#include "index/fsmonitor-settings.h"
 
 #define AB_DELAY_WARNING_IN_MS (2 * 1000)
 #define UF_DELAY_WARNING_IN_MS (2 * 1000)
index/wt-status.h renamed from wt-status.h +1 -1
similarity index 99%
rename from wt-status.h
rename to index/wt-status.h
index e9fe32e98c..b7a508186d 100644
@@ -3,7 +3,7 @@
 
 #include "string-list.h"
 #include "color.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "remote.h"
 
 struct repository;
merge-ort-wrappers.c +1 -1
index 846753abdf..c31ed7028d 100644
@@ -5,7 +5,7 @@
 #include "lockfile.h"
 #include "merge-ort.h"
 #include "merge-ort-wrappers.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "odb/tag.h"
 #include "odb/tree.h"
merge-ort.c +6 -6
index 71274c24bf..516cd265c5 100644
@@ -23,17 +23,17 @@
 #include "odb/alloc.h"
 #include "advice.h"
 #include "attr.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "odb/commit.h"
 #include "revision/commit-reach.h"
 #include "config.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "entry.h"
+#include "index/entry.h"
 #include "merge-ll.h"
 #include "odb/match-trees.h"
 #include "mem-pool.h"
@@ -43,14 +43,14 @@
 #include "odb/oid-array.h"
 #include "path.h"
 #include "promisor-remote.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "refs/refs.h"
 #include "revision/revision.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "strmap.h"
 #include "trace2.h"
 #include "odb/tree.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "diff/xdiff-interface.h"
 
 /*
merge.c +2 -2
index f46d968b70..0fcfc1460f 100644
@@ -9,10 +9,10 @@
 #include "odb/commit.h"
 #include "repository.h"
 #include "run-command.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 
 static const char *merge_argument(struct commit *commit)
 {
meson.build +20 -20
index 65be53078d..c61ebc35a6 100644
@@ -326,10 +326,10 @@ libgit_sources = [
   'branch.c',
   'bundle-uri.c',
   'bundle.c',
-  'cache-tree.c',
+  'index/cache-tree.c',
   'odb/cbtree.c',
   'chdir-notify.c',
-  'checkout.c',
+  'index/checkout.c',
   'pack/chunk-format.c',
   'color.c',
   'column.c',
@@ -363,10 +363,10 @@ libgit_sources = [
   'diff/diffcore-pickaxe.c',
   'diff/diffcore-rename.c',
   'diff/diffcore-rotate.c',
-  'dir-iterator.c',
-  'dir.c',
+  'index/dir-iterator.c',
+  'index/dir.c',
   'editor.c',
-  'entry.c',
+  'index/entry.c',
   'environment.c',
   'ewah/bitmap.c',
   'ewah/ewah_bitmap.c',
@@ -378,9 +378,9 @@ libgit_sources = [
   'fetch-pack.c',
   'fmt-merge-msg.c',
   'odb/fsck.c',
-  'fsmonitor.c',
-  'fsmonitor-ipc.c',
-  'fsmonitor-settings.c',
+  'index/fsmonitor.c',
+  'index/fsmonitor-ipc.c',
+  'index/fsmonitor-settings.c',
   'gettext.c',
   'git-zlib.c',
   'gpg-interface.c',
@@ -418,7 +418,7 @@ libgit_sources = [
   'merge.c',
   'pack/midx.c',
   'pack/midx-write.c',
-  'name-hash.c',
+  'index/name-hash.c',
   'negotiator/default.c',
   'negotiator/noop.c',
   'negotiator/skipping.c',
@@ -457,7 +457,7 @@ libgit_sources = [
   'pack/packfile.c',
   'pack/packfile-list.c',
   'pager.c',
-  'parallel-checkout.c',
+  'index/parallel-checkout.c',
   'parse.c',
   'parse-options-cb.c',
   'parse-options.c',
@@ -465,9 +465,9 @@ libgit_sources = [
   'diff/patch-ids.c',
   'path.c',
   'path-walk.c',
-  'pathspec.c',
+  'index/pathspec.c',
   'pkt-line.c',
-  'preload-index.c',
+  'index/preload-index.c',
   'revision/pretty.c',
   'prio-queue.c',
   'progress.c',
@@ -480,7 +480,7 @@ libgit_sources = [
   'quote.c',
   'diff/range-diff.c',
   'pack/reachable.c',
-  'read-cache.c',
+  'index/read-cache.c',
   'rebase-interactive.c',
   'rebase.c',
   'refs/ref-filter.c',
@@ -521,7 +521,7 @@ libgit_sources = [
   'repository.c',
   'rerere.c',
   'reset.c',
-  'resolve-undo.c',
+  'index/resolve-undo.c',
   'revision/revision.c',
   'run-command.c',
   'send-pack.c',
@@ -532,10 +532,10 @@ libgit_sources = [
   'revision/shallow.c',
   'sideband.c',
   'sigchain.c',
-  'sparse-index.c',
-  'split-index.c',
+  'index/sparse-index.c',
+  'index/split-index.c',
   'stable-qsort.c',
-  'statinfo.c',
+  'index/statinfo.c',
   'strbuf.c',
   'string-list.c',
   'strmap.c',
@@ -543,7 +543,7 @@ libgit_sources = [
   'sub-process.c',
   'submodule-config.c',
   'submodule.c',
-  'symlinks.c',
+  'index/symlinks.c',
   'odb/tag.c',
   'tempfile.c',
   'thread-utils.c',
@@ -568,7 +568,7 @@ libgit_sources = [
   'diff/tree-diff.c',
   'odb/tree-walk.c',
   'odb/tree.c',
-  'unpack-trees.c',
+  'index/unpack-trees.c',
   'upload-pack.c',
   'url.c',
   'urlmatch.c',
@@ -583,7 +583,7 @@ libgit_sources = [
   'wrapper.c',
   'write-or-die.c',
   'ws.c',
-  'wt-status.c',
+  'index/wt-status.c',
   'diff/xdiff-interface.c',
   'xdiff/xdiffi.c',
   'xdiff/xemit.c',
notes-merge.c +1 -1
index 53f42ba863..2bb6ad735e 100644
@@ -16,7 +16,7 @@
 #include "hex.h"
 #include "diff/xdiff-interface.h"
 #include "merge-ll.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "notes.h"
 #include "notes-merge.h"
 #include "strbuf.h"
odb/commit.c +1 -1
index 1b0703a9ef..3b490c760c 100644
@@ -20,7 +20,7 @@
 #include "odb/commit-slab.h"
 #include "prio-queue.h"
 #include "odb/hash-lookup.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "advice.h"
 #include "refs/refs.h"
 #include "revision/commit-reach.h"
odb/fsck.c +1 -1
index 8c953f61a4..e889268b48 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "date.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "hex.h"
 #include "odb/odb.h"
odb/hash-lookup.c +1 -1
index cf2d4a0245..9e8e5efb4f 100644
@@ -3,7 +3,7 @@
 #include "git-compat-util.h"
 #include "odb/hash.h"
 #include "odb/hash-lookup.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 
 static uint32_t take2(const struct object_id *oid, size_t ofs)
 {
odb/object-file.c +2 -2
index 41ee67abb6..847b78e5c7 100644
@@ -11,7 +11,7 @@
 
 #include "git-compat-util.h"
 #include "convert.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "odb/fsck.h"
 #include "gettext.h"
@@ -25,7 +25,7 @@
 #include "pack/pack.h"
 #include "pack/packfile.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
 #include "strvec.h"
 #include "tempfile.h"
odb/object-name.c +2 -2
index 825fc717bf..95a63c7f64 100644
@@ -14,11 +14,11 @@
 #include "odb/tree-walk.h"
 #include "refs/refs.h"
 #include "remote.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/odb.h"
 #include "odb/oid-array.h"
 #include "revision/pretty.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repo-settings.h"
 #include "repository.h"
 #include "setup.h"
odb/object.c +1 -1
index 7c2f920d3f..cd93a7b47b 100644
@@ -8,7 +8,7 @@
 #include "odb/object-file.h"
 #include "odb/streaming.h"
 #include "odb/blob.h"
-#include "statinfo.h"
+#include "index/statinfo.h"
 #include "odb/tree.h"
 #include "odb/commit.h"
 #include "odb/tag.h"
odb/odb.c +1 -1
index e942149d91..4e408501e8 100644
@@ -2,7 +2,7 @@
 #include "abspath.h"
 #include "pack/commit-graph.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
odb/source-packed.c +1 -1
index c1e2756471..d3def038c6 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "chdir-notify.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "git-zlib.h"
 #include "revision/list-objects-filter-options.h"
 #include "mergesort.h"
odb/tmp-objdir.c +1 -1
index b9ba5c4cd3..21219e8797 100644
@@ -2,7 +2,7 @@
 #include "odb/tmp-objdir.h"
 #include "abspath.h"
 #include "chdir-notify.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "odb/object-file.h"
 #include "path.h"
odb/tree-walk.c +3 -3
index 51e8037ef5..e3e22e1a32 100644
@@ -2,17 +2,17 @@
 
 #include "git-compat-util.h"
 #include "odb/tree-walk.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "trace2.h"
 #include "odb/tree.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "json-writer.h"
 #include "environment.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 
 static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned long size, struct strbuf *err)
 {
organize/gitorganize-format.c +1 -1
index 541dd373aa..8edf1659e0 100644
@@ -2,7 +2,7 @@
 #include "gitorganize-format.h"
 #include "gettext.h"
 #include "quote.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "wrapper.h"
organize/organize.c +3 -3
index 298557a3da..f1f0aec6ea 100644
@@ -5,16 +5,16 @@
 #include "organizer-protocol.h"
 #include "config.h"
 #include "gettext.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "quote.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "wrapper.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 
 /* The configured command organize.<key> (labeler or organizer), or NULL. */
 static const char *organize_command(struct repository *repo, const char *key)
pack/midx.c +1 -1
index 2608e99468..76e77d0dd2 100644
@@ -2,7 +2,7 @@
 
 #include "git-compat-util.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "hex.h"
 #include "pack/packfile.h"
 #include "odb/hash-lookup.h"
pack/packfile.c +1 -1
index 72252faffe..77de6bb821 100644
@@ -7,7 +7,7 @@
 #include "revision/list.h"
 #include "pack/pack.h"
 #include "repository.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "pack/packfile.h"
 #include "pack/delta.h"
 #include "odb/hash-lookup.h"
pack/reachable.c +1 -1
index f61525308e..5b8a2a4f79 100644
@@ -9,7 +9,7 @@
 #include "diff/diff.h"
 #include "revision/revision.h"
 #include "pack/reachable.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "progress.h"
 #include "revision/list-objects.h"
 #include "pack/packfile.h"
pack/repack.c +1 -1
index 91dde13b29..52e7779a44 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "pack/midx.h"
 #include "odb/odb.h"
 #include "pack/packfile.h"
pack/server-info.c +1 -1
index 627d2e3c98..dbd86d6fd2 100644
@@ -1,7 +1,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "hex.h"
 #include "repository.h"
 #include "refs/refs.h"
path-walk.c +1 -1
index 4b8ddb2a28..00686d3dbf 100644
@@ -5,7 +5,7 @@
 #include "path-walk.h"
 #include "odb/blob.h"
 #include "odb/commit.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "hashmap.h"
 #include "hex.h"
 #include "revision/list-objects.h"
path.c +1 -1
index 516abb3f82..e4d489e10a 100644
@@ -8,7 +8,7 @@
 #include "repository.h"
 #include "strbuf.h"
 #include "string-list.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "refs/worktree.h"
 #include "setup.h"
 #include "submodule-config.h"
rebase-interactive.c +1 -1
index df9c2d1275..ee2ef8b535 100644
@@ -11,7 +11,7 @@
 #include "strbuf.h"
 #include "odb/commit-slab.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/object-name.h"
 
 static const char edit_todo_list_advice[] =
refs/files-backend.c +2 -2
index a792297d8f..e6e07938a3 100644
@@ -16,10 +16,10 @@
 #include "packed-backend.h"
 #include "../ident.h"
 #include "../iterator.h"
-#include "../dir-iterator.h"
+#include "index/dir-iterator.h"
 #include "../lockfile.h"
 #include "../path.h"
-#include "../dir.h"
+#include "index/dir.h"
 #include "../chdir-notify.h"
 #include "../setup.h"
 #include "refs/worktree.h"
refs/packed-backend.c +2 -2
index afcb800a5f..97f76c1d76 100644
@@ -2,7 +2,7 @@
 
 #include "../git-compat-util.h"
 #include "../config.h"
-#include "../dir.h"
+#include "index/dir.h"
 #include "odb/fsck.h"
 #include "../gettext.h"
 #include "odb/hash.h"
@@ -13,7 +13,7 @@
 #include "../iterator.h"
 #include "../lockfile.h"
 #include "../chdir-notify.h"
-#include "../statinfo.h"
+#include "index/statinfo.h"
 #include "refs/worktree.h"
 #include "../wrapper.h"
 #include "../write-or-die.h"
refs/ref-filter.c +1 -1
index 7635e13f88..32027789a8 100644
@@ -28,7 +28,7 @@
 #include "utf8.h"
 #include "versioncmp.h"
 #include "trailer.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "odb/commit-slab.h"
 #include "revision/commit-reach.h"
 #include "refs/worktree.h"
refs/reftable-backend.c +1 -1
index 120f9c947f..0c02b2d287 100644
@@ -2,7 +2,7 @@
 #include "../abspath.h"
 #include "../chdir-notify.h"
 #include "../config.h"
-#include "../dir.h"
+#include "index/dir.h"
 #include "../environment.h"
 #include "odb/fsck.h"
 #include "../gettext.h"
refs/worktree.c +2 -2
index 3578229534..0f1fe6a7d2 100644
@@ -10,8 +10,8 @@
 #include "setup.h"
 #include "strbuf.h"
 #include "refs/worktree.h"
-#include "dir.h"
-#include "wt-status.h"
+#include "index/dir.h"
+#include "index/wt-status.h"
 #include "config.h"
 
 void free_worktree(struct worktree *worktree)
remote.c +1 -1
index 8a65967fb0..2b376893b3 100644
@@ -18,7 +18,7 @@
 #include "odb/commit.h"
 #include "diff/diff.h"
 #include "revision/revision.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "setup.h"
 #include "string-list.h"
 #include "strvec.h"
repository.c +2 -2
index b5e442f9f3..8771145515 100644
@@ -9,12 +9,12 @@
 #include "odb/object.h"
 #include "lockfile.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "remote.h"
 #include "setup.h"
 #include "odb/loose.h"
 #include "submodule-config.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "trace2.h"
 #include "promisor-remote.h"
 #include "refs/refs.h"
rerere.c +4 -4
index 3055989a41..df30ebbe93 100644
@@ -10,14 +10,14 @@
 #include "hex.h"
 #include "lockfile.h"
 #include "string-list.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "rerere.h"
 #include "diff/xdiff-interface.h"
-#include "dir.h"
-#include "resolve-undo.h"
+#include "index/dir.h"
+#include "index/resolve-undo.h"
 #include "merge-ll.h"
 #include "path.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "strmap.h"
reset.c +2 -2
index 29bbeaa9d4..0eddc94d8c 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
@@ -8,7 +8,7 @@
 #include "reset.h"
 #include "odb/tree-walk.h"
 #include "odb/tree.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "hook.h"
 
 static int update_refs(struct repository *repo,
revision/bisect.c +1 -1
index 696e365310..7805872c3e 100644
@@ -22,7 +22,7 @@
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "path.h"
-#include "dir.h"
+#include "index/dir.h"
 
 static struct oid_array good_revs;
 static struct oid_array skipped_revs;
revision/blame.c +2 -2
index 54284ed8da..a75bf22193 100644
@@ -4,7 +4,7 @@
 #include "git-compat-util.h"
 #include "refs/refs.h"
 #include "odb/odb.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "mergesort.h"
 #include "odb/commit.h"
 #include "convert.h"
@@ -13,7 +13,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "path.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "revision/revision.h"
 #include "setup.h"
 #include "odb/tag.h"
revision/list-objects-filter.c +1 -1
index 0ea4cb826e..da88781aef 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/commit.h"
revision/revision.c +4 -4
index 9a19a5654a..97c6fa6fef 100644
@@ -29,14 +29,14 @@
 #include "revision/log-tree.h"
 #include "mailmap.h"
 #include "odb/commit-slab.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "revision/bisect.h"
 #include "pack/packfile.h"
 #include "refs/worktree.h"
 #include "path.h"
-#include "read-cache.h"
+#include "index/read-cache.h"
 #include "setup.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "strvec.h"
 #include "trace2.h"
 #include "revision/commit-reach.h"
@@ -47,7 +47,7 @@
 #include "pack/bloom.h"
 #include "json-writer.h"
 #include "revision/list-objects-filter-options.h"
-#include "resolve-undo.h"
+#include "index/resolve-undo.h"
 #include "parse-options.h"
 #include "wildmatch.h"
 
revision/shallow.c +1 -1
index 51ba602971..f4ce207278 100644
@@ -18,7 +18,7 @@
 #include "revision/list-objects.h"
 #include "revision/commit-reach.h"
 #include "revision/shallow.h"
-#include "statinfo.h"
+#include "index/statinfo.h"
 #include "trace.h"
 
 void set_alternate_shallow_file(struct repository *r, const char *path)
run-command.c +1 -1
index e0c4325900..80382354dc 100644
@@ -7,7 +7,7 @@
 #include "gettext.h"
 #include "sigchain.h"
 #include "strvec.h"
-#include "symlinks.h"
+#include "index/symlinks.h"
 #include "thread-utils.h"
 #include "strbuf.h"
 #include "string-list.h"
scalar.c +3 -3
index 2cb09af1a5..d1e397ef50 100644
@@ -11,10 +11,10 @@
 #include "config.h"
 #include "run-command.h"
 #include "simple-ipc.h"
-#include "fsmonitor-ipc.h"
-#include "fsmonitor-settings.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/fsmonitor-settings.h"
 #include "refs/refs.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "pack/packfile.h"
 #include "help.h"
 #include "setup.h"
sequencer.c +5 -5
index d5b1eb9719..f4a0f77eaf 100644
@@ -10,7 +10,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
@@ -21,7 +21,7 @@
 #include "run-command.h"
 #include "hook.h"
 #include "utf8.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "diff/diff.h"
 #include "path.h"
 #include "revision/revision.h"
@@ -30,16 +30,16 @@
 #include "merge-ort.h"
 #include "merge-ort-wrappers.h"
 #include "refs/refs.h"
-#include "sparse-index.h"
+#include "index/sparse-index.h"
 #include "strvec.h"
 #include "quote.h"
 #include "trailer.h"
 #include "revision/log-tree.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 #include "hashmap.h"
 #include "notes-utils.h"
 #include "sigchain.h"
-#include "unpack-trees.h"
+#include "index/unpack-trees.h"
 #include "odb/oidmap.h"
 #include "odb/oidset.h"
 #include "odb/commit-slab.h"
sequencer.h +1 -1
index 64a9c7fb1b..0906cc127d 100644
@@ -3,7 +3,7 @@
 
 #include "strbuf.h"
 #include "strvec.h"
-#include "wt-status.h"
+#include "index/wt-status.h"
 
 struct commit;
 struct index_state;
setup.c +1 -1
index 62fbda948d..e4e9ca83fe 100644
@@ -12,7 +12,7 @@
 #include "refs/refs.h"
 #include "repository.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "setup.h"
 #include "revision/shallow.h"
 #include "string-list.h"
submodule-config.c +1 -1
index 094e64d8fd..c8be0acbb1 100644
@@ -2,7 +2,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
submodule.c +2 -2
index 16f4d30b82..e14b53d3c8 100644
@@ -7,7 +7,7 @@
 #include "config.h"
 #include "submodule-config.h"
 #include "submodule.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "diff/diff.h"
 #include "odb/commit.h"
 #include "environment.h"
@@ -29,7 +29,7 @@
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "revision/commit-reach.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
 #include "advice.h"
 #include "url.h"
t/helper/test-cache-tree.c +2 -2
index 9f613d2911..cf7e7efc5d 100644
@@ -5,9 +5,9 @@
 #include "gettext.h"
 #include "hex.h"
 #include "odb/tree.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 #include "parse-options.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-dir-iterator.c +1 -1
index 8d46e8ba40..f2734c5f88 100644
@@ -2,7 +2,7 @@
 #include "git-compat-util.h"
 #include "strbuf.h"
 #include "iterator.h"
-#include "dir-iterator.h"
+#include "index/dir-iterator.h"
 
 static const char *error_name(int error_number)
 {
t/helper/test-dump-cache-tree.c +2 -2
index 849727d69b..599b316ac1 100644
@@ -4,8 +4,8 @@
 #include "odb/hash.h"
 #include "hex.h"
 #include "odb/tree.h"
-#include "cache-tree.h"
-#include "read-cache-ll.h"
+#include "index/cache-tree.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-dump-fsmonitor.c +1 -1
index c991cbbb8a..1dbdb28fbf 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "test-tool.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-dump-split-index.c +2 -2
index aae0a40a74..79c8628005 100644
@@ -2,10 +2,10 @@
 
 #include "test-tool.h"
 #include "hex.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
-#include "split-index.h"
+#include "index/split-index.h"
 #include "ewah/ewok.h"
 
 static void show_bit(size_t pos, void *data UNUSED)
t/helper/test-dump-untracked-cache.c +2 -2
index 24308bd371..c31d01f3b5 100644
@@ -1,9 +1,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "test-tool.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "hex.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-fsmonitor-client.c +2 -2
index dc1dff23fb..845c1db493 100644
@@ -7,8 +7,8 @@
 
 #include "test-tool.h"
 #include "parse-options.h"
-#include "fsmonitor-ipc.h"
-#include "read-cache-ll.h"
+#include "index/fsmonitor-ipc.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "thread-utils.h"
t/helper/test-lazy-init-name-hash.c +2 -2
index 43cead6d7d..6f16fcf7e8 100644
@@ -2,9 +2,9 @@
 
 #include "test-tool.h"
 #include "environment.h"
-#include "name-hash.h"
+#include "index/name-hash.h"
 #include "parse-options.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "trace.h"
t/helper/test-parse-pathspec-file.c +1 -1
index 89ecefd1cd..1b21e919db 100644
@@ -1,6 +1,6 @@
 #include "test-tool.h"
 #include "parse-options.h"
-#include "pathspec.h"
+#include "index/pathspec.h"
 
 int cmd__parse_pathspec_file(int argc, const char **argv)
 {
t/helper/test-path-utils.c +1 -1
index f77b3f9d70..fd98a5bfd9 100644
@@ -5,7 +5,7 @@
 #include "abspath.h"
 #include "environment.h"
 #include "path.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "setup.h"
 #include "string-list.h"
 #include "trace.h"
t/helper/test-path-walk.c +1 -1
index 71d052d504..f689ff3c53 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "test-tool.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "environment.h"
 #include "hex.h"
 #include "revision/list-objects-filter-options.h"
t/helper/test-read-cache.c +1 -1
index 6b08ba8f07..dad40b8ad7 100644
@@ -3,7 +3,7 @@
 #include "test-tool.h"
 #include "config.h"
 #include "environment.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-scrap-cache-tree.c +2 -2
index f4f7df067d..8e40a08436 100644
@@ -2,11 +2,11 @@
 
 #include "test-tool.h"
 #include "lockfile.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "odb/tree.h"
-#include "cache-tree.h"
+#include "index/cache-tree.h"
 
 int cmd__scrap_cache_tree(int ac UNUSED, const char **av UNUSED)
 {
t/helper/test-write-cache.c +1 -1
index 98e1477c98..ffe468b445 100644
@@ -2,7 +2,7 @@
 
 #include "test-tool.h"
 #include "lockfile.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/unit-tests/test-lib.c +1 -1
index 72ee20a06f..4d4e37019e 100644
@@ -31,7 +31,7 @@ static struct {
  * There are other compilers that do the same, and are not for
  * Windows.
  */
-#include "dir.h"
+#include "index/dir.h"
 
 static const char *make_relative(const char *location)
 {
t/unit-tests/u-dir.c +1 -1
index 2d0adaa39e..72de0b0299 100644
@@ -1,5 +1,5 @@
 #include "unit-test.h"
-#include "dir.h"
+#include "index/dir.h"
 
 #define TEST_WITHIN_DEPTH(path, depth, max_depth, expect) do { \
 		int actual = within_depth(path, strlen(path), \
t/unit-tests/u-reftable-stack.c +1 -1
index e6c1635940..4c53301154 100644
@@ -9,7 +9,7 @@ license that can be found in the LICENSE file or at
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "unit-test.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "lib-reftable.h"
 #include "reftable/merged.h"
 #include "reftable/reftable-error.h"
t/unit-tests/u-strcmp-offset.c +1 -1
index 7e8e9acf3c..8b65c5555c 100644
@@ -1,5 +1,5 @@
 #include "unit-test.h"
-#include "read-cache-ll.h"
+#include "index/read-cache-ll.h"
 
 static void check_strcmp_offset(const char *string1, const char *string2,
 				int expect_result, uintmax_t expect_offset)
trace2/tr2_sysenv.c +1 -1
index 4abc218514..c63aebbec5 100644
@@ -2,7 +2,7 @@
 
 #include "git-compat-util.h"
 #include "config.h"
-#include "dir.h"
+#include "index/dir.h"
 #include "tr2_sysenv.h"
 
 /*
Signature · 1 line
2.54.0
#16 lore raw

RFC PATCH 13/14 setup: gather the setup sources under setup/

In reply to Michael Montalbo

Move the 9 setup C sources and 9 headers into setup/ as renames. Repoint every reference to their old paths to the new ones: the #include lines across the tree, the Makefile and meson.build build entries, and the tutorial #include examples.

---
 .gitorganize                                 | 36 ++++++++++----------
 Documentation/MyFirstContribution.adoc       |  4 +--
 Documentation/MyFirstObjectWalk.adoc         |  2 +-
 Makefile                                     | 30 ++++++++--------
 add-interactive.c                            |  2 +-
 add-patch.c                                  |  6 ++--
 advice.c                                     |  4 +--
 apply.c                                      |  8 ++---
 archive-tar.c                                |  2 +-
 archive-zip.c                                |  2 +-
 archive.c                                    |  6 ++--
 attr.c                                       |  6 ++--
 branch.c                                     |  6 ++--
 builtin.h                                    |  2 +-
 builtin/add.c                                |  4 +--
 builtin/am.c                                 |  6 ++--
 builtin/backfill.c                           |  6 ++--
 builtin/bisect.c                             |  2 +-
 builtin/blame.c                              |  6 ++--
 builtin/branch.c                             |  4 +--
 builtin/bugreport.c                          |  6 ++--
 builtin/bundle.c                             |  2 +-
 builtin/cat-file.c                           |  8 ++---
 builtin/check-attr.c                         |  6 ++--
 builtin/check-ignore.c                       |  4 +--
 builtin/check-mailmap.c                      |  6 ++--
 builtin/check-ref-format.c                   |  2 +-
 builtin/checkout--worker.c                   |  4 +--
 builtin/checkout-index.c                     |  6 ++--
 builtin/checkout.c                           | 10 +++---
 builtin/clean.c                              |  6 ++--
 builtin/clone.c                              |  8 ++---
 builtin/column.c                             |  2 +-
 builtin/commit-graph.c                       |  4 +--
 builtin/commit-tree.c                        |  4 +--
 builtin/commit.c                             |  6 ++--
 builtin/config.c                             |  8 ++---
 builtin/count-objects.c                      |  4 +--
 builtin/credential-cache--daemon.c           |  2 +-
 builtin/credential-store.c                   |  2 +-
 builtin/credential.c                         |  4 +--
 builtin/describe.c                           |  6 ++--
 builtin/diff-files.c                         |  2 +-
 builtin/diff-index.c                         |  4 +--
 builtin/diff-pairs.c                         |  2 +-
 builtin/diff-tree.c                          |  2 +-
 builtin/diff.c                               |  4 +--
 builtin/difftool.c                           |  8 ++---
 builtin/fast-export.c                        |  4 +--
 builtin/fast-import.c                        |  4 +--
 builtin/fetch.c                              |  4 +--
 builtin/fmt-merge-msg.c                      |  2 +-
 builtin/for-each-ref.c                       |  4 +--
 builtin/for-each-repo.c                      |  4 +--
 builtin/fsck.c                               |  2 +-
 builtin/fsmonitor--daemon.c                  |  4 +--
 builtin/gc.c                                 |  8 ++---
 builtin/grep.c                               |  6 ++--
 builtin/hash-object.c                        |  6 ++--
 builtin/help.c                               |  8 ++---
 builtin/history.c                            |  4 +--
 builtin/hook.c                               |  6 ++--
 builtin/index-pack.c                         |  6 ++--
 builtin/init-db.c                            |  4 +--
 builtin/interpret-trailers.c                 |  4 +--
 builtin/last-modified.c                      |  6 ++--
 builtin/log.c                                |  6 ++--
 builtin/ls-files.c                           |  6 ++--
 builtin/ls-tree.c                            |  4 +--
 builtin/mailinfo.c                           |  2 +-
 builtin/merge-base.c                         |  4 +--
 builtin/merge-file.c                         |  4 +--
 builtin/merge-ours.c                         |  4 +--
 builtin/merge-tree.c                         |  4 +--
 builtin/merge.c                              | 10 +++---
 builtin/mktag.c                              |  2 +-
 builtin/multi-pack-index.c                   |  6 ++--
 builtin/mv.c                                 |  6 ++--
 builtin/name-rev.c                           |  4 +--
 builtin/notes.c                              |  4 +--
 builtin/organize.c                           |  2 +-
 builtin/pack-objects.c                       |  4 +--
 builtin/patch-id.c                           |  6 ++--
 builtin/prune.c                              |  2 +-
 builtin/pull.c                               |  4 +--
 builtin/push.c                               |  4 +--
 builtin/range-diff.c                         |  2 +-
 builtin/read-tree.c                          |  6 ++--
 builtin/rebase.c                             |  6 ++--
 builtin/receive-pack.c                       | 10 +++---
 builtin/reflog.c                             |  2 +-
 builtin/refs.c                               |  2 +-
 builtin/remote.c                             |  4 +--
 builtin/repack.c                             |  4 +--
 builtin/replace.c                            |  4 +--
 builtin/replay.c                             |  2 +-
 builtin/repo.c                               |  4 +--
 builtin/rerere.c                             |  2 +-
 builtin/reset.c                              |  8 ++---
 builtin/rev-list.c                           |  4 +--
 builtin/rev-parse.c                          | 10 +++---
 builtin/revert.c                             |  2 +-
 builtin/rm.c                                 |  6 ++--
 builtin/send-pack.c                          |  4 +--
 builtin/shortlog.c                           |  6 ++--
 builtin/show-branch.c                        |  4 +--
 builtin/show-ref.c                           |  4 +--
 builtin/sparse-checkout.c                    |  6 ++--
 builtin/stash.c                              |  8 ++---
 builtin/stripspace.c                         |  6 ++--
 builtin/submodule--helper.c                  |  6 ++--
 builtin/symbolic-ref.c                       |  4 +--
 builtin/tag.c                                |  4 +--
 builtin/unpack-file.c                        |  4 +--
 builtin/unpack-objects.c                     |  4 +--
 builtin/update-index.c                       |  6 ++--
 builtin/update-ref.c                         |  4 +--
 builtin/update-server-info.c                 |  4 +--
 builtin/upload-archive.c                     |  2 +-
 builtin/upload-pack.c                        |  4 +--
 builtin/var.c                                |  6 ++--
 builtin/verify-commit.c                      |  4 +--
 builtin/verify-pack.c                        |  4 +--
 builtin/verify-tag.c                         |  4 +--
 builtin/worktree.c                           |  6 ++--
 builtin/write-tree.c                         |  4 +--
 bundle-uri.c                                 |  2 +-
 bundle.c                                     |  4 +--
 color.c                                      |  2 +-
 column.c                                     |  2 +-
 common-init.c                                |  4 +--
 compat/fsmonitor/fsm-health-darwin.c         |  2 +-
 compat/fsmonitor/fsm-health-linux.c          |  2 +-
 compat/fsmonitor/fsm-health-win32.c          |  2 +-
 compat/fsmonitor/fsm-ipc-unix.c              |  4 +--
 compat/fsmonitor/fsm-ipc-win32.c             |  2 +-
 compat/fsmonitor/fsm-listen-win32.c          |  2 +-
 compat/fsmonitor/fsm-settings-unix.c         |  2 +-
 compat/fsmonitor/fsm-settings-win32.c        |  4 +--
 compat/mingw.c                               |  6 ++--
 compat/precompose_utf8.c                     |  4 +--
 compat/regex/regex.c                         |  2 +-
 compat/win32/path-utils.c                    |  4 +--
 compat/win32/trace2_win32_process_info.c     |  2 +-
 connect.c                                    |  8 ++---
 contrib/libgit-sys/public_symbol_export.c    |  4 +--
 convert.c                                    |  2 +-
 credential.c                                 |  6 ++--
 daemon.c                                     |  6 ++--
 diagnose.c                                   |  2 +-
 diff/combine-diff.c                          |  2 +-
 diff/diff-lib.c                              |  2 +-
 diff/diff.c                                  |  6 ++--
 diff/range-diff.c                            |  4 +--
 diff/tree-diff.c                             |  2 +-
 diff/userdiff.c                              |  4 +--
 diff/xdiff-interface.c                       |  4 +--
 editor.c                                     |  4 +--
 exec-cmd.c                                   |  2 +-
 fetch-negotiator.c                           |  2 +-
 fetch-pack.c                                 |  8 ++---
 fmt-merge-msg.c                              |  4 +--
 gettext.c                                    |  2 +-
 git.c                                        |  8 ++---
 gpg-interface.c                              |  6 ++--
 grep.c                                       |  2 +-
 help.c                                       |  8 ++---
 http-backend.c                               |  8 ++---
 http-fetch.c                                 |  6 ++--
 http-push.c                                  |  6 ++--
 http-walker.c                                |  2 +-
 http.c                                       |  6 ++--
 imap-send.c                                  |  6 ++--
 index/cache-tree.c                           |  2 +-
 index/checkout.c                             |  4 +--
 index/dir.c                                  |  8 ++---
 index/entry.c                                |  2 +-
 index/fsmonitor-ipc.c                        |  2 +-
 index/fsmonitor-settings.c                   |  4 +--
 index/fsmonitor.c                            |  6 ++--
 index/name-hash.c                            |  2 +-
 index/parallel-checkout.c                    |  2 +-
 index/pathspec.c                             |  6 ++--
 index/preload-index.c                        |  6 ++--
 index/read-cache.c                           |  8 ++---
 index/read-cache.h                           |  2 +-
 index/sparse-index.c                         |  6 ++--
 index/split-index.c                          |  2 +-
 index/statinfo.c                             |  4 +--
 index/symlinks.c                             |  2 +-
 index/unpack-trees.c                         |  6 ++--
 index/wt-status.c                            |  6 ++--
 lockfile.c                                   |  2 +-
 mailinfo.c                                   |  4 +--
 mailmap.c                                    |  6 ++--
 merge-ll.c                                   |  2 +-
 merge-ort-wrappers.c                         |  2 +-
 merge-ort.c                                  |  4 +--
 merge.c                                      |  2 +-
 meson.build                                  | 18 +++++-----
 negotiator/default.c                         |  2 +-
 negotiator/skipping.c                        |  2 +-
 notes-cache.c                                |  2 +-
 notes-merge.c                                |  2 +-
 notes-utils.c                                |  4 +--
 notes.c                                      |  4 +--
 odb/alloc.c                                  |  2 +-
 odb/commit.c                                 |  8 ++---
 odb/fsck.c                                   |  6 ++--
 odb/hash.h                                   |  2 +-
 odb/loose.c                                  |  2 +-
 odb/match-trees.c                            |  2 +-
 odb/object-file-convert.c                    |  2 +-
 odb/object-file.c                            |  4 +--
 odb/object-name.c                            | 10 +++---
 odb/odb.c                                    |  6 ++--
 odb/replace-object.c                         |  2 +-
 odb/replace-object.h                         |  2 +-
 odb/source-files.c                           |  2 +-
 odb/source-inmemory.c                        |  2 +-
 odb/source-loose.c                           |  2 +-
 odb/streaming.c                              |  4 +--
 odb/tag.c                                    |  4 +--
 odb/tmp-objdir.c                             |  4 +--
 odb/tree-walk.c                              |  2 +-
 odb/tree.c                                   |  4 +--
 organize/organize.c                          |  4 +--
 oss-fuzz/fuzz-commit-graph.c                 |  2 +-
 oss-fuzz/fuzz-config.c                       |  2 +-
 pack/bloom.c                                 |  4 +--
 pack/commit-graph.c                          |  4 +--
 pack/delta-islands.c                         |  2 +-
 pack/midx-write.c                            |  2 +-
 pack/midx.c                                  |  2 +-
 pack/pack-bitmap-write.c                     |  4 +--
 pack/pack-bitmap.c                           |  4 +--
 pack/pack-check.c                            |  4 +--
 pack/pack-objects.c                          |  2 +-
 pack/pack-revindex.c                         |  2 +-
 pack/pack-write.c                            |  4 +--
 pack/packfile.c                              |  4 +--
 pack/packfile.h                              |  2 +-
 pack/prune-packed.c                          |  2 +-
 pack/pseudo-merge.c                          |  2 +-
 pack/reachable.c                             |  2 +-
 pack/repack-cruft.c                          |  2 +-
 pack/repack-filtered.c                       |  2 +-
 pack/repack-geometry.c                       |  2 +-
 pack/repack-promisor.c                       |  2 +-
 pack/repack.c                                |  2 +-
 pack/server-info.c                           |  2 +-
 pager.c                                      |  8 ++---
 parse-options-cb.c                           |  4 +--
 path-walk.c                                  |  2 +-
 path.c                                       |  4 +--
 path.h                                       |  2 +-
 progress.c                                   |  2 +-
 promisor-remote.c                            |  6 ++--
 promisor-remote.h                            |  2 +-
 prompt.c                                     |  4 +--
 protocol-caps.c                              |  2 +-
 protocol.c                                   |  4 +--
 rebase-interactive.c                         |  6 ++--
 refs/files-backend.c                         | 10 +++---
 refs/ls-refs.c                               |  6 ++--
 refs/pack-refs.c                             |  4 +--
 refs/packed-backend.c                        |  2 +-
 refs/ref-cache.c                             |  2 +-
 refs/ref-filter.c                            | 10 +++---
 refs/reflog-walk.c                           |  2 +-
 refs/reflog.c                                |  4 +--
 refs/refs.c                                  | 12 +++----
 refs/refs.h                                  |  4 +--
 refs/reftable-backend.c                      | 10 +++---
 refs/worktree.c                              |  8 ++---
 remote-curl.c                                |  6 ++--
 remote.c                                     |  6 ++--
 replay.c                                     |  2 +-
 rerere.c                                     |  4 +--
 reset.c                                      |  2 +-
 reset.h                                      |  2 +-
 revision/bisect.c                            |  4 +--
 revision/blame.c                             |  2 +-
 revision/graph.c                             |  2 +-
 revision/line-log.c                          |  4 +--
 revision/list-objects-filter-options.c       |  2 +-
 revision/list-objects.c                      |  2 +-
 revision/log-tree.c                          |  6 ++--
 revision/pretty.c                            |  4 +--
 revision/revision.c                          |  8 ++---
 revision/revision.h                          |  2 +-
 revision/shallow.c                           |  2 +-
 revision/shallow.h                           |  2 +-
 run-command.c                                |  4 +--
 scalar.c                                     |  4 +--
 send-pack.c                                  |  4 +--
 sequencer.c                                  |  8 ++---
 serve.c                                      |  6 ++--
 alias.c => setup/alias.c                     |  4 +--
 alias.h => setup/alias.h                     |  0
 config.c => setup/config.c                   |  8 ++---
 config.h => setup/config.h                   |  2 +-
 environment.c => setup/environment.c         | 10 +++---
 environment.h => setup/environment.h         |  2 +-
 hook.c => setup/hook.c                       |  8 ++---
 hook.h => setup/hook.h                       |  2 +-
 ident.c => setup/ident.c                     |  4 +--
 ident.h => setup/ident.h                     |  0
 repo-settings.c => setup/repo-settings.c     |  8 ++---
 repo-settings.h => setup/repo-settings.h     |  0
 repository.c => setup/repository.c           |  8 ++---
 repository.h => setup/repository.h           |  4 +--
 setup.c => setup/setup.c                     |  8 ++---
 setup.h => setup/setup.h                     |  0
 version.c => setup/version.c                 |  2 +-
 version.h => setup/version.h                 |  0
 shell.c                                      |  2 +-
 sideband.c                                   |  2 +-
 submodule-config.c                           |  6 ++--
 submodule-config.h                           |  2 +-
 submodule.c                                  |  8 ++---
 t/helper/test-advise.c                       |  6 ++--
 t/helper/test-bitmap.c                       |  2 +-
 t/helper/test-bloom.c                        |  4 +--
 t/helper/test-cache-tree.c                   |  4 +--
 t/helper/test-config.c                       |  4 +--
 t/helper/test-dump-cache-tree.c              |  4 +--
 t/helper/test-dump-fsmonitor.c               |  4 +--
 t/helper/test-dump-split-index.c             |  4 +--
 t/helper/test-dump-untracked-cache.c         |  4 +--
 t/helper/test-find-pack.c                    |  2 +-
 t/helper/test-fsmonitor-client.c             |  4 +--
 t/helper/test-lazy-init-name-hash.c          |  6 ++--
 t/helper/test-match-trees.c                  |  4 +--
 t/helper/test-pack-deltas.c                  |  2 +-
 t/helper/test-pack-mtimes.c                  |  2 +-
 t/helper/test-partial-clone.c                |  4 +--
 t/helper/test-path-utils.c                   |  4 +--
 t/helper/test-path-walk.c                    |  4 +--
 t/helper/test-progress.c                     |  2 +-
 t/helper/test-reach.c                        |  2 +-
 t/helper/test-read-cache.c                   |  8 ++---
 t/helper/test-read-graph.c                   |  4 +--
 t/helper/test-read-midx.c                    |  4 +--
 t/helper/test-ref-store.c                    |  4 +--
 t/helper/test-repository.c                   |  6 ++--
 t/helper/test-revision-walking.c             |  4 +--
 t/helper/test-scrap-cache-tree.c             |  4 +--
 t/helper/test-serve-v2.c                     |  4 +--
 t/helper/test-submodule-config.c             |  6 ++--
 t/helper/test-submodule-nested-repo-config.c |  4 +--
 t/helper/test-submodule.c                    |  4 +--
 t/helper/test-subprocess.c                   |  2 +-
 t/helper/test-synthesize.c                   |  4 +--
 t/helper/test-trace2.c                       |  4 +--
 t/helper/test-userdiff.c                     |  4 +--
 t/helper/test-write-cache.c                  |  4 +--
 t/unit-tests/u-example-decorate.c            |  2 +-
 t/unit-tests/u-odb-inmemory.c                |  2 +-
 trace.c                                      |  4 +--
 trace2.c                                     |  4 +--
 trace2/tr2_cfg.c                             |  2 +-
 trace2/tr2_sysenv.c                          |  2 +-
 trace2/tr2_tgt_event.c                       |  6 ++--
 trace2/tr2_tgt_normal.c                      |  6 ++--
 trace2/tr2_tgt_perf.c                        |  6 ++--
 trailer.c                                    |  4 +--
 transport-helper.c                           |  4 +--
 transport.c                                  |  6 ++--
 upload-pack.c                                |  8 ++---
 urlmatch.h                                   |  2 +-
 versioncmp.c                                 |  2 +-
 walker.c                                     |  2 +-
 373 files changed, 798 insertions(+), 798 deletions(-)
 rename alias.c => setup/alias.c (98%)
 rename alias.h => setup/alias.h (100%)
 rename config.c => setup/config.c (99%)
 rename config.h => setup/config.h (99%)
 rename environment.c => setup/environment.c (99%)
 rename environment.h => setup/environment.h (99%)
 rename hook.c => setup/hook.c (99%)
 rename hook.h => setup/hook.h (99%)
 rename ident.c => setup/ident.c (99%)
 rename ident.h => setup/ident.h (100%)
 rename repo-settings.c => setup/repo-settings.c (98%)
 rename repo-settings.h => setup/repo-settings.h (100%)
 rename repository.c => setup/repository.c (99%)
 rename repository.h => setup/repository.h (99%)
 rename setup.c => setup/setup.c (99%)
 rename setup.h => setup/setup.h (100%)
 rename version.c => setup/version.c (98%)
 rename version.h => setup/version.h (100%)
.gitorganize +18 -18
index fe81c40f09..cb6416bfc3 100644
@@ -28,8 +28,6 @@ add-patch.c component=? role=lib prefix=add-patch includes=setup:3,index:2,odb:2
 add-patch.h component=? role=public prefix=add-patch cochange=odb:1
 advice.c component=? role=lib prefix=advice includes=setup:2 cochange=transport:18,index:12,odb:9,diff:8,revision:8
 advice.h component=? role=public prefix=advice cochange=transport:14,index:9,odb:6,submodule:4,pack:3
-alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2
-alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1
 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
 apply.h component=? role=public prefix=apply includes=odb:1 cochange=diff:2
 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
@@ -58,8 +56,6 @@ common-exit.c component=? role=lib prefix=common-main
 common-init.c component=? role=lib prefix=common-main includes=odb:2,setup:2,convert:1 cochange=setup:1
 common-init.h component=? role=public prefix=common-main
 common-main.c component=? role=lib prefix=common-main cochange=setup:5,transport:4,convert:3,index:1
-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
-config.h component=setup role=header prefix=config includes=setup:1 cochange=setup:100,index:30,transport:23,submodule:21,merge:6
 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
 connect.h component=transport role=header prefix=connect includes=transport:1 cochange=transport:58,refs:1
 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
@@ -103,8 +99,6 @@ diff/xdiff-interface.c component=diff role=lib prefix=xdiff-interface includes=s
 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
 editor.c component=? role=lib prefix=editor includes=setup:2 cochange=transport:20,setup:12,index:8,odb:4,submodule:4
 editor.h component=? role=public prefix=editor cochange=transport:1
-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
-environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9
 exec-cmd.c component=? role=lib prefix=strvec includes=setup:1
 exec-cmd.h component=? role=public prefix=argv-array cochange=refs:4,transport:4,odb:1,setup:1,submodule:1
 fetch-negotiator.c component=transport role=lib prefix=repo-settings includes=setup:1,transport:1 cochange=setup:8,transport:7,index:2,odb:1
@@ -135,16 +129,12 @@ hex-ll.c component=? role=lib prefix=hex-ll
 hex-ll.h component=? role=public prefix=hex-ll
 hex.c component=? role=lib prefix=hex includes=odb:1 cochange=odb:7,revision:5,notes:3,transport:3,refs:2
 hex.h component=? role=public prefix=hex includes=odb:1 cochange=revision:3,odb:2,convert:1,merge:1,pack:1
-hook.c component=setup role=lib prefix=hook includes=setup:4 cochange=setup:37,transport:10,odb:8,refs:5,diff:3
-hook.h component=setup role=header prefix=hook includes=setup:1 cochange=setup:34,transport:6,odb:5,refs:5,pack:3
 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
 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
 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
 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
 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
 http.h component=transport role=header prefix=http includes=transport:1 cochange=transport:149,pack:15,diff:6,odb:4,archive:3
-ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4
-ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1
 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
 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
 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
@@ -373,10 +363,6 @@ remote.c component=transport role=lib prefix=remote includes=odb:3,setup:3,trans
 remote.h component=transport role=header prefix=remote includes=odb:1,refs:1 cochange=transport:245,refs:24,index:12,revision:6,setup:2
 replay.c component=? role=lib prefix=replay includes=odb:2,merge:1,refs:1,revision:1,setup:1 cochange=transport:1
 replay.h component=? role=public prefix=replay includes=odb:1
-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
-repo-settings.h component=setup role=header prefix=environment cochange=setup:40,pack:7,refs:6,odb:4,diff:2
-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
-repository.h component=setup role=header prefix=repository includes=setup:2 cochange=setup:157,index:31,refs:25,pack:22,odb:19
 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
 rerere.h component=merge role=header prefix=rerere cochange=merge:16,odb:1
 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
@@ -420,8 +406,24 @@ sequencer.c component=? role=lib prefix=sequencer includes=odb:8,index:5,merge:4
 sequencer.h component=? role=public prefix=sequencer includes=index:1 cochange=revision:5,index:4,notes:3,odb:3,transport:3
 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
 serve.h component=transport role=header prefix=serve cochange=transport:9,refs:3,submodule:1
-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
-setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:70,refs:8,index:5,revision:4,submodule:4
+setup/alias.c component=setup role=lib prefix=alias includes=setup:2 cochange=setup:8,diff:4,transport:3,convert:2,index:2
+setup/alias.h component=setup role=header prefix=completion cochange=setup:3,transport:2,pack:1,revision:1
+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
+setup/config.h component=setup role=header prefix=config includes=setup:1 cochange=setup:100,index:30,transport:23,submodule:21,merge:6
+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
+setup/environment.h component=setup role=header prefix=environment includes=setup:1 cochange=setup:135,index:37,odb:15,refs:11,pack:9
+setup/hook.c component=setup role=lib prefix=hook includes=setup:4 cochange=setup:37,transport:10,odb:8,refs:5,diff:3
+setup/hook.h component=setup role=header prefix=hook includes=setup:1 cochange=setup:34,transport:6,odb:5,refs:5,pack:3
+setup/ident.c component=setup role=lib prefix=ident includes=setup:2 cochange=setup:19,revision:10,odb:6,refs:6,pack:4
+setup/ident.h component=setup role=header prefix=ident cochange=setup:3,revision:1
+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
+setup/repo-settings.h component=setup role=header prefix=environment cochange=setup:40,pack:7,refs:6,odb:4,diff:2
+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
+setup/repository.h component=setup role=header prefix=repository includes=setup:2 cochange=setup:157,index:31,refs:25,pack:22,odb:19
+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
+setup/setup.h component=setup role=header prefix=setup includes=refs:1 cochange=setup:70,refs:8,index:5,revision:4,submodule:4
+setup/version.c component=setup role=lib prefix=version includes=setup:1 cochange=setup:8,transport:2
+setup/version.h component=setup role=header prefix=version cochange=setup:8,transport:2
 sh-i18n--envsubst.c component=? role=program prefix=sh-i18n--envsubst cochange=index:3,diff:1,transport:1
 sha1dc_git.c component=? role=lib prefix=sha1dc cochange=diff:3,odb:2,revision:2,setup:1
 sha1dc_git.h component=? role=public prefix=sha1dc cochange=odb:2
@@ -478,8 +480,6 @@ utf8.c component=? role=lib prefix=utf8 cochange=revision:6,index:3,setup:3,tran
 utf8.h component=? role=public prefix=utf8 cochange=revision:6,index:2,setup:2,transport:2,convert:1
 varint.c component=? role=lib prefix=varint cochange=index:2,transport:1
 varint.h component=? role=public prefix=varint cochange=index:2,transport:1
-version.c component=setup role=lib prefix=version includes=setup:1 cochange=setup:8,transport:2
-version.h component=setup role=header prefix=version cochange=setup:8,transport:2
 versioncmp.c component=? role=lib prefix=versioncmp includes=setup:1 cochange=setup:5,pack:3,transport:3,index:2,refs:2
 versioncmp.h component=? role=public prefix=versioncmp cochange=refs:1
 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
Documentation/MyFirstContribution.adoc +2 -2
index 63468494c1..9d899efb36 100644
@@ -331,8 +331,8 @@ on the command line, including the name of our command. (If `prefix` is empty
 for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so
 helpful. So what other context can we get?
 
-Add a line to `#include "config.h"`, `#include "repository.h"` and
-`#include "environment.h"`.
+Add a line to `#include "setup/config.h"`, `#include "setup/repository.h"` and
+`#include "setup/environment.h"`.
 Then, add the following bits to the function body:
 function body:
 
Documentation/MyFirstObjectWalk.adoc +1 -1
index 7fb63e6861..6e3715bad7 100644
@@ -219,7 +219,7 @@ Add a new function to `builtin/walken.c`.
 We'll also need to include the `config.h` header:
 
 ----
-#include "config.h"
+#include "setup/config.h"
 
 ...
 
Makefile +15 -15
index 5e404ffa5e..cec75e834a 100644
@@ -1102,7 +1102,7 @@ LIB_OBJS += abspath.o
 LIB_OBJS += add-interactive.o
 LIB_OBJS += add-patch.o
 LIB_OBJS += advice.o
-LIB_OBJS += alias.o
+LIB_OBJS += setup/alias.o
 LIB_OBJS += odb/alloc.o
 LIB_OBJS += apply.o
 LIB_OBJS += archive-tar.o
@@ -1135,7 +1135,7 @@ LIB_OBJS += compat/obstack.o
 LIB_OBJS += compat/open.o
 LIB_OBJS += compat/terminal.o
 LIB_OBJS += compiler-tricks/not-constant.o
-LIB_OBJS += config.o
+LIB_OBJS += setup/config.o
 LIB_OBJS += connect.o
 LIB_OBJS += connected.o
 LIB_OBJS += convert.o
@@ -1162,7 +1162,7 @@ LIB_OBJS += index/dir-iterator.o
 LIB_OBJS += index/dir.o
 LIB_OBJS += editor.o
 LIB_OBJS += index/entry.o
-LIB_OBJS += environment.o
+LIB_OBJS += setup/environment.o
 LIB_OBJS += ewah/bitmap.o
 LIB_OBJS += ewah/ewah_bitmap.o
 LIB_OBJS += ewah/ewah_io.o
@@ -1187,8 +1187,8 @@ LIB_OBJS += hashmap.o
 LIB_OBJS += help.o
 LIB_OBJS += hex.o
 LIB_OBJS += hex-ll.o
-LIB_OBJS += hook.o
-LIB_OBJS += ident.o
+LIB_OBJS += setup/hook.o
+LIB_OBJS += setup/ident.o
 LIB_OBJS += json-writer.o
 LIB_OBJS += kwset.o
 LIB_OBJS += levenshtein.o
@@ -1312,8 +1312,8 @@ LIB_OBJS += pack/repack-midx.o
 LIB_OBJS += pack/repack-promisor.o
 LIB_OBJS += odb/replace-object.o
 LIB_OBJS += replay.o
-LIB_OBJS += repo-settings.o
-LIB_OBJS += repository.o
+LIB_OBJS += setup/repo-settings.o
+LIB_OBJS += setup/repository.o
 LIB_OBJS += rerere.o
 LIB_OBJS += reset.o
 LIB_OBJS += index/resolve-undo.o
@@ -1323,7 +1323,7 @@ LIB_OBJS += send-pack.o
 LIB_OBJS += sequencer.o
 LIB_OBJS += serve.o
 LIB_OBJS += pack/server-info.o
-LIB_OBJS += setup.o
+LIB_OBJS += setup/setup.o
 LIB_OBJS += revision/shallow.o
 LIB_OBJS += sideband.o
 LIB_OBJS += sigchain.o
@@ -1373,7 +1373,7 @@ LIB_OBJS += utf8.o
 ifdef NO_RUST
 LIB_OBJS += varint.o
 endif
-LIB_OBJS += version.o
+LIB_OBJS += setup/version.o
 LIB_OBJS += versioncmp.o
 LIB_OBJS += walker.o
 LIB_OBJS += wildmatch.o
@@ -2691,7 +2691,7 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
 
 help.sp help.s help.o: command-list.h
 builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h
-hook.sp hook.s hook.o: hook-list.h
+setup/hook.sp setup/hook.s setup/hook.o: hook-list.h
 
 builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX
 builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
@@ -2708,7 +2708,7 @@ pager.sp pager.s pager.o: EXTRA_CPPFLAGS = \
 version-def.h: version-def.h.in GIT-VERSION-GEN GIT-VERSION-FILE GIT-USER-AGENT
 	$(QUIET_GEN)$(call version_gen,"$(shell pwd)",$<,$@)
 
-version.sp version.s version.o: version-def.h
+setup/version.sp setup/version.s setup/version.o: version-def.h
 
 $(BUILT_INS): git$X
 	$(QUIET_BUILT_IN)$(RM) $@ && \
@@ -2973,12 +2973,12 @@ exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \
 	'-DBINDIR="$(bindir_relative_SQ)"' \
 	'-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"'
 
-setup.sp setup.s setup.o: GIT-PREFIX
-setup.sp setup.s setup.o: EXTRA_CPPFLAGS = \
+setup/setup.sp setup/setup.s setup/setup.o: GIT-PREFIX
+setup/setup.sp setup/setup.s setup/setup.o: EXTRA_CPPFLAGS = \
 	-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
 
-config.sp config.s config.o: GIT-PREFIX
-config.sp config.s config.o: EXTRA_CPPFLAGS = \
+setup/config.sp setup/config.s setup/config.o: GIT-PREFIX
+setup/config.sp setup/config.s setup/config.o: EXTRA_CPPFLAGS = \
 	-DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
 
 attr.sp attr.s attr.o: GIT-PREFIX
add-interactive.c +1 -1
index 5f4d379910..e14a2c98f3 100644
@@ -9,7 +9,7 @@
 #include "hex.h"
 #include "index/preload-index.h"
 #include "index/read-cache-ll.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "revision/revision.h"
 #include "refs/refs.h"
 #include "string-list.h"
add-patch.c +3 -3
index 0499152dbc..f1f4b0c4c6 100644
@@ -5,16 +5,16 @@
 #include "add-patch.h"
 #include "advice.h"
 #include "odb/commit.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
 #include "pager.h"
 #include "index/read-cache-ll.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "strbuf.h"
 #include "sigchain.h"
 #include "run-command.h"
advice.c +2 -2
index 63bf8b0c5f..3139ac5e87 100644
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "color.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "help.h"
 #include "string-list.h"
apply.c +4 -4
index 70d5461fbe..75f81b1444 100644
@@ -13,12 +13,12 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "base85.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/odb.h"
 #include "pack/delta.h"
 #include "diff/diff.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "diff/xdiff-interface.h"
@@ -31,11 +31,11 @@
 #include "path.h"
 #include "quote.h"
 #include "index/read-cache.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "rerere.h"
 #include "apply.h"
 #include "index/entry.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/symlinks.h"
 #include "wildmatch.h"
 #include "ws.h"
archive-tar.c +1 -1
index 318b9bcc24..525b517749 100644
@@ -5,7 +5,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "git-zlib.h"
 #include "hex.h"
archive-zip.c +1 -1
index df1edadd33..1e8baf3205 100644
@@ -5,7 +5,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "archive.h"
 #include "gettext.h"
 #include "git-zlib.h"
archive.c +3 -3
index e6fdd2ea8f..3f3922c3e6 100644
@@ -3,16 +3,16 @@
 
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "git-zlib.h"
 #include "hex.h"
 #include "odb/object-name.h"
 #include "path.h"
 #include "revision/pretty.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "refs/refs.h"
 #include "odb/odb.h"
 #include "odb/commit.h"
attr.c +3 -3
index 841d2f23ae..9180683faa 100644
@@ -10,8 +10,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "exec-cmd.h"
 #include "attr.h"
 #include "index/dir.h"
@@ -23,7 +23,7 @@
 #include "refs/refs.h"
 #include "revision/revision.h"
 #include "odb/odb.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "thread-utils.h"
 #include "odb/tree-walk.h"
 #include "odb/object-name.h"
branch.c +3 -3
index d752e55b88..14483c1402 100644
@@ -2,9 +2,9 @@
 
 #include "git-compat-util.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "branch.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
@@ -12,7 +12,7 @@
 #include "refs/refs.h"
 #include "refs/refspec.h"
 #include "remote.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "sequencer.h"
 #include "odb/commit.h"
 #include "refs/worktree.h"
builtin.h +1 -1
index 0ac855e534..7c48a8e29f 100644
@@ -2,7 +2,7 @@
 #define BUILTIN_H
 
 #include "git-compat-util.h"
-#include "repository.h"
+#include "setup/repository.h"
 
 /*
  * builtin API
builtin/add.c +2 -2
index e544220eb2..69b6d7e7ca 100644
@@ -6,8 +6,8 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "lockfile.h"
 #include "editor.h"
 #include "index/dir.h"
builtin/am.c +3 -3
index 0b6d77004f..053043e477 100644
@@ -9,15 +9,15 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
 #include "index/dir.h"
 #include "run-command.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "quote.h"
 #include "tempfile.h"
 #include "lockfile.h"
builtin/backfill.c +3 -3
index b8e21c844c..f30addad55 100644
@@ -3,12 +3,12 @@
 
 #include "builtin.h"
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "parse-options.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/commit.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
builtin/bisect.c +1 -1
index cfb0741d22..61205f13b6 100644
@@ -3,7 +3,7 @@
 
 #include "builtin.h"
 #include "copy.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
builtin/blame.c +3 -3
index 9e5776e31b..23e6f77d42 100644
@@ -8,9 +8,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "color.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/commit.h"
@@ -31,7 +31,7 @@
 #include "pager.h"
 #include "revision/blame.h"
 #include "refs/refs.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "odb/tag.h"
 #include "write-or-die.h"
 
builtin/branch.c +2 -2
index c80df76d36..eeab13a4b6 100644
@@ -8,10 +8,10 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "color.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "refs/refs.h"
 #include "odb/commit.h"
 #include "gettext.h"
builtin/bugreport.c +3 -3
index f78c3f2aed..dffed32db6 100644
@@ -8,11 +8,11 @@
 #include "strbuf.h"
 #include "help.h"
 #include "compat/compiler.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "hook-list.h"
 #include "diagnose.h"
-#include "setup.h"
-#include "version.h"
+#include "setup/setup.h"
+#include "setup/version.h"
 
 static void get_system_info(struct strbuf *sys_info)
 {
builtin/bundle.c +1 -1
index 1e170e9278..6dbe478bcb 100644
@@ -2,7 +2,7 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "gettext.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "parse-options.h"
 #include "pkt-line.h"
builtin/cat-file.c +4 -4
index 94979a2683..4a5c73720d 100644
@@ -8,13 +8,13 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
 #include "diff/diff.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "ident.h"
+#include "setup/ident.h"
 #include "revision/list-objects-filter-options.h"
 #include "parse-options.h"
 #include "diff/userdiff.h"
@@ -28,7 +28,7 @@
 #include "promisor-remote.h"
 #include "mailmap.h"
 #include "write-or-die.h"
-#include "alias.h"
+#include "setup/alias.h"
 #include "remote.h"
 #include "transport.h"
 
builtin/check-attr.c +3 -3
index 02ff3b4eb5..8eb5d4e748 100644
@@ -1,12 +1,12 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "attr.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/object-name.h"
 #include "quote.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "parse-options.h"
 #include "write-or-die.h"
 
builtin/check-ignore.c +2 -2
index 1d2c3cb8db..00a04404bd 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "quote.h"
 #include "index/pathspec.h"
builtin/check-mailmap.c +3 -3
index 3f2a39cae0..4c3fc0de7a 100644
@@ -1,9 +1,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
-#include "ident.h"
+#include "setup/ident.h"
 #include "mailmap.h"
 #include "parse-options.h"
 #include "strbuf.h"
builtin/check-ref-format.c +1 -1
index 5de8c0e6f5..cb8f539b02 100644
@@ -6,7 +6,7 @@
 
 #include "builtin.h"
 #include "refs/refs.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 
 static const char builtin_check_ref_format_usage[] =
builtin/checkout--worker.c +2 -2
index 9c49474753..aa1ca1ed14 100644
@@ -2,9 +2,9 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/entry.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "index/parallel-checkout.h"
 #include "parse-options.h"
builtin/checkout-index.c +3 -3
index c659e5c764..139f4f9441 100644
@@ -8,8 +8,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "lockfile.h"
 #include "quote.h"
@@ -18,7 +18,7 @@
 #include "index/entry.h"
 #include "index/parallel-checkout.h"
 #include "index/read-cache-ll.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 
 #define CHECKOUT_ALL 4
builtin/checkout.c +5 -5
index 48882b0f8e..3dedddc61a 100644
@@ -7,13 +7,13 @@
 #include "index/cache-tree.h"
 #include "index/checkout.h"
 #include "odb/commit.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "merge-ll.h"
 #include "lockfile.h"
 #include "mem-pool.h"
@@ -26,11 +26,11 @@
 #include "index/read-cache.h"
 #include "refs/refs.h"
 #include "remote.h"
-#include "repo-settings.h"
+#include "setup/repo-settings.h"
 #include "index/resolve-undo.h"
 #include "revision/revision.h"
 #include "sequencer.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "strvec.h"
 #include "submodule.h"
builtin/clean.c +3 -3
index 81b3b86491..35a5c1465d 100644
@@ -11,14 +11,14 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "path.h"
 #include "index/read-cache-ll.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "string-list.h"
 #include "quote.h"
 #include "column.h"
builtin/clone.c +4 -4
index 58cf9761a0..a8f7e1b6f3 100644
@@ -15,9 +15,9 @@
 
 #include "abspath.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "copy.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
@@ -38,13 +38,13 @@
 #include "branch.h"
 #include "remote.h"
 #include "run-command.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "connected.h"
 #include "pack/packfile.h"
 #include "path.h"
 #include "pkt-line.h"
 #include "revision/list-objects-filter-options.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "bundle.h"
 #include "bundle-uri.h"
 
builtin/column.c +1 -1
index 87dce3c6e5..8603d23d1f 100644
@@ -1,6 +1,6 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "strbuf.h"
 #include "parse-options.h"
builtin/commit-graph.c +2 -2
index 2de897402e..d4dc4985d3 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "odb/commit.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
builtin/commit-tree.c +2 -2
index 598ef30372..eb6fa99d14 100644
@@ -5,8 +5,8 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
builtin/commit.c +3 -3
index 85ab748ff0..3bf6f012c0 100644
@@ -10,13 +10,13 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "lockfile.h"
 #include "index/cache-tree.h"
 #include "color.h"
 #include "index/dir.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "diff/diff.h"
 #include "odb/commit.h"
 #include "add-interactive.h"
@@ -30,7 +30,7 @@
 #include "path.h"
 #include "index/preload-index.h"
 #include "index/read-cache.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "string-list.h"
 #include "rerere.h"
 #include "index/unpack-trees.h"
builtin/config.c +4 -4
index 15782dfe64..3c56c7380d 100644
@@ -2,18 +2,18 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "color.h"
 #include "date.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
-#include "ident.h"
+#include "setup/ident.h"
 #include "parse-options.h"
 #include "urlmatch.h"
 #include "path.h"
 #include "quote.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "refs/worktree.h"
 
builtin/count-objects.c +2 -2
index cf10ddcae1..0a28c0a552 100644
@@ -5,9 +5,9 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "path.h"
 #include "parse-options.h"
builtin/credential-cache--daemon.c +1 -1
index 65cc619bec..313f4c58e8 100644
@@ -7,7 +7,7 @@
 
 #ifndef NO_UNIX_SOCKETS
 
-#include "config.h"
+#include "setup/config.h"
 #include "tempfile.h"
 #include "credential.h"
 #include "unix-socket.h"
builtin/credential-store.c +1 -1
index bc1453c6b2..91004b6188 100644
@@ -1,6 +1,6 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "lockfile.h"
 #include "credential.h"
builtin/credential.c +2 -2
index a295c80b36..1917982734 100644
@@ -3,8 +3,8 @@
 #include "git-compat-util.h"
 #include "credential.h"
 #include "builtin.h"
-#include "environment.h"
-#include "config.h"
+#include "setup/environment.h"
+#include "setup/config.h"
 
 static const char usage_msg[] =
 	"git credential (fill|approve|reject)";
builtin/describe.c +3 -3
index c22158d157..0c840c84ad 100644
@@ -2,8 +2,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
@@ -16,7 +16,7 @@
 #include "revision/revision.h"
 #include "diff/diff.h"
 #include "hashmap.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "run-command.h"
 #include "odb/odb.h"
builtin/diff-files.c +1 -1
index 1f67480362..d536ce8475 100644
@@ -8,7 +8,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "odb/commit.h"
builtin/diff-index.c +2 -2
index dac8099081..dac7eac2d8 100644
@@ -2,13 +2,13 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "odb/commit.h"
 #include "index/preload-index.h"
 #include "revision/revision.h"
-#include "setup.h"
+#include "setup/setup.h"
 
 static const char diff_cache_usage[] =
 "git diff-index [-m] [--cached] [--merge-base] "
builtin/diff-pairs.c +1 -1
index df5630be47..6400caf0a6 100644
@@ -1,5 +1,5 @@
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
 #include "gettext.h"
builtin/diff-tree.c +1 -1
index 8f7f48ac67..010a996ab6 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "odb/commit.h"
 #include "gettext.h"
builtin/diff.c +2 -2
index 0e8c488408..badef1411b 100644
@@ -8,7 +8,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "ewah/ewok.h"
 #include "lockfile.h"
 #include "color.h"
@@ -22,7 +22,7 @@
 #include "index/read-cache-ll.h"
 #include "revision/revision.h"
 #include "revision/log-tree.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "odb/oid-array.h"
 #include "odb/tree.h"
 
builtin/difftool.c +4 -4
index 1d3fae8793..425f3ddf83 100644
@@ -15,16 +15,16 @@
 #include "builtin.h"
 
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "copy.h"
 #include "run-command.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
 #include "path.h"
 #include "index/read-cache-ll.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/sparse-index.h"
 #include "strvec.h"
 #include "strbuf.h"
@@ -33,7 +33,7 @@
 #include "odb/odb.h"
 #include "index/dir.h"
 #include "index/entry.h"
-#include "setup.h"
+#include "setup/setup.h"
 
 static const char *const builtin_difftool_usage[] = {
 	N_("git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]"),
builtin/fast-export.c +2 -2
index 565cdccb40..5e5e100884 100644
@@ -8,8 +8,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs/refs.h"
builtin/fast-import.c +2 -2
index da586c7c63..16353c1d71 100644
@@ -3,10 +3,10 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "config.h"
+#include "setup/config.h"
 #include "lockfile.h"
 #include "odb/object.h"
 #include "odb/blob.h"
builtin/fetch.c +2 -2
index 2f744ac8b8..60be51f079 100644
@@ -7,9 +7,9 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "refs/refs.h"
 #include "refs/refspec.h"
builtin/fmt-merge-msg.c +1 -1
index cf4273a52c..a7e681afdf 100644
@@ -1,5 +1,5 @@
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "fmt-merge-msg.h"
 #include "gettext.h"
 #include "parse-options.h"
builtin/for-each-ref.c +2 -2
index 9b3f277cb8..6a39f52698 100644
@@ -1,7 +1,7 @@
 #include "builtin.h"
 #include "odb/commit.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "for-each-ref.h"
 #include "gettext.h"
 #include "odb/object.h"
builtin/for-each-repo.c +2 -2
index 927d3d92da..0ee86283cd 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "path.h"
builtin/fsck.c +1 -1
index 6e8fd0e828..049f32e13a 100644
@@ -1,7 +1,7 @@
 #include "builtin.h"
 #include "gettext.h"
 #include "hex.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
 #include "odb/tree.h"
 #include "odb/blob.h"
builtin/fsmonitor--daemon.c +2 -2
index 49b492fba0..8d82f210cc 100644
@@ -3,9 +3,9 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "index/fsmonitor-ll.h"
builtin/gc.c +4 -4
index 0243b34e3e..e4c482c243 100644
@@ -17,9 +17,9 @@
 #include "abspath.h"
 #include "date.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
-#include "config.h"
+#include "setup/config.h"
 #include "tempfile.h"
 #include "lockfile.h"
 #include "parse-options.h"
@@ -39,8 +39,8 @@
 #include "remote.h"
 #include "exec-cmd.h"
 #include "gettext.h"
-#include "hook.h"
-#include "setup.h"
+#include "setup/hook.h"
+#include "setup/setup.h"
 #include "trace2.h"
 #include "refs/worktree.h"
 
builtin/grep.c +3 -3
index 20cd821af7..10df2dacef 100644
@@ -9,10 +9,10 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/tag.h"
 #include "odb/tree-walk.h"
 #include "parse-options.h"
@@ -22,7 +22,7 @@
 #include "quote.h"
 #include "index/dir.h"
 #include "index/pathspec.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "odb/object-name.h"
builtin/hash-object.c +3 -3
index 335575862c..95a5105c2a 100644
@@ -7,8 +7,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-file.h"
@@ -16,7 +16,7 @@
 #include "odb/blob.h"
 #include "quote.h"
 #include "parse-options.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "write-or-die.h"
 
builtin/help.c +4 -4
index a140339999..4d1c5e18bd 100644
@@ -5,8 +5,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "pager.h"
@@ -15,8 +15,8 @@
 #include "run-command.h"
 #include "config-list.h"
 #include "help.h"
-#include "alias.h"
-#include "setup.h"
+#include "setup/alias.h"
+#include "setup/setup.h"
 
 #ifndef DEFAULT_HELP_FORMAT
 #define DEFAULT_HELP_FORMAT "man"
builtin/history.c +2 -2
index c817745f30..9c38be5b38 100644
@@ -4,9 +4,9 @@
 #include "index/cache-tree.h"
 #include "odb/commit.h"
 #include "revision/commit-reach.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
builtin/hook.c +3 -3
index cceeb3586e..6cff5b0889 100644
@@ -1,9 +1,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "parse-options.h"
 #include "thread-utils.h"
 
builtin/index-pack.c +3 -3
index 23d7e68020..167a6df9e7 100644
@@ -2,9 +2,9 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "pack/delta.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "pack/pack.h"
@@ -29,7 +29,7 @@
 #include "odb/tree-walk.h"
 #include "promisor-remote.h"
 #include "run-command.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 
 static const char index_pack_usage[] =
builtin/init-db.c +2 -2
index f459635129..bc8496b585 100644
@@ -6,12 +6,12 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "path.h"
 #include "refs/refs.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 
 static int guess_repository_type(const char *git_dir)
builtin/interpret-trailers.c +2 -2
index e7e86e9523..2462307a98 100644
@@ -6,13 +6,13 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "string-list.h"
 #include "tempfile.h"
 #include "trailer.h"
-#include "config.h"
+#include "setup/config.h"
 
 static const char * const git_interpret_trailers_usage[] = {
 	N_("git interpret-trailers [--in-place] [--trim-empty]\n"
builtin/last-modified.c +3 -3
index 88e122db9b..763d0f93a7 100644
@@ -4,10 +4,10 @@
 #include "pack/commit-graph.h"
 #include "odb/commit-slab.h"
 #include "odb/commit.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "ewah/ewok.h"
 #include "hashmap.h"
 #include "hex.h"
@@ -16,7 +16,7 @@
 #include "parse-options.h"
 #include "prio-queue.h"
 #include "quote.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "revision/revision.h"
 
 /* Remember to update object flag allocation in object.h */
builtin/log.c +3 -3
index 82144cf2b6..5b79637af3 100644
@@ -9,8 +9,8 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs/refs.h"
@@ -37,7 +37,7 @@
 #include "parse-options.h"
 #include "revision/line-log.h"
 #include "branch.h"
-#include "version.h"
+#include "setup/version.h"
 #include "mailmap.h"
 #include "progress.h"
 #include "odb/commit-slab.h"
builtin/ls-files.c +3 -3
index 49e8a685e3..3ef55beb89 100644
@@ -9,9 +9,9 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "quote.h"
 #include "index/dir.h"
 #include "gettext.h"
@@ -23,7 +23,7 @@
 #include "path.h"
 #include "index/pathspec.h"
 #include "index/read-cache.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "submodule.h"
 #include "odb/odb.h"
builtin/ls-tree.c +2 -2
index b59c186a21..70ca5dca69 100644
@@ -6,8 +6,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
builtin/mailinfo.c +1 -1
index 8de7ba7de1..943757ebcf 100644
@@ -5,7 +5,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "strbuf.h"
 #include "mailinfo.h"
builtin/merge-base.c +2 -2
index 7eec05ae7b..fa9c4945d4 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
builtin/merge-file.c +2 -2
index 12701b1d81..7075fce70d 100644
@@ -8,9 +8,9 @@
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "xdiff/xdiff.h"
 #include "diff/xdiff-interface.h"
 #include "parse-options.h"
builtin/merge-ours.c +2 -2
index c33e176c65..3900f64b5d 100644
@@ -10,8 +10,8 @@
 
 #include "git-compat-util.h"
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "diff/diff.h"
 
 static const char builtin_merge_ours_usage[] =
builtin/merge-tree.c +2 -2
index 41d8bbcbc1..7a73454060 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "odb/tree-walk.h"
 #include "diff/xdiff-interface.h"
 #include "help.h"
@@ -17,7 +17,7 @@
 #include "merge-blobs.h"
 #include "quote.h"
 #include "odb/tree.h"
-#include "config.h"
+#include "setup/config.h"
 #include "strvec.h"
 #include "write-or-die.h"
 
builtin/merge.c +5 -5
index da37fb11eb..090e2a8fb1 100644
@@ -13,17 +13,17 @@
 
 #include "abspath.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "lockfile.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "run-command.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "diff/diff.h"
 #include "diff/diff-merges.h"
 #include "refs/refs.h"
@@ -46,7 +46,7 @@
 #include "sequencer.h"
 #include "string-list.h"
 #include "odb/tag.h"
-#include "alias.h"
+#include "setup/alias.h"
 #include "branch.h"
 #include "revision/commit-reach.h"
 #include "index/wt-status.h"
builtin/mktag.c +1 -1
index eb25acc4a5..f7ed512639 100644
@@ -8,7 +8,7 @@
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "odb/fsck.h"
-#include "config.h"
+#include "setup/config.h"
 
 static char const * const builtin_mktag_usage[] = {
 	"git mktag",
builtin/multi-pack-index.c +3 -3
index 81401e37d5..2d78a08326 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "pack/midx.h"
@@ -12,7 +12,7 @@
 #include "odb/source.h"
 #include "odb/source-files.h"
 #include "odb/replace-object.h"
-#include "repository.h"
+#include "setup/repository.h"
 
 #define BUILTIN_MIDX_WRITE_USAGE \
 	N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]\n" \
builtin/mv.c +3 -3
index f49eec035e..bc51d64c95 100644
@@ -10,8 +10,8 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "index/name-hash.h"
 #include "odb/object-file.h"
@@ -24,7 +24,7 @@
 #include "index/read-cache-ll.h"
 #include "index/symlinks.h"
 
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "submodule.h"
 #include "index/entry.h"
builtin/name-rev.c +2 -2
index 31bc960b34..5cccf689f5 100644
@@ -2,10 +2,10 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
 #include "odb/tag.h"
 #include "refs/refs.h"
builtin/notes.c +2 -2
index 61087b0fa5..5a1201b315 100644
@@ -8,9 +8,9 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "notes.h"
builtin/organize.c +1 -1
index 925ef17128..35bf5cf90d 100644
@@ -13,7 +13,7 @@
 #include "gettext.h"
 #include "organize/organize.h"
 #include "parse-options.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "strvec.h"
 
 static const char *const organize_usage[] = {
builtin/pack-objects.c +2 -2
index b611b27573..cc97d7e814 100644
@@ -2,10 +2,10 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "config.h"
+#include "setup/config.h"
 #include "attr.h"
 #include "odb/object.h"
 #include "odb/commit.h"
builtin/patch-id.c +3 -3
index 7207279cef..22196195d2 100644
@@ -1,14 +1,14 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
 #include "parse-options.h"
-#include "setup.h"
+#include "setup/setup.h"
 
 static void flush_current_id(size_t patchlen, struct object_id *id, struct object_id *result)
 {
builtin/prune.c +1 -1
index d2d5bd2619..fc70161992 100644
@@ -4,7 +4,7 @@
 #include "odb/commit.h"
 #include "diff/diff.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "revision/revision.h"
builtin/pull.c +2 -2
index 818ddbf956..cca98abb65 100644
@@ -10,8 +10,8 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "merge.h"
builtin/push.c +2 -2
index 280cfd289f..b4556466d7 100644
@@ -7,9 +7,9 @@
 #include "builtin.h"
 #include "advice.h"
 #include "branch.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs/refspec.h"
builtin/range-diff.c +1 -1
index 323046c696..ffb36c6086 100644
@@ -5,7 +5,7 @@
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "diff/range-diff.h"
-#include "config.h"
+#include "setup/config.h"
 #include "parse.h"
 #include "color.h"
 
builtin/read-tree.c +3 -3
index 2bc2f43729..6c2ea503f7 100644
@@ -5,8 +5,8 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
@@ -18,7 +18,7 @@
 #include "index/unpack-trees.h"
 #include "parse-options.h"
 #include "index/resolve-undo.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "submodule.h"
 
builtin/rebase.c +3 -3
index 62b58da192..03bc28aba9 100644
@@ -10,14 +10,14 @@
 #include "builtin.h"
 
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "run-command.h"
 #include "strvec.h"
 #include "index/dir.h"
 #include "refs/refs.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/unpack-trees.h"
 #include "lockfile.h"
 #include "odb/object-file.h"
@@ -35,7 +35,7 @@
 #include "rebase-interactive.h"
 #include "reset.h"
 #include "trace2.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "trailer.h"
 
 static char const * const builtin_rebase_usage[] = {
builtin/receive-pack.c +5 -5
index 9a816f1e86..718073653c 100644
@@ -5,16 +5,16 @@
 #include "abspath.h"
 #include "odb/commit.h"
 #include "revision/commit-reach.h"
-#include "config.h"
+#include "setup/config.h"
 #include "connect.h"
 #include "connected.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "exec-cmd.h"
 #include "odb/fsck.h"
 #include "gettext.h"
 #include "gpg-interface.h"
 #include "hex.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "lockfile.h"
 #include "odb/object.h"
 #include "odb/object-file.h"
@@ -31,7 +31,7 @@
 #include "remote.h"
 #include "run-command.h"
 #include "pack/server-info.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "revision/shallow.h"
 #include "sideband.h"
 #include "sigchain.h"
@@ -39,7 +39,7 @@
 #include "strvec.h"
 #include "trace.h"
 #include "trace2.h"
-#include "version.h"
+#include "setup/version.h"
 #include "refs/worktree.h"
 
 static const char * const receive_pack_usage[] = {
builtin/reflog.c +1 -1
index d8d1cb2c6a..83e40a0194 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/odb.h"
builtin/refs.c +1 -1
index abfc0acdd2..d6e28a6043 100644
@@ -1,5 +1,5 @@
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/fsck.h"
 #include "refs/pack-refs.h"
 #include "parse-options.h"
builtin/remote.c +2 -2
index 3f6cee14ff..5a4fa6de8b 100644
@@ -2,10 +2,10 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "date.h"
 #include "gettext.h"
-#include "ident.h"
+#include "setup/ident.h"
 #include "parse-options.h"
 #include "path.h"
 #include "transport.h"
builtin/repack.c +2 -2
index aa74f2161a..1d861c6062 100644
@@ -1,8 +1,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "parse-options.h"
 #include "path.h"
 #include "run-command.h"
builtin/replace.c +2 -2
index 83497cd974..37f3dbd537 100644
@@ -9,9 +9,9 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs/refs.h"
builtin/replay.c +1 -1
index 4f5515a314..f2f8c16343 100644
@@ -5,7 +5,7 @@
 #include "git-compat-util.h"
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "hex.h"
 #include "odb/object-name.h"
 #include "parse-options.h"
builtin/repo.c +2 -2
index b296e2cda7..e736c97e9a 100644
@@ -2,7 +2,7 @@
 
 #include "builtin.h"
 #include "odb/commit.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "odb/hash.h"
 #include "hex.h"
 #include "odb/odb.h"
@@ -14,7 +14,7 @@
 #include "refs/ref-filter.h"
 #include "refs/refs.h"
 #include "revision/revision.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "revision/shallow.h"
builtin/rerere.c +1 -1
index 4b1b7d49ce..f7d406168c 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "rerere.h"
builtin/reset.c +4 -4
index 96c7bf9cf1..2202e0006d 100644
@@ -12,8 +12,8 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
@@ -28,10 +28,10 @@
 #include "odb/object-name.h"
 #include "parse-options.h"
 #include "path.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/unpack-trees.h"
 #include "index/cache-tree.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "submodule.h"
 #include "trace.h"
builtin/rev-list.c +2 -2
index 21d7b8aa81..54aabd084f 100644
@@ -2,10 +2,10 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "revision/revision.h"
builtin/rev-parse.c +5 -5
index 1d97c4869b..6f394db8d2 100644
@@ -11,9 +11,9 @@
 
 #include "abspath.h"
 #include "revision/bisect.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
@@ -24,10 +24,10 @@
 #include "path.h"
 #include "diff/diff.h"
 #include "index/read-cache-ll.h"
-#include "repo-settings.h"
-#include "repository.h"
+#include "setup/repo-settings.h"
+#include "setup/repository.h"
 #include "revision/revision.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/split-index.h"
 #include "submodule.h"
 #include "revision/commit-reach.h"
builtin/revert.c +1 -1
index ae3f186f12..f220268baa 100644
@@ -4,7 +4,7 @@
 #include "builtin.h"
 #include "parse-options.h"
 #include "diff/diff.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "revision/revision.h"
 #include "rerere.h"
builtin/rm.c +3 -3
index 4f7194f541..cf59a9895d 100644
@@ -8,8 +8,8 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "lockfile.h"
 #include "index/dir.h"
 #include "gettext.h"
@@ -20,7 +20,7 @@
 #include "index/read-cache.h"
 
 #include "string-list.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "submodule.h"
 #include "index/pathspec.h"
builtin/send-pack.c +2 -2
index 2597a47bde..1e358bc0b0 100644
@@ -1,6 +1,6 @@
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "pkt-line.h"
 #include "run-command.h"
builtin/shortlog.c +3 -3
index 2fe86d6f46..fe98e4f21b 100644
@@ -1,16 +1,16 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "string-list.h"
 #include "revision/revision.h"
 #include "utf8.h"
 #include "mailmap.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "shortlog.h"
 #include "parse-options.h"
 #include "trailer.h"
builtin/show-branch.c +2 -2
index e0e912439c..31008f6d51 100644
@@ -2,8 +2,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
builtin/show-ref.c +2 -2
index e4b186b930..77362ae6c7 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs/refs-internal.h"
builtin/sparse-checkout.c +3 -3
index efe6f7897e..8f2daa10ac 100644
@@ -3,9 +3,9 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
@@ -17,7 +17,7 @@
 #include "lockfile.h"
 #include "index/unpack-trees.h"
 #include "quote.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "refs/worktree.h"
 
builtin/stash.c +4 -4
index a8337ffdc4..81b3506598 100644
@@ -2,8 +2,8 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
@@ -20,10 +20,10 @@
 #include "index/entry.h"
 #include "index/preload-index.h"
 #include "index/read-cache.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "rerere.h"
 #include "revision/revision.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "revision/log-tree.h"
 #include "diff/diffcore.h"
builtin/stripspace.c +3 -3
index 18705f1a5b..9547c474e3 100644
@@ -1,10 +1,10 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "write-or-die.h"
 
builtin/submodule--helper.c +3 -3
index 5226a5f331..5a97263743 100644
@@ -2,11 +2,11 @@
 
 #include "builtin.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 
-#include "config.h"
+#include "setup/config.h"
 #include "parse-options.h"
 #include "quote.h"
 #include "path.h"
@@ -14,7 +14,7 @@
 #include "index/preload-index.h"
 #include "index/dir.h"
 #include "index/read-cache.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
builtin/symbolic-ref.c +2 -2
index 9ea9ca6500..d5461ac52c 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "refs/refs.h"
 #include "parse-options.h"
builtin/tag.c +2 -2
index 46df0f7c27..08a50c3c43 100644
@@ -11,9 +11,9 @@
 
 #include "builtin.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs/refs.h"
builtin/unpack-file.c +2 -2
index 47f43f5a87..600da7fd06 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "odb/object-file.h"
 #include "odb/object-name.h"
builtin/unpack-objects.c +2 -2
index fb724e46ea..9081e618b3 100644
@@ -2,8 +2,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "git-zlib.h"
 #include "hex.h"
builtin/update-index.c +3 -3
index b5c8fae02c..1824c9590e 100644
@@ -8,8 +8,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
@@ -26,7 +26,7 @@
 #include "index/pathspec.h"
 #include "index/dir.h"
 #include "index/read-cache.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "index/split-index.h"
 #include "index/symlinks.h"
builtin/update-ref.c +2 -2
index 5bcd100e52..57090fffae 100644
@@ -2,8 +2,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
builtin/update-server-info.c +2 -2
index 41bbd0114f..ca087aa41f 100644
@@ -1,6 +1,6 @@
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "pack/server-info.h"
builtin/upload-archive.c +1 -1
index 718e74b3ac..7b63b0185b 100644
@@ -5,7 +5,7 @@
 #include "builtin.h"
 #include "archive.h"
 #include "pkt-line.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "sideband.h"
 #include "run-command.h"
 #include "strvec.h"
builtin/upload-pack.c +2 -2
index dc37ffb70c..7131fb6689 100644
@@ -9,9 +9,9 @@
 #include "odb/replace-object.h"
 #include "upload-pack.h"
 #include "serve.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "odb/commit.h"
-#include "environment.h"
+#include "setup/environment.h"
 
 static const char * const upload_pack_usage[] = {
 	N_("git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
builtin/var.c +3 -3
index d01c87dfa2..0d48bd81a8 100644
@@ -9,10 +9,10 @@
 #include "builtin.h"
 
 #include "attr.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
-#include "ident.h"
+#include "setup/environment.h"
+#include "setup/ident.h"
 #include "pager.h"
 #include "refs/refs.h"
 #include "path.h"
builtin/verify-commit.c +2 -2
index 3ec03f016c..529b2d2573 100644
@@ -6,8 +6,8 @@
  * Based on git-verify-tag
  */
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/object-name.h"
 #include "odb/commit.h"
builtin/verify-pack.c +2 -2
index 65fd6629a0..1b282e6bb9 100644
@@ -1,7 +1,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "parse-options.h"
builtin/verify-tag.c +2 -2
index 460244f25b..82edf73980 100644
@@ -6,8 +6,8 @@
  * Based on git-verify-tag.sh
  */
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/tag.h"
 #include "odb/object-name.h"
builtin/worktree.c +3 -3
index c4068b45d6..1d808800cc 100644
@@ -5,10 +5,10 @@
 #include "abspath.h"
 #include "advice.h"
 #include "index/checkout.h"
-#include "config.h"
+#include "setup/config.h"
 #include "copy.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/object-file.h"
@@ -21,7 +21,7 @@
 #include "refs/refs.h"
 #include "remote.h"
 #include "run-command.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "sigchain.h"
 #include "submodule.h"
 #include "utf8.h"
builtin/write-tree.c +2 -2
index 4a2b1ceb58..7d21f64007 100644
@@ -5,8 +5,8 @@
  */
 #define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/tree.h"
bundle-uri.c +1 -1
index 96ddf92347..cd26d38249 100644
@@ -10,7 +10,7 @@
 #include "run-command.h"
 #include "hashmap.h"
 #include "pkt-line.h"
-#include "config.h"
+#include "setup/config.h"
 #include "fetch-pack.h"
 #include "remote.h"
 #include "trace2.h"
bundle.c +2 -2
index dc50661bdd..1e01ab38d4 100644
@@ -4,11 +4,11 @@
 #include "git-compat-util.h"
 #include "lockfile.h"
 #include "bundle.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/odb.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/object.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
color.c +1 -1
index 00b53f97ac..06a0b92958 100644
@@ -1,7 +1,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "color.h"
 #include "editor.h"
 #include "gettext.h"
column.c +1 -1
index 93fae316b4..505abf2bfb 100644
@@ -1,7 +1,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "column.h"
 #include "string-list.h"
 #include "pager.h"
common-init.c +2 -2
index 7e6b392800..aacfc85db6 100644
@@ -7,9 +7,9 @@
 #include "attr.h"
 #include "odb/odb.h"
 #include "parse.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/replace-object.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "trace2.h"
 
compat/fsmonitor/fsm-health-darwin.c +1 -1
index f24d56b3d2..dfa07f4b7b 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "index/fsmonitor--daemon.h"
compat/fsmonitor/fsm-health-linux.c +1 -1
index 7be822fb1c..60f878b55e 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "index/fsmonitor--daemon.h"
compat/fsmonitor/fsm-health-win32.c +1 -1
index 09dee50777..c4574f1eb0 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "index/fsmonitor--daemon.h"
compat/fsmonitor/fsm-ipc-unix.c +2 -2
index ffd864ae92..bb1bed15fb 100644
@@ -1,11 +1,11 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "hex.h"
 #include "path.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "strbuf.h"
 #include "index/fsmonitor-ll.h"
 #include "index/fsmonitor-ipc.h"
compat/fsmonitor/fsm-ipc-win32.c +1 -1
index bc92e1fd20..d3febb8dbd 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/fsmonitor-ipc.h"
 #include "path.h"
 
compat/fsmonitor/fsm-listen-win32.c +1 -1
index c8cbdf4a97..4c49b04a7b 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/fsmonitor-ll.h"
 #include "fsm-listen.h"
 #include "index/fsmonitor--daemon.h"
compat/fsmonitor/fsm-settings-unix.c +1 -1
index 41106355b1..67c49d0ca7 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/fsmonitor-ll.h"
 #include "index/fsmonitor-ipc.h"
 #include "index/fsmonitor-settings.h"
compat/fsmonitor/fsm-settings-win32.c +2 -2
index 5b2872a4f1..4c822e01ed 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
-#include "config.h"
-#include "repository.h"
+#include "setup/config.h"
+#include "setup/repository.h"
 #include "index/fsmonitor-ll.h"
 #include "index/fsmonitor-settings.h"
 #include "index/fsmonitor-path-utils.h"
compat/mingw.c +3 -3
index 64814ac35d..9fce208dde 100644
@@ -4,10 +4,10 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "odb/alloc.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
-#include "repository.h"
+#include "setup/environment.h"
+#include "setup/repository.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "strbuf.h"
compat/precompose_utf8.c +2 -2
index 8077f6235b..c047c17675 100644
@@ -7,8 +7,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "path.h"
 #include "strbuf.h"
compat/regex/regex.c +1 -1
index 4b09cc4e14..25f7e13d9e 100644
@@ -20,7 +20,7 @@
 #pragma GCC diagnostic ignored "-Wsign-compare"
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "setup/config.h"
 #endif
 
 /* Make sure no one compiles this code with a C++ compiler.  */
compat/win32/path-utils.c +2 -2
index f779f367cf..043b077d67 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "../../git-compat-util.h"
-#include "../../environment.h"
-#include "../../repository.h"
+#include "setup/environment.h"
+#include "setup/repository.h"
 
 int win32_has_dos_drive_prefix(const char *path)
 {
compat/win32/trace2_win32_process_info.c +1 -1
index 6a6a396078..6fe122e637 100644
@@ -2,7 +2,7 @@
 
 #include "../../git-compat-util.h"
 #include "../../json-writer.h"
-#include "../../repository.h"
+#include "setup/repository.h"
 #include "../../strvec.h"
 #include "../../trace2.h"
 #include "lazyload.h"
connect.c +4 -4
index a24b019b2c..2a1b177490 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "pkt-line.h"
@@ -18,9 +18,9 @@
 #include "transport.h"
 #include "trace2.h"
 #include "strbuf.h"
-#include "version.h"
+#include "setup/version.h"
 #include "protocol.h"
-#include "alias.h"
+#include "setup/alias.h"
 #include "bundle-uri.h"
 #include "promisor-remote.h"
 
contrib/libgit-sys/public_symbol_export.c +2 -2
index dfbb257115..02765ba5a9 100644
@@ -5,9 +5,9 @@
  */
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "contrib/libgit-sys/public_symbol_export.h"
-#include "version.h"
+#include "setup/version.h"
 
 #pragma GCC visibility push(default)
 
convert.c +1 -1
index f71d6dcefd..5490c4a558 100644
@@ -3,7 +3,7 @@
 
 #include "git-compat-util.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
 #include "copy.h"
 #include "gettext.h"
credential.c +3 -3
index 2594c0c422..dfbd1e9f74 100644
@@ -2,7 +2,7 @@
 
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "credential.h"
 #include "gettext.h"
 #include "string-list.h"
@@ -12,9 +12,9 @@
 #include "sigchain.h"
 #include "strbuf.h"
 #include "urlmatch.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "trace2.h"
-#include "repository.h"
+#include "setup/repository.h"
 
 void credential_init(struct credential *c)
 {
daemon.c +3 -3
index 5d7978211c..219eeab179 100644
@@ -2,14 +2,14 @@
 
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "path.h"
 #include "pkt-line.h"
 #include "protocol.h"
 #include "run-command.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "string-list.h"
 
diagnose.c +1 -1
index 0bac203282..341354ee6d 100644
@@ -10,7 +10,7 @@
 #include "odb/odb.h"
 #include "pack/packfile.h"
 #include "parse-options.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "write-or-die.h"
 
 struct archive_dir {
diff/combine-diff.c +1 -1
index 8e03062f39..4446183707 100644
@@ -7,7 +7,7 @@
 #include "convert.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "odb/object-name.h"
 #include "quote.h"
diff/diff-lib.c +1 -1
index 4a932f9067..fa3ca39389 100644
@@ -18,7 +18,7 @@
 #include "index/cache-tree.h"
 #include "index/unpack-trees.h"
 #include "refs/refs.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "submodule.h"
 #include "index/symlinks.h"
 #include "trace.h"
diff/diff.c +3 -3
index c00b87cca2..4603493a36 100644
@@ -8,9 +8,9 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "base85.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "tempfile.h"
 #include "revision/revision.h"
@@ -43,7 +43,7 @@
 #include "odb/object-file.h"
 #include "odb/object-name.h"
 #include "index/read-cache-ll.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strmap.h"
 #include "ws.h"
 
diff/range-diff.c +2 -2
index 281c043480..80ebfe1114 100644
@@ -2,7 +2,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "diff/range-diff.h"
 #include "odb/object-name.h"
@@ -16,7 +16,7 @@
 #include "odb/commit.h"
 #include "pager.h"
 #include "revision/pretty.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "diff/userdiff.h"
 #include "apply.h"
 #include "revision/revision.h"
diff/tree-diff.c +1 -1
index a34559daa5..30fc2725e7 100644
@@ -10,7 +10,7 @@
 #include "odb/hash.h"
 #include "odb/tree.h"
 #include "odb/tree-walk.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/dir.h"
 
 /*
diff/userdiff.c +2 -2
index 8993b622c1..63d195e7d7 100644
@@ -2,11 +2,11 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/userdiff.h"
 #include "attr.h"
 #include "strbuf.h"
-#include "environment.h"
+#include "setup/environment.h"
 
 static struct userdiff_driver *drivers;
 static int ndrivers;
diff/xdiff-interface.c +2 -2
index 2c87316caa..8b016b327c 100644
@@ -1,9 +1,9 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
-#include "config.h"
+#include "setup/config.h"
 #include "hex.h"
 #include "odb/odb.h"
 #include "strbuf.h"
editor.c +2 -2
index 0d1cb8768d..5c0238eb80 100644
@@ -3,9 +3,9 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "editor.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "pager.h"
 #include "path.h"
exec-cmd.c +1 -1
index 507e67d528..5e0e00fb79 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "path.h"
fetch-negotiator.c +1 -1
index be383367f5..90fee42b50 100644
@@ -3,7 +3,7 @@
 #include "negotiator/default.h"
 #include "negotiator/skipping.h"
 #include "negotiator/noop.h"
-#include "repository.h"
+#include "setup/repository.h"
 
 void fetch_negotiator_init(struct repository *r,
 			   struct fetch_negotiator *negotiator)
fetch-pack.c +4 -4
index d27a28502f..5bc72eb370 100644
@@ -2,10 +2,10 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "repository.h"
-#include "config.h"
+#include "setup/repository.h"
+#include "setup/config.h"
 #include "date.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
@@ -20,7 +20,7 @@
 #include "run-command.h"
 #include "connect.h"
 #include "trace2.h"
-#include "version.h"
+#include "setup/version.h"
 #include "odb/oid-array.h"
 #include "odb/oidset.h"
 #include "pack/packfile.h"
fmt-merge-msg.c +2 -2
index 4993cc4a02..d38b2b5c8c 100644
@@ -2,8 +2,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "refs/refs.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
gettext.c +1 -1
index 8d08a61f84..7bb4305ad6 100644
@@ -6,7 +6,7 @@
 
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "utf8.h"
git.c +4 -4
index f01a80867b..693604a598 100644
@@ -1,8 +1,8 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "builtin.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "help.h"
@@ -10,9 +10,9 @@
 #include "pager.h"
 #include "index/read-cache-ll.h"
 #include "run-command.h"
-#include "alias.h"
+#include "setup/alias.h"
 #include "odb/replace-object.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "attr.h"
 #include "revision/shallow.h"
 #include "trace.h"
gpg-interface.c +3 -3
index 45a922496b..69e99d56c0 100644
@@ -2,18 +2,18 @@
 
 #include "git-compat-util.h"
 #include "odb/commit.h"
-#include "config.h"
+#include "setup/config.h"
 #include "date.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "index/dir.h"
-#include "ident.h"
+#include "setup/ident.h"
 #include "gpg-interface.h"
 #include "path.h"
 #include "sigchain.h"
 #include "tempfile.h"
-#include "alias.h"
+#include "setup/alias.h"
 
 static int git_gpg_config(const char *, const char *,
 			  const struct config_context *, void *);
grep.c +1 -1
index c4eb18ccd7..9eda692529 100644
@@ -1,7 +1,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
 #include "grep.h"
 #include "hex.h"
help.c +4 -4
index f7a0950f6c..34ab22ade5 100644
@@ -3,7 +3,7 @@
 
 #include "git-compat-util.h"
 #include "git-zlib.h"
-#include "config.h"
+#include "setup/config.h"
 #include "builtin.h"
 #include "exec-cmd.h"
 #include "run-command.h"
@@ -14,13 +14,13 @@
 #include "command-list.h"
 #include "string-list.h"
 #include "column.h"
-#include "version.h"
+#include "setup/version.h"
 #include "refs/refs.h"
 #include "parse-options.h"
 #include "prompt.h"
 #include "index/fsmonitor-ipc.h"
-#include "repository.h"
-#include "alias.h"
+#include "setup/repository.h"
+#include "setup/alias.h"
 #include "utf8.h"
 
 #ifndef NO_CURL
http-backend.c +4 -4
index 57589cc127..dcf8506c1e 100644
@@ -2,12 +2,12 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "git-zlib.h"
 #include "hex.h"
 #include "path.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "refs/refs.h"
 #include "pkt-line.h"
 #include "odb/object.h"
@@ -16,7 +16,7 @@
 #include "run-command.h"
 #include "string-list.h"
 #include "url.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "pack/packfile.h"
 #include "odb/odb.h"
http-fetch.c +3 -3
index 05f68f306a..ad2447ce72 100644
@@ -1,13 +1,13 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "http.h"
 #include "walker.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "url.h"
 #include "urlmatch.h"
http-push.c +3 -3
index d45daee9e0..fb18e8756f 100644
@@ -1,9 +1,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/commit.h"
 #include "odb/tag.h"
 #include "odb/blob.h"
@@ -12,7 +12,7 @@
 #include "revision/revision.h"
 #include "remote.h"
 #include "revision/list-objects.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "sigchain.h"
 #include "strvec.h"
 #include "odb/tree.h"
http-walker.c +1 -1
index 8df0c5329b..b5bba74da4 100644
@@ -2,7 +2,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "hex.h"
 #include "walker.h"
 #include "http.h"
http.c +3 -3
index 24a6b30ab3..5b3b2b24d6 100644
@@ -3,16 +3,16 @@
 
 #include "git-compat-util.h"
 #include "git-curl-compat.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "http.h"
-#include "config.h"
+#include "setup/config.h"
 #include "pack/pack.h"
 #include "run-command.h"
 #include "url.h"
 #include "urlmatch.h"
 #include "credential.h"
-#include "version.h"
+#include "setup/version.h"
 #include "pkt-line.h"
 #include "gettext.h"
 #include "trace.h"
imap-send.c +3 -3
index 0d16d02029..de244d8011 100644
@@ -26,13 +26,13 @@
 
 #include "git-compat-util.h"
 #include "advice.h"
-#include "config.h"
+#include "setup/config.h"
 #include "credential.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "parse-options.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #ifdef USE_CURL_FOR_IMAP_SEND
 #include "http.h"
index/cache-tree.c +1 -1
index e7c4bfe45c..bb813bd840 100644
@@ -13,7 +13,7 @@
 #include "odb/transaction.h"
 #include "index/read-cache-ll.h"
 #include "odb/replace-object.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "promisor-remote.h"
 #include "trace.h"
 #include "trace2.h"
index/checkout.c +2 -2
index 13d8895032..b262ada8c7 100644
@@ -4,9 +4,9 @@
 #include "odb/object-name.h"
 #include "remote.h"
 #include "refs/refspec.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/checkout.h"
-#include "config.h"
+#include "setup/config.h"
 #include "strbuf.h"
 
 struct tracking_name_data {
index/dir.c +4 -4
index 6f74a3e87c..8eb684c005 100644
@@ -11,16 +11,16 @@
 
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "index/name-hash.h"
 #include "odb/object-file.h"
 #include "path.h"
 #include "refs/refs.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "wildmatch.h"
 #include "index/pathspec.h"
 #include "utf8.h"
@@ -28,7 +28,7 @@
 #include "ewah/ewok.h"
 #include "index/fsmonitor-ll.h"
 #include "index/read-cache-ll.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/sparse-index.h"
 #include "strbuf.h"
 #include "submodule-config.h"
index/entry.c +1 -1
index 5b89ad2294..b37c53198f 100644
@@ -4,7 +4,7 @@
 #include "odb/odb.h"
 #include "odb/streaming.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "index/name-hash.h"
index/fsmonitor-ipc.c +1 -1
index 7c213245a1..68c0148de6 100644
@@ -4,7 +4,7 @@
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "index/fsmonitor-ipc.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "trace2.h"
index/fsmonitor-settings.c +2 -2
index 883b5902a9..4668dd424e 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "gettext.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/fsmonitor-ipc.h"
 #include "index/fsmonitor-settings.h"
 #include "index/fsmonitor-path-utils.h"
index/fsmonitor.c +3 -3
index 606a59d36d..32bc60e44a 100644
@@ -2,14 +2,14 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "ewah/ewok.h"
 #include "index/fsmonitor.h"
 #include "index/fsmonitor-ipc.h"
 #include "index/name-hash.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "trace2.h"
index/name-hash.c +1 -1
index 5d126bc1a3..49c0dd5775 100644
@@ -10,7 +10,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "index/name-hash.h"
 #include "odb/object.h"
index/parallel-checkout.c +1 -1
index 971c4b33fa..0905a7ff1e 100644
@@ -2,7 +2,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/entry.h"
 #include "gettext.h"
 #include "odb/hash.h"
index/pathspec.c +3 -3
index 7a0c152fb9..fe80ab49d1 100644
@@ -4,13 +4,13 @@
 #include "abspath.h"
 #include "parse.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "index/pathspec.h"
 #include "attr.h"
 #include "index/read-cache.h"
-#include "repository.h"
-#include "setup.h"
+#include "setup/repository.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "index/symlinks.h"
 #include "quote.h"
index/preload-index.c +3 -3
index eab3bfc602..d2d01ae72d 100644
@@ -7,7 +7,7 @@
 #include "git-compat-util.h"
 #include "index/pathspec.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "index/fsmonitor.h"
 #include "gettext.h"
 #include "parse.h"
@@ -15,10 +15,10 @@
 #include "progress.h"
 #include "index/read-cache.h"
 #include "thread-utils.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/symlinks.h"
 #include "trace2.h"
-#include "config.h"
+#include "setup/config.h"
 
 /*
  * Mostly randomly chosen maximum thread counts: we
index/read-cache.c +4 -4
index 9c62ae5ee8..20a5e191a4 100644
@@ -8,7 +8,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "date.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
@@ -24,7 +24,7 @@
 #include "odb/oid-array.h"
 #include "odb/tree.h"
 #include "odb/commit.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "mem-pool.h"
 #include "index/name-hash.h"
@@ -32,7 +32,7 @@
 #include "path.h"
 #include "index/preload-index.h"
 #include "index/read-cache.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/resolve-undo.h"
 #include "revision/revision.h"
 #include "strbuf.h"
@@ -47,7 +47,7 @@
 #include "index/sparse-index.h"
 #include "csum-file.h"
 #include "promisor-remote.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "advice.h"
index/read-cache.h +1 -1
index d8519c7b36..69d04e93be 100644
@@ -4,7 +4,7 @@
 #include "index/read-cache-ll.h"
 #include "odb/object.h"
 #include "index/pathspec.h"
-#include "environment.h"
+#include "setup/environment.h"
 
 /*
  * Determine the appropriate index mode for a file based on its stat()
index/sparse-index.c +3 -3
index 0a061a7658..7ac6142023 100644
@@ -2,18 +2,18 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "ewah/ewok.h"
 #include "gettext.h"
 #include "index/name-hash.h"
 #include "index/read-cache-ll.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/sparse-index.h"
 #include "odb/tree.h"
 #include "index/pathspec.h"
 #include "trace2.h"
 #include "index/cache-tree.h"
-#include "config.h"
+#include "setup/config.h"
 #include "index/dir.h"
 #include "index/fsmonitor-ll.h"
 #include "advice.h"
index/split-index.c +1 -1
index 02a5b011c5..9835b71f21 100644
@@ -5,7 +5,7 @@
 #include "odb/hash.h"
 #include "mem-pool.h"
 #include "index/read-cache-ll.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "index/split-index.h"
 #include "strbuf.h"
 #include "ewah/ewok.h"
index/statinfo.c +2 -2
index 4a22923009..5f4d710795 100644
@@ -1,9 +1,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "index/statinfo.h"
-#include "repository.h"
+#include "setup/repository.h"
 
 /*
  * Munge st_size into an unsigned int.
index/symlinks.c +1 -1
index 18fadf3f75..ab894f2e05 100644
@@ -2,7 +2,7 @@
 
 #include "git-compat-util.h"
 #include "gettext.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "index/symlinks.h"
 
 static int threaded_check_leading_path(struct cache_def *cache, const char *name,
index/unpack-trees.c +3 -3
index 68d85f622e..2eecede699 100644
@@ -4,10 +4,10 @@
 #include "git-compat-util.h"
 #include "advice.h"
 #include "strvec.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "parse.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "index/name-hash.h"
@@ -30,7 +30,7 @@
 #include "promisor-remote.h"
 #include "index/entry.h"
 #include "index/parallel-checkout.h"
-#include "setup.h"
+#include "setup/setup.h"
 
 /*
  * Error messages expected by scripts out of plumbing commands such as
index/wt-status.c +3 -3
index 3381a40e75..847438f121 100644
@@ -8,7 +8,7 @@
 #include "index/dir.h"
 #include "odb/commit.h"
 #include "diff/diff.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "odb/hash.h"
 #include "hex.h"
@@ -17,7 +17,7 @@
 #include "revision/revision.h"
 #include "diff/diffcore.h"
 #include "quote.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "run-command.h"
 #include "strvec.h"
 #include "remote.h"
@@ -25,7 +25,7 @@
 #include "submodule.h"
 #include "column.h"
 #include "index/read-cache.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strbuf.h"
 #include "trace.h"
 #include "trace2.h"
lockfile.c +1 -1
index 100f603771..942b919941 100644
@@ -9,7 +9,7 @@
 #include "gettext.h"
 #include "lockfile.h"
 #include "parse.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "strbuf.h"
 #include "wrapper.h"
 
mailinfo.c +2 -2
index 13949ff31e..6c44a6c6c6 100644
@@ -1,8 +1,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex-ll.h"
 #include "utf8.h"
mailmap.c +3 -3
index 558b1972f8..670fb01403 100644
@@ -1,11 +1,11 @@
 #include "git-compat-util.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "string-list.h"
 #include "mailmap.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
-#include "setup.h"
-#include "config.h"
+#include "setup/setup.h"
+#include "setup/config.h"
 
 struct mailmap_info {
 	char *name;
merge-ll.c +1 -1
index 2aa45bfa90..9cb5119aa2 100644
@@ -8,7 +8,7 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "convert.h"
 #include "attr.h"
 #include "diff/xdiff-interface.h"
merge-ort-wrappers.c +1 -1
index c31ed7028d..227181d105 100644
@@ -6,7 +6,7 @@
 #include "merge-ort.h"
 #include "merge-ort-wrappers.h"
 #include "index/read-cache-ll.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/tag.h"
 #include "odb/tree.h"
 
merge-ort.c +2 -2
index 516cd265c5..f101b5e0c4 100644
@@ -26,11 +26,11 @@
 #include "index/cache-tree.h"
 #include "odb/commit.h"
 #include "revision/commit-reach.h"
-#include "config.h"
+#include "setup/config.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "index/entry.h"
merge.c +1 -1
index 0fcfc1460f..95a943c477 100644
@@ -7,7 +7,7 @@
 #include "lockfile.h"
 #include "merge.h"
 #include "odb/commit.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "run-command.h"
 #include "index/resolve-undo.h"
 #include "odb/tree.h"
meson.build +9 -9
index c61ebc35a6..bad597d8ff 100644
@@ -311,7 +311,7 @@ libgit_sources = [
   'add-interactive.c',
   'add-patch.c',
   'advice.c',
-  'alias.c',
+  'setup/alias.c',
   'odb/alloc.c',
   'apply.c',
   'archive-tar.c',
@@ -340,7 +340,7 @@ libgit_sources = [
   'common-exit.c',
   'common-init.c',
   'compiler-tricks/not-constant.c',
-  'config.c',
+  'setup/config.c',
   'connect.c',
   'connected.c',
   'convert.c',
@@ -367,7 +367,7 @@ libgit_sources = [
   'index/dir.c',
   'editor.c',
   'index/entry.c',
-  'environment.c',
+  'setup/environment.c',
   'ewah/bitmap.c',
   'ewah/ewah_bitmap.c',
   'ewah/ewah_io.c',
@@ -392,8 +392,8 @@ libgit_sources = [
   'help.c',
   'hex.c',
   'hex-ll.c',
-  'hook.c',
-  'ident.c',
+  'setup/hook.c',
+  'setup/ident.c',
   'json-writer.c',
   'kwset.c',
   'levenshtein.c',
@@ -517,8 +517,8 @@ libgit_sources = [
   'pack/repack-promisor.c',
   'odb/replace-object.c',
   'replay.c',
-  'repo-settings.c',
-  'repository.c',
+  'setup/repo-settings.c',
+  'setup/repository.c',
   'rerere.c',
   'reset.c',
   'index/resolve-undo.c',
@@ -528,7 +528,7 @@ libgit_sources = [
   'sequencer.c',
   'serve.c',
   'pack/server-info.c',
-  'setup.c',
+  'setup/setup.c',
   'revision/shallow.c',
   'sideband.c',
   'sigchain.c',
@@ -575,7 +575,7 @@ libgit_sources = [
   'usage.c',
   'diff/userdiff.c',
   'utf8.c',
-  'version.c',
+  'setup/version.c',
   'versioncmp.c',
   'walker.c',
   'wildmatch.c',
negotiator/default.c +1 -1
index 7d67933e06..3211453743 100644
@@ -6,7 +6,7 @@
 #include "../fetch-negotiator.h"
 #include "../prio-queue.h"
 #include "refs/refs.h"
-#include "../repository.h"
+#include "setup/repository.h"
 #include "odb/tag.h"
 
 /* Remember to update object flag allocation in object.h */
negotiator/skipping.c +1 -1
index 9e685f54a1..eabfac6edd 100644
@@ -7,7 +7,7 @@
 #include "../hex.h"
 #include "../prio-queue.h"
 #include "refs/refs.h"
-#include "../repository.h"
+#include "setup/repository.h"
 #include "odb/tag.h"
 
 /* Remember to update object flag allocation in object.h */
notes-cache.c +1 -1
index 1e734c5c19..3963f3bf08 100644
@@ -5,7 +5,7 @@
 #include "odb/object-file.h"
 #include "odb/odb.h"
 #include "revision/pretty.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/commit.h"
 #include "refs/refs.h"
 #include "strbuf.h"
notes-merge.c +1 -1
index 2bb6ad735e..67e6da2ebd 100644
@@ -10,7 +10,7 @@
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "path.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "diff/diff.h"
 #include "diff/diffcore.h"
 #include "hex.h"
notes-utils.c +2 -2
index 491de7a7ce..62a99fdd4b 100644
@@ -1,9 +1,9 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
-#include "config.h"
+#include "setup/config.h"
 #include "odb/commit.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "refs/refs.h"
 #include "notes-utils.h"
notes.c +2 -2
index 5842226c68..87a1cdf542 100644
@@ -2,8 +2,8 @@
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "notes.h"
 #include "odb/object-file.h"
odb/alloc.c +1 -1
index e0f0146bf8..f261262b6f 100644
@@ -13,7 +13,7 @@
 #include "odb/blob.h"
 #include "odb/tree.h"
 #include "odb/commit.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/tag.h"
 #include "odb/alloc.h"
 
odb/commit.c +4 -4
index 3b490c760c..83c14e7dc4 100644
@@ -4,10 +4,10 @@
 #include "odb/tag.h"
 #include "odb/commit.h"
 #include "pack/commit-graph.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/object-name.h"
 #include "odb/odb.h"
 #include "utf8.h"
@@ -24,10 +24,10 @@
 #include "advice.h"
 #include "refs/refs.h"
 #include "revision/commit-reach.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "revision/shallow.h"
 #include "odb/tree.h"
-#include "hook.h"
+#include "setup/hook.h"
 #include "parse.h"
 #include "odb/object-file.h"
 #include "odb/object-file-convert.h"
odb/fsck.c +3 -3
index e889268b48..ec6c57ef06 100644
@@ -1,11 +1,11 @@
 #include "git-compat-util.h"
 #include "date.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "hex.h"
 #include "odb/odb.h"
 #include "path.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/object.h"
 #include "attr.h"
 #include "odb/blob.h"
@@ -20,7 +20,7 @@
 #include "odb/oidset.h"
 #include "pack/packfile.h"
 #include "submodule-config.h"
-#include "config.h"
+#include "setup/config.h"
 #include "help.h"
 
 static ssize_t max_tree_entry_len = 4096;
odb/hash.h +1 -1
index cf94ad5700..602ca12f28 100644
@@ -269,7 +269,7 @@ enum get_oid_result {
 };
 
 #ifdef USE_THE_REPOSITORY_VARIABLE
-# include "repository.h"
+# include "setup/repository.h"
 # define the_hash_algo the_repository->hash_algo
 #endif
 
odb/loose.c +1 -1
index 58af1f7910..d9866de7c7 100644
@@ -5,7 +5,7 @@
 #include "odb/odb.h"
 #include "odb/source-files.h"
 #include "hex.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "wrapper.h"
 #include "gettext.h"
 #include "odb/loose.h"
odb/match-trees.c +1 -1
index 4062373e11..9672d3d84c 100644
@@ -8,7 +8,7 @@
 #include "odb/tree-walk.h"
 #include "odb/object-file.h"
 #include "odb/odb.h"
-#include "repository.h"
+#include "setup/repository.h"
 
 static int score_missing(unsigned mode)
 {
odb/object-file-convert.c +1 -1
index cad75963f7..b17574202d 100644
@@ -4,7 +4,7 @@
 #include "gettext.h"
 #include "strbuf.h"
 #include "hex.h"
-#include "repository.h"
+#include "setup/repository.h"
 #include "odb/hash.h"
 #include "odb/object.h"
 #include "odb/loose.h"
odb/object-file.c +2 -2
index 847b78e5c7..762fedcc8e 100644
@@ -12,7 +12,7 @@
 #include "git-compat-util.h"
 #include "convert.h"
 #include "index/dir.h"
-#include "environment.h"
+#include "setup/environment.h"
 #include "odb/fsck.h"
 #include "gettext.h"
 #include "hex.h"
@@ -26,7 +26,7 @@
 #include "pack/packfile.h"
 #include "path.h"
 #include "index/read-cache-ll.h"
-#include "setup.h"
+#include "setup/setup.h"
 #include "strvec.h"
 #include "tempfile.h"
 #include "odb/tmp-objdir.h"
odb/object-name.c +5 -5
index 95a63c7f64..af03d8d0e5 100644
@@ -4,8 +4,8 @@
 #include "git-compat-util.h"
 #include "odb/object-name.h"
 #include "advice.h"
-#include "config.h"
-#include "environment.h"
+#include "setup/config.h"
+#include "setup/environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "odb/tag.h"
@@ -19,9 +19,9 @@
 #include "odb/oid-array.h"
 #include "revision/pretty.h"
 #include "index/read-cache-ll.h"
-#include "repo-settings.h"
-#include "repository.h"
-#include "setup.h"
+#include "setup/repo-settings.h"
+#include "setup/repository.h"
+#include "setup/setup.h"
 #include "pack/midx.h"
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

odb/odb.c +3 -3
index 4e408501e8..f326dbb284 100644

Lines of this file are not shown. View the raw message.

odb/replace-object.c +1 -1
index c69c5aa200..a5b33d27a6 100644

Lines of this file are not shown. View the raw message.

odb/replace-object.h +1 -1
index d7139028a3..8473817292 100644

Lines of this file are not shown. View the raw message.

odb/source-files.c +1 -1
index b526e5c219..7b8a21d137 100644

Lines of this file are not shown. View the raw message.

odb/source-inmemory.c +1 -1
index 288b51848e..6c3ada4640 100644

Lines of this file are not shown. View the raw message.

odb/source-loose.c +1 -1
index 2b073d2a22..acf5a15b89 100644

Lines of this file are not shown. View the raw message.

odb/streaming.c +2 -2
index c3a06f5622..dd33584a64 100644

Lines of this file are not shown. View the raw message.

odb/tag.c +2 -2
index 36cb7732a8..7d74850db3 100644

Lines of this file are not shown. View the raw message.

odb/tmp-objdir.c +2 -2
index 21219e8797..281a25bd6a 100644

Lines of this file are not shown. View the raw message.

odb/tree-walk.c +1 -1
index e3e22e1a32..270913835c 100644

Lines of this file are not shown. View the raw message.

odb/tree.c +2 -2
index f1a9779d1a..3bcb9ef191 100644

Lines of this file are not shown. View the raw message.

organize/organize.c +2 -2
index f1f0aec6ea..ef4888aab7 100644

Lines of this file are not shown. View the raw message.

oss-fuzz/fuzz-commit-graph.c +1 -1
index e0ef2ef871..bc14cb4304 100644

Lines of this file are not shown. View the raw message.

oss-fuzz/fuzz-config.c +1 -1
index 94027f5b97..86048ef9d8 100644

Lines of this file are not shown. View the raw message.

pack/bloom.c +2 -2
index 3fdbbf3aba..c36ebbf9c5 100644

Lines of this file are not shown. View the raw message.

pack/commit-graph.c +2 -2
index d5537a9ee8..b060a5a16e 100644

Lines of this file are not shown. View the raw message.

pack/delta-islands.c +1 -1
index 7c48204384..e911354aa1 100644

Lines of this file are not shown. View the raw message.

pack/midx-write.c +1 -1
index 1d5a6525a6..bd4a200b82 100644

Lines of this file are not shown. View the raw message.

pack/midx.c +1 -1
index 76e77d0dd2..e3a67aa45a 100644

Lines of this file are not shown. View the raw message.

pack/pack-bitmap-write.c +2 -2
index 3b7b41c5d7..1863ff2dd5 100644

Lines of this file are not shown. View the raw message.

pack/pack-bitmap.c +2 -2
index 7cd24a37f5..4851c0d074 100644

Lines of this file are not shown. View the raw message.

pack/pack-check.c +2 -2
index e66ef8f1b7..9123d4da21 100644

Lines of this file are not shown. View the raw message.

pack/pack-objects.c +1 -1
index aa1d5bb1c9..b3059f4865 100644

Lines of this file are not shown. View the raw message.

pack/pack-revindex.c +1 -1
index 51cf1f82c6..637802f16b 100644

Lines of this file are not shown. View the raw message.

pack/pack-write.c +2 -2
index 3ced89d932..45066b9657 100644

Lines of this file are not shown. View the raw message.

pack/packfile.c +2 -2
index 77de6bb821..9509d6efcb 100644

Lines of this file are not shown. View the raw message.

pack/packfile.h +1 -1
index 1e6e69fb77..2640288e9b 100644

Lines of this file are not shown. View the raw message.

pack/prune-packed.c +1 -1
index 52473c6bf9..f94fcfebec 100644

Lines of this file are not shown. View the raw message.

pack/pseudo-merge.c +1 -1
index 07c6ebea05..a3a0e5b0e9 100644

Lines of this file are not shown. View the raw message.

pack/reachable.c +1 -1
index 5b8a2a4f79..4c35f26119 100644

Lines of this file are not shown. View the raw message.

pack/repack-cruft.c +1 -1
index 0f49a59ca7..fc05d13955 100644

Lines of this file are not shown. View the raw message.

pack/repack-filtered.c +1 -1
index 2a77018951..a590533bf5 100644

Lines of this file are not shown. View the raw message.

pack/repack-geometry.c +1 -1
index 1ae2e8be9f..0771905997 100644

Lines of this file are not shown. View the raw message.

pack/repack-promisor.c +1 -1
index 628903244c..f1538a5365 100644

Lines of this file are not shown. View the raw message.

pack/repack.c +1 -1
index 52e7779a44..7c115c30fc 100644

Lines of this file are not shown. View the raw message.

pack/server-info.c +1 -1
index dbd86d6fd2..ecaaa25e9d 100644

Lines of this file are not shown. View the raw message.

pager.c +4 -4
index 543ef12936..add45ef679 100644

Lines of this file are not shown. View the raw message.

parse-options-cb.c +2 -2
index 7826b8ad43..ba587028d7 100644

Lines of this file are not shown. View the raw message.

path-walk.c +1 -1
index 00686d3dbf..e99e43f95a 100644

Lines of this file are not shown. View the raw message.

path.c +2 -2
index e4d489e10a..1ae08c384b 100644

Lines of this file are not shown. View the raw message.

path.h +1 -1
index 7e7408dd05..36711c6647 100644

Lines of this file are not shown. View the raw message.

progress.c +1 -1
index 8315bdc3d4..3faea369df 100644

Lines of this file are not shown. View the raw message.

promisor-remote.c +3 -3
index da6b1225dd..80caaeca99 100644

Lines of this file are not shown. View the raw message.

promisor-remote.h +1 -1
index 301f5ac5cb..9adca948f9 100644

Lines of this file are not shown. View the raw message.

prompt.c +2 -2
index d8d74c7e37..36f24790f1 100644

Lines of this file are not shown. View the raw message.

protocol-caps.c +1 -1
index edac5dbd05..ffda7e11dd 100644

Lines of this file are not shown. View the raw message.

protocol.c +2 -2
index a3e26a8dd3..7f19dbc04d 100644

Lines of this file are not shown. View the raw message.

rebase-interactive.c +3 -3
index ee2ef8b535..f328910af4 100644

Lines of this file are not shown. View the raw message.

refs/files-backend.c +5 -5
index e6e07938a3..22aaa69a23 100644

Lines of this file are not shown. View the raw message.

refs/ls-refs.c +3 -3
index 75b9b5e620..03ab2720e9 100644

Lines of this file are not shown. View the raw message.

refs/pack-refs.c +2 -2
index d6c41d64f1..cf586ddf36 100644

Lines of this file are not shown. View the raw message.

refs/packed-backend.c +1 -1
index 97f76c1d76..88fac2f868 100644

Lines of this file are not shown. View the raw message.

refs/ref-cache.c +1 -1
index 3599199b8e..e06d56bce5 100644

Lines of this file are not shown. View the raw message.

refs/ref-filter.c +5 -5
index 32027789a8..9a426b6ce9 100644

Lines of this file are not shown. View the raw message.

refs/reflog-walk.c +1 -1
index 4c321fb3a8..8157b7fb0b 100644

Lines of this file are not shown. View the raw message.

refs/reflog.c +2 -2
index 1050ae6301..cdd8bcf6fd 100644

Lines of this file are not shown. View the raw message.

refs/refs.c +6 -6
index 2bc9c3cecd..2cafa50349 100644

Lines of this file are not shown. View the raw message.

refs/refs.h +2 -2
index 1746d1035c..03d145deb7 100644

Lines of this file are not shown. View the raw message.

refs/reftable-backend.c +5 -5
index 0c02b2d287..932e91fe8a 100644

Lines of this file are not shown. View the raw message.

refs/worktree.c +4 -4
index 0f1fe6a7d2..63a7251c47 100644

Lines of this file are not shown. View the raw message.

remote-curl.c +3 -3
index a6a145c046..d0aa42c974 100644

Lines of this file are not shown. View the raw message.

remote.c +3 -3
index 2b376893b3..ae77c5b1db 100644

Lines of this file are not shown. View the raw message.

replay.c +1 -1
index 6922a1f137..97ef099650 100644

Lines of this file are not shown. View the raw message.

rerere.c +2 -2
index df30ebbe93..bd6e452036 100644

Lines of this file are not shown. View the raw message.

reset.c +1 -1
index 0eddc94d8c..8155336712 100644

Lines of this file are not shown. View the raw message.

reset.h +1 -1
index 52055ad68d..09179ece6d 100644

Lines of this file are not shown. View the raw message.

revision/bisect.c +2 -2
index 7805872c3e..7949d74e14 100644

Lines of this file are not shown. View the raw message.

revision/blame.c +1 -1
index a75bf22193..11e3dd63ff 100644

Lines of this file are not shown. View the raw message.

revision/graph.c +1 -1
index c6f10398a2..9524af5010 100644

Lines of this file are not shown. View the raw message.

revision/line-log.c +2 -2
index 3da7af2340..97fe28d3ef 100644

Lines of this file are not shown. View the raw message.

revision/list-objects-filter-options.c +1 -1
index 6730808896..38604a580c 100644

Lines of this file are not shown. View the raw message.

revision/list-objects.c +1 -1
index fdf98b629f..8544ff2a2a 100644

Lines of this file are not shown. View the raw message.

revision/log-tree.c +3 -3
index e555d07072..679dd21806 100644

Lines of this file are not shown. View the raw message.

revision/pretty.c +2 -2
index cdf63ded49..7925bea766 100644

Lines of this file are not shown. View the raw message.

revision/revision.c +4 -4
index 97c6fa6fef..7470333ae6 100644

Lines of this file are not shown. View the raw message.

revision/revision.h +1 -1
index 9cb9419b22..5a894e27a4 100644

Lines of this file are not shown. View the raw message.

revision/shallow.c +1 -1
index f4ce207278..a6e8a66c14 100644

Lines of this file are not shown. View the raw message.

revision/shallow.h +1 -1
index 0cb1d5ba70..60b283c9d5 100644

Lines of this file are not shown. View the raw message.

run-command.c +2 -2
index 80382354dc..83702c99f1 100644

Lines of this file are not shown. View the raw message.

scalar.c +2 -2
index d1e397ef50..17468d1332 100644

Lines of this file are not shown. View the raw message.

send-pack.c +2 -2
index f59686f971..546835b0aa 100644

Lines of this file are not shown. View the raw message.

sequencer.c +4 -4
index f4a0f77eaf..1dd0c6af95 100644

Lines of this file are not shown. View the raw message.

serve.c +3 -3
index df3086fb3a..4408187c47 100644

Lines of this file are not shown. View the raw message.

setup/alias.c renamed from alias.c +2 -2
similarity index 98%
rename from alias.c
rename to setup/alias.c
index e737c49edd..c6939bd88e 100644

Lines of this file are not shown. View the raw message.

setup/alias.h renamed from alias.h +0 -0
similarity index 100%
rename from alias.h
rename to setup/alias.h
setup/config.c renamed from config.c +4 -4
similarity index 99%
rename from config.c
rename to setup/config.c
index 59c6029654..3f26a8beda 100644

Lines of this file are not shown. View the raw message.

setup/config.h renamed from config.h +1 -1
similarity index 99%
rename from config.h
rename to setup/config.h
index 31fe3e2961..44aba10ce1 100644

Lines of this file are not shown. View the raw message.

setup/environment.c renamed from environment.c +5 -5
similarity index 99%
rename from environment.c
rename to setup/environment.c
index 6066417b62..0b135d4d8d 100644

Lines of this file are not shown. View the raw message.

setup/environment.h renamed from environment.h +1 -1
similarity index 99%
rename from environment.h
rename to setup/environment.h
index e7ec5b0437..ba8004e179 100644

Lines of this file are not shown. View the raw message.

setup/hook.c renamed from hook.c +4 -4
similarity index 99%
rename from hook.c
rename to setup/hook.c
index d10eef4763..e4cfca5fa5 100644

Lines of this file are not shown. View the raw message.

setup/hook.h renamed from hook.h +1 -1
similarity index 99%
rename from hook.h
rename to setup/hook.h
index 27bb1aeb2e..f5ca5364cc 100644

Lines of this file are not shown. View the raw message.

setup/ident.c renamed from ident.c +2 -2
similarity index 99%
rename from ident.c
rename to setup/ident.c
index 0b7aacecd7..27e620fdf4 100644

Lines of this file are not shown. View the raw message.

setup/ident.h renamed from ident.h +0 -0
similarity index 100%
rename from ident.h
rename to setup/ident.h
setup/repo-settings.c renamed from repo-settings.c +4 -4
similarity index 98%
rename from repo-settings.c
rename to setup/repo-settings.c
index f40d1436a9..3c71eb6fc6 100644

Lines of this file are not shown. View the raw message.

setup/repo-settings.h renamed from repo-settings.h +0 -0
similarity index 100%
rename from repo-settings.h
rename to setup/repo-settings.h
setup/repository.c renamed from repository.c +4 -4
similarity index 99%
rename from repository.c
rename to setup/repository.c
index 8771145515..77be866c82 100644

Lines of this file are not shown. View the raw message.

setup/repository.h renamed from repository.h +2 -2
similarity index 99%
rename from repository.h
rename to setup/repository.h
index 3b467a2513..3157f56e9c 100644

Lines of this file are not shown. View the raw message.

setup/setup.c renamed from setup.c +4 -4
similarity index 99%
rename from setup.c
rename to setup/setup.c
index e4e9ca83fe..e71fa7b118 100644

Lines of this file are not shown. View the raw message.

setup/setup.h renamed from setup.h +0 -0
similarity index 100%
rename from setup.h
rename to setup/setup.h
setup/version.c renamed from version.c +1 -1
similarity index 98%
rename from version.c
rename to setup/version.c
index 21ec7c0fbe..c4a55edb5c 100644

Lines of this file are not shown. View the raw message.

setup/version.h renamed from version.h +0 -0
similarity index 100%
rename from version.h
rename to setup/version.h
shell.c +1 -1
index 76333c8068..4e7f8e43c0 100644

Lines of this file are not shown. View the raw message.

sideband.c +1 -1
index 374187402e..b915fdf114 100644

Lines of this file are not shown. View the raw message.

submodule-config.c +3 -3
index c8be0acbb1..334cfb54ee 100644

Lines of this file are not shown. View the raw message.

submodule-config.h +1 -1
index 3f4f0bf454..b1d075a754 100644

Lines of this file are not shown. View the raw message.

submodule.c +4 -4
index e14b53d3c8..16b3ffbcc6 100644

Lines of this file are not shown. View the raw message.

t/helper/test-advise.c +3 -3
index 8f9db2693e..1f4a67bb65 100644

Lines of this file are not shown. View the raw message.

t/helper/test-bitmap.c +1 -1
index 59beba76d2..40bf0c790f 100644

Lines of this file are not shown. View the raw message.

t/helper/test-bloom.c +2 -2
index 5c469af08d..0be36ac656 100644

Lines of this file are not shown. View the raw message.

t/helper/test-cache-tree.c +2 -2
index cf7e7efc5d..bbdedf44dd 100644

Lines of this file are not shown. View the raw message.

t/helper/test-config.c +2 -2
index cfb3f4b111..8d5a7af0b4 100644

Lines of this file are not shown. View the raw message.

t/helper/test-dump-cache-tree.c +2 -2
index 599b316ac1..251aea165d 100644

Lines of this file are not shown. View the raw message.

t/helper/test-dump-fsmonitor.c +2 -2
index 1dbdb28fbf..adcb90bd3a 100644

Lines of this file are not shown. View the raw message.

t/helper/test-dump-split-index.c +2 -2
index 79c8628005..f3013bba91 100644

Lines of this file are not shown. View the raw message.

t/helper/test-dump-untracked-cache.c +2 -2
index c31d01f3b5..8fc213e26a 100644

Lines of this file are not shown. View the raw message.

t/helper/test-find-pack.c +1 -1
index 216e7abb9a..def817ba1b 100644

Lines of this file are not shown. View the raw message.

t/helper/test-fsmonitor-client.c +2 -2
index 845c1db493..35f313e568 100644

Lines of this file are not shown. View the raw message.

t/helper/test-lazy-init-name-hash.c +3 -3
index 6f16fcf7e8..328732f72a 100644

Lines of this file are not shown. View the raw message.

t/helper/test-match-trees.c +2 -2
index b6122af08f..65a56444c8 100644

Lines of this file are not shown. View the raw message.

t/helper/test-pack-deltas.c +1 -1
index a3117ca6fc..f86434bf93 100644

Lines of this file are not shown. View the raw message.

t/helper/test-pack-mtimes.c +1 -1
index 4750a33140..a662bebb10 100644

Lines of this file are not shown. View the raw message.

t/helper/test-partial-clone.c +2 -2
index 76fc0329fc..db27488954 100644

Lines of this file are not shown. View the raw message.

t/helper/test-path-utils.c +2 -2
index fd98a5bfd9..34ccd254e5 100644

Lines of this file are not shown. View the raw message.

t/helper/test-path-walk.c +2 -2
index f689ff3c53..8bf2ec3dc6 100644

Lines of this file are not shown. View the raw message.

t/helper/test-progress.c +1 -1
index 1f75b7bd19..8146c56f08 100644

Lines of this file are not shown. View the raw message.

t/helper/test-reach.c +1 -1
index 7f00cc7d9c..30bde7d2ee 100644

Lines of this file are not shown. View the raw message.

t/helper/test-read-cache.c +4 -4
index dad40b8ad7..ae2e1f19f4 100644

Lines of this file are not shown. View the raw message.

t/helper/test-read-graph.c +2 -2
index c80df07586..76f0833cc0 100644

Lines of this file are not shown. View the raw message.

t/helper/test-read-midx.c +2 -2
index 1e3db8cd81..ce8c10d4f1 100644

Lines of this file are not shown. View the raw message.

t/helper/test-ref-store.c +2 -2
index 582e8b4d97..522520046e 100644

Lines of this file are not shown. View the raw message.

t/helper/test-repository.c +3 -3
index 58f486a471..947aaf6b94 100644

Lines of this file are not shown. View the raw message.

t/helper/test-revision-walking.c +2 -2
index 57e0bcea63..264c96fc59 100644

Lines of this file are not shown. View the raw message.

t/helper/test-scrap-cache-tree.c +2 -2
index 8e40a08436..0989f969da 100644

Lines of this file are not shown. View the raw message.

t/helper/test-serve-v2.c +2 -2
index 27f3ed8947..13452d4eab 100644

Lines of this file are not shown. View the raw message.

t/helper/test-submodule-config.c +3 -3
index 7a756d4f8d..e928d148f6 100644

Lines of this file are not shown. View the raw message.

t/helper/test-submodule-nested-repo-config.c +2 -2
index 7e31d3fe47..a7078a0ef4 100644

Lines of this file are not shown. View the raw message.

t/helper/test-submodule.c +2 -2
index 3c5c4c4a09..7a82e1f0f9 100644

Lines of this file are not shown. View the raw message.

t/helper/test-subprocess.c +1 -1
index a8194d24b3..b2b1d5494e 100644

Lines of this file are not shown. View the raw message.

t/helper/test-synthesize.c +2 -2
index 1997141691..df4a4c972c 100644

Lines of this file are not shown. View the raw message.

t/helper/test-trace2.c +2 -2
index 3b12f4173e..ffd2bd99f1 100644

Lines of this file are not shown. View the raw message.

t/helper/test-userdiff.c +2 -2
index ee829e0868..b01b8d5c84 100644

Lines of this file are not shown. View the raw message.

t/helper/test-write-cache.c +2 -2
index ffe468b445..f5707e6248 100644

Lines of this file are not shown. View the raw message.

t/unit-tests/u-example-decorate.c +1 -1
index 85d0277ee2..dde491a450 100644

Lines of this file are not shown. View the raw message.

t/unit-tests/u-odb-inmemory.c +1 -1
index 4f923f7267..48e048aa14 100644

Lines of this file are not shown. View the raw message.

trace.c +2 -2
index 515b99e7f5..67ac945821 100644

Lines of this file are not shown. View the raw message.

trace2.c +2 -2
index c23c0a227b..a8e23ff96f 100644

Lines of this file are not shown. View the raw message.

trace2/tr2_cfg.c +1 -1
index bbcfeda60a..174252feaa 100644

Lines of this file are not shown. View the raw message.

trace2/tr2_sysenv.c +1 -1
index c63aebbec5..9da3946d5f 100644

Lines of this file are not shown. View the raw message.

trace2/tr2_tgt_event.c +3 -3
index 5a0381791f..fa42082bc6 100644

Lines of this file are not shown. View the raw message.

trace2/tr2_tgt_normal.c +3 -3
index 924736ab36..0fc180b021 100644

Lines of this file are not shown. View the raw message.

trace2/tr2_tgt_perf.c +3 -3
index 4eb9289f95..46e5c3d56c 100644

Lines of this file are not shown. View the raw message.

trailer.c +2 -2
index 7723c5cf52..bf02921cfa 100644

Lines of this file are not shown. View the raw message.

transport-helper.c +2 -2
index 6721209d46..94d3d9ced8 100644

Lines of this file are not shown. View the raw message.

transport.c +3 -3
index 38915e5466..18429b78f5 100644

Lines of this file are not shown. View the raw message.

upload-pack.c +4 -4
index 09a986e486..23c0357496 100644

Lines of this file are not shown. View the raw message.

urlmatch.h +1 -1
index db1a335e72..e3f1ce7477 100644

Lines of this file are not shown. View the raw message.

versioncmp.c +1 -1
index 3a81b17bc1..cdf130cc28 100644

Lines of this file are not shown. View the raw message.

walker.c +1 -1
index 83f980c1f3..079dcd378c 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.54.0

Part of the diff is not shown here. View the raw message.