auto-changelog icon indicating copy to clipboard operation
auto-changelog copied to clipboard

Commits with description/body content are being left out

Open geebru opened this issue 2 years ago • 4 comments

It is entirely possible I'm missing something obvious in the documentation but I'm facing an issue fairly detrimental to how myself and my team write commits.

A typical commit being added to the changelog via auto-changelog consists of: 🔨 Update functionality for feature

However I noticed when commits were tied to a story ID, or had extra description, they are not included in the automated updates and are left out entirely:

🔨 Update functionality for feature

PID-123

or

🔨 Update functionality for feature

Due to change in requirements, needed
to change how thing is handled

Both of those examples are not included in the changelog created by auto-changelog. They exist in the Git history locally and on the remote, so they do exist, but auto-changelog seems to be skipping over any commit that is not only a subject line.

Am I, like I mentioned, missing or misusing an option or template? Both can be found below: Code screenshot showing the package.json setup of auto-changelog

Code screenshot showing the Handlebars template for the changelog

geebru avatar Mar 24 '22 13:03 geebru

For extra context here is the point where I noticed this occuring:

In GitHub, and locally, this was the history I expected to see (minus release commits of course): image

After running auto-changelog, the changelog created was this: image

The "Add new styles" commit, which has description area content (where I store my story links), is left out of the generated log.

EDIT: Running npx auto-changelog does show the full list of commits (including release and merge commits) so I'm guessing it has to do with my template, but it's mostly a variation of the example template from the docs. I originally assumed maybe commits missing from the message regex were being left out, but that doesn't seem to be true either (as two commits missing have "Add" in them.

geebru avatar Mar 24 '22 13:03 geebru

Merge commits and commits that fix an issue are grouped into separate lists (merges and fixes) which is why they don’t appear in commits.

I guess in your case you need a flag that doesn’t do any clever grouping of commits based on the content, so they all appear in the commits array and can be filtered by your handlebars template.

cookpete avatar Jul 08 '22 08:07 cookpete

@geebru Hi, have you figured out the issue "commits with description/body content are being left out "? I experience the same issue. The command I use: auto-changelog --output CHANGELOG.md --commit-limit false --template keepachangelog --ignore-commit-pattern '.*\[skip ci\].*'

For the commit, I expect to have both commit title and body message, like

Author: Jiyang Ye <[email protected]>
Date:   Sat Dec 9 14:02:40 2023 +0100

    This commit has both title and message
    
    Dummy message. xxxx

The result I got missed the body message,

Commits
This commit has both title and message b0bedf8

yejiyang avatar Dec 09 '23 13:12 yejiyang

Any chance we could have an option to include the commit body in the changelog? I use it to describe breaking changes and how users can migrate. Would be useful to have in the changelog

alber70g avatar Feb 20 '24 11:02 alber70g