4

cargo-new should not add ignore rule on Cargo.lock inside subdirs by weihanglo ·...

 2 years ago
source link: https://github.com/rust-lang/cargo/pull/10379
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

weihanglo commented 15 days ago

edited

What does this PR try to resolve?

Fixes #10370

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.
    #321
  2. Someday one wanted to support both gitignore and hgingore's syntax
    and removed the leading slash.
    #1247
  3. Later, one found that we should not ignore target other than
    under root directory and added /target back.
    #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.
    #4342

This commit rollbacks to what original implementation tries to do.

How should we test and review this PR?

I've manual tested git/hg/fossil and all ignore rules work as expected.
I feel like adding tests on hg/fossil/pijul is not worthy since our CI
does not have tools to run those tests. But maybe I am wrong.

For your convenience, here is ignore rule syntax for each VCS


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK