feat!: merge usage into summarizeGitDiff, peel tags in merge-base, boolean --merge-base flag - #73
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
summarizeGitDiffnow always returns{ summary, usage };summarizeGitDiffWithUsageis removed — one function instead of two with near-identical bodies.getMergeBasepeels annotated tags before calling tsgit'smergeBaseprimitive.revParseon a tag returns the tag object's own oid, not the commit it targets, andmergeBasedoesn't peel — so--merge-baseagainst 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-basePR).--from-merge-base <ref>is replaced by--merge-base/-b:<from>/--fromis now always required, and--merge-baseresolves it asmerge-base(to, from)instead of using it directly.Breaking changes
summarizeGitDiffWithUsageremoved.summarizeGitDiff's return type changes fromstringto{ summary, usage }.fromMergeBaseoption /--from-merge-baseflag removed. Usefrom+mergeBase: true(CLI:<from>+--merge-base/-b).Test plan
npx tsc --noEmitnpx 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