You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8fe3f03
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: store embd config per-submodule instead of one root file (#59)
Each embedded folder now gets its own `.embd` file holding exactly
one entry, mirroring how beman-submodule stores a .beman_submodule
file inside each submodule. Drops the name-keyed shared Config in
favor of EmbdEntry::load/save, and drops the now-redundant
metadata.folder field since the file's location is the folder.
status/update now take folder paths instead of names; add checks
for an existing folder/.embd instead of a name collision. Embeds
are discovered by walking the tree for .embd files when no folder
args are given.
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ cargo install --path .
29
29
embd add -l <repo link>.git -f <local folder>
30
30
```
31
31
32
-
This will clone the repository to the given folder and create an `embd.toml` file in the `.embd` folder. This file tracks both the pinned remote/commit for each embed and the hashes of the files it manages, and should be commited to VCS. You can also filter the contents of the repository using `-i` and `-e` flags. These use glob filters to include or exclude certain folders or files. For example, to exclude all Markdown and include all text files, you could the following:
32
+
This will clone the repository to the given folder and create a `.embd` file inside it. This file tracks both the pinned remote/commit for the embed and the hashes of the files it manages, and should be commited to VCS. You can also filter the contents of the repository using `-i` and `-e` flags. These use glob filters to include or exclude certain folders or files. For example, to exclude all Markdown and include all text files, you could the following:
@@ -43,7 +43,7 @@ To update all embedded projects, run:
43
43
embd update
44
44
```
45
45
46
-
To update a specific project, use the name of the repo. This corresponds to the key of the projects entry in the `.embd/embd.toml` file:
46
+
To update a specific project, use its folder path:
47
47
48
48
```bash
49
49
embd update infra
@@ -55,7 +55,7 @@ To update a project to a new commit, tag or branch, use the `-r` or `--rev` flag
55
55
embd update infra --rev abcd1234
56
56
```
57
57
58
-
This will update the files on disk and update the commit hash and file manifest tracked for that project in `embd.toml`. Updates can also be forced using `--force` and untracked files can be removed using `--overwrite`. See `embd update -h` for more details.
58
+
This will update the files on disk and update the commit hash and file manifest tracked for that project in its `.embd` file. Updates can also be forced using `--force` and untracked files can be removed using `--overwrite`. See `embd update -h` for more details.
|`add`| Add a new embedded repo to the project. |`folder`: Specify what subdirectory to put embed in. \n `allow-untracked`: Allow untracked files in the embed directory. \n `link`: The link to the project to include \n `rev`: Specify the commit,tag or branch to pull \n `include`: Glob patterns to include \n `exclude`: Glob patterns to exclude |
22
-
|`update`| Update all embeds to match the config file. |`rev`: Specify the commit, tag or branch to advance to \n `force`: Overwrite any local modification \n `overwrite`: Delete all untracked files (requries `force`) \n `quiet`: Print summaries, not each file updates. |
23
-
|`status`| Show the status of all embeds. |`quiet`: Should summaries per embed, not per file. |
|`add`|Add a new embedded repo to the project.|`folder`: Specify what subdirectory to put embed in. \n `allow-untracked`: Allow untracked files in the embed directory. \n `link`: The link to the project to include \n `rev`: Specify the commit,tag or branch to pull \n `include`: Glob patterns to include \n `exclude`: Glob patterns to exclude |
22
+
|`update`| Update all embeds to match their pinned config. |`rev`: Specify the commit, tag or branch to advance to \n `force`: Overwrite any local modification \n `overwrite`: Delete all untracked files (requries `force`) \n `quiet`: Print summaries, not each file updates. |
23
+
|`status`|Show the status of all embeds.|`quiet`: Should summaries per embed, not per file. |
24
24
25
25
### Configuration File
26
26
27
-
`embd` keeps a single consolidated file, `.embd/embd.toml`, describing all the embedded sources. Each entry has a `metadata` table which includes data like the remote repository URL, commit, folder, and include/exclude filters. The config entry also includes a `files` table of sha256 hashes per tracked file. This is used to detect local drift without having to re-pull or clone files from the remote.
27
+
`embd` stores one configuration file per embed, named `.embd`, inside the embedded folder itself. This mirrors how [beman-submodule](https://github.com/bemanproject/beman-submodule) stores a `.beman_submodule` file inside each submodule it manages. There's no project-wide config file; `embd` discovers embeds by walking the project tree for `.embd` files.
28
+
29
+
Each file has a `metadata` table with the remote repository URL, commit, and include/exclude filters, plus a `files` table of sha256 hashes per tracked file, used to detect local drift without re-pulling or cloning files from the remote. The embed's folder isn't stored in the file — it's implied by the file's own location.
0 commit comments