Re: [PATCH 7/8] Provide a build time default-editor setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> Junio C Hamano wrote:
>> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:
>  
>>> +test_expect_success 'does editor have a simple name (no slashes, etc)?' '
>>> +
>>> +	editor=$(TERM=vt100 git var GIT_EDITOR) &&
>>> +	test -n "$editor" &&
>>> +	simple=t &&
>>> +	case "$editor" in
>>> +	*/* | core_editor | [A-Z]*)
>> 
>> Hmm, what are the latter two cases designed to catch?
>
> Both are meant to allow the test to work without too many changes.

Honestly speaking, my preference is to see if the built-in editor is
exactly spelled as 'v' 'i', and skip this test altogether if it isn't.
Then the patch only needs to insert these lines (and reword "default
editor name too complicated" to "using customized default editor") without
touching the rest.  It simply does not look worth the complication.

You _might_ be able to skip only the "vi" part of the test when you see
that the built-in default is customized, though.  I didn't look closely
enough.

> diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh
> ...
> +unset EDITOR VISUAL GIT_EDITOR
> +
> +test_expect_success 'determine default editor' '
> +
> +	editor=$(TERM=vt100 git var GIT_EDITOR) &&
> +	test -n "$editor"
> +
> +'
> +
> +if ! test -z "$(printf '%s\n' "$editor" | sed '/^[a-z]*$/d')"
> +then
> +	say 'skipping editor tests, default editor name too complicated'
> +	test_done
> +fi
> +
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]