Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore only root target directory #4099

Merged
merged 1 commit into from
May 25, 2017
Merged

Conversation

matklad
Copy link
Member

@matklad matklad commented May 25, 2017

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.
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented May 25, 2017

📌 Commit 06267a7 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented May 25, 2017

⌛ Testing commit 06267a7 with merge b96038c...

bors added a commit that referenced this pull request May 25, 2017
@bors
Copy link
Contributor

bors commented May 25, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing b96038c to master...

@bors bors merged commit 06267a7 into rust-lang:master May 25, 2017
@matklad matklad deleted the ignore-root-target branch March 17, 2018 08:39
@ehuss ehuss added this to the 1.19.0 milestone Feb 6, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants