Skip to content

feat(changelog): expose commit parents #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

unleashed
Copy link
Owner

Description

Expose commit parent(s) digests to the changelog process. This has an application
for projects that want to generate changelogs based on merge commits only, but it
is likely useful in more contexts, for example listing commits that belong to the same
PR under its own section.

Checklist

  • Add test cases to all the changes you introduce
  • Run poetry all locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

The changelog generation code exposes the parents field with a list of parent
digests in git commits.

Steps to Test This Pull Request

You can create a changelog template iterating the parents field of changes and
for merge commits you should have at least 2 parents.

Additional context

Useful in the git workflow I'm currently working on, where merge commits cannot
be told apart by the changelog generation machinery and I need to distinguish them
as they are the only ones that can be taken into account without rewriting the project's
git history due to using varied standards throughout its life.

@unleashed unleashed force-pushed the feature/changelog/expose-commit-parents branch 4 times, most recently from c8d47cc to b8d8ab7 Compare March 21, 2025 23:32
COMMIT_DATA in test_changelog.py had to be type annotated to avoid an
issue with mypy linting when creating a GitCommit where the tool would
expect the wrong type for the arguments.
@unleashed unleashed force-pushed the feature/changelog/expose-commit-parents branch from b8d8ab7 to ca410a4 Compare April 9, 2025 09:21
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