Skip to content

Commit 23a6d6d

Browse files
aclark4lifeCopilot
andcommitted
Document flat layout mode in overview and repo-management docs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5d65610 commit 23a6d6d

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

docs/features/repo-management.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,49 @@ Because ``mongo-python-driver`` ends up physically inside each group directory
248248
(e.g. ``pymongo/mongo-python-driver``), ``dbx install -g pymongo`` and
249249
``dbx test mongo-python-driver`` all work without any extra flags.
250250

251+
Flat Layout
252+
~~~~~~~~~~~
253+
254+
By default dbx uses a two-level directory layout (``base_dir/<group>/<repo>``).
255+
Setting ``flat = true`` collapses this so all repositories live directly under
256+
``base_dir``:
257+
258+
.. code-block:: toml
259+
260+
[repo]
261+
base_dir = "~/Developer/mongodb"
262+
flat = true
263+
264+
[repo.groups.pymongo]
265+
repos = [
266+
"git@github.com:mongodb/mongo-python-driver.git",
267+
"git@github.com:mongodb/specifications.git",
268+
]
269+
270+
[repo.groups.django]
271+
repos = [
272+
"git@github.com:mongodb-labs/django-mongodb-backend.git",
273+
]
274+
275+
Resulting layout:
276+
277+
.. code-block:: text
278+
279+
~/Developer/mongodb/
280+
├── mongo-python-driver/
281+
├── specifications/
282+
└── django-mongodb-backend/
283+
284+
In flat mode:
285+
286+
- Group membership is resolved from the config rather than directory structure.
287+
- ``dbx list`` shows a tree grouped by config group (same visual style as
288+
grouped mode).
289+
- ``dbx clone -g pymongo`` clones directly into ``base_dir`` instead of
290+
``base_dir/pymongo/``.
291+
- A single shared ``.venv`` is used across all groups.
292+
- All other commands (``-g``, install, test, etc.) continue to work normally.
293+
251294
**Configuration:**
252295

253296
Repository groups are defined in ``~/.config/dbx-python-cli/config.toml``. The default base directory for cloning is ``~/Developer/dbx-repos``, which can be customized.

docs/introduction/overview.rst

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,46 @@ Typical directory structure after setup:
173173
│ └── another_project/
174174
├── pymongo/ # Group directory
175175
│ ├── .venv/ # Group-level virtual environment
176-
│ ├── mongo-python-driver/ # Cloned from global group
176+
│ ├── mongo-python-driver/ # Repository
177177
│ ├── specifications/ # Repository
178178
│ └── drivers-evergreen-tools/ # Repository
179179
└── langchain/ # Another group
180180
├── .venv/ # Separate venv for this group
181-
├── mongo-python-driver/ # Cloned from global group
182-
└── langchain-mongodb/ # Repository
181+
└── langchain-mongodb/ # Repository
182+
183+
Flat Layout
184+
~~~~~~~~~~~
185+
186+
Setting ``flat = true`` in ``[repo]`` switches to a flat layout where all repositories
187+
live directly under ``base_dir`` instead of in per-group subdirectories:
188+
189+
.. code-block:: toml
190+
191+
[repo]
192+
base_dir = "~/Developer/mongodb"
193+
flat = true
194+
195+
[repo.groups.pymongo]
196+
repos = [
197+
"git@github.com:mongodb/mongo-python-driver.git",
198+
]
199+
200+
[repo.groups.django]
201+
repos = [
202+
"git@github.com:mongodb-labs/django-mongodb-backend.git",
203+
]
204+
205+
.. code-block:: text
206+
207+
~/Developer/mongodb/ # base_dir (also group root)
208+
├── .venv/ # Shared venv across all groups
209+
├── mongo-python-driver/ # pymongo group repo
210+
└── django-mongodb-backend/ # django group repo
211+
212+
In flat mode ``dbx list`` still shows repos grouped by their config group in a
213+
tree view, and all group-aware commands (``-g``, install, test) continue to work
214+
normally — group membership is resolved from the config rather than the directory
215+
structure.
183216

184217
Design Philosophy
185218
-----------------

0 commit comments

Comments
 (0)