Discussion
Veselin Dimitrov
agateau: Would be curious to know if it works better than writing the Why as human-friendly paragraphs in the body of the commit message.
vidimitrov: A few examples are the ability to query historical data and using each action line as a signal for other tooling to build on top but there are many others… you can check what Conventional Commits did in the past and what they unlocked only by introducing structure to commit subjects
keybored: > an open standard for capturing the WHY in git historyAgentic coding keeps reinventing coding.That was my first thought.> And then it hit me - the commit body has always been there. Completely underutilised.Wait. What? This is the standard?> Here is an example of how a Contextual Commit looks:The format is key-value stuff. You can already use trailers for that. The syntax here doesn’t work with that stuff.If you have already readh the “conventional commits” (pronounce with a sneer) specification you have already seen them. They’re called footers because they also didn’t know about trailers.> No new tools. No infrastructure. Just better commits.Okay, let’s cut right to the point..
vidimitrov: Trailers were not suitable for the use case.The scope in parentheses is doing real work. `rejected(oauth-library)` lets you do `git log --grep="rejected(auth"` to find every rejected auth decision across history.If you flatten it to a trailer token you either lose the scope or encode it awkwardly as `Rejected-auth-oauth-library: value`, which doesn't grep cleanly and doesn't parse naturally.
skydhash: I think those are better suited to an issue tracker. As for changes that affected the source code, you can grep the patch in the git log too.
teeray: It continually amazes me how averse people are to just explaining why a commit exists in the body of the commit. Is all this tagging actually easier to read than written prose? You don’t even have to write it anymore if the sight of your editor opening upon `git commit` causes some instinctual revulsion.
vidimitrov: The problem is that usually we don't write the WHY in the commits... We tend to always capture the WHAT in the form of prose. And for agents, this is just more noise, since all they need is just the diff to reconstruct the WHAT.I've never seen someone write decisions or the intent they started with in commit messages. Even the solutions today that auto-generate commit messages just summarise the diff.This was helpful when humans were the only ones reading the history. But for agents its useless.
skydhash: > I've never seen someone write decisions or the intent they started with in commit messagesYou may not have seen enough good repos. The following is an example commit from freebsdhttps://cgit.freebsd.org/src/commit/?id=ac5ff2813027c385f903...A proper email is like an email. You have the first line as the subject and it may be enough to explain the intent of the diff. But sometimes it’s not enough and you add more details in the body. I strongly believe that people who write the WHAT again don’t know that there’s a diff attached to the commit and think of them a separatete objects. GitHub and VSCode do not really help in that regard.
vidimitrov: This looks very good. Thanks for sharing. I can only imagine how much discipline it takes to write these kinds of commits manually.
evolve2k: I like these conventions. Another personal practice I us the body for is where I’ve relied on any webpages; blogs, issue reports, stack overlap pages etc to help the commit come together.The example of using one library over another, especially if research has gone into which to choose, regularly involves say finding a good article that compares the alternatives.I’ll say though that I usually include links to more notable references, I won’t usually commit refs to a libraries own docs and more obvious stuff; revealing and keeping references to resources found that went towards getting it done are what I keep and add to commit body.Maybe there’s spaces for useful references to be added to the spec/conventions. Personally I usually show links like this after the body message.——Using the modified date library to fix leapsecond issue.Ref: www.something.com/picking-a-thing
SamuelAdams: Our standard of practice is to document the “why” in Jira. Then reference that card in the commit message.This gives product owners the ability to embellish as they wish and reduces the need of the dev to repeat themselves.
vidimitrov: That’s cool. But how does it work in agentic environment? Do you get any benefit from it? Or it’s intended only for humans to read?
0x457: > The scope in parentheses is doing real work. `rejected(oauth-library)` lets you do `git log --grep="rejected(auth"` to find every rejected auth decision across history.I'm 99% sure that grep won't find your commit because you rejected "oauth-library" and grepping for "auth" rejection. Given that LLM will make up category name, it will just get worse unless there is deterministic enforcement.All of this really feels like people that never wrote code starting doing it via agents and started reinventing already solved issues.
vidimitrov: The “deterministic enforcement” is exactly what this enables but its not the responsibility of the spec to say that. Its harnesses or IDEs or you own implementation that will enforce that.
keybored: Rejected: (auth-library) ... ?