5

$EDTIORgit と svnの代わりに小さなシェル スクリプトを使用することは可能ですか?

そのため、vi や emacs に精通していない人がコミットを行い、 -m "fixed the foo bug" パラメーターを追加するのを忘れた場合、エディターは開かれず、終了方法がわかりませんが、代わりにプロンプ​​トが表示されます。

このコミットの内容を証明してください:

ユーザーは短い文を書き、Enter キーを押すだけで終了します。

4

2 に答える 2

2

gitの場合、configファイルを編集できます。セクションに追加editorcore、選択したエディターをポイントします。たとえば、cygwinの下のnotepad++とgit:

[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 "$*"`
于 2011-05-06T06:11:10.423 に答える
1

それには理由がありnanoます。

ただし、小さな bash スクリプトを使用できます。

#!/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
于 2011-05-06T06:20:13.917 に答える