-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Problem
cargo new --vcs fossil
changes global ignore-glob/clean-glob settings for fossil-scm instead of repository local settings.
It will also affect other fossil-scm working copies.
Steps
- clear global setings `fossil unset ignore-glob --global & fossil unset clean-glob --global
- create new cargo package with
cargo new project_name --vcs fossil
- global settings has been changed.
Possible Solution(s)
https://github.com/rust-lang/cargo/blob/master/src/cargo/util/vcs.rs#L99-L111
It seems that cargo executes fossil settings
on the current working directory for cargo.
If it has to change the local settings of the repository, we need to do it in the project working directory.
just like this?
ProcessBuilder::new("fossil")
.cwd(&path)
.arg("settings")
.arg("ignore-glob")
.arg("target")
.exec()?;
ProcessBuilder::new("fossil")
.cwd(&path)
.arg("settings")
.arg("clean-glob")
.arg("target")
.exec()?;
But it is unversioned settings.
I think it would be better using versioned setting files in the project working directory.
- create
.fossil-settings/ignore-glob
and.fossil-settings/clean-glob
files. - (optional) add configuration files to the repository.
fossil add .fossil-settings/ignore-glob .fossil-settings/clean-glob
Notes
Output of cargo version
:
cargo 1.51.0 (43b129a 2021-03-16)
output of rustup show
:
Default host: x86_64-pc-windows-msvc
stable-x86_64-pc-windows-msvc (default)
rustc 1.51.0 (2fd73fabe 2021-03-23)
Output of fossil version
:
This is fossil version 2.15.1 [2f901f98b3] 2021-04-08 01:05:44 UTC