Is it possible to have a small shell script to replace the $EDTIOR
for git and svn?
So when a person not familiar with vi or emacs makes a commit and forgets to add a
-m "fixed the foo bug"
parameters it would not open an editor they do not know how to exit, but instead it would just prompt
Please proved a sentence on what this commit contains:
and the user just writes a small sentence, hits enter, and off it goes.
For git you can edit your config
file. Add editor
to core
section, and point to editor of your choice. For example notepad++ and git under cygwin:
[core]
editor = git-core-editor.sh
Contents of git-core-editor.sh
(put it in cygwin/bin
directory) :
#!/bin/sh
"C:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst -notabbar -nosession `cygpath -w -a "$*"`
There's a reason we have nano
, you know.
But you could use a small bash script:
#!/bin/sh
set -e
# Show the message template so the user knows what's up
cat $1
echo "Type your message, or press return to abort:"
head -n1 > $1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With