Ignore only root target directory#4099
Merged
bors merged 1 commit intorust-lang:masterfrom May 25, 2017
Merged
Conversation
We used to ignore all target directories, because it was common to have multiple packages with different target directories in a single repository. Now, when workspaces are here, such setups usually have a single target, and we can .gitignore only it. It's useful because sometimes you want to have a module named `target` in Rust. If you use non-workspaced multi-package setup, you can create a .gitignore with `/target/` for each package.
Member
|
@bors: r+ |
Contributor
|
📌 Commit 06267a7 has been approved by |
Contributor
bors
added a commit
that referenced
this pull request
May 25, 2017
Ignore only root target directory r? @alexcrichton
Contributor
|
☀️ Test successful - status-appveyor, status-travis |
weihanglo
added a commit
to weihanglo/cargo
that referenced
this pull request
Feb 11, 2022
Have traced down the issue. It feel like the original intent is to ignore `Cargo.lock` and `target` at project root but not subdirectories. 1. The original implementation did ignore root `/Cargo.lock`. rust-lang#321 2. Someday one wanted to support both gitignore and hgingore's syntax and removed the leading slash. rust-lang#1247 3. Later, one found that we should not ignore `target` other than under root directory and added `/target` back. rust-lang#4099 4. It turns out that the syntax is not compatible between gitignore and hgignore. Therefore, one started to use hgignore special syntax to handle `Cargo.lock`. rust-lang#4342 This commit rollbacks to what original implementation tries to do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @alexcrichton