[PATCH 2/4] notes: use GIT_EDITOR and core.editor over VISUAL/EDITOR
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Feb 14, 2009, 19:15 UTC
- Message-ID
- <d2ca964918f3f930505cd969cf8407d4a8d67fe3.1234638466.git.trast@student.ethz.ch>
- In-Reply-To
- <b36bbe2f7f0ede6a2caa47190ada868dd4c0099c.1234638466.git.trast@student.ethz.ch>
This is the order documented in git-config(1), so we should stick to it.
Signed-off-by: Thomas Rast <trast@student.ethz.ch> ---
It's actually only _almost_ the documented order: the manpage says that $GIT_EDITOR is used when it is set, presumably even when it is set but empty. I cannot see how that would be useful however.
git-notes.sh | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-notes.sh b/git-notes.sh index 246df65..6859470 100755 --- a/git-notes.sh +++ b/git-notes.sh @@ -35,7 +35,8 @@ edit) git cat-file blob :$COMMIT >> "$MESSAGE" 2> /dev/null fi - ${VISUAL:-${EDITOR:-vi}} "$MESSAGE" + core_editor="$(git config core.editor)" + ${GIT_EDITOR:-${core_editor:-${VISUAL:-${EDITOR:-vi}}}} "$MESSAGE" grep -v ^# < "$MESSAGE" | git stripspace > "$MESSAGE".processed mv "$MESSAGE".processed "$MESSAGE"
-- 1.6.2.rc0.288.g6852b