Skip to content

[ISSUE]: /diag is ignored if not last argument #4763

@davidjenni

Description

@davidjenni

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.5.0

Operating system

N/A

What are you seeing?

order of the /diag switch matters:

  • it is only respected if it is last argument in cmd line
  • insult to injury: the directly following argument is silently swallowed

Observation was motivated by the discussion in #4539; but different from that issue's observation that it is a regression since 6.3.0, this /diag "swallowing" has been around for 6.x and 5.x versions (and likely longer?).

This bug is also the deeper cause of #4395

What is expected?

Order of /diag within command line arguments should not matter and a legal argument following /diag should not be swallowed

Steps to Reproduce

But right now, only 1) works as expected:

  1. dotnet gitversion -l console -diag -> works: emits diag info, followed by JSON version info
  2. dotnet gitversion -diag -l console -> no diag info to console; only JSON version info in stdout
  3. dotnet gitversion -diag -l logfile.log -> log file is not created, so no diag info; but JSON version info in stdout

RepositoryFixture Test

see also separate commit with added tests in my soon to be published PR

Output log or link to your CI build (if appropriate).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions