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

Print a clear warning when including untracked files in package #1597

Closed
bluss opened this issue May 9, 2015 · 4 comments
Closed

Print a clear warning when including untracked files in package #1597

bluss opened this issue May 9, 2015 · 4 comments

Comments

@bluss
Copy link
Member

bluss commented May 9, 2015

Print a clear warning when including untracked files in package.

Admonition the user to track or ignore these files in git.

See issue #1584.

Cargo should help the author for two reasons:

  • If the file is untracked, it might be lost and an important part of a working package is lost
  • It might alert the author to junk. It happens easily, perf.data, files you saved to test, logs

If it's about empty directories, tell the crate author to use the standard workaround (.gitignore inside to make it non-empty).

@bluss
Copy link
Member Author

bluss commented Aug 3, 2015

Some food for thought, I downloaded all packages from crates.io, and I'm grepping for junk and filing bugs. Mostly the bugs will help everyone because we don't have to download things like 10 MB of perf.data files or a random 10 MB mp4 file that a developer had lying around, or some extra 160 MB database directory they had..

issues:

Edit: Everyone responded. Well done team!

@codyps
Copy link
Contributor

codyps commented Oct 19, 2015

This came up on IRC #rust recently.

I'd prefer:

  • exclude untracked files by default
  • require special additions to Cargo.toml for the special cases that need to ship non-tracked files

Because:

  • by the time we get warnings, we're moments away from uploading anyhow
  • including untracked files is probably not widely used

@rillian
Copy link
Contributor

rillian commented Oct 19, 2015

See also #2063. I'd prefer cargo not package anything not explicitly traceable from the crate sources and Cargo.toml, but limiting it to VCS-tracked files would definitely help.

@bluss
Copy link
Member Author

bluss commented Nov 8, 2015

Issue rust-bakery/nom/issues/117 is another “victim”

bors added a commit that referenced this issue Jun 11, 2016
Prevent packaging a crate if any files are dirty

This commit alters Cargo's behavior to prevent publishing a crate by default if
any files in that crate are determined to be dirty, that is either modified or
not part of the working tree.

This can prevent common mistakes like many listed in #2063 and enables features like #841.

Closes #1597
Closes #2063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants