]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #6521 - starsheriff:feature/6377-duplicates-in-ignore-files, r=dwijnand
authorbors <bors@rust-lang.org>
Sun, 6 Jan 2019 09:21:57 +0000 (09:21 +0000)
committerbors <bors@rust-lang.org>
Sun, 6 Jan 2019 09:21:57 +0000 (09:21 +0000)
avoid duplicates in ignore files

Hi,
here is my first PR for cargo. It's my take on #6377 with some minor refactoring included, mainly to avoid keeping the two different types of ignore file entries (gitignore and hg) in sync.) Basically, the contents of a ignore file are now read if the file exists and filtered out. To filter out I would propose to just comment the entries that cargo would add out, in that way it is nice to see which duplicates were found and more important _what cargo usually adds_. In that way, a user can modify his ignore file and be sure that he can keep everything that cargo would add.

A new ignore file will look like this:
```
/target
**/*.rs.bk
Cargo.lock",
```

An existing ignore file will be modified like this:
```
/target
/some/other/path

#Added by cargo
#
#already existing elements are commented out

#/target
**/*.rs.bk
Cargo.lock
```

Fixes #6377


Trivial merge