Skip to content

fixes validation issue where it was honly comparing base to itself, n…#8

Merged
funkyshu merged 2 commits into
mainfrom
fix_validate
Jun 19, 2026
Merged

fixes validation issue where it was honly comparing base to itself, n…#8
funkyshu merged 2 commits into
mainfrom
fix_validate

Conversation

@funkyshu

Copy link
Copy Markdown
Member

…ot the staged changes

@c2fo-cibot c2fo-cibot Bot added the size/L Denotes a PR that changes 100-499 lines label Jun 19, 2026
@funkyshu funkyshu requested a review from Copilot June 19, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes releasegen validate --require-changelog-entry so it correctly detects local pre-commit changes (where HEAD hasn’t advanced yet) and compares changelog content against what will actually be committed (the git index), rather than relying on the working tree / HEAD tree alone.

Changes:

  • Extend VCS diffing to include worktree status in ChangedFiles, enabling pre-commit scenarios where changes are staged but not committed.
  • Add FileAtIndex and update validation to compare [Unreleased] against the staged (index) version of the changelog.
  • Add/extend tests covering staged-but-uncommitted changes and staged-vs-unstaged changelog behavior; document the behavior in the project changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/vcs/git.go Adds worktree-aware changed-file detection and introduces FileAtIndex for reading staged content.
internal/vcs/git_test.go Adds coverage for pre-commit changed-file detection and FileAtIndex behavior across staged/unstaged/untracked cases.
cmd/releasegen/validate.go Switches changelog comparison to staged/index content to match what the next commit will contain.
cmd/releasegen/validate_test.go Adds regression tests for pre-commit detection and for rejecting unstaged changelog edits.
CHANGELOG.md Documents the validation behavior changes (worktree-inclusive diffs and index-based changelog comparison).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/vcs/git.go
Comment thread internal/vcs/git.go
Comment thread cmd/releasegen/validate_test.go
@funkyshu funkyshu merged commit 6e63cb1 into main Jun 19, 2026
7 checks passed
@funkyshu funkyshu deleted the fix_validate branch June 19, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants