{"thread":{"id":"38673","subject":"[PATCH] git: make was_alias non-static","startedAt":"2015-03-01T06:48:51Z","lastAt":"2015-03-01T23:44:20Z","messageCount":2,"participants":["Alexander Kuleshov","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"256795","messageId":"1425192531-11951-1-git-send-email-kuleshovmail@gmail.com","threadId":"38673","inReplyTo":null,"subject":"[PATCH] git: make was_alias non-static","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2015-03-01T06:48:51Z","receivedAt":"2015-03-01T06:48:51Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"'was_alias' variable does not need to store it's value each iteration in the\nloop, anyway this variable changes it's value with run_argv. So it does not\nneed to be static.\n\nSigned-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n---\n git.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git.c b/git.c\nindex 1780233..b8b6520 100644\n--- a/git.c\n+++ b/git.c\n@@ -682,7 +682,7 @@ int main(int argc, char **av)\n \n \twhile (1) {\n \t\tstatic int done_help = 0;\n-\t\tstatic int was_alias = 0;\n+\t\tint was_alias = 0;\n \t\twas_alias = run_argv(&argc, &argv);\n \t\tif (errno != ENOENT)\n \t\t\tbreak;\n-- \n2.3.1.422.ge618558.dirty\n"},{"id":"256812","messageId":"CAPig+cQdFSjN55o7E_F-Xr4HCax+JwzxYG90N0n4UXxe3yxNcg@mail.gmail.com","threadId":"38673","inReplyTo":"1425192531-11951-1-git-send-email-kuleshovmail@gmail.com","subject":"Re: [PATCH] git: make was_alias non-static","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-03-01T23:44:20Z","receivedAt":"2015-03-01T23:44:20Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Mar 1, 2015 at 1:48 AM, Alexander Kuleshov\n<kuleshovmail@gmail.com> wrote:\n> 'was_alias' variable does not need to store it's value each iteration in the\n> loop, anyway this variable changes it's value with run_argv. So it does not\n> need to be static.\n>\n> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n> ---\n>  git.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git.c b/git.c\n> index 1780233..b8b6520 100644\n> --- a/git.c\n> +++ b/git.c\n> @@ -682,7 +682,7 @@ int main(int argc, char **av)\n>\n>         while (1) {\n>                 static int done_help = 0;\n\n'done_help' could receive similar treatment by dropping 'static' and\nmoving it outside the 'while' loop. Doing so would make the logic\neasier to understand.\n\n> -               static int was_alias = 0;\n> +               int was_alias = 0;\n\nNo need for the 0 initialization since 'was_alias' is being assigned\nimmediately below.\n\n>                 was_alias = run_argv(&argc, &argv);\n>                 if (errno != ENOENT)\n>                         break;\n> --\n> 2.3.1.422.ge618558.dirty\n"}]}