Skip to content

Fix inconsistent CLI output format for GitCommitDate #1246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 10, 2025
Merged

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 10, 2025

The CLI output format for GitCommitDate was inconsistent between different output methods, making it difficult to parse dates reliably in scripts and automation.

Problem:

  • nbgv get-version -v GitCommitDate outputs locale-specific format: 08/10/2025 19:10:07 +00:00
  • nbgv get-version -f json outputs ISO 8601 format: "GitCommitDate": "2025-08-10T19:10:07+00:00"

This inconsistency made it challenging to write portable automation scripts that needed to parse commit dates, as the format would vary depending on the system locale and output method used.

Solution:
Modified the individual variable output logic in Program.cs to format DateTimeOffset properties using the ISO 8601 standard ("o" format specifier) to match the JSON output behavior. This ensures all CLI output methods use a consistent, machine-readable date format.

After the fix:

  • nbgv get-version -v GitCommitDate: 2025-08-10T19:10:07.0000000+00:00 (ISO 8601)
  • nbgv get-version -f json: "GitCommitDate": "2025-08-10T19:10:07+00:00" (ISO 8601)

The change also applies to GitCommitAuthorDate and any other DateTimeOffset properties, while maintaining full compatibility with all other property types.

Fixes #485.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED (dns block)
  • dotnetbuilds.azureedge.net
    • Triggering command: curl --retry 20 --retry-delay 2 --connect-timeout 15 -sSL -f --create-dirs REDACTED (dns block)
    • Triggering command: curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Inconsistent CLI output format for GitCommitDate Fix inconsistent CLI output format for GitCommitDate Aug 10, 2025
@Copilot Copilot AI requested a review from AArnott August 10, 2025 19:28
Copilot finished work on behalf of AArnott August 10, 2025 19:28
@AArnott AArnott marked this pull request as ready for review August 10, 2025 19:36
@AArnott AArnott enabled auto-merge (squash) August 10, 2025 19:36
@AArnott AArnott added this to the v3.8 milestone Aug 10, 2025
@AArnott AArnott merged commit f3a939a into main Aug 10, 2025
12 checks passed
@AArnott AArnott deleted the copilot/fix-485 branch August 10, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent CLI output format for GitCommitDate
2 participants