Skip to content

Exclude non-included dotfiles regardless of the used VCS #16267

@newpavlov

Description

@newpavlov

Currently cargo package follows the following rules:

If include is not specified, then the following files will be excluded:

  • If the package is not in a git repository, all “hidden” files starting with a dot will be skipped.
  • If the package is in a git repository, any files that are ignored by the gitignore rules of the repository and global git configuration will be skipped.

This handling is arguably inconsistent and results in surprising behavior such as inclusion of .github/ folder for one-crate repositories (e.g. see here).

I suggest to remove the git exception and always exclude dotfiles which are not listed in the include field.

Previous IRLO discussion: https://internals.rust-lang.org/t/23700

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-nextArea: may require a breaking change over an editionA-manifestArea: Cargo.toml issuesC-enhancementCategory: enhancementCommand-packageCommand-publishS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions