Show HN: Cocommit – A copilot for git commit

AndrewRDev | 28 points

I don’t know why it’s so hard for devs to stop for 30 seconds and answer the question “why does this commit exist?” That’s the question you’re going to ask when you find the commit in `git blame`, so just answer it.

teeray | 25 days ago

There are a lot of these tools. I use AI Commits. https://github.com/Blarc/ai-commits-intellij-plugin

Feature suggestions:

* Emit validated conventional commits. https://www.conventionalcommits.org/

* Create templated PR descriptions from multiple commits.

* Take the existing diff into account when you do a git amend.

esafak | 25 days ago

Tools such as this should not be used. The generated commit messages are all noise, no signal. The LLM can not possibly describe why a change was made, and it can never describe why a corresponding more obvious change was not made.

Should you somehow find yourself in a situation where the above does not hold, and you really want the LLM description, it is still bad design to run the LLM on commit. LLMs will only get better over time. In that case you should not use commit messages but run the LLM on "git log" instead.

Just as it uses heuristics to show moved files it is also the more suitable place to summarize the diff, if that is all you place in the commit message field anyway. At that stage it has potential knowledge of the future as well, with that added context the summary might actually be useful ("this functionality is later replaced with ..").

xorcist | 25 days ago

I really don't like this as - similar to many comments here - it feels like an attempt to outsource the essence of programming and at best give you a pseudo-code summary of your changes vs. a valuable description of the intent.

But if it tamps down the holy wars of "pick a git comment style; be a dick about it" maybe there's value?

skeeter2020 | 25 days ago

"A good commit consists of multiple elements, but at a minimum, it should have a well-crafted commit message. " I'm not sure I accept this premise. Just a few words is all that is needed. Anymore and it becomes this OCD novel you are writing that doesn't actually help the code base later. Git log -p is where you really look to see what the commit did, not a well crafted message.

andrewfromx | a month ago

Use this bash script https://gist.github.com/davidesantangelo/ce7424e68b7d1e7903e... and paste the result into your favorite LLM with a simple prompt "write a git commit message markdown from this <result>"

daviducolo | 25 days ago

What I don’t like is using AI to write commit messages outright.

But this reviews the commit message. Which might have merit.

There are projects where the commit messages are reviewed. And they may have guidelines written in prose for that somewhere. If the AI can be tuned on that then great, might save some human review time.

keybored | 25 days ago

I'd recommend following the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines for writing the commit messages.

MahendraDani | 25 days ago

Despite the confusing copy here and on the landing page, the tool appears to be a commit message linter not a generator. Which seems useful. In fact, I was thinking of building something like that for internal use. Thank you for sharing.

gleb | 25 days ago

Don't listen to the negative comments. I think this is great, good on ya for building and releasing it.

Sure you could improve it by emphasizing the 'why' of the commit, but what I see is a great start.

bsima | 25 days ago

Can I use this to rebase in a commit message higher up in the commit log without rewriting it myself?

It might be useful to decorate a repo that lacks commit messages with synthetic guesswork.

cess11 | 25 days ago

Sorry if I'm confused, cocommit doesn't actually generate commit messages (based on staged code)? It only analyses the previous commit message?

polynomial | 25 days ago

Meanwhile senior devs just commit with "fix" and get the job done. Context is important, and I doubt an LLM can adapt to internal culture as well as a developer that takes 30 seconds to write the commit themselves.

ramon156 | 25 days ago

It's a great addition to vibe coding: people who can't code and don't want to learn can now write commit messages they won't understand. Do we really need LLMs and AI slop to write a few sentences now? What's next? LLMs to move the cursor of your mouse because it's too hard?

JTyQZSnP3cQGa8B | 25 days ago
[deleted]
| a month ago