Skip to content

Git config doesn't get properly applied #187

@mu88

Description

@mu88

Problem description

Running dotnet tool run versionize fails when extending Git config via includeIf in env vars.

Steps to reproduce

  1. Configure the env var GIT_CONFIG_COUNT=1
  2. Configure the env var GIT_CONFIG_KEY=include.path
  3. Configure the env var GIT_CONFIG_VALUE=D:\work\GitHub\dotfiles\.gitconfig
  4. Create the Git config file D:\work\GitHub\dotfiles\.gitconfig with the following content:
[includeIf "gitdir:**/GitHub/"]
    path = .gitconfig-github
  1. Create the Git config file D:\work\GitHub\dotfiles\.gitconfig-github with the following content:
[user]
    name = bla
    email = [email protected]
  1. Create/clone a Git repository into D:\work\GitHub\myRepo
  2. Inside the cloned repo, run git config user.email and/or git config user.name and make sure that Git properly returns the configured value(s).
  3. Make a change to the repository so that Versionize needs to create a new release.
  4. Run dotnet tool run versionize

Expected Behavior

Versionize properly creates a release commit.

Actual Behavior

Warning: Git configuration is missing. Please configure git before running versionize:
git config --global user.name "John Doe"
$ git config --global user.email [email protected]
NativeCommandExitException: Program "dotnet.exe" ended with non-zero exit code: 1.

Workaround

Explicitly set the Git username and email address (although not necessary from Git perspective, only to make Versionize happy), i.e. duplicate the Git config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions