Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/doc/src/reference/specifying-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@ See [Multiple locations](#multiple-locations) section below for detailed explana
> locations](#multiple-locations) section for a fallback alternative for `git`
> and `path` dependencies.

### Git submodules

When cloning a `git` dependency,
Cargo automatically fetches its submodules recursively
so that all required code is available for the build.

To skip updates for a specific submodule,
Cargo respects the [`submodule.<name>.update`] setting in `.gitmodules`.
Setting it to `none` disables updates for that submodule if it isn't needed for the build.
This is usually set in the repository itself,
so changes require access to the dependency's repo.
Comment on lines +310 to +314
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first paragraph talks in terms of behavior (fetch) while the second paragraph talks in terms of a git submodule specific term (update) that I worry may confuse users.

What do you think of:

Suggested change
To skip updates for a specific submodule,
Cargo respects the [`submodule.<name>.update`] setting in `.gitmodules`.
Setting it to `none` disables updates for that submodule if it isn't needed for the build.
This is usually set in the repository itself,
so changes require access to the dependency's repo.
To skip fetching submodules unrelated to the build, you can set [`submodule.<name>.update = none`] in the dependency repo's `.gitmodules`.
This requires write access to the repo and will disable submodule updates more generally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit more concise and understandable!


[`submodule.<name>.update`]: https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submodulenameupdate

### Accessing private Git repositories

See [Git Authentication](../appendix/git-authentication.md) for help with Git authentication for private repos.
Expand Down
Loading