git-chglog / git-chglog

CHANGELOG generator implemented in Go (Golang).
https://godoc.org/github.com/git-chglog/git-chglog
MIT License
2.7k stars 234 forks source link

Get only one changelog entry per feature branch #98

Open stefanello57 opened 3 years ago

stefanello57 commented 3 years ago

After merging a feature branch I get a changelog entry for each commit prefixed with "feat:". What I would like to accomplish is to get just one changelog entry that describes the feature that was merged.

What's the best way to accomplish this?

clok commented 3 years ago

Can you provide

  1. An example of the output you are seeing?
  2. A small sample of the git log output?
  3. The .git-chglog/config.yml you are using?

It sounds like a headerPattern mapping issue in your config. With those we should be able to help out.

clok commented 3 years ago

Another thing to consider is is you are using a "Merge Commit" or a "Squash and Merge".

With a "Merge Commit", you will see an entry in git log for every commit that was in the branch that was just merged.

With a "Squash and Merge" the commits within a branch are squashed to a single commit and then merged.

It sounds like what you want is accomplished via a "Squash and Merge" process. That is the practice that I have used on many projects and it has helped keep the log clean and informative. Also, the commits that are squashed are logged within the commit message, so the info is not lost.