Skip to content

cargo_new: drop the trailing slash for target exclusion in Git #4944

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 16, 2018

Conversation

mathstuf
Copy link
Contributor

When target is a symlink (e.g., to keep build outputs on a separate
partition), Git will not match the /target/ ignore to the symlink
since it is not a directory. Drop the trailing slash to support ignoring
target as a symlink.

When `target` is a symlink (e.g., to keep build outputs on a separate
partition), Git will not match the `/target/` ignore to the symlink
since it is not a directory. Drop the trailing slash to support ignoring
`target` as a symlink.
@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 16, 2018

📌 Commit f4e0eef has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jan 16, 2018

⌛ Testing commit f4e0eef with merge c5e21db...

bors added a commit that referenced this pull request Jan 16, 2018
cargo_new: drop the trailing slash for target exclusion in Git

When `target` is a symlink (e.g., to keep build outputs on a separate
partition), Git will not match the `/target/` ignore to the symlink
since it is not a directory. Drop the trailing slash to support ignoring
`target` as a symlink.
@bors
Copy link
Contributor

bors commented Jan 16, 2018

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

@bors bors merged commit f4e0eef into rust-lang:master Jan 16, 2018
@mathstuf mathstuf deleted the better-gitignore-template branch January 17, 2018 13:58
mathstuf added a commit to mathstuf/github-gitignore that referenced this pull request Jun 13, 2019
mathstuf added a commit to mathstuf/rust that referenced this pull request Mar 25, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 25, 2020
…r=Mark-Simulacrum

gitignore: allow target to be a symlink

Following rust-lang/cargo#4944.
mathstuf added a commit to mathstuf/github-gitignore that referenced this pull request Sep 28, 2020
mathstuf added a commit to mathstuf/github-gitignore that referenced this pull request Sep 28, 2020
near-bulldozer bot pushed a commit to near/nearcore that referenced this pull request Jan 28, 2022
Allows the `target` build directory to be ignored when symlinked from another partition. With the `target/` spec, git doesn't ignore symlinks because it expects a directory, of which a symlink is not.

Prior Art: rust-lang/cargo#4944

As seen in;

- https://github.com/rust-lang/rust/blob/6abb6385b2cb7249f67b9b3ce7522527767dd907/.gitignore#L47
- https://github.com/rust-lang/cargo/blob/1c034752de0df744fcd7788fcbca158830b8bf85/.gitignore#L1
@ehuss ehuss added this to the 1.25.0 milestone Feb 6, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants