Editable Vendors
Most vendored source should be treated as read-only reference material. When you know the project needs to modify the vendor, use a different workflow on purpose.
Recommendation
Section titled “Recommendation”Use a fork-backed submodule for durable vendor modifications.
ingraft add your-org/effect --strategy submodule --ref vendor-patchesThis keeps the parent repository small while making the vendor changes real git commits in a repository that can be pushed, reviewed, rebased, and opened as an upstream pull request. The parent project records the submodule pointer; the fork records the patch history.
Why Not Subtree First?
Section titled “Why Not Subtree First?”subtree is still the best default for read-only source because every checkout
gets files immediately and agents do not need to initialize nested repositories.
It is less clean when the vendor itself is under active development:
- vendor patches are mixed into the host repository history
- upstreaming requires
git subtree splitor manual patch extraction - update conflicts happen in the parent repository
- ownership is less obvious during review
Use subtree for editable code only when the patch is intentionally private to
the host project and you want every clone to include the patched files without a
submodule init step.
Workflow
Section titled “Workflow”- Fork the upstream repository.
- Create a long-lived branch in the fork, for example
vendor-patches. - Add the fork as a submodule with
--strategy submodule --ref vendor-patches. - Make vendor changes inside
vendor/<name>/. - Commit and push those changes inside the submodule.
- From the parent repository, commit the updated submodule pointer.
- Open an upstream pull request from the fork when the patch should be shared.
cd vendor/effectgit switch -c fix-runtime-edge-case# edit vendor filesgit add .git commit -m "fix runtime edge case"git push origin fix-runtime-edge-case
cd ../..git add vendor/effectgit commit -m "vendor: point effect at fork patch"If the patch becomes unnecessary after an upstream release, update the vendored target back to the upstream repository or a release tag.
Strategy Guide
Section titled “Strategy Guide”| Need | Strategy |
|---|---|
| Read-only source for agents and LSPs | subtree |
| Large read-only source that should not enter parent history | submodule |
| Durable vendor patches, forks, or upstream PRs | fork-backed submodule |
| Local experiment that should not be committed | clone-ignore |
Colocated jj workspace | clone-ignore |
clone-ignore is useful for debugging and local exploration, but it is not a
team-visible patch workflow. If a change matters, move it to a fork-backed
submodule or commit it intentionally through subtree.
Agent Instructions
Section titled “Agent Instructions”When using editable vendors, update agent docs with the ownership rule:
- read-only vendors: inspect and learn from source, do not modify
- editable fork submodules: changes are allowed, but commits belong inside the submodule first
- clone-ignore vendors: local scratch only, do not rely on changes for CI or review
This prevents coding agents from accidentally editing reference-only source while still giving them a clear path for deliberate vendor patches.