Skip to content

feat!: merge usage into summarizeGitDiff, peel tags in merge-base, boolean --merge-base flag - #73

Merged
mcarvin8 merged 3 commits into
mainfrom
feat/merge-usage-and-merge-base-flag
Aug 16, 2026
Merged

feat!: merge usage into summarizeGitDiff, peel tags in merge-base, boolean --merge-base flag#73
mcarvin8 merged 3 commits into
mainfrom
feat/merge-usage-and-merge-base-flag

Conversation

@mcarvin8

Copy link
Copy Markdown
Owner

Summary

  • summarizeGitDiff now always returns { summary, usage }; summarizeGitDiffWithUsage is removed — one function instead of two with near-identical bodies.
  • getMergeBase peels annotated tags before calling tsgit's mergeBase primitive. revParse on a tag returns the tag object's own oid, not the commit it targets, and mergeBase doesn't peel — so --merge-base against a tag ref used to falsely report no common ancestor on a perfectly valid input (same class of bug flagged in tsgit's own --from-merge-base PR).
  • --from-merge-base <ref> is replaced by --merge-base / -b: <from>/--from is now always required, and --merge-base resolves it as merge-base(to, from) instead of using it directly.

Breaking changes

  • summarizeGitDiffWithUsage removed. summarizeGitDiff's return type changes from string to { summary, usage }.
  • fromMergeBase option / --from-merge-base flag removed. Use from + mergeBase: true (CLI: <from> + --merge-base/-b).

Test plan

  • npx tsc --noEmit
  • npx vitest run (326 tests passing, incl. new annotated-tag merge-base regression test and updated CLI/lib specs)
  • npm run build (via pre-push hook)

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

mcarvin8 and others added 3 commits August 16, 2026 16:25
…olean --merge-base flag

- summarizeGitDiff now always returns { summary, usage }; summarizeGitDiffWithUsage is removed.
- getMergeBase peels annotated tags (revParse returns the tag object oid, not
  the commit; tsgit's mergeBase primitive doesn't peel) so --merge-base against
  a tag no longer falsely reports no common ancestor.
- --from-merge-base <ref> is replaced by --merge-base/-b: <from>/--from is now
  always required, and --merge-base resolves it as merge-base(to, from).

BREAKING CHANGE: summarizeGitDiffWithUsage is removed; summarizeGitDiff's
return type changes from string to { summary, usage }. --from-merge-base is
removed in favor of --from/<from> plus --merge-base/-b (mergeBase option
replaces fromMergeBase).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Restores 100% coverage on gitDiffOps.ts after the annotated-tag peeling
change — the throw path was never exercised by a real test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mcarvin8
mcarvin8 merged commit 26ba851 into main Aug 16, 2026
6 checks passed
@mcarvin8
mcarvin8 deleted the feat/merge-usage-and-merge-base-flag branch August 16, 2026 20:34
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.

1 participant