TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Git log is not a changelog

124 pointsby agateaualmost 3 years ago

27 comments

teerayalmost 3 years ago
The purpose of a git commit message is to answer the question “why does this commit exist?” That is the principal question you should be answering when you type `git commit`. This is the question you will be asking yourself when you find that commit in `git blame` or if it shows up in `git bisect`. Try to help your future self out.<p>The changelog, on the other hand, answers the question “why does the customer care about these changes?” It could be the same reason as why the commit exists, but the question <i>is</i> different. If the customer doesn’t care, maybe it doesn’t even need an entry. Maybe why they care is slightly different than the reason the commit(s) exist.<p>This is why I advocate for a hand-updated CHANGELOG.md. It’s a very small amount of writing that forces developers to consider how their PRs will impact customers that an auto-generator will never be able to do well.
评论 #32122986 未加载
评论 #32123342 未加载
评论 #32123603 未加载
评论 #32124104 未加载
lhnzalmost 3 years ago
I think commits should contain atomic-yet-meaningful changes and the commit message should describe this as well as possible.<p>It&#x27;s worth rewriting the history to achieve this and squashing or splitting commits until this is the case. You shouldn&#x27;t do this for the benefit of your users or a changelog, you should do this in order that it is easier to bisect the history or for other contributors to understand exactly the change a commit relates to. There is nothing worse than commits which combine a working bug fix with a half-written feature -- split them out!<p>Obviously, it&#x27;s possible to inadvertently create a misleading history by re-arranging the order that work was done or getting rid of failed attempts at a solution, but generally the false reality is easier to understand and good understanding is key.
评论 #32123830 未加载
kazinatoralmost 3 years ago
Yes the Git log is the ChangeLog.<p>For instance, I retired the ChangeLog in the TXR project in 2015; commit messages continue to be in the ChangeLog format. A ChangeLog file could easily be produced from the commit messages.<p>Replicating that information in a file that is checked into git is silly; you&#x27;re just begging for merge conflicts. Any time anyone sends you a patch, if it is not rebased to your current HEAD, you have a guaranteed conflict in the ChangeLog file.<p>Why do that to yourself.<p>&gt; <i>The changelog targets your users. It must answer questions like:</i><p>&gt; <i>&quot;What cool new feature is in this version?&quot;</i><p>&gt; <i>&quot;Is this annoying bug fixed?&quot;</i><p>&gt; <i>&quot;Is it safe to upgrade, or do I need to adjust my code&#x2F;workflow to this new version?&quot;</i><p>Oh, I see what this person&#x27;s problem is. He&#x27;s referring to some lower case &quot;changelog&quot; that everyone calls &quot;release notes&quot;.<p>I agree; the git log is not your release notes.<p>Please don&#x27;t call &quot;release notes&quot; &quot;changelog&quot; in 2022.<p>Release notes aren&#x27;t a change log because, doh, they don&#x27;t (exactly) log the changes.
评论 #32125839 未加载
taverasalmost 3 years ago
I find that many programmers are hyper-focused on writing automation for things that feel like a chore. This thinking has its purpose, but it’s almost an addiction.<p>For these folks, putting deliberate effort into change logs, release notes, and documentation feels wasteful.<p>My hunch is that this is due to a missing feedback loop: we are unlikely to get feedback about documentation, and more likely to get feedback on our project’s code.<p>My own writing improved after a past project had a strong feedback loop with my documentation’s intended audience. This has been so damn rare in my career, that it’s never surprising when I meet programmers who are uncomfortable with technical writing.
评论 #32125950 未加载
评论 #32125818 未加载
bloopernovaalmost 3 years ago
Use multiple &quot;-m&quot; parameters in your git commit.<p><pre><code> git commit -m &quot;feat: script pretty print&quot; -m &quot;added variables for bold, normal, and a nice blue arrow&quot; </code></pre> becomes:<p><pre><code> feat: script pretty print added variables for bold, normal, and a nice blue arrow </code></pre> In your git log output. Use extra &quot;-m&quot; sections for stuff like ticket references, or other relevant information like a link to a design document.
评论 #32126427 未加载
评论 #32124114 未加载
Karellenalmost 3 years ago
That depends what you mean by a changelog.<p>According to the GNU coding standards, which have been used for decades for a large amount of the core software on a Linux system, what you should put in the changelog looks quite a lot like a good git commit log would look like[0]. And Linux currently uses the git log as the changelog, and IIRC had a similar format in the pre-git era.<p>&gt; The changelog targets your users. It must answer questions like:<p>&gt; &quot;What cool new feature is in this version?&quot;<p>&gt; &quot;Is this annoying bug fixed?&quot;<p>&gt; &quot;Is it safe to upgrade, or do I need to adjust my code&#x2F;workflow to this new version?&quot;<p>To me, that sounds like what a lot of projects would call &quot;release notes&quot; or (per GNU) &quot;NEWS file&quot;[1], not the changelog.<p>[0] <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;prep&#x2F;standards&#x2F;standards.html#Change-Logs" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;prep&#x2F;standards&#x2F;standards.html#Change-Log...</a> [1] <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;prep&#x2F;standards&#x2F;standards.html#NEWS-File" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;prep&#x2F;standards&#x2F;standards.html#NEWS-File</a>
评论 #32125858 未加载
评论 #32124182 未加载
_ph_almost 3 years ago
Yes, a commit log isn&#x27;t a changelog. However, a good commit log can make writing your change log much easier. While this isn&#x27;t an automatic process, writing a changelog becomes a bit of filtering of the commit messages as well as rephrasing them for the intended audience.
cpercivaalmost 3 years ago
FreeBSD uses<p><pre><code> Relnotes: yes, or text for the release notes </code></pre> in commit messages to note that the commit has significant user-visible effects.
ptxalmost 3 years ago
&gt; <i>Git commit messages and changelogs do not have the same target audience. [...] Some people dislike merge commits. [...] If that bothers you, you can always ask contributors to rebase before merging.</i><p>I think that squashing and merging, much like commit messages and changelogs, also have different target audiences.<p>If there are contributors to the project who aren&#x27;t proficient with git, asking them to rebase would be a huge obstacle for them and create a much worse mess. Squashing simplifies their workflow and allows any mistakes (e.g. checking in the database, accidental merges from the wrong branch, etc.) to be cleaned up and kept out of the permanent history.
jmmvalmost 3 years ago
Agree with the premise of the article: changelogs—or rather, news files—are not the commit history. Describing the changes between releases at a high level is super important but also a skill that’s hard to acquire.<p>I thought I had written about this way back as well, but what I found instead is a post from 2005 that’s tangentially related. I remember that some projects back in the day tried to replicate the equivalent of git log in their ChangeLog file… by hand!<p>Here is the post: <a href="https:&#x2F;&#x2F;jmmv.dev&#x2F;2005&#x2F;08&#x2F;manual-changelogs-thing-of-past.html" rel="nofollow">https:&#x2F;&#x2F;jmmv.dev&#x2F;2005&#x2F;08&#x2F;manual-changelogs-thing-of-past.htm...</a> — and pardon the English and its structure. Not as nice as I’d like it to be, but that was written 17 years ago!
GauntletWizardalmost 3 years ago
The missing part of this is filtering git history with &quot;git log --first-parent&quot;, but that only works if your repo has good a) merge commit messages and b) hygiene in creating your merges so that your &quot;Pretty&quot; history is on branch 1.<p>On the other hand, it takes a lot of discipline to make the second branch useful at all. If you constantly make short commits with messages like &quot;stuff&quot;, why bother keeping them in the repo at all? There&#x27;s a ton of junk you don&#x27;t need in the typical code review, and making it useful requires... Discipline.
mikewhyalmost 3 years ago
At work we squash and use standard-version to create a generic change log, then have a script that ingests that change log and goes to the PR to grab any associated tickets, screenshots, and release notes the developer may have written. The body of the PR is split into sections (just using markdown headers), so there is control over what goes into the release notes.<p>A git log is not a change log, sure. But PRs can contain a lot of useful information.
mulle_natalmost 3 years ago
I use the git log to feed my changelog. I prefix the stuff that&#x27;s supposed to go in the release notes with a asterix and the technical boring stuff is just a normal line. Then at release time I have a script that pulls the asterix prefixed lines from the change log into the RELEASENOTES.md. I wouldn&#x27;t want to bother with more.
评论 #32122517 未加载
评论 #32123764 未加载
thihtalmost 3 years ago
I completely agree with this. Every single project with « conventional commits » that try to generate release notes end up with completely useless release notes. Just bite the bullet and write for humans, it’s not that hard, especially if you do it on the fly as suggested by the post.
sudo_chmod777almost 3 years ago
If you write dev facing projects, unless your volume is that high, your commit history can absolutely be your change log using conventional commits.<p>Otherwise your PM can write change logs basing off of JIRA or something. Your change log generated from commits can still be useful for incident management, etc.
SuperSandro2000almost 3 years ago
NixOS maintainer here and this is really annoying me since months. I can&#x27;t really know what from a 100+ line git log is a breaking change and needs special attention and what is totally uninteresting for consumers of the piece of software.
sss111almost 3 years ago
use <a href="https:&#x2F;&#x2F;www.conventionalcommits.org&#x2F;en&#x2F;v1.0.0&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.conventionalcommits.org&#x2F;en&#x2F;v1.0.0&#x2F;</a>, it has extensions that can autogenerate a nice looking changelog.
评论 #32122500 未加载
评论 #32125871 未加载
评论 #32122833 未加载
wagoodmanalmost 3 years ago
we use <a href="https:&#x2F;&#x2F;github.com&#x2F;anchore&#x2F;chronicle" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;anchore&#x2F;chronicle</a> to generate release notes in a changelog format using the issues and PRs from GitHub as the source of truth. In this way time well spent in the curation of issues and PRs (which is something we need to do anyway) means that we automatically get release notes for free. (disclaimer: I&#x27;m the author of chronicle)
lamontcgalmost 3 years ago
Your changelog is also not release notes.
bstar77almost 3 years ago
For me, it&#x27;s as simple as my audiences are different, hence what I choose to put in them will often be different.
dataangelalmost 3 years ago
Most software is written for internal use and not sold to external customers. For this case Changelogs are busy work without much utility up until the point your organization is big enough that you and your &quot;customer&quot; may as well be separate companies. In that case you&#x27;re better off writing a blog post or release announcement than a text file change log which is for grey beards, not users.
awinter-pyalmost 3 years ago
instead of a changelog, would be neat to ship a &#x27;spec&#x27; file that says what features the codebase provides, as well as detailed semantics<p>plus maybe a &#x27;fixes&#x27; list (because a spec file doesn&#x27;t need to say &#x27;what used to not work&#x27;)<p>then compute diffs of these using git history to produce a changelog
rurbanalmost 3 years ago
Apparently nobody knows the difference between NEWS and CHANGELOG anymore. Maybe re-read the GNU coding Standards. <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;prep&#x2F;standards&#x2F;standards.html#NEWS-File" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;prep&#x2F;standards&#x2F;standards.html#NEWS-File</a>
quickthrower2almost 3 years ago
git log let’s you check if you might be missing something from the change log (aka release notes) though.<p>Or if you didn’t actually release something you thought you did.
foxhopalmost 3 years ago
no changelog until somebody complains?
Lapsaalmost 3 years ago
export that cr*p out of whatever issue tracker you using. and merge commits are great
yellowapplealmost 3 years ago
Alternately: be religious about (merged) branches and changelog entries being 1:1.