3 ms·
Stop wasting time writing commit messages
- kgellci 3y agoI (and AI) made a simple bash script which will write your commit message for you using a diff of your staged changes. Stop wasting precious seconds of brain energy. You do need to use your own OpenAI API key for the script but it should otherwise work out of the box.
- smt88 3y agoIf you find that using git is taking up a lot of your time, the first thing you should do is switch to a good GUI, which saves 90% of your time anyway. Automating the fastest and easiest part of using git is penny-wise and pounds-foolish.
- kgellci 3y agogit commands are generally faster than a GUI once you learn them but some engineers still struggle with wording the commit message regardless of what tool they use.
- smt88 3y agoThere is no universe in which remembering and typing git commands is more efficient than clicking a single button. Just the mistakes from git CLI use are a major time waster. Good GUIs roll up multiple commands into easy actions and can even automate your team's workflow.
- cratermoon 3y agoIf the wording of the commit message is the issue, there are ways to reduce the toil without having AI confabulate a message. Conventional Commits <https://www.conventionalcommits.org/en/v1.0.0/ https://www.conventionalcommits.org/en/v1.0.0/> has been discussed on HN many times. The 50/72 practice (some tools will help with this) <https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html https://tbaggery.com/2008/04/19/a-note-about-git-commit-mess...> and many many words out there suggesting some best practices. A team can and should work out their own best practices. A git prepare-commit-msg hook can provide a template for message conventions. Perhaps there's room for a tool or UI enhancement to provide additional guidance.
- theamk 3y agojust as last time a similar project came up, that's a pretty terrible idea. Example (from the gif in screeshot), https://github.com/kgellci/git_ai/commit/f3de488de88bf0893d881574b90c075158798bf1 https://github.com/kgellci/git_ai/commit/f3de488de88bf0893d8... entire AI-generated commit message: "Update prompt in ai_commit.sh to be more descriptive" _actual_ changes: "Add error handling; tweak default prompt a bit" It is pretty amazing how badly AI summarizes such a simple change.
- kgellci 3y agoIt's more for fun or for personal projects. All of the commits in the repo are AI generated and they are generally good enough. I find that it has a hard time summarizing GPT prompt changes, which this project is mostly.