"
Acknowledgments
- OpenAI for providing the GPT API
- The conventional commits specification
- The git community for powerful version control tools
"
The future of sharing code is probably dead. Everything is write-only now. Vibe it yourself.
Heh. I wonder if the author asked GPT to remove that section from the readme.
[1]: https://github.com/f/git-rewrite-commits/commit/210ada7ec78f...
"Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith."
What is the "strongest plausible interpretation" of that comment? Because I interpreted it in the exact same way, and don't really see any other possible interpretation.
Otherwise, why bother to run your vibe-coded website on nginx? Just have the LLM spit out its own novel web server, its own novel TCP stack, its own novel OS for that matter.
Please stop following this. It provides zero value.
A one char ID on a web app is all very well but is the extra hassle worth it?
Turns out it's a valid single-character name as well on GH:
this tool is not meant to rewrite public history or alter real project timelines. it's more of a utility for personal or experimental repos (or branches), the kind of messy ones full of "update again" commits that never had a proper history. that's exactly why I built it.
What you actually want is a ban on rewriting tags or accepting branch updates to commits that do not have the current commit as an ancestor. These hooks do exist, but are not on by default (beyond the toilet paper protection of needing --force).
You also have to ban deleting branches because otherwise you just delete and push a new one with the same name. Maybe we should store topic branches in repos under refs/topics/ to distinguish integration branches from development/review branches?
I'm not nearly important enough to have an intern write my commit messages but now that AI can do them, and do them extremely well, I'm more than happy to offload the work and get back to the actual work. The AI is far more thorough than I would be and because it takes away nearly all the mental effort the end result is, I think, better.
I am sure AI cannot even glims the frustration I feel committing these commits.
You can argue, that these messages are as poor as the code that I have written; but don't tell me you haven't been there -- and if you have please tell me your secret
Actually I wish that we had two branches in parallel, one with cleaned up commits, another with how the software were actually edited. But we need tooling for that
If you don't go that far, you could mimic something like it with sub-branches and merge commits for each one into your working branch, but I imagine it would be annoying to handle at that granularity.
If you don’t have respect for your future self, don’t expect me to have respect for you.
The only time I've ever regretted not writing better messages on personal projects is when they eventually became shared. Which is like, twice, in a decade or so and wasn't even a big deal in those cases.
So when I'm writing commit messages, it is exclusively for other people.
Being a good communicator is very commonly the main difference between "moving up" in one's career. Quotes because i don't want this to be a debate about IC vs management tracks.
(And sure, you could also say that I should have added better documentation back in 2014...)
You can apply this logic to procedurally generated games like No Man's Sky. Why would you want to play a level that a human didn't even bother to design?
I'm not sure I would go whole-hog and let this tool rewrite my history but my `git commit -v` wraper pre-populates the commit message with something AI generated based on the diff and I've been quite happy with the results. I think my commit messages are much better as a result.
I personally don't see what the use case of this is -- you shouldn't even be hired in the first place if you can't even describe the changes you made properly.
Also please kill conventional commits, that info should be in a trailer too.
But I do agree that you want the commit message to encode your reasoning for the change.
If anybody who works on one of these commit message generators is around, some requests:
1. just allow it to take any existing commit message I've already written and expand it based on the diff. that will let me have a starting point or give a crappy but directionally accurate intention explanation
2. look at surrounding code agentically
3. make the commit messages shorter and less fluffy
This is extremely dissimilar to the thoughts of the author.
The value of what this emits is already handled by evaluating the diffs in the per-file history.
It's not good to throw this sort of thing over the fence, and justifying it by considering it to be wasteful of your precious time doesn't change that.
It's better to leave it blank, but a tool like this looks perfect to help someone avoid scrutiny, while simultaneously avoiding providing a tiny depiction of what they were thinking when they committed the change, at the expense of injecting vast amounts of noise.
You almost had the right idea there: the value of what this emits is really in the summary of diffs. I'm certainly not going to go through each commit and read the diff each time I look at the log, but I still want to understand what happened and be able to find individual commits. If extra information about the author's thoughts is just not available, I'd much rather have summaries than a blank log of "WIP" comments.
It's absurd to gatekeep commit messages to only "the thoughts of the author", even if that's what usually goes in there. A good diff summary might even be more useful than a ramble that doesn't mention important changes.
Why do you want a summary of the changes? The bulk of the information in a commit is the diff itself.
The information that is not contained in the diff is the author's intent, and that's what the space is meant to contain.
I'm not convinced you actually believe that a summary is valuable because this whole comment is coming from a very defensive place.
I mean, for the initial development/contribution/PR workflow, I agree with you: any code reviewer should be reading the diffs anyway, and if you're reading the diffs, these messages (being purely summaries derived from the code itself without the LLM having any info about developer intent) don't add anything.
But that's not the only time commit messages matter. A tool "fixing up" bad commit messages before they're pushed to a PR branch like this, might still help with later code maintenance after the code is merged:
• When you or someone else is looking at the commit lines after the fact, in e.g. `git log` to find commits to cherry-pick, such summaries would be a substitute for having to go commit-by-commit reading the diffs to find the one you're looking for. Or when doing e.g. a `git bisect`, they'd allow the likely-offender commit to "jump out" at you from the list of remaining commits, after just the first few bisect steps, without having to do 10 more iterations to narrow it down with actual rebuilds+test suite runs.
• and when someone else is looking at `git blame` while bug-hunting, or seeing the latest commit that touched each file when browsing a github repo tree, having these summaries would be the difference between having an opaque timeline of "fix" -> "fix 2" -> "fix again" -> "update" -> "fix" commits to try to keep distinct in one's head (may as well just try to recognize commits by the abbreviated git ref at that point), vs. having commits with descriptive mnemonic "names".
Note that this tool is supposed to be retroactive, not incremental. It rewrites messages for existing commits, that already had some other message when they were initially committed; it doesn't have any function that you could use to do `EDITOR=this-program git commit` and have it generate a commit's original commit message just-in-time.
As the author says in the README, this tool was created with the goal of fixing one's private git commit history before making it public. At the point when this tool would be run (i.e. at the point a developer is trying to "clean up" their private git history for publication), it's often already been long enough since you created these commits, that you likely don't actually remember what you were thinking at the time you created them. Any information about "what [you] were thinking when [you] committed" has already been lost. "The rice has been cooked", per se.
At that point, there's no value you could add by going back over the commits manually, beyond that which this program could add. In both cases, whether you or the LLM is doing it, the result would just be a reconstruction (i.e. a guess) at what the original developer was thinking/trying to accomplish at the time.
---
Which is not to say that this tool is a substitute for making good commits (instead of random-junk-drawer snapshot-your-work "WIP commits") in the first place. And, in fact, I have a feeling that this tool is not nearly as widely applicable (at least in its current form) as its author thinks it is... because "WIP commits" don't generally have any good way of summarizing them; because "WIP commits" are often not coherent single-purpose edits of the code.
A better version of this tool, I think, would be one that rewrites a private work branch / PR branch by first squashing it into a patch, and then breaks that patch back apart into a series of commits that each "do one thing", essentially introducing the change in a literate programming style where you're meant to read the commit-series top to bottom.
In other words, exactly what an experienced software engineer who knows they'll need to maintain their own code will already do themselves, at commit time, with `git add -p` (and before commit time, by having the discipline to avoid getting distracted solving a second problem while in the middle of solving the first!) And it's also exactly the format that patch-based workflows like LKML already expect contributors to construct [from whatever they were doing internally] when submitting a patch-series, to allow the patch to be read and considered on the mailing list as essentially a linear literate-programming explanation of the changes.
The tool still wouldn't be able to recover the intent of each patch series if it was never added; so the commits would still just be descriptions of the kind a later "software archaeologist" or reverse-engineer would give to the code. But it would at least be generating descriptions for coherent chunks of code, rather than attaching descriptions to commits that were essentially "whatever probably-partial progress on whatever incoherent set of things the programmer was trying to do at the time they needed to sync their work to switch from their laptop to their workstation."
My opinionated take is: I wouldn't want to use this space for the information that this tool could provide, and rather leave it as the truth.
The truth is that it was committed without a meaningful message, and now I might recognize a chain of message-less commits, representing a moment in time where the authors were trying to figure out where they wanted to end up.
If the tool is producing this info simply by reading the diffs in the code, why not just use it when you need it, to help explain what you're digging through, instead of changing the commit history?
Either way, the critical detail is: People should get that detail out before the rice has been cooked, and that's what I do for myself, in my own private repos, and when others do that for future archaeologists, we all benefit.
Also, it seems a tool like this would be much better suited to help someone who wants more fluff understand a terse git history, than to rewrite the history. That way, you'd benefit from any later improvements of the model rather than freeze comments at whatever level of slop was the state of the art of the day
cube00•2mo ago
This misses the whole point of using commit messages to record intent.
At least with a bunch of "fixed it" commits I know what I'm in for. This only fools yourself and others into thinking the repository was well maintained.
fka•2mo ago
In those cases, the "intent" was never recorded in the first place, so the AI is just giving some structure and readability to what’s already lost context.
It’s not about pretending the repo was well maintained, it’s about making messy histories a bit more understandable for humans (and future me) without rewriting the actual code or meaning.
MangoToupe•2mo ago
fka•2mo ago
cube00•2mo ago
I don't accept "chaotic early stages of side projects" is a justification for skipping out on writing good quality commit messages.
It wouldn't be acceptable in a well managed company so I don't understand why side projects would get a pass to become sloppy.
It's your side project and you're free to skip writing commit messages, but you need to own that decision and not blame "those chaotic early stages"
I've found taking the time to write good commit messages helps me as I can see what I've tried previously and pull out any older versions if I've found a new direction isn't working for me. It also captures my thought process in case I'm tempted to repeat the sins of the past.
jghn•2mo ago
cube00•2mo ago
I write them for my future self.
In this context we're talking about a side project which presumably won't have a PR where the commit messages are cleaned up (at least I don't do PRs for my own side projects).
If I'm on a branch then I will write junk commits and clean them up before merging to main if I actually manage to get the feature right.
accoil•2mo ago
milkey_mouse•2mo ago
Because no one's paying you, and you owe your users nothing?
cube00•2mo ago
While I'm certainly getting there, I'm not cynical enough to believe being paid is the only reason to take pride in the quality of your work.
milkey_mouse•2mo ago
milkey_mouse•2mo ago
retsibsi•2mo ago
Yes, sometimes that makes things harder in the long run, but on the other hand there may not be a long run for this project if I try to force myself to do all the tedious bits 'correctly'. (And 99% of the time what bites me is my sloppy coding practices; it's very rare for much to hinge on the quality of my commit messages.)
twodave•2mo ago
Spivak•2mo ago
I can assure you that it's very acceptable at companies of all sizes and ironically it's the most senior most experienced people who write "flerpin derpin" as commit messages.
FuckButtons•2mo ago
leptons•2mo ago
skydhash•2mo ago
That is why good summary and atomic commits are important. They exist in the time dimension.
leptons•2mo ago
acjohnson55•2mo ago
amake•2mo ago
cube00•2mo ago
docs(readme): remove acknowledgments section [2]
[1]: https://news.ycombinator.com/item?id=45871258
[2]: https://github.com/f/git-rewrite-commits/commit/210ada7ec78f...
nikeee•2mo ago
Please don't use AI-generated commit messages blindly. Instead, use AI later when reading commit messages. It will have more context (following commits) to see what was actually happening. Having to guess whether a message was hallucinated by an AI won't help. If the message conflicts in its intention with what it isactually doing, you can spot the bug. You won't get that with AI messages.
Also, using AI commit messages will freeze it's capabilities in time, when creating the commit. When using AI at reading commit messages, you'll always get the latest options for analyzing the commits.
Just because it has more text doesn't make it a better message.