Skip to content

fix: compare changelog against working directory instead of HEAD#8

Merged
lukemun merged 3 commits into
mainfrom
fix-changelog-diff-comparison
Aug 17, 2025
Merged

fix: compare changelog against working directory instead of HEAD#8
lukemun merged 3 commits into
mainfrom
fix-changelog-diff-comparison

Conversation

@lukemun
Copy link
Copy Markdown
Owner

@lukemun lukemun commented Aug 17, 2025

The previous comparison logic was flawed because it compared the changelog between origin/main and HEAD (last commit), ignoring uncommitted changes made by the generate-changelog.js script.

This fix:

  • Extracts content from base branch using git show
  • Compares against actual file content in working directory
  • Shows proper diff between base and current state

This ensures PR suggestions are created when changelog is actually modified.

Description

Brief description of the changes in this PR.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Other (please describe):

Testing

  • Added/updated tests for the changes
  • All tests pass locally
  • Tested with a real repository
  • Manual testing completed

Test Details:
Describe how you tested the changes.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Breaking Changes

If this is a breaking change, please describe the impact and migration path for existing users.

Additional Notes

Any additional information that would be helpful for reviewers.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Changelog Ready! Click "Apply suggestion" to append new changes ⬇️

Comment thread CHANGELOG.md Outdated
<!-- CONTEXT_LEDGER_MARKER -->


<!-- AI_APPEND_HERE -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<!-- AI_APPEND_HERE -->
## [1.0.19] - August 2025
Improves changelog comparison logic to ensure more accurate and reliable changelog updates by comparing against the working directory state instead of HEAD.
### Changed
- Updated changelog comparison logic to use working directory instead of HEAD reference
### Technical Details
- Optimized git diff comparison mechanism for more reliable changelog updates

@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Workflow: Production Version - This changelog was generated using lukemun/context-ledger@v1

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Changelog Ready! Click "Apply suggestion" to append new changes ⬇️

Comment thread CHANGELOG.md Outdated
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Workflow: Local Version - This changelog was generated using the PR's local code (./)

The previous comparison logic was flawed because it compared the changelog
between origin/main and HEAD (last commit), ignoring uncommitted changes
made by the generate-changelog.js script.

This fix:
- Extracts content from base branch using git show
- Compares against actual file content in working directory
- Shows proper diff between base and current state

This ensures PR suggestions are created when changelog is actually modified.
@lukemun lukemun force-pushed the fix-changelog-diff-comparison branch from c16eb77 to 7d74130 Compare August 17, 2025 21:37
🤖 Automated by Claude AI
[skip ci]
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Workflow: Production Version - This changelog was generated using lukemun/context-ledger@v1

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🤖 AI Changelog Ready! Click "Apply suggestion" to append new changes ⬇️

Comment thread CHANGELOG.md Outdated
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Workflow: Local Version - This changelog was generated using the PR's local code (./)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@lukemun lukemun merged commit 096d44d into main Aug 17, 2025
5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Workflow: Local Version - This changelog was generated using the PR's local code (./)

@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Workflow: Production Version - This changelog was generated using lukemun/context-ledger@v1

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