Keep a Changelog
keepachangelog.com
keepachangelog.com
For an actual log of individual changes, that's what "git log" is for; any project that pre-dates git should "git mv ChangeLog ChangeLog.pre-git". And if your "git log" output isn't highly readable, write better commit messages and group changes into more logical commits; once you stop breaking "git rebase -i", that gets a lot easier.
Some of this advice potentially makes sense, but for a NEWS file, not a changelog. A NEWS file has one top-level heading per release, containing the release notes for that release, summarizing the key user-visible changes. However, that file should not attempt to track every change, should not contain times or dates, and should get grouped in logical chunks rather than chronological order.
And while it can potentially make sense to update that file as part of the commit introducing a new user-visible change, that also reintroduces the same conflict and collaboration issues as a changelog, so personally I only update NEWS files right before a release. I run a script that generates a properly formatted NEWS entry based on the version and git commit messages (turning each one into a markdown bullet-list entry with indentation), then edit the result to add headings, group entries under those headings, and delete any non-user-visible changes that don't merit a release note.
Something like: security issues, breaking changes, major features, major bugfixes, minor features, minor bugfixes.
But regarding git conflicts, I've set up dpkg-mergechangelogs as a global merge driver and it works decently well for cherry-picking things within Debian packages represented as git repos. In ~/.gitconfig:
[core]
attributesfile = ~/.gitattributes
[merge "dpkg-mergechangelogs"]
name = debian/changelog merge driver
driver = dpkg-mergechangelogs -m %O %A %B %A
and in .gitattributes: debian/changelog merge=dpkg-mergechangelogs
So the author of this spec could write a similar command and advocate for similar configuration. (The bottom of the dpkg-mergechangelogs manpage mentions this, but doesn't mention how to make it global for all repositories.)Then as part of the release process, somebody (usually me) uses `git log --grep` to find all the commit messages that developers thought to be change log relevant and writes a document that can be consumed by end users (including screenshots of the features etc).
This way end-users can still be informed about changes (most don't care, some notice and complain even when one pixel has moved to a different spot), but we never have issues with merges or rebases (at least not related to change log maintenance :p)
Also, in my opinion, keeping a change log for developers is completely unnecessary these days with git and other tools to provide very quick and easy access to the revision history.
But for end-users it still makes sense, though it of course has to be on a higher level than individual commits.
Every file in every commit should be meaningful for the given commit. These are obviously usually source files or even documentation of the current behavior of the software. The problem with CHANGELOG and NEWS files that they are not meaningful to every single commit only for commits that are tagged as releases.
I don't know what would be a good practice to manage change logs in a repo. I'm sure that it shouldn't be in a project's git repo though. Maybe having a separate git repo for managing releases would help, like have your original project as a submodule and keep release specific files in this separate repo. Obviously it looks more complicated but it's better than managing merge conflicts between CHANGELOG files when there is no meaning of the CHANGELOG for the merge commit anyway.
Sumup:
> At GitLab we solved the above problem by adding a 100 lines with just a hyphen placeholder at the top of the changelog. People can insert their entry at a random location in the changelog. There is still a chance of conflict when two merge requests change the same line but it is greatly reduced. It looks a bit strange to have these empty lines on top so we added a comment to explain their purpose..
It's actually pretty simple - you keep CHANGELOG updates to their own commit, and just aggressively rebase into that commit as you prepare the release. The release owner is the only person who works on the CHANGELOG. We do that at Snowplow and it works really well. Here is the WIP commit for the CHANGELOG for the next Snowplow release: https://github.com/snowplow/snowplow/commit/a862b1e4ab935184...
When we finish a release, the CHANGELOG becomes the GitHub release notes: https://github.com/snowplow/snowplow/releases/tag/r60-bee-hu...
We are approaching 1 issue : 1 commit : 1 CHANGELOG entry but it's not always possible, and a huge number of open source software users are not technical enough to parse a git log anyway.
lastTag = `git describe --abbrev=0 --tags`
git log --oneline --no-merges #{lastTag}..HEAD | cut -c 9- | sort
Then you just need to edit that list down to the relevant details.
This was part of a release script which also added things like increasing the version number, generating md5 hashes for the binaries, date etc.If you have something like a changelog, it's important to keep the audience in mind. In this case the audience was mainly the internal test department and marketing. Testers also had access to the bug tracker of course and only used the changelog to get an overview. Marketing and support used the changelog as the basis for their communication with customers.
> Is there a standard change log format?
> Sadly, no. But I want to change that.
There is a standard change log format: https://www.gnu.org/prep/standards/html_node/Style-of-Change...
Most GNU tools (and many others) use this format.
The Debian changelog format which most people have seen is based on that format, and is compatible with it.
> What’s the point of a change log?
> To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
Oooh, they mean a NEWS file. Standardized like so: https://www.gnu.org/prep/standards/html_node/NEWS-File.html
> What should the change log file be named?
> Well, if you can’t tell from the example above, CHANGELOG.md is the best convention so far.
> Some projects also use HISTORY.txt, HISTORY.md, History.md, NEWS.txt, NEWS.md, News.txt, RELEASES.txt, RELEASE.md, releases.md, etc.
> It’s a mess. All these names only makes it harder for people to find it.
Please use standard names. Details here: http://en.tldp.org/HOWTO/Software-Release-Practice-HOWTO/dis...
Does it make any sense to do that in a project?
The GNU conventions for change logs and news files are not exactly self-explanatory (semantics matter), which probably explains how rarely they have been followed to the letter. I have no data to back this up, but I doubt people who use and depend on open source software would discard this claim.
Now it's interesting to see this initiative mocked as a "not invented here syndrome" (Moru's comment). I did not define these guidelines, I merely gathered them from existing open source projects which were exceptionally good at communicating changes. The poor examples and the frustration that fueled this project came from projects that did the opposite:
- inconsistent (file naming, change categories, etc.)
- dumping git diffs which provides absolutely no value to end-users (OSS software users who need to regularly update their dependencies)
- littered with references to irrelevant issue trackers (which did not provide clarifications regarding the changes)
- poorly written with the wrong audience in mind (fellow project collaborators who have context vs. external users who don't)
- not given any dates or given confusing regionally-flavored dates
- and the crux of my frustration: not singling out and emphasizing API breaking changes and deprecations
Anyway, please don't dismiss this project because a convention exist in one community. This convention is not being followed for now and I would really appreciate your help in improving the status quo: https://github.com/olivierlacan/keep-a-changelog/issues
Thanks.
Your project to create a standard format and file name for what you want is unnecessary, since these exist already. Furthermore, you seem aware of this, and seem to want to change the existing standards to your history-naïve preference. You don’t even go to the projects which are the keepers of said standards, but instead set yourself up as a competing standards body. This does not endear you to people such as myself, who are on the whole happy with the current system, and see no benefits to your proposed changes.
- The name "NEWS" is not what users expect. I used to have a NEWS file which documents major changes in a high-level way, per the GNU standards. But I kept getting requests from users to "keep a changelog", and I kept getting questions from users about where the changelog is. Apparently most users never bother to check the NEWS file; they don't even associate the filename "NEWS" with what they're looking for. 95% of the users associate that concept with the word "changelog". "Changelog" is the new "NEWS". After several years, I gave up the resistance and renamed by "NEWS" to "Changelog".
- The actual Changelog format, per the GNU standards, is useless in my opinion now that version control systems have gotten so good. In my opinion, the git history is exactly what the GNU changelog tried to be, with the added benefit that the git history is much easier to browse, query and manipulate.
This, I suspect, depends on your user base. Apparently your users expect the name "changelog". (Do they all use that exact term? Could this usage be traced to a single source, common among your users?)
> The actual Changelog format, per the GNU standards, is useless in my opinion now that version control systems have gotten so good.
Indeed, I believe even GNU Emacs has abandoned (or is about to abandon) it, now that they have switched to git.
Other projects (GNU Emacs) still continue to use ChangeLog files because it is easier to correct ChangeLog entries than editing the commit history (which in git is destructive).
I've been maintaining changelogs for pretty much all my career, in simpler format:
- at the top of file go unreleased changes, without a header
1.6.1: 2005-01-22
- fixed: one
- fixed: another
1.6: 2004-11-18
- fixed: this
- added: that
- redesigned preferences dialog
There is zero markup noise here, and when interpreted as markdown it looks just as nice.Is there a standard change log format?
Sadly, no. But I want to change that.
... wait, what?
There are plenty of standardised change log formats. Take for example Debian's changelog format:
https://www.debian.org/doc/debian-policy/ch-source.html#s-dp...
Or are they talking about one standard to rule them all? In which case...
> Is there a standard change log format?
Sadly, no. But I want to change that.
What's missing from some formats which already exist and are pretty popular? https://www.debian.org/doc/debian-policy/ch-source.html describes debian changelog format which applies to all .deb packages for years now.And if you build your distributions with Dist::Zilla[2] you can use plugins to ensure that you have an entry for your release[3] and that the changelog follows the standard[4].
[1] https://metacpan.org/pod/distribution/CPAN-Changes/lib/CPAN/...
[2] https://metacpan.org/pod/Dist::Zilla
[3] https://metacpan.org/pod/Dist::Zilla::Plugin::CheckChangesHa...
[4] https://metacpan.org/pod/Dist::Zilla::Plugin::Test::CPAN::Ch...
I thought this was the point of squashing your commits together when making a pull request, so the `git log` of master reads like a changelog. You can also interactively rebase and change commit messages if the wording is confusing.
Your version-control system should be helping programmers understand the evolution of the codebase, or the reasons behind certain line-changes... especially when those changes were made by someone else long ago.
The changelog, on the other hand, is for a less-technical (or at least less-involved) audience. It has to summarize the net-change which occurs in a way which is meaningful to people asking different sets of questions. Such as: "What are the new features?" and "Did they change anything about X?"
It maintains a CHANGELOG.md file that includes all the changes that have happened between version numbers. It chooses which commits to include by filtering on [added], [changed], [deleted], or [fixed]. Thus, if you'd like a change to appear in your changelog, just include one of those tags in the relevant commit message.
Seems like a nice way to prevent maintaining an npm package from becoming a chore.
Depending on how you write your comments for commits, merges, or tags, it seems that you could dump those logs and have quite a reasonable changelog.
Thank you :-)
Your project could easily transition to become a project to document, codify, and standardize existing NEWS file practices and conventions and also submit these as a patch to the GNU coding standards. This would be an effort I could support.
It documents and explains (with examples!) everything normal D programmer needs to know.
Know of somewhere that explains how to do that well? I'm a big fan of keeping all of my workflows related to project in git as much as possible, especially if GitHub picks it up correctly.
https://github.com/tech-angels/vandamme/#changelogs-conventi...
I prefer Vandamme's recommended format, but I'd greatly appreciate this site's format as well.
Updated: French, Portuguese Brazilian, Spanish International
It doesn't affect the app other than those specific translations and it makes it easy to pinpoint when a given translation was last updated.