Keep a Changelog
keepachangelog.com
keepachangelog.com
* you'll never forget to add something to changelog
* you get links to PRs in your changelog
* it's much faster to make edits to PR messages compared to editing files
* outside contributors get familiarized with the practice much faster (imagine getting new contributors to update changelogs)
We recently adopted this practice at Pyroscope and it's been working out pretty well for us [2], I can certainly recommend it.
[0] - https://github.com/apps/semantic-pull-requests
[1] - https://github.com/conventional-changelog/conventional-chang...
[2] - https://github.com/pyroscope-io/pyroscope/blob/main/CHANGELO...
In general, as a developer-consumer of them, I have found automatically-generated-from-commits changelogs to be not so useful, but I don't know if I've experienced any using the conventions you are recommending (which I dont' understand!).
In the small projects I write, I include links to the PR in the manually created CHANGELOG (the delta of which is part of the PR) simply by making the PR, then making another commit/ammend in the PR to add it's own url to the CHANGELOG. These are some extra steps, it's true.
It forces you to think a moment for a good PR title, but it is an small price to pay when it gives you a 0 extra work changelog that is good enough for semi-internal use.
git --no-pager log | grep 'CHANGELOG: '
https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Gi...> Ugh. One of my pet peeves is the generation of release notes from commit messages. Commit messages and PR descriptions have a different audience (i.e. contributors) from release notes (i.e. users).
> For example, take a look at ESLint's autogenerated changelog [1]:
67c0074 Update: Suggest missing rule in flat config (fixes #14027) (#15074) (Nicholas C. Zakas)
cf34e5c Update: space-before-blocks ignore after switch colons (fixes #15082) (#15093) (Milos Djermanovic)
c9efb5f Fix: preserve formatting when rules are removed from disable directives (#15081) (Milos Djermanovic)
14a4739 Update: no-new-func rule catching eval case of MemberExpression (#14860) (Mojtaba Samimi)
7f2346b Docs: Update release blog post template (#15094) (Nicholas C. Zakas)
fabdf8a Chore: Remove target.all from Makefile.js (#15088) (Hirotaka Tagawa / wafuwafu13)
e3cd141 Sponsors: Sync README with website (ESLint Jenkins)
05d7140 Chore: document target global in Makefile.js (#15084) (Hirotaka Tagawa / wafuwafu13)
0a1a850 Update: include ruleId in error logs (fixes #15037) (#15053) (Ari Perkkiö)
47be800 Chore: test Property > .key with { a = 1 } pattern (fixes #14799) (#15072) (Milos Djermanovic)
a744dfa Docs: Update CLA info (#15058) (Brian Warner)
9fb0f70 Chore: fix bug report template (#15061) (Milos Djermanovic)
f87e199 Chore: Cleanup issue templates (#15039) (Nicholas C. Zakas)
> I'm reading release notes to get a feel for how the new release might impact me. This takes so much time to scan, because there's so much useless cruft (to me, as a user) I have to ignore.> What's worked very well for me is to simply have an "I updated the changelog, if applicable" entry in my PR template checklist. Then when I cut a new release, I simply add the release date above the release notes currently listed under "Unreleased", and they'll list all relevant changes, reviewed during the pull request to verify that it is relevant to users.
> [1] https://github.com/eslint/eslint/blob/master/CHANGELOG.md
But it is a _way_ better starting point to write a changelog that 'usual' commit messages or PR descriptions.
I use custom scheme tho, using Gitlab issue title and issue labels. I find this more meaningful since one issue can contain multiple PRs and I still want single changelog line.
We do this and it works great, but I've still found value in summarizing things in a digest (ie changelog or release notes, depending on the context)
What is the size of the resulting commit (in terms of average modified files, lines of code) ?
> What is the size of the resulting commit (in terms of average modified files, lines of code) ?
Lately I'm starting to advocate squashing PR branches even if they have only a single commit. The real benefit here is that Github puts the PR URL into the squashed commit message. It automates the "context links" regardless of whether a PR branch ends up being 1 commit or 50
Also, everything you describe can be achieved with a merge commit. As a side effect, when you look at the history, you may be annoyed with small commits that may not interest you. But Git can help by displaying only merge commit (with --first-parent option).
True that you can achieve it in a merge commit. And I think Github includes the PR URL in a merge commit as well iirc. I suppose my main argument is really just that the always-rebase strategy that was trendy for awhile has some downsides over squash/merge commit /shrug
> The real benefit here is that Github puts the PR URL into the squashed commit message.
While not in the commit message, github will show you the PR a commit is part of in it's commit view regardless, also for every commit in a PR whether it's one commit or 50. Which I do find invaluable for tracing the documentation of a change, agreed! Not everyone knows about this feature (I don't think it's been there forever) in github UI.
Eg notice the `#279` included in this github commit UI display (the PR was, I'm pretty sure, not "squashed").
https://github.com/traject/traject/commit/10339e774e92e57f44...
We use release-please to automatically generate WIP "release PRs" so we can see the exact changelog (for a candidate release) drafted as merges come in.
I also recognize that for full-speed delivery, they are suboptimal in that they sit directly on the critical path. After reviewing the code of the PR, there is now an extra context switch to also review the title/semantics.
So the complexity of turning a list of PRs into a changelog does not disapper, it gets hidden within each individual PR.
Keep a Changelog - https://news.ycombinator.com/item?id=22295555 - Feb 2020 (1 comment)
Keep a Changelog - https://news.ycombinator.com/item?id=17631326 - July 2018 (71 comments)
Keep a Changelog - https://news.ycombinator.com/item?id=12370119 - Aug 2016 (45 comments)
Keep a Changelog - https://news.ycombinator.com/item?id=9054627 - Feb 2015 (43 comments)
I got used to the second file, after using CocoaPods. I don't really use CocoaPods anymore, but they would render the CHANGELOG.md file in a separate tab, which was nice. I don't think anyone else does that.
I think a hand-written changelog is better than a semantically-generated one, because it connects the developers' mindset to the consumer (usually, another developer). It says "These are the aspects of this release that I think are important."
A semantically-written changelog doesn't actually need to be kept. It can be auto-generated on demand. As long as the developer keeps good commit notes, with things like issue numbers, then this could be useful.
https://github.com/bmlt-enabled/bmlt-root-server/blob/master...
It was in the README for most of that time. It has just been broken out into a separate file, by the new team.
I’d rather fix that. I’ve been following the suggestion from this website in the past. It is a nice take but tedious and boring.
Better have commit messages. For example: https://www.conventionalcommits.org
Using commit logs as part of a changelog, or as the starting point for additions... sure.
Even as a dev, I usually don't care about your PRs. I'm pretty sure there will never be a 1:1 PR/feature history. Keeping the commit history in the repository clean must be useful for the developer (for example, to possibly revert atomically a change), not for the end user.
Do you find more informative the Linus changelog between kernel releases listing a stack of PRs, or the nicer summary provided by kernelnewbies (and others) showing the prominent new features so you can drill down later?
Git has very nice release notes. The language used in the release notes is completely different from commit history.
It's a very nice gesture to write good release notes.
It doesn't take long to do, and I find it beneficial for PRs that include notable changes that should get into the release notes also include a new line in there. It doesn't need to be perfect (surely it will change before being finalized), but it serves as a landmark for the final edit.
I find a changelog is a great place to provide a high level summary of changes and a good opportunity to highlight backwards-incompatible changes or API changes users should be aware of. If your commit messages are of the form "Fix #123" (without the issue title), it's also a good place to summarize #123 so your users don't have to cross-check everything with GitHub.
I'd love to see a commit log that was consumer-friendly. But, as long as devs are writing messages within the constraints of other tools, I don't see it happening. Conventional commits is an interesting idea, but for those keeping messages to 72 characters, it eats up a fair bit of the message. Also, a lot of it ends up being noise that you wouldn't want in a user-facing changelog (e.g., "test:" and "refactor:").
Typically, when projects are non-trivial in size, providing a changelog summarizing the important changes is useful.
But I guess real engineers get it right the first time /s
For those saying “just use commit history”, I once had to sift through 200 commits because the library author was too lazy to separate the breaking changes from the patches. It’s horrible for users of your library, a changelog doesn’t have to replicate your commit log but it should at the least be the “highlights” or need-to-know version of it.
Exactly... I think it's a good idea to "roll up" the impact of the changes so that users and external developers can easily understand what was changed without getting too "in the weeds"- raw commit messages are generally the opposite of that.
> GitHub have developed a feature to generate release notes
The annoying part here is that if you are using a branch-based CI auto-deployment (without an "Approve" step) then you have to push the branch before writing the release notes. Anyway I just do `git cherry -v release` or so from `main` (for instance) and paste the results into the Release Notes at the bottom and put my summaries at the top. The benefit of just pasting the results is that Github will detect the commit IDs and link to them automatically. It makes for a pretty good experience where you can sum it up and have the full commit messages for those interested.
We wrote Chronicle to do that automation for us: https://github.com/anchore/chronicle .
The nice thing about this... since you typically curate issues during the development process anyway, if you're doing that right then you get a nice looking changlog for free! We use this approach with our core tools, Syft and Grype (some changlog examples: https://github.com/anchore/syft/releases/tag/v0.31.0 and https://github.com/anchore/grype/releases/tag/v0.26.1 ).
Always happy to hear new feature ideas and possible customizations for Chronicle (put in an issue and let's chat )!
[0] https://manpages.debian.org/testing/dpkg-dev/deb-changelog.5...
I disagree. ISO 8601 is great for machine readable dates. For human readable dates I prefer to spell the month out.
17 July 2017 is more readable than 2020-07-17. Yes it is in English but if your audience is in English and the rest of your content is in English then it’s fine.
For a changelog in text format I think it is safe to assume the reader will understand yyyy-mm-dd, and it is safer than dd/mm/yyyy or mm/dd/yyyy due to the lack of ambiguity. Also if they don't understand they'll know and hopefully learn the standard, where with other numeric formats they could blindly assume they have understood.
> 17 July 2017 is more readable than 2020-07-17
I don't agree there, but that could be what I'm used to. The textual month at least removes the ambiguity so is significantly preferable to the same order in a numeric-only form.
> Yes it is in English but if your audience is in English…
But if a chunk of your audience is American? IIRC they generally verbalise dates in mdy order which is why they ended up using that order in numeric forms, so they may find it as jarring, or more so, as ymd. Not that I alter my spelling for American comfort, but as clarity-to-the-audience is the arguement here…
If course if the text you are working on is mainly for your benefit, forget everyone else and do what works best for your style/comprehension/preference.
YYYY-MM-DD is completely unambiguous.
I would like to encourage developers to maintain changelog for their projects, but to host the changelogs outside of the project's Git repository. Maybe put it on the "Wiki" or "Releases" pages on GitHub.
When the changelog is an actual file in the Git repository, it becomes another source for merge and rebase conflicts.
Changelogs with reference to the actual source changes are support natively by git. They're called commits.
Git history is also not ideal for giving to users since the history is primarily intended for developers. If you actually want to use git history for this, I actually think non-squash merges are better since you can have the merge commit be very high level and use the other commits for technical details and incremental changes. However, even if you do regular merges, you absolutely still need to keep your history clean via rebasing before sending out a PR.
Another tip for keeping your PRs clean without confusing people is to create a separate branch while working on feedback from the PR so you can still manipulate the history as needed while backing up your code to the remote server.
Commit logs are for all changes, regardless of size or context. Whereas changelogs are for consumer-facing changes.
Anything new here?