Problem
The current documentation for the exclude and include fields explains that gitignore rules are applied when include is not specified, but does not explicitly state that gitignore rules are not applied when include is specified.
This leads to surprising behavior: a pattern like LICENSE in package.include will match files such as .venv/some-package/LICENSE, even if .venv/ is gitignored, causing cargo publish to fail unless --allow-dirty is passed.
context: #16872
Proposed Solution
Add a note to the exclude and include fields documentation clarifying that:
- When
include is specified, gitignore rules are not applied
- Files in gitignored directories may still be matched unexpectedly
- The
! prefix can be used to explicitly exclude such paths
Notes
No response
Problem
The current documentation for the
excludeandincludefields explains that gitignore rules are applied whenincludeis not specified, but does not explicitly state that gitignore rules are not applied whenincludeis specified.This leads to surprising behavior: a pattern like
LICENSEinpackage.includewill match files such as .venv/some-package/LICENSE, even if .venv/ is gitignored, causingcargo publishto fail unless--allow-dirtyis passed.context: #16872
Proposed Solution
Add a note to the exclude and include fields documentation clarifying that:
includeis specified, gitignore rules are not applied!prefix can be used to explicitly exclude such pathsNotes
No response