Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:39

Possibly related (same subject, not in this thread)

Jonathan Nieder [off-list ref] writes:
Junio C Hamano wrote:
quoted
Jonathan Nieder [off-list ref] writes:
 
quoted
quoted
+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.
quoted hunk
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
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help