GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

Format no format

Open 9swampy opened this issue 6 months ago • 9 comments

Fix legacy .NET composite format syntax

Description

Fixes legacy .NET format syntax {CommitsSinceVersionSource:0000;;''} that was outputting literal text instead of formatted values.

  • Added LegacyCompositeFormatter for semicolon-separated format sections
  • Updated ValueFormatter and RegexPatterns to support semicolons
  • Maintains compatibility with existing ?? syntax

Before: 6.13.54-gv6-CommitsSinceVersionSource-0000----- After: 6.13.54-gv60002

Related Issue

Fixes #4654

Motivation and Context

Legacy .NET semicolon format syntax stopped working, breaking existing GitVersion configurations.

How Has This Been Tested?

Added comprehensive test suites:

  • BackwardCompatibilityTests.cs - 8 tests covering legacy format scenarios
  • Issue4654Tests.cs - 4 tests for the specific issue

All 12 new tests pass. No regression in existing tests.

Screenshots (if appropriate):

N/A

Checklist:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.
  • [x] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.

9swampy avatar Aug 13 '25 23:08 9swampy

@phatcher #4654

9swampy avatar Aug 13 '25 23:08 9swampy

Apologies. Two passes is already more time than I had. The first pass was comfortable, the second's expanded in to assumptions that likely warrant a review & retrospect on regression pack coverage? Rollback & regroup the wise call?

9swampy avatar Aug 14 '25 03:08 9swampy

@9swampy You mention "modern ?? fallback syntax" - what do you mean by that, AFAIK ?? is just the null coalescing operation and nothing to do with string formatting?

phatcher avatar Sep 17 '25 10:09 phatcher

Honestly I'm embarrassed I've not got back to fixing this. It's been maniac at my day job and I've maxed the AI tooling out repeatedly so haven't had capacity to revisit.

The reason to call that out now is to answer the question; don't get hung up on the modern quip. AIism.

I will get a poke at the fix as soon as I can.

9swampy avatar Sep 17 '25 13:09 9swampy

@9swampy No worries - reason I was asking was to see if I could do the same idea of suppressing the commit number when it's zero via a different syntax

phatcher avatar Sep 18 '25 11:09 phatcher

@9swampy any updates on this one?

arturcic avatar Oct 25 '25 14:10 arturcic

Sorry, not yet. I will.

9swampy avatar Nov 01 '25 13:11 9swampy