Skip to content

Improve diff stats to compare against default branch and handle squash merges #67

Merged
amandal0903 merged 3 commits intomainfrom
update-diff-algo
Apr 5, 2026
Merged

Improve diff stats to compare against default branch and handle squash merges #67
amandal0903 merged 3 commits intomainfrom
update-diff-algo

Conversation

@amandal0903
Copy link
Copy Markdown
Collaborator

Summary

  • Rework getDiffStats to compare worktree changes against origin/ instead of
    using merge-base, so squash-merged branches correctly show empty stats
  • Use a scoped two-dot diff (only files touched by the branch) to avoid counting unrelated
    changes main picked up after merge
  • Fall back to local working-tree changes (staged + unstaged + untracked) when there are no
    commits ahead of the base
  • Extract parseNumstat helper and add unit tests (298 lines)

Avijit Mandal added 3 commits April 5, 2026 19:44
…h merges

Rework getDiffStats to diff against origin/<default-branch> instead of
using merge-base from the worktree branch. Uses a scoped two-dot diff
so squash-merged branches correctly show empty stats. Falls back to
local working-tree changes when there are no commits ahead. Extracts
parseNumstat helper with unit tests.
@amandal0903 amandal0903 merged commit e37201d into main Apr 5, 2026
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