crate-ci / cargo-release

Cargo subcommand `release`: everything about releasing a rust crate.
Apache License 2.0
1.35k stars 113 forks source link

Error detecting clean working directory #195

Closed dbcfd closed 2 years ago

dbcfd commented 4 years ago
$ HEAD_OUTPUT=$(git diff HEAD --exit-code --name-only)
$ echo Head Output=$HEAD_OUTPUT
Head Output=
$ LS_OUTPUT=$(git ls-files --exclude-standard --others)
$ echo LS Output=$LS_OUTPUT
LS Output=
$ RUST_LOG=trace cargo release --no-confirm --no-dev-version --tag-name "{{crate_name}}-{{prev_version}}" -vv patch
[2019-12-18T18:51:27Z WARN ] Uncommitted changes detected, please commit before release.

Git status also indicates a clean working directory. Not sure what it is error'ing on.

dbcfd commented 4 years ago

This was actually due to the CI environment and a hidden directory, having files on git ls-files. Not sure how to marry this up with the git status output.

dbcfd commented 4 years ago

Even with these files in .gitignore, they still show up as uncomitted.

epage commented 4 years ago

Here are the checks that we perform https://github.com/sunng87/cargo-release/blob/master/src/git.rs#L10

dbcfd commented 4 years ago

Yeah, I've been trying to figure out how resolve the output from those commands with what the environment has. The path it tells me is causing what is dirty (I forked and added debugging) doesn't seem to exist, so something is possibly going on with the command and the filesystem interaction.

dbcfd commented 4 years ago

Downgrading to 0.12.4 fixes the issue. Going to do a PR to make dirty via untracked optional.

epage commented 4 years ago

Here is publishes logic https://github.com/rust-lang/cargo/blob/d8106473c16cad67574ac334759bc10a70b572d9/src/cargo/ops/cargo_package.rs#L228

TotalKrill commented 3 years ago

I ran into this issue today as well it seems

TotalKrill commented 3 years ago

Downgrading did not work for me, so is probably another issue

epage commented 3 years ago

We're adding logging so we can at least tell what is causing cargo-release to think things are dirty

epage commented 2 years ago

Are you using submodules? That seems to be the cause in #416

edeustace commented 1 year ago

Seeing this on AWS Codebuild running windows using a codestar connection. The list contains all files in the repo with status WT_DELETED.

edeustace commented 1 year ago

I suspect this is related to: git config --global core.autocrlf false