{"thread":{"id":"4746","subject":"[RFC/PATCH] consistently try VISUAL, EDITOR and vi in this order.","startedAt":"2006-07-03T02:47:55Z","lastAt":"2006-07-03T09:24:02Z","messageCount":2,"participants":["Junio C Hamano","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"23080","messageId":"7vmzbrv1yc.fsf@assigned-by-dhcp.cox.net","threadId":"4746","inReplyTo":null,"subject":"[RFC/PATCH] consistently try VISUAL, EDITOR and vi in this order.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-03T02:47:55Z","receivedAt":"2006-07-03T02:47:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"git grep -e VISUAL -e EDITOR revealed this inconsistency.  All\nother commands seem to check VISUAL and then EDITOR as they should.\n\n---\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex c5d9e73..7b81962 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -222,8 +256,7 @@ GIT: for the patch you are writing.\n EOT\n \tclose(C);\n \n-\tmy $editor = $ENV{EDITOR};\n-\t$editor = 'vi' unless defined $editor;\n+\tmy $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';\n \tsystem($editor, $compose_filename);\n \n \topen(C2,\">\",$compose_filename . \".final\")\n"},{"id":"23096","messageId":"e8anmn$ufp$1@sea.gmane.org","threadId":"4746","inReplyTo":"7vmzbrv1yc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC/PATCH] consistently try VISUAL, EDITOR and vi in this order.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-07-03T09:24:02Z","receivedAt":"2006-07-03T09:24:02Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> git grep -e VISUAL -e EDITOR revealed this inconsistency.  All\n> other commands seem to check VISUAL and then EDITOR as they should.\n> \n\n> +     my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';\n>       system($editor, $compose_filename);\n\nShouldn't we check if we are in visual (non CLI-only) environment,\nlike X-Window, MS Windows or MacOS X, before trying to use VISUAL?\nHow other parts solve it? </me checks> Ah, we use VISUAL unconditionally,\nat least in scripts...\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}