Live data from Hacker News

Git log is not a changelog

agateau.com

41–50 of 92 posts

Re: Git log is not a changelog

#41
post #38

Earlier quoted context omitted.

To explain why a certain block of code exists. When the code came into existence is rarely that important. You just want to know why. Why does the code fence against a particular circumstance you didn't think should be possible? Why does it call out to something you think is unrelated? Those questions can be answered by a proper commit message.

I set a breakpoint and run the test suite for that answer

That answers what the code does, but not why it does what it does.

Re: Git log is not a changelog

#42

Earlier quoted context omitted.

We autogenerate our CHANGELOG.md extract from Changelog-[section] our git commit messages (Release Captain massages them if necessary), and have a GH bot which checks that you have a Changelog- note somewhere in your PR commits (can be Changelog-None: ....). This avoid merge hell on the CHANGELOG.md file.

Setting `CHANGELOG.md merge=union` in .gitattributes mostly eliminates spurious merges conflicts on the changelog.

Oh wow, thanks for the tip! Had no idea this existed.

Re: Git log is not a changelog

#43

Earlier quoted context omitted.

> The purpose of a git commit message is to answer the question “why does this commit exist?” Why? Every time I have asked this people say because you'll search the logs (which I have never done in my life) or because "it's good practice"

I think you just haven't discovered you can? I don't know of anyone arbitrarily looking through logs, but it's incredibly useful with git blame when you get to a section of code and don't understand it or typically it's done in an odd or unintuitive way. The blame shows who wrote it, information as to what they were working on via the actual commit message, and branch information. If the person still works with you,…

I'm starting to understand why. It appears my workflow has the information other people would want from a git log elsewhere (test, specs, examples, etc)

Re: Git log is not a changelog

#44
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.

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!

Here is the post: https://jmmv.dev/2005/08/manual-changelogs-thing-of-past.htm... — and pardon the English and its structure. Not as nice as I’d like it to be, but that was written 17 years ago!

Re: Git log is not a changelog

#45

Earlier quoted context omitted.

I think you just haven't discovered you can? I don't know of anyone arbitrarily looking through logs, but it's incredibly useful with git blame when you get to a section of code and don't understand it or typically it's done in an odd or unintuitive way. The blame shows who wrote it, information as to what they were working on via the actual commit message, and branch information. If the person still works with you,…

I'm starting to understand why. It appears my workflow has the information other people would want from a git log elsewhere (test, specs, examples, etc)

Let's say you have some code written 2 years ago. 2 months ago someone made a bug fix in the code replacing a few of the lines. How would you know from test, specs or examples which specific lines were modified and by whom? I don't get it.

Re: Git log is not a changelog

#46
post #38

Earlier quoted context omitted.

To explain why a certain block of code exists. When the code came into existence is rarely that important. You just want to know why. Why does the code fence against a particular circumstance you didn't think should be possible? Why does it call out to something you think is unrelated? Those questions can be answered by a proper commit message.

I set a breakpoint and run the test suite for that answer

So you never need to understand when or why a bug was introduced? Or you never need to understand why the current behavior as is it is?

Re: Git log is not a changelog

#47
If you write dev facing projects, unless your volume is that high, your commit history can absolutely be your change log using conventional commits.

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.

Re: Git log is not a changelog

#49

That depends what you mean by a changelog. 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. > The changelog targets your users. It…

GNU's notion of a changelog predates the widespread use of source control, and is indeed there to cover which is now covered by git history. It's not what anyone using modern software development approaches means by a changelog.

> It's not what anyone using modern software development approaches means by a changelog.

Well, it's a good job then that this forum is cool with blurring the subtle distinctions between technical terms that have been in use for decades, and is happy to just go with whatever mainstream definition of a word has the most traction...

...on this site for news about breaking into computer systems.

/s

Post reply on HN