A multi-purpose EDITOR variable
brettterpstra.com
brettterpstra.com
#!/bin/bash
case $1 in
*_EDITMSG | *MERGE_MSG | *_TAGMSG)
/usr/local/bin/vim "$@" ;;
*.md | *.txt) /usr/local/bin/mmdc "$@" ;;
*) /usr/local/bin/subl -w "$@" ;;
esacThis is using a dispatch script as $EDITOR.
$ commit -m 'This is
> my long
> multi-line message'
Granted, if you really want to write a novel that gets inconvenient, but I try to keep commit message short and reference a story or bug id# for more details when necessary.When you find a commit from two years ago that changes a constant from -1 to -2, and the commit message says "constant change", or "bugfix in floobers" you're left with no context.
I found that this also encourages me to be a bit more specific about the reasons for the changes committed. A few lines don't really hurt.
On the other hand, it might be that my commit schedule might still be too influenced by the older VCS systems, and a more frequent git-ish approach would encourage a more in-line approach. But right now I think that my one or two additional lines help more than they hurt.
Build up your commit with git add -p (which requires an editor), then git commit -v and check what you are committing again.
Regardless of that... I love this!