default .gitignore from cargo new
should explicitly exclude vendor/
#15352
Labels
A-vcs
Area: general VCS issues
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-init
Command-new
Command-vendor
S-triage
Status: This issue is waiting on initial triage.
Problem
cargo vendor
creates a bunch of files with paths from other people's crates. people sometimes write poorly specified .gitignore files that are too broad and don't anchor specific directories; this is silly but people do silly things, see for example rust-lang/rust#138978. in this casegit add vendor/
doesn't do what they expect, some of the paths are ignored.Proposed Solution
add
!/vendor
to the default gitignore.Notes
i took a look at the code for this. currently the logic lives here:
cargo/src/cargo/ops/cargo_new.rs
Lines 747 to 750 in 6344cad
it's not as simple as adding another
.push
line, because Fossil requires these to be configured in a separateignore-glob
file and Mercurial doesn't support this kind of thing at all. Not sure if this has interactions with pijul.the current design makes it hard to handle two different files for include and exclude, so that would need to be refactored somehow.
The text was updated successfully, but these errors were encountered: