AI Commits – a CLI that writes your commit messages for you
github.com
github.com
That said, a lot of my personal projects that will never get published are just "foo" messages.
Not being able to adapt your commit message style to the purpose it's serving is overly dogmatic. I wouldn't use the same language or tools for every project, so why would I use the same commit message style?
I've seen bad rebases where unintended stuff slips in that probably could be caught by this sort of thing.
In the workflow I was introduced to all commits backing a PR get squashed and merged with the commit message for that merge being the ticket number and title of the ticket the PR resolves.
This creates an incredibly clean commit history that is easy to trace back to tickets and their associated work items (like product docs). It also frees coders from any burden of writing good messages as they progress.
You can still write “fix” and “wip” commits locally, as long as you rebase them before you push your branch.
- It becomes harder to change the issue tracking software. I used to work for a company that went through a few bug trackers, resulting in tons of older commits referencing an inaccessible bug tracker.
- It forces developers to switch from their IDE or git blame to another tool when doing code archeology. The last thing I personally want when trying to understand some code is more context switch.
- Not all commits have an associated issue. I sometimes stumble upon problems in the code that I fix straight away. Writing a good commit message explaining the reason is important because otherwise the context is lost.
This approach when merging in the GH UI, puts the ticket number in the merged commit (not a merge commit though). And the biggest advantage of this approach is there is NEVER a "revert the revert" situation when dealing with reverting. So easy and clean to revert because you aren't reverting a merge commit.
I get that "we can't change issue tracking software" but that is just something you gotta live with, and the advantages of squash and merge far outweigh this "possibility".
Ridiculous. That defeats the point of source control, which is partly to aid future readers, not merely track changes.
I’m happy your workflow works nicely for you, but I hope the mindset goes away.
Personally, I think it’s important to force push over your “bad commit” when it happens. That way you don’t generate dozens of WIP commits, and there’s no need to squash. But sometimes WIP commits are fine to let through. They inform other devs about what you’re experimenting with.
You’re just saying that messages (or: what and why things happened to the code) should be moved out of the repository and into the issue tracker.
This is like me saying that wiki articles aren’t important… because we don’t use a wiki for documentation and just commit the docs in the repository. Yeah, sure. But most of your interlocutors were probably more concerned with the fact that things needed to be documented, somehow.
The only place this falls down are for commits where the reasoning cannot be inferred and summarised from the code alone, or for reasons not apparent in the immediate code that require deeper understanding of the relationship between disparate code. The kind of information which is only in your brain, intent, these are the most important types of commit messages, and no language model is going to be able to help there... but for the rest, why not.
Special thanks to Nutlope.
(1) tests (2) features and or fixes (3) perhaps supporting documentation (4) perhaps even applicable build changes
If I could do the work of even two developers, I’m definitely getting paid. I think software engineering is headed for a John Henry moment.
https://github.com/programmarchy/git-gpt
Hardest part is writing the correct prompt. Your prompt looks better!
Nope.
Not saying a commit message should be drivel but it can just be a simple one liner (it does help with Git Lens as you navigate code but that's about it).