How to add command line prompt as $ EDITOR when committed in svn and git

Is it possible to have a small shell script to replace $EDTIORfor git and svn?

So, when a person who is not familiar with vi or emacs commits and forgets to add -m "fixed the foo bug" parameters, he will not open an editor that does not know how to exit, but instead he will just tell you

Please confirm the offer that contains this message:

and the user simply writes a small sentence, gets into it, and he exits.

+5
source share
2 answers

git config. editor core . , ++ git cygwin:

[core]
    editor = git-core-editor.sh

git-core-editor.sh ( cygwin/bin):

#!/bin/sh
"C:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst -notabbar -nosession `cygpath -w -a "$*"`
+2

nano.

bash script:

#!/bin/sh
set -e
# Show the message template so the user knows what up
cat $1
echo "Type your message, or press return to abort:"
head -n1 > $1
+1

All Articles