Skip to content

Conversation

@iwanders
Copy link
Contributor

Connections
Originally proposed and discussed in #8795 (comment) with @ErichDonGubler and @inner-daemons , where the consensus was that this change would warrant its own PR.

Description
Commit message:

With the trailing slash it will not ignore 'target' if it is a symlink. By removing that symlinked 'target' directories are correctly ignored. The slash at the start ensures that it will not ignore directories called 'target' that may be created in the future that aren't at the root of the repository.

This change aligns with the default .gitignore from cargo init. Originally discussed in #8795 (comment)

I confirmed that using /target is still the default ignore in today's master branch for Cargo.

Testing
Prior to touching the .gitignore, the target symlink at the root of my repository was marked as dirty, after this commit it is properly ignored and no longer marked as dirty and available for staging.

Squash or Rebase?
Single commit, so shouldn't matter.

Checklist

  • Run cargo fmt.
  • Run taplo format. -> Don't have this installed, shouldn't matter.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown -> NA
  • Run cargo xtask test to run tests. -> Don't have this installed, shouldn't matter.
  • If this contains user-facing changes, add a CHANGELOG.md entry. -> No user facing changes.

With the trailing slash it will not ignore 'target' if it is a symlink. By
removing that symlinked 'target' directories are correctly ignored.
The slash at the start ensures that it will not ignore directories called
'target' that may be created in the future that aren't at the root of the
repository.

This change aligns with the default .gitignore from `cargo init`. Originally
discussed in gfx-rs#8795 (comment)
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting!

@cwfitzgerald cwfitzgerald merged commit aba9161 into gfx-rs:trunk Dec 30, 2025
47 checks passed
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.

2 participants