Skip to content

feat: add configurable file and Git version sources - #182

Merged
justinmchase merged 8 commits into
mainfrom
codex/source-git-file-181
Oct 28, 2026
Merged

justinmchase merged 8 commits into
mainfrom
codex/source-git-file-181

Conversation

@justinmchase

Copy link
Copy Markdown
Collaborator

Summary

  • Add optional top-level source: file | git configuration. File remains the default; a missing VERSION is initialized from reachable local tags or 0.1.0.
  • In Git mode, derive the current version from local tags, remove VERSION, make inc report the same proposal as git-latest, and let set apply post hooks without creating a file or tag.
  • Add the specs marker, version source specification, eight traced requirements, and Deno tests. Grant the standard test task the permissions those tests need.

Validation

  • deno task test (56 Deno tests plus Node, Helm, Maven, and .NET scenarios)
  • deno fmt --check .agents AGENTS.md deno.json src README.md
  • deno lint
  • deno check main.ts

Closes #181

Resolve versions from local Git tags or VERSION, with source-specific increment and set behavior. Add specs, requirements, and regression coverage for issue #181.
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation labels Oct 28, 2026
Keep Git tags as the version source while applying proposed versions to configured hook targets. Update the spec and exercise all increment variants.
Comment thread src/util/version.ts Resolved
Comment thread src/util/version.ts Resolved
Comment thread src/util/version.ts Resolved
Comment thread src/util/version.ts Resolved
Comment thread src/util/version.ts Resolved
justinmchase and others added 2 commits October 27, 2026 22:00
getVersionFromGitTags had grown an unreachable-remote-tag map, a
compare-based "highest version wins" reduction for same-commit tags, and a
separate ls-remote-and-precision-fetch pass just to avoid pulling in
unrelated tags. Replace it with: check local tags first (zero network
calls in the common case), and only when shallow with tags on the remote,
deepen the commit history incrementally with a tree/blob filter until a
reachable tag turns up. No comparison between same-commit tags, no
reachability bookkeeping against ls-remote output.

This changes two observable behaviors, now reflected in the spec and
requirements: when multiple version tags name the same commit, one is
used arbitrarily instead of picking the highest; and deepening may also
pull in unrelated tag refs (never their tree/blob contents) instead of
fetching only the one resolved tag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same-commit comparison is a narrow, well-defined case (at most a handful
of tags), unlike comparing across different commits while walking
history for the nearest reachable tag, which stays a plain first-match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@justinmchase
justinmchase merged commit aadf6c7 into main Oct 28, 2026
6 checks passed
@justinmchase
justinmchase deleted the codex/source-git-file-181 branch October 28, 2026 18:20
@justinmchase justinmchase added enhancement New feature or request feature labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add source: git | file to the config

1 participant