Skip to content

GetEffectiveGitSetting treats non 0 results as failures #11145

@vbjay

Description

@vbjay

Environment

  • Git Extensions 33.33.33
  • Build 79a312b
  • Git 2.41.0.windows.1
  • Microsoft Windows NT 10.0.22621.0
  • .NET 6.0.21
  • DPI 96dpi (no scaling)
  • Portable: False
  • Microsoft.WindowsDesktop.App Versions
    Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Issue description

As seen in https://git-scm.com/docs/git-config#_description it is not an error to get an exit code of non 0. Right now we get an exception because of the changes to GetOutput and treating all non 0 exit codes as exceptions instead of handing the result.

This command will fail with non-zero status upon error. Some exit codes are:

The section or key is invalid (ret=1),

no section or name was provided (ret=2),

the config file is invalid (ret=3),

the config file cannot be written (ret=4),

you try to unset an option which does not exist (ret=5),

you try to unset/set an option for which multiple lines match (ret=5), or

you try to use an invalid regexp (ret=6).

Not understanding exit codes as non errors is a failure on executable handling. Found during gpg work on a clean machine ant it looking for gpg.Program and commit.gpgSign and such. Which when not set, exit code is 1. Which tells you that value is not set.

Steps to reproduce

Change the name and email fetching in formCommit to get usser.Value

Did this work in previous version of GitExtensions?

Maybe before the changes @mstv and @gerhardol did with changing the way executable output is handled with GetOutput from the executable.

Diagnostics

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions