1
» cargo publish
    Updating crates.io index
warning: manifest has no license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
error: 1 files in the working directory contain changes that were not yet committed into git:

rusttermpose.sublime-workspace

Committing this file or to deleting it every time I push changes would both be terrible options. It is listed in ./.gitignore, but cargo seems not to care. I'm fairly sure cargo is supposed to care, and historically, has, but this would be a strange bug, so I thought I should ask if I'm missing something before reporting.

The project is in a subdirectory (/rust/) inside of a larger git repo.

/rust/.gitignore, and /.gitignore say

/rust/rusttermpose.sublime-workspace
rusttermpose.sublime-workspace
/rusttermpose.sublime-workspace
*.sublime-workspace

rusttermpose.sublime-workspace is not among git's tracked files

» git ls-files
Cargo.toml
README.md
examples/simple.rs
longterm.term
rusttermpose.sublime-project
sexp tests.sexp
shortterm.term
shortwood.sexp
src/lib.rs
src/parsers/mod.rs
src/parsers/termpose_parser.rs
src/parsers/woodslist_parser.rs
src/wooder.rs
tests.term
wood_derive/Cargo.toml
wood_derive/src/lib.rs
mako
  • 1,201
  • 14
  • 30

2 Answers2

1

If I understood your question correct, you can mention it as:

# Workspace files
*.sublime-workspace

It will ignore all the files with .sublime-workspace extension.

You can also do:

/rusttermpose.sublime-workspace

But not:

./rusttermpose.sublime-workspace

i.e. do it relative to your root.

You can also do (to ignore files in sub directories):

**/*.sublime-workspace

or (including the current directory)

**.sublime-workspace

If you are unsure of the exact directory structure.

R4444
  • 2,016
  • 2
  • 19
  • 30
  • The project now contains two gitignores, one at root, and the other in the rust crate directory, each containing ` /rust/rusttermpose.sublime-workspace rusttermpose.sublime-workspace /rusttermpose.sublime-workspace *.sublime-workspace ` It hasn't helped. – mako May 08 '19 at 05:53
  • If you have multiple gitignores then managing them become a headache. Please refer to this question - https://stackoverflow.com/questions/3305869/are-multiple-gitignores-frowned-on so you have to provide the paths with respect to the current directory in which your gitignore is. – R4444 May 08 '19 at 05:59
  • @mako I edited my answer. Hope this will work for you. – R4444 May 08 '19 at 06:14
1

Yep, it's a bug. Been there since /10/18

It only afflicts crates in subdirectories of the git project.

https://github.com/rust-lang/cargo/issues/6188

mako
  • 1,201
  • 14
  • 30