diff options
author | David Kastrup <dak@gnu.org> | 2007-08-01 23:47:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-08-01 18:00:17 -0700 |
commit | 08874658b450600e72bb7cb0d0747c1ec4b0bfe1 (patch) | |
tree | 8b87450d24d6a8501a52885b031d1c49f78d3704 /t | |
parent | 21e9757e31d136fad0c04f3ce9da11b8b128b4f2 (diff) | |
download | git-08874658b450600e72bb7cb0d0747c1ec4b0bfe1.tar.gz git-08874658b450600e72bb7cb0d0747c1ec4b0bfe1.tar.xz |
git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands
The previous code only allowed specifying a single executable rather
than a complete command like "emacsclient --alternate-editor vi" in
those variables. Since VISUAL/EDITOR appear to be traditionally
passed to a shell for interpretation (as corroborated with "less",
"mail" and "mailx", while the really ancient "more" indeed allows only
an executable name), the shell function git_editor has been amended
appropriately.
"eval" is employed to have quotes and similar interpreted _after_
expansion, so that specifying
EDITOR='"/home/dak/My Commands/notepad.exe"'
can be used for actually using commands with blanks.
Instead of passing just the first argument of git_editor on, we pass
all of them (so that +lineno might be employed at a later point of
time, or so that multiple files may be edited when appropriate).
Strictly speaking, there is a change in behavior: when
git config core.editor
returns a valid but empty string, the fallbacks are still searched.
This is more consistent, and the old code was problematic with regard
to multiple blanks. Putting in additional quotes might have worked,
but quotes inside of command substitution inside of quotes is nasty
enough to not reliably work the same across "Bourne shells".
Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions