Skip to content

--version output omits commit SHA and build metadata #1550

Description

@Widthdom

Summary

--version prints cdidx v1.21.0 only. Dev builds from main are indistinguishable from the tagged release in the output. Bug reports become ambiguous: "I'm on v1.21.0" could mean the tagged release or any number of in-progress builds at HEAD.

Evidence

  • src/CodeIndex/Cli/ConsoleUi.cs:305-322LoadVersion reads version.json only.
  • version.json{"version": "1.21.0"}, no commit SHA / build date.

Impact

  • Bug triage is harder than necessary.
  • Hard to verify in the field whether a fix landed or whether the user is running stale binary.

Proposed direction

  • At build time, embed BuildMetadata (commit SHA, build date, dirty/clean tag) — git rev-parse --short HEAD and git diff-index --quiet HEAD for dirty detection.
  • Display in --version: cdidx v1.21.0 (commit abc1234, built 2026-05-12, clean).
  • Provide --version --json for machine consumption.

Repro env

  • Branch: main @ 2ee912d (release v1.21.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions