{"thread":{"id":"29967","subject":"[PATCH 5/9] difftool: eliminate setup_environment function","startedAt":"2012-03-17T01:58:54Z","lastAt":"2012-03-17T01:58:54Z","messageCount":1,"participants":["Tim Henigan"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"187121","messageId":"1331949534-15100-1-git-send-email-tim.henigan@gmail.com","threadId":"29967","inReplyTo":null,"subject":"[PATCH 5/9] difftool: eliminate setup_environment function","fromName":"Tim Henigan","fromEmail":"tim.henigan@gmail.com","sentAt":"2012-03-17T01:58:54Z","receivedAt":"2012-03-17T01:58:54Z","isPatch":true,"sender":{"key":"tim.henigan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42022?v=4"},"body":"Removing this function shortens the code and makes it easier to read.\nNow all environment variables are set as part of procedural operation.\n\nSigned-off-by: Tim Henigan <tim.henigan@gmail.com>\n---\n git-difftool.perl |    9 ++-------\n 1 file changed, 2 insertions(+), 7 deletions(-)\n\ndiff --git a/git-difftool.perl b/git-difftool.perl\nindex 99ff587..9495f14 100755\n--- a/git-difftool.perl\n+++ b/git-difftool.perl\n@@ -27,12 +27,6 @@ USAGE\n \texit($exitcode);\n }\n \n-sub setup_environment\n-{\n-\t$ENV{GIT_PAGER} = '';\n-\t$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper';\n-}\n-\n # parse command-line options. all unrecognized options and arguments\n # are passed through to the 'git diff' command.\n my ($difftool_cmd, $extcmd, $gui, $help, $no_prompt, $prompt);\n@@ -76,7 +70,8 @@ elsif (defined($no_prompt)) {\n \t$ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';\n }\n \n-setup_environment();\n+$ENV{GIT_PAGER} = '';\n+$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper';\n my @command = ('git', 'diff', @ARGV);\n \n # ActiveState Perl for Win32 does not implement POSIX semantics of\n-- \n1.7.9.1.290.gbd444\n"}]}