Re: [PATCH/RFC 2/2] Provide a build time default-editor setting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2009, 20:43 UTC
- Message-ID
- <7v8weu6idl.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20091029075021.GC15403@progeny.tock>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 5 quoted lines
> Provide a DEFAULT_EDITOR knob to allow the fallback editor (to > use instead of vi if VISUAL, EDITOR, and GIT_EDITOR are unset) to > be set at build time according to a system’s policy. For > example, on Debian systems, the default editor should be the > 'editor' command.
I think we allow things like
GIT_EDITOR='"/c/my program/vi" --i-like-color --config=$HOME/.myvicfg'
and the eval construct in git-sh-setup.sh is about supporting that kind of insanity^Wflexibility.
My "how about" patch on DEFAULT_PAGER might be minimally safe with
make DEFAULT_PAGER="/c/my program/less"
but if you are going to do this for real, you would need to use proper quoting in the Makefile (look for _SQ for hints).
Also I do not think it allows this at all:
make DEFAULT_PAGER='"/c/my program/less" --i-like-color'
It probably is Ok to force the "default" one to be just the path to the command (i.e. not part of command line), but I thought this would be worth pointing out.
> This change makes t7005-editor into a mess. Any ideas for fixing > this?
I think the introduction of DEFAULT_EDITOR makes it unfixable; your DEFAULT_EDITOR may be set to '/usr/bin/vi' not 'vi'.
Just detect DEFAULT_EDITOR being not the default 'vi' and abort/skip the entire test, perhaps?