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

cargo --fix does not recognise there's a VCS on a fossil project #12721

Open
bingen13 opened this issue Sep 21, 2023 · 1 comment
Open

cargo --fix does not recognise there's a VCS on a fossil project #12721

bingen13 opened this issue Sep 21, 2023 · 1 comment
Labels
A-vcs Area: general VCS issues C-bug Category: bug Command-fix S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@bingen13
Copy link

Problem

After running cargo --build, it offered suggestions to fix issues via cargo --fix. However, cargo --fix does not recognise the project is versioned by fossil, although it was created with the appropriate cargo new option.

Steps

  1. Create a project version by fossil: cargo new example --vcs fossil
  2. Run cargo fix on it: cargo fix

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.72.1 (103a7ff2e 2023-08-15)
@bingen13 bingen13 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Sep 21, 2023
@weihanglo
Copy link
Member

There is indeed very limited to VCS support in cargo fix command — only Git and Mecurial are supported at this moment, and only Git got the ability to detect dirty state. The logic was implemented here:

cargo/src/cargo/ops/fix.rs

Lines 150 to 156 in 5bf83d8

if !existing_vcs_repo(config.cwd(), config.cwd()) {
bail!(
"no VCS found for this package and `cargo fix` can potentially \
perform destructive changes; if you'd like to suppress this \
error pass `--allow-no-vcs`"
)
}

I am not quite sure if we want to add the support to cargo fix, although it doesn't seem to have alternative approach.

FWIW, here is a summary of previous discussions about “VCS support”.

@weihanglo weihanglo added A-vcs Area: general VCS issues Command-fix S-needs-team-input Status: Needs input from team on whether/how to proceed. and removed S-triage Status: This issue is waiting on initial triage. labels Sep 21, 2023
@weihanglo weihanglo added S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. and removed S-needs-team-input Status: Needs input from team on whether/how to proceed. labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vcs Area: general VCS issues C-bug Category: bug Command-fix S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

2 participants