{"thread":{"id":"17656","subject":"[PATCH] add -p: get rid of Git.pm warnings about unitialized values","startedAt":"2009-02-08T17:40:39Z","lastAt":"2009-02-08T18:01:25Z","messageCount":2,"participants":["Stephan Beyer","Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"103763","messageId":"1234114839-11958-1-git-send-email-s-beyer@gmx.net","threadId":"17656","inReplyTo":null,"subject":"[PATCH] add -p: get rid of Git.pm warnings about unitialized values","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-02-08T17:40:39Z","receivedAt":"2009-02-08T17:40:39Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"After invoking git add -p I always got the warnings:\n\n Use of uninitialized value $_[3] in exec at Git.pm line 1282.\n Use of uninitialized value $args[2] in join or string at Git.pm line 1264.\n\nA bisect showed that these warnings occur in a301973 \"add -p: print errors\nin separate color\" the first time.\n\nThey can be reproduced by setting color.ui (or color.interactive) to \"auto\"\nand unsetting color.interactive.help and color.interactive.error.\nI am using Perl 5.10.0.\n\nThe reason of the warning is that color.interactive.error defaults to\ncolor.interactive.help which defaults to nothing in the specific codepath.\nIt defaults to 'red bold' some lines above which could lead to the wrong\nassumption that it always defaults to 'red bold' now.\n\nThis patch lets it default to 'red bold', blowing the warnings away.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n git-add--interactive.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex ec47888..5f129a4 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -14,7 +14,8 @@ my ($prompt_color, $header_color, $help_color) =\n \t) : ();\n my $error_color = ();\n if ($menu_use_color) {\n-\tmy $help_color_spec = $repo->config('color.interactive.help');\n+\tmy $help_color_spec = ($repo->config('color.interactive.help') or\n+\t\t\t\t'red bold');\n \t$error_color = $repo->get_color('color.interactive.error',\n \t\t\t\t\t$help_color_spec);\n }\n-- \n1.6.2.rc0.446.g760ba.dirty\n"},{"id":"103765","messageId":"200902081901.44974.trast@student.ethz.ch","threadId":"17656","inReplyTo":"1234114839-11958-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH] add -p: get rid of Git.pm warnings about unitialized values","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-08T18:01:25Z","receivedAt":"2009-02-08T18:01:25Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Stephan Beyer wrote:\n> After invoking git add -p I always got the warnings:\n> \n>  Use of uninitialized value $_[3] in exec at Git.pm line 1282.\n>  Use of uninitialized value $args[2] in join or string at Git.pm line 1264.\n[...]\n> -\tmy $help_color_spec = $repo->config('color.interactive.help');\n> +\tmy $help_color_spec = ($repo->config('color.interactive.help') or\n> +\t\t\t\t'red bold');\n\nAcked-By: Thomas Rast <trast@student.ethz.ch>\n\nThanks for spotting this.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}