3 ms·
I exploit the same trick to have a script automatically set what it thinks a commit message should be, but still pass it for human review/edit before actually c
by yjftsjthsd-h 6y ago
I exploit the same trick to have a script automatically set what it thinks a commit message should be, but still pass it for human review/edit before actually committing and pushing. Come to think of it, you could easily use this to set a default message base and do things like always prefix the directory; I like my commits to be something like "modules/foo: added bar", so I could just alias gc='git commit -m "${PWD##*/}" -e' (well, something like that, but more sophisticated).
- delusional 6y agoFor this usecase git has the 'prepare-commit-msg' hook that allows you to configure this per repo.
- pkaye 6y agoHow does the script determine what the commit message should be?
- usr1106 6y agoI always have the issue number and short description in the branch name, e.g. foo#123-handle-new-orders. So that might sometimes be good enough for a first automatic commit message. I typically clean the history before I submit I submit my work to review.