Skip to content
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

Append release notes to changelog instead of overwrite #858

Open
Rebekah-Chuang opened this issue Mar 13, 2024 · 3 comments
Open

Append release notes to changelog instead of overwrite #858

Rebekah-Chuang opened this issue Mar 13, 2024 · 3 comments
Labels
confirmed Prevent from becoming stale feature A new feature or a feature request

Comments

@Rebekah-Chuang
Copy link

Hello!

I'm wondering if there's a way to simply append the latest release notes to the changelog instead of overwriting the entire changelog. I'm asking because, at the beginning of the project, I didn't follow the correct commit message format, resulting in most of them being unrecognized. My solution was to manually update the changelog for those incorrect commit messages. I thought it would update the changelog based on the previous version, but it instead overwrites the entire changelog, causing the unknown section to reappear. If this is not currently possible, I believe it could be a beneficial feature, as it would make the changelog neater (I've noticed that the changelog for this repo also includes an unknown section in earlier versions).

Thank you in advance!

@codejedi365
Copy link
Contributor

@Rebekah-Chuang, unfortunately there is not a current method for only prepending the latest release information. I do believe there was a previous ticket that mentioned this but it seems nothing specifically came of it. I agree it would be a useful feature to provide methods of adoption of this project to an existing project.

@Rebekah-Chuang
Copy link
Author

Hi @codejedi365, sorry for the late response, thank you so much for replying, I think the ticket you mentioned was #722. Hope to see this feature in the future!

@codejedi365
Copy link
Contributor

codejedi365 commented Mar 23, 2024

@Rebekah-Chuang, given the complexities discussed in #722, I'm not sure if or when this feature would actually be solved, but there may be an alternative.

You could use the changelog template directory to write a custom template which does not loop through all of the versions as the provided default does. Jinja2 also provides the ability to import other files and macros. Potentially, you could correct your changelog for the previous versions and store that as a file such as 3.x_CHANGELOG.md. Then in your custom changelog template abort the loop when the version matches 3.x and just import the other file and append it. Unfortunately, Jinja does not support "break" so you likely will need to write a macro to filter out all versions below your threshold (ex. 4.x). This is a bit exploratory as I have not done this myself but thinking about it now I believe it accomplishes what you need.

@codejedi365 codejedi365 added this to the Better Changelogs milestone Apr 12, 2024
@codejedi365 codejedi365 added the confirmed Prevent from becoming stale label May 6, 2024
@codejedi365 codejedi365 added feature A new feature or a feature request and removed question labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Prevent from becoming stale feature A new feature or a feature request
Projects
None yet
Development

No branches or pull requests

2 participants