Skip to content

[vcs] cargo new --vcs fossil changes global settings for fossil-scm. #9449

@yasuoohno

Description

@yasuoohno

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

  1. clear global setings `fossil unset ignore-glob --global & fossil unset clean-glob --global
  2. create new cargo package with cargo new project_name --vcs fossil
  3. 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.

  1. create .fossil-settings/ignore-glob and .fossil-settings/clean-glob files.
  2. (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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions