{"thread":{"id":"5062","subject":"Fix up some fallout from \"setup_git_directory()\" cleanups","startedAt":"2006-07-31T20:13:55Z","lastAt":"2006-08-01T05:15:50Z","messageCount":5,"participants":["Linus Torvalds","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24456","messageId":"Pine.LNX.4.64.0607311311060.4168@g5.osdl.org","threadId":"5062","inReplyTo":null,"subject":"Fix up some fallout from \"setup_git_directory()\" cleanups","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-31T20:13:55Z","receivedAt":"2006-07-31T20:13:55Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\ngit-ls-files was broken by the setup_git_directory() calling changes, \nbecause I had missed the fact that the \"prefix\" variable in that file was \nstatic to the whole file, and unlike git-ls-tree (where I had fixed it \nup), it ended up using two different variables with the same name \ndepending on what the scoping happened to be.\n\nThis fixes it up properly (by just removing the static variable, and \npassing the automatic one around properly), and git-ls-files should work \nagain.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\n\nSorry about that.\n\ndiff --git a/builtin-ls-files.c b/builtin-ls-files.c\nindex 79ffe8f..11386c4 100644\n--- a/builtin-ls-files.c\n+++ b/builtin-ls-files.c\n@@ -24,7 +24,6 @@ static int show_valid_bit = 0;\n static int line_terminator = '\\n';\n \n static int prefix_len = 0, prefix_offset = 0;\n-static const char *prefix = NULL;\n static const char **pathspec = NULL;\n static int error_unmatch = 0;\n static char *ps_matched = NULL;\n@@ -207,7 +206,7 @@ static void show_ce_entry(const char *ta\n \t}\n }\n \n-static void show_files(struct dir_struct *dir)\n+static void show_files(struct dir_struct *dir, const char *prefix)\n {\n \tint i;\n \n@@ -253,7 +252,7 @@ static void show_files(struct dir_struct\n /*\n  * Prune the index to only contain stuff starting with \"prefix\"\n  */\n-static void prune_cache(void)\n+static void prune_cache(const char *prefix)\n {\n \tint pos = cache_name_pos(prefix, prefix_len);\n \tunsigned int first, last;\n@@ -276,7 +275,7 @@ static void prune_cache(void)\n \tactive_nr = last;\n }\n \n-static void verify_pathspec(void)\n+static const char *verify_pathspec(const char *prefix)\n {\n \tconst char **p, *n, *prev;\n \tchar *real_prefix;\n@@ -313,7 +312,7 @@ static void verify_pathspec(void)\n \t\tmemcpy(real_prefix, prev, max);\n \t\treal_prefix[max] = 0;\n \t}\n-\tprefix = real_prefix;\n+\treturn real_prefix;\n }\n \n static const char ls_files_usage[] =\n@@ -453,7 +452,7 @@ int cmd_ls_files(int argc, const char **\n \n \t/* Verify that the pathspec matches the prefix */\n \tif (pathspec)\n-\t\tverify_pathspec();\n+\t\tprefix = verify_pathspec(prefix);\n \n \t/* Treat unmatching pathspec elements as errors */\n \tif (pathspec && error_unmatch) {\n@@ -476,8 +475,8 @@ int cmd_ls_files(int argc, const char **\n \n \tread_cache();\n \tif (prefix)\n-\t\tprune_cache();\n-\tshow_files(&dir);\n+\t\tprune_cache(prefix);\n+\tshow_files(&dir, prefix);\n \n \tif (ps_matched) {\n \t\t/* We need to make sure all pathspec matched otherwise\n"},{"id":"24463","messageId":"7v7j1t5tgj.fsf@assigned-by-dhcp.cox.net","threadId":"5062","inReplyTo":"Pine.LNX.4.64.0607311311060.4168@g5.osdl.org","subject":"Re: Fix up some fallout from \"setup_git_directory()\" cleanups","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-31T21:56:44Z","receivedAt":"2006-07-31T21:56:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> git-ls-files was broken by the setup_git_directory() calling changes, \n> because I had missed the fact that the \"prefix\" variable in that file was \n> static to the whole file, and unlike git-ls-tree (where I had fixed it \n> up), it ended up using two different variables with the same name \n> depending on what the scoping happened to be.\n\nThis would have been prevented if the rest of the sources were -Wshadow\nclean.  I once tried to clean things up, but there are tons of\nwarnings in the current code [*1*].\n\nAnother thing that would help us is to have more tests that run\nthings from subdirectories.  Any takers?\n\n\n[Footnote]\n\n*1* They are mostly local variables masking unrelated system\n    library function names.\n\n\nThis deletes more lines than it adds, but I am not sure if it is\nworth it.\n\n-- >8 --\nSubject: [PATCH] -Wshadow\n\nThis renames local variables and parameters to avoid -Wshadow warnings.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n blame.c                 |    9 ++--\n builtin-apply.c         |   36 ++++++++--------\n builtin-diff.c          |    1 \n builtin-fmt-merge-msg.c |    8 ++--\n builtin-grep.c          |    2 -\n builtin-help.c          |    6 +--\n builtin-ls-files.c      |   10 ++---\n builtin-mailinfo.c      |  103 ++++++++++++++++++++++++-----------------------\n builtin-mv.c            |    6 +--\n builtin-prune.c         |    8 ++--\n builtin-push.c          |   10 ++---\n builtin-read-tree.c     |   78 ++++++++++++++++++------------------\n builtin-rev-list.c      |    8 ++--\n builtin-show-branch.c   |    9 ++--\n cache.h                 |    6 +--\n config.c                |    4 +-\n convert-objects.c       |   10 ++---\n daemon.c                |    2 -\n date.c                  |   30 +++++++-------\n delta.h                 |   12 +++--\n diff-delta.c            |   34 ++++++++--------\n fetch-clone.c           |   14 +++---\n fetch.c                 |    6 +--\n fsck-objects.c          |    1 \n git.c                   |    6 +--\n http-fetch.c            |   26 ++++++------\n http-push.c             |   28 ++++++-------\n merge-tree.c            |   18 ++++----\n pack-check.c            |    1 \n pack-objects.c          |   36 ++++++++--------\n path-list.c             |   24 +++++------\n revision.c              |    2 -\n setup.c                 |    2 -\n sha1_file.c             |   60 ++++++++++++++-------------\n tree-walk.c             |   10 ++---\n xdiff/xprepare.c        |    8 ++--\n 36 files changed, 315 insertions(+), 319 deletions(-)\n\ndiff --git a/blame.c b/blame.c\nindex 76712b5..2e8bbe7 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -428,7 +428,6 @@ static void process_commits(struct rev_i\n \tdo {\n \t\tstruct commit_list *parents;\n \t\tint num_parents;\n-\t\tstruct util_info *util;\n \n \t\tif (DEBUG)\n \t\t\tprintf(\"\\nProcessing commit: %d %s\\n\", num_commits,\n@@ -682,16 +681,16 @@ static void get_commit_info(struct commi\n \t*tmp = 0;\n }\n \n-static const char* format_time(unsigned long time, const char* tz_str,\n+static const char* format_time(unsigned long unix_time, const char* tz_str,\n \t\t\t       int show_raw_time)\n {\n \tstatic char time_buf[128];\n-\ttime_t t = time;\n+\ttime_t t = unix_time;\n \tint minutes, tz;\n \tstruct tm *tm;\n \n \tif (show_raw_time) {\n-\t\tsprintf(time_buf, \"%lu %s\", time, tz_str);\n+\t\tsprintf(time_buf, \"%lu %s\", unix_time, tz_str);\n \t\treturn time_buf;\n \t}\n \n@@ -699,7 +698,7 @@ static const char* format_time(unsigned \n \tminutes = tz < 0 ? -tz : tz;\n \tminutes = (minutes / 100)*60 + (minutes % 100);\n \tminutes = tz < 0 ? -minutes : minutes;\n-\tt = time + minutes * 60;\n+\tt = unix_time + minutes * 60;\n \ttm = gmtime(&t);\n \n \tstrftime(time_buf, sizeof(time_buf), \"%Y-%m-%d %H:%M:%S \", tm);\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex f8c6763..25454dd 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -199,7 +199,7 @@ static int name_terminate(const char *na\n \treturn 1;\n }\n \n-static char * find_name(const char *line, char *def, int p_value, int terminate)\n+static char * find_name(const char *line, char *def, int p_val, int terminate)\n {\n \tint len;\n \tconst char *start = line;\n@@ -212,12 +212,12 @@ static char * find_name(const char *line\n \t\tname = unquote_c_style(line, NULL);\n \t\tif (name) {\n \t\t\tchar *cp = name;\n-\t\t\twhile (p_value) {\n+\t\t\twhile (p_val) {\n \t\t\t\tcp = strchr(name, '/');\n \t\t\t\tif (!cp)\n \t\t\t\t\tbreak;\n \t\t\t\tcp++;\n-\t\t\t\tp_value--;\n+\t\t\t\tp_val--;\n \t\t\t}\n \t\t\tif (cp) {\n \t\t\t\t/* name can later be freed, so we need\n@@ -244,7 +244,7 @@ static char * find_name(const char *line\n \t\t\t\tbreak;\n \t\t}\n \t\tline++;\n-\t\tif (c == '/' && !--p_value)\n+\t\tif (c == '/' && !--p_val)\n \t\t\tstart = line;\n \t}\n \tif (!start)\n@@ -601,7 +601,7 @@ static char *git_header_name(char *line,\n \t\tcase '\\t': case ' ':\n \t\t\tsecond = name+len;\n \t\t\tfor (;;) {\n-\t\t\t\tchar c = *second++;\n+\t\t\t\tc = *second++;\n \t\t\t\tif (c == '\\n')\n \t\t\t\t\treturn NULL;\n \t\t\t\tif (c == '/')\n@@ -1152,7 +1152,7 @@ static const char minuses[]= \"----------\n \n static void show_stats(struct patch *patch)\n {\n-\tconst char *prefix = \"\";\n+\tconst char *leading = \"\";\n \tchar *name = patch->new_name;\n \tchar *qname = NULL;\n \tint len, max, add, del, total;\n@@ -1175,7 +1175,7 @@ static void show_stats(struct patch *pat\n \t\tmax = 50;\n \tif (len > max) {\n \t\tchar *slash;\n-\t\tprefix = \"...\";\n+\t\tleading = \"...\";\n \t\tmax -= 3;\n \t\tname += len - max;\n \t\tslash = strchr(name, '/');\n@@ -1201,9 +1201,9 @@ static void show_stats(struct patch *pat\n \t\tdel = total - add;\n \t}\n \tif (patch->is_binary)\n-\t\tprintf(\" %s%-*s |  Bin\\n\", prefix, len, name);\n+\t\tprintf(\" %s%-*s |  Bin\\n\", leading, len, name);\n \telse\n-\t\tprintf(\" %s%-*s |%5d %.*s%.*s\\n\", prefix,\n+\t\tprintf(\" %s%-*s |%5d %.*s%.*s\\n\", leading,\n \t\t       len, name, patch->lines_added + patch->lines_deleted,\n \t\t       add, pluses, del, minuses);\n \tif (qname)\n@@ -1453,7 +1453,7 @@ static int apply_one_fragment(struct buf\n \t\t\toffset = -1;\n \t\tif (offset >= 0) {\n \t\t\tint diff = newsize - oldsize;\n-\t\t\tunsigned long size = desc->size + diff;\n+\t\t\tunsigned long sz = desc->size + diff;\n \t\t\tunsigned long alloc = desc->alloc;\n \n \t\t\t/* Warn if it was necessary to reduce the number\n@@ -1463,14 +1463,14 @@ static int apply_one_fragment(struct buf\n \t\t\t\tfprintf(stderr, \"Context reduced to (%ld/%ld) to apply fragment at %d\\n\",\n \t\t\t\t\tleading, trailing, pos + lines);\n \n-\t\t\tif (size > alloc) {\n-\t\t\t\talloc = size + 8192;\n+\t\t\tif (sz > alloc) {\n+\t\t\t\talloc = sz + 8192;\n \t\t\t\tdesc->alloc = alloc;\n \t\t\t\tbuf = xrealloc(buf, alloc);\n \t\t\t\tdesc->buffer = buf;\n \t\t\t}\n-\t\t\tdesc->size = size;\n-\t\t\tmemmove(buf + offset + newsize, buf + offset + oldsize, size - offset - newsize);\n+\t\t\tdesc->size = sz;\n+\t\t\tmemmove(buf + offset + newsize, buf + offset + oldsize, sz - offset - newsize);\n \t\t\tmemcpy(buf + offset, newlines, newsize);\n \t\t\toffset = 0;\n \n@@ -1827,13 +1827,13 @@ static int check_patch(struct patch *pat\n static int check_patch_list(struct patch *patch)\n {\n \tstruct patch *prev_patch = NULL;\n-\tint error = 0;\n+\tint err = 0;\n \n \tfor (prev_patch = NULL; patch ; patch = patch->next) {\n-\t\terror |= check_patch(patch, prev_patch);\n+\t\terr |= check_patch(patch, prev_patch);\n \t\tprev_patch = patch;\n \t}\n-\treturn error;\n+\treturn err;\n }\n \n static inline int is_null_sha1(const unsigned char *sha1)\n@@ -2268,7 +2268,7 @@ static int git_apply_config(const char *\n }\n \n \n-int cmd_apply(int argc, const char **argv, const char *prefix)\n+int cmd_apply(int argc, const char **argv, const char *unused_prefix)\n {\n \tint i;\n \tint read_stdin = 1;\ndiff --git a/builtin-diff.c b/builtin-diff.c\nindex 48d2fd0..44c39b0 100644\n--- a/builtin-diff.c\n+++ b/builtin-diff.c\n@@ -263,7 +263,6 @@ int cmd_diff(int argc, const char **argv\n \t * default to HEAD by hand.  Eek.\n \t */\n \tif (!rev.pending.nr) {\n-\t\tint i;\n \t\tfor (i = 1; i < argc; i++) {\n \t\t\tconst char *arg = argv[i];\n \t\t\tif (!strcmp(arg, \"--\"))\ndiff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c\nindex c84224e..0c8d50d 100644\n--- a/builtin-fmt-merge-msg.c\n+++ b/builtin-fmt-merge-msg.c\n@@ -138,7 +138,7 @@ static int handle_line(char *line)\n \t}\n \n \tif (!strcmp(\".\", src) || !strcmp(src, origin)) {\n-\t\tint len = strlen(origin);\n+\t\tlen = strlen(origin);\n \t\tif (origin[0] == '\\'' && origin[len - 1] == '\\'') {\n \t\t\tchar *new_origin = malloc(len - 1);\n \t\t\tmemcpy(new_origin, origin + 1, len - 2);\n@@ -338,10 +338,10 @@ int cmd_fmt_merge_msg(int argc, char **a\n \t\tprintf(\" into %s\\n\", current_branch);\n \n \tif (merge_summary) {\n-\t\tstruct commit *head;\n+\t\tstruct commit *head_commit;\n \t\tstruct rev_info rev;\n \n-\t\thead = lookup_commit(head_sha1);\n+\t\thead_commit = lookup_commit(head_sha1);\n \t\tinit_revisions(&rev, prefix);\n \t\trev.commit_format = CMIT_FMT_ONELINE;\n \t\trev.ignore_merges = 1;\n@@ -349,7 +349,7 @@ int cmd_fmt_merge_msg(int argc, char **a\n \n \t\tfor (i = 0; i < origins.nr; i++)\n \t\t\tshortlog(origins.list[i], origins.payload[i],\n-\t\t\t\t\thead, &rev, limit);\n+\t\t\t\t head_commit, &rev, limit);\n \t}\n \n \t/* No cleanup yet; is standalone anyway */\ndiff --git a/builtin-grep.c b/builtin-grep.c\nindex 69b7c48..64cb1eb 100644\n--- a/builtin-grep.c\n+++ b/builtin-grep.c\n@@ -783,7 +783,7 @@ static int external_grep(struct grep_opt\n \t\t\tcontinue;\n \t\tname = ce->name;\n \t\tif (name[0] == '-') {\n-\t\t\tint len = ce_namelen(ce);\n+\t\t\tlen = ce_namelen(ce);\n \t\t\tname = xmalloc(len + 3);\n \t\t\tmemcpy(name, \"./\", 2);\n \t\t\tmemcpy(name + 2, ce->name, len + 1);\ndiff --git a/builtin-help.c b/builtin-help.c\nindex bb0b03f..f86a7c7 100644\n--- a/builtin-help.c\n+++ b/builtin-help.c\n@@ -77,7 +77,7 @@ static int cmdname_compare(const void *a\n \treturn strcmp(a->name, b->name);\n }\n \n-static void pretty_print_string_list(struct cmdname **cmdname, int longest)\n+static void pretty_print_string_list(struct cmdname **name, int longest)\n {\n \tint cols = 1, rows;\n \tint space = longest + 1; /* min 1 SP between words */\n@@ -88,7 +88,7 @@ static void pretty_print_string_list(str\n \t\tcols = max_cols / space;\n \trows = (cmdname_cnt + cols - 1) / cols;\n \n-\tqsort(cmdname, cmdname_cnt, sizeof(*cmdname), cmdname_compare);\n+\tqsort(name, cmdname_cnt, sizeof(*name), cmdname_compare);\n \n \tfor (i = 0; i < rows; i++) {\n \t\tprintf(\"  \");\n@@ -100,7 +100,7 @@ static void pretty_print_string_list(str\n \t\t\t\tbreak;\n \t\t\tif (j == cols-1 || n + rows >= cmdname_cnt)\n \t\t\t\tsize = 1;\n-\t\t\tprintf(\"%-*s\", size, cmdname[n]->name);\n+\t\t\tprintf(\"%-*s\", size, name[n]->name);\n \t\t}\n \t\tputchar('\\n');\n \t}\ndiff --git a/builtin-ls-files.c b/builtin-ls-files.c\nindex 11386c4..17ec3d2 100644\n--- a/builtin-ls-files.c\n+++ b/builtin-ls-files.c\n@@ -40,7 +40,7 @@ static const char *tag_modified = \"\";\n  * Match a pathspec against a filename. The first \"len\" characters\n  * are the common prefix\n  */\n-static int match(const char **spec, char *ps_matched,\n+static int match(const char **spec, char *matched,\n \t\t const char *filename, int len)\n {\n \tconst char *m;\n@@ -60,12 +60,12 @@ static int match(const char **spec, char\n \t\t}\n \t\tif (!fnmatch(m + len, filename + len, 0))\n \t\t\tgoto matched;\n-\t\tif (ps_matched)\n-\t\t\tps_matched++;\n+\t\tif (matched)\n+\t\t\tmatched++;\n \t\tcontinue;\n \tmatched:\n-\t\tif (ps_matched)\n-\t\t\t*ps_matched = 1;\n+\t\tif (matched)\n+\t\t\t*matched = 1;\n \t\treturn 1;\n \t}\n \treturn 0;\ndiff --git a/builtin-mailinfo.c b/builtin-mailinfo.c\nindex 24a4fc6..612f8cf 100644\n--- a/builtin-mailinfo.c\n+++ b/builtin-mailinfo.c\n@@ -18,16 +18,16 @@ static FILE *cmitmsg, *patchfile, *fin, \n \n static int keep_subject = 0;\n static const char *metainfo_charset = NULL;\n-static char line[1000];\n-static char date[1000];\n-static char name[1000];\n-static char email[1000];\n-static char subject[1000];\n+static char line_buf[1000];\n+static char date_buf[1000];\n+static char name_buf[1000];\n+static char email_buf[1000];\n+static char subject_buf[1000];\n \n static enum  {\n \tTE_DONTCARE, TE_QP, TE_BASE64,\n } transfer_encoding;\n-static char charset[256];\n+static char charset_buf[256];\n \n static char multipart_boundary[1000];\n static int multipart_boundary_len;\n@@ -51,7 +51,7 @@ static int bogus_from(char *line)\n \t/* This is fallback, so do not bother if we already have an\n \t * e-mail address.\n \t */\n-\tif (*email)\n+\tif (*email_buf)\n \t\treturn 0;\n \n \tbra = strchr(line, '<');\n@@ -61,15 +61,15 @@ static int bogus_from(char *line)\n \tif (!ket)\n \t\treturn 0;\n \n-\tfor (dst = email, cp = bra+1; cp < ket; )\n+\tfor (dst = email_buf, cp = bra+1; cp < ket; )\n \t\t*dst++ = *cp++;\n \t*dst = 0;\n \tfor (cp = line; isspace(*cp); cp++)\n \t\t;\n \tfor (bra--; isspace(*bra); bra--)\n \t\t*bra = 0;\n-\tcp = sanity_check(cp, email);\n-\tstrcpy(name, cp);\n+\tcp = sanity_check(cp, email_buf);\n+\tstrcpy(name_buf, cp);\n \treturn 1;\n }\n \n@@ -87,7 +87,7 @@ static int handle_from(char *in_line)\n \t/*\n \t * If we already have one email, don't take any confusing lines\n \t */\n-\tif (*email && strchr(at+1, '@'))\n+\tif (*email_buf && strchr(at+1, '@'))\n \t\treturn 0;\n \n \t/* Pick up the string around '@', possibly delimited with <>\n@@ -103,7 +103,7 @@ static int handle_from(char *in_line)\n \t\t}\n \t\tat--;\n \t}\n-\tdst = email;\n+\tdst = email_buf;\n \tfor (;;) {\n \t\tunsigned char c = *at;\n \t\tif (!c || c == '>' || isspace(c)) {\n@@ -140,20 +140,20 @@ static int handle_from(char *in_line)\n \t\t}\n \t\tat++;\n \t}\n-\tat = sanity_check(at, email);\n-\tstrcpy(name, at);\n+\tat = sanity_check(at, email_buf);\n+\tstrcpy(name_buf, at);\n \treturn 1;\n }\n \n static int handle_date(char *line)\n {\n-\tstrcpy(date, line);\n+\tstrcpy(date_buf, line);\n \treturn 0;\n }\n \n static int handle_subject(char *line)\n {\n-\tstrcpy(subject, line);\n+\tstrcpy(subject_buf, line);\n \treturn 0;\n }\n \n@@ -194,11 +194,11 @@ static int handle_subcontent_type(char *\n \t\tfprintf(stderr, \"Not handling nested multipart message.\\n\");\n \t\texit(1);\n \t}\n-\tslurp_attr(line, \"charset=\", charset);\n-\tif (*charset) {\n+\tslurp_attr(line, \"charset=\", charset_buf);\n+\tif (*charset_buf) {\n \t\tint i, c;\n-\t\tfor (i = 0; (c = charset[i]) != 0; i++)\n-\t\t\tcharset[i] = tolower(c);\n+\t\tfor (i = 0; (c = charset_buf[i]) != 0; i++)\n+\t\t\tcharset_buf[i] = tolower(c);\n \t}\n \treturn 0;\n }\n@@ -210,7 +210,7 @@ static int handle_content_type(char *lin\n \t\tmemcpy(multipart_boundary, \"--\", 2);\n \t\tmultipart_boundary_len = strlen(multipart_boundary);\n \t}\n-\tslurp_attr(line, \"charset=\", charset);\n+\tslurp_attr(line, \"charset=\", charset_buf);\n \treturn 0;\n }\n \n@@ -300,7 +300,7 @@ static char *cleanup_subject(char *subje\n \t\treturn subject;\n \tfor (;;) {\n \t\tchar *p;\n-\t\tint len, remove;\n+\t\tint len, strip_len;\n \t\tswitch (*subject) {\n \t\tcase 'r': case 'R':\n \t\t\tif (!memcmp(\"e:\", subject+1, 2)) {\n@@ -319,8 +319,8 @@ static char *cleanup_subject(char *subje\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tlen = strlen(p);\n-\t\t\tremove = p - subject;\n-\t\t\tif (remove <= len *2) {\n+\t\t\tstrip_len = p - subject;\n+\t\t\tif (strip_len <= len *2) {\n \t\t\t\tsubject = p+1;\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -659,14 +659,14 @@ static void handle_info(void)\n {\n \tchar *sub;\n \n-\tsub = cleanup_subject(subject);\n-\tcleanup_space(name);\n-\tcleanup_space(date);\n-\tcleanup_space(email);\n+\tsub = cleanup_subject(subject_buf);\n+\tcleanup_space(name_buf);\n+\tcleanup_space(date_buf);\n+\tcleanup_space(email_buf);\n \tcleanup_space(sub);\n \n \tfprintf(fout, \"Author: %s\\nEmail: %s\\nSubject: %s\\nDate: %s\\n\\n\",\n-\t       name, email, sub, date);\n+\t       name_buf, email_buf, sub, date_buf);\n }\n \n /* We are inside message body and have read line[] already.\n@@ -677,11 +677,12 @@ static int handle_commit_msg(int *seen)\n \tif (!cmitmsg)\n \t\treturn 0;\n \tdo {\n-\t\tif (!memcmp(\"diff -\", line, 6) ||\n-\t\t    !memcmp(\"---\", line, 3) ||\n-\t\t    !memcmp(\"Index: \", line, 7))\n+\t\tif (!memcmp(\"diff -\", line_buf, 6) ||\n+\t\t    !memcmp(\"---\", line_buf, 3) ||\n+\t\t    !memcmp(\"Index: \", line_buf, 7))\n \t\t\tbreak;\n-\t\tif ((multipart_boundary[0] && is_multipart_boundary(line))) {\n+\t\tif ((multipart_boundary[0] &&\n+\t\t     is_multipart_boundary(line_buf))) {\n \t\t\t/* We come here when the first part had only\n \t\t\t * the commit message without any patch.  We\n \t\t\t * pretend we have not seen this line yet, and\n@@ -693,16 +694,16 @@ static int handle_commit_msg(int *seen)\n \t\t/* Unwrap transfer encoding and optionally\n \t\t * normalize the log message to UTF-8.\n \t\t */\n-\t\tdecode_transfer_encoding(line);\n+\t\tdecode_transfer_encoding(line_buf);\n \t\tif (metainfo_charset)\n-\t\t\tconvert_to_utf8(line, charset);\n+\t\t\tconvert_to_utf8(line_buf, charset_buf);\n \n-\t\thandle_inbody_header(seen, line);\n+\t\thandle_inbody_header(seen, line_buf);\n \t\tif (!(*seen & SEEN_PREFIX))\n \t\t\tcontinue;\n \n-\t\tfputs(line, cmitmsg);\n-\t} while (fgets(line, sizeof(line), fin) != NULL);\n+\t\tfputs(line_buf, cmitmsg);\n+\t} while (fgets(line_buf, sizeof(line_buf), fin) != NULL);\n \tfclose(cmitmsg);\n \tcmitmsg = NULL;\n \treturn 0;\n@@ -714,16 +715,16 @@ static int handle_commit_msg(int *seen)\n static void handle_patch(void)\n {\n \tdo {\n-\t\tif (multipart_boundary[0] && is_multipart_boundary(line))\n+\t\tif (multipart_boundary[0] && is_multipart_boundary(line_buf))\n \t\t\tbreak;\n \t\t/* Only unwrap transfer encoding but otherwise do not\n \t\t * do anything.  We do *NOT* want UTF-8 conversion\n \t\t * here; we are dealing with the user payload.\n \t\t */\n-\t\tdecode_transfer_encoding(line);\n-\t\tfputs(line, patchfile);\n+\t\tdecode_transfer_encoding(line_buf);\n+\t\tfputs(line_buf, patchfile);\n \t\tpatch_lines++;\n-\t} while (fgets(line, sizeof(line), fin) != NULL);\n+\t} while (fgets(line_buf, sizeof(line_buf), fin) != NULL);\n }\n \n /* multipart boundary and transfer encoding are set up for us, and we\n@@ -736,10 +737,10 @@ static int handle_multipart_one_part(int\n {\n \tint n = 0;\n \n-\twhile (fgets(line, sizeof(line), fin) != NULL) {\n+\twhile (fgets(line_buf, sizeof(line_buf), fin) != NULL) {\n \tagain:\n \t\tn++;\n-\t\tif (is_multipart_boundary(line))\n+\t\tif (is_multipart_boundary(line_buf))\n \t\t\tbreak;\n \t\tif (handle_commit_msg(seen))\n \t\t\tgoto again;\n@@ -757,8 +758,8 @@ static void handle_multipart_body(void)\n \tint part_num = 0;\n \n \t/* Skip up to the first boundary */\n-\twhile (fgets(line, sizeof(line), fin) != NULL)\n-\t\tif (is_multipart_boundary(line)) {\n+\twhile (fgets(line_buf, sizeof(line_buf), fin) != NULL)\n+\t\tif (is_multipart_boundary(line_buf)) {\n \t\t\tpart_num = 1;\n \t\t\tbreak;\n \t\t}\n@@ -766,16 +767,16 @@ static void handle_multipart_body(void)\n \t\treturn;\n \t/* We are on boundary line.  Start slurping the subhead. */\n \twhile (1) {\n-\t\tint hdr = read_one_header_line(line, sizeof(line), fin);\n+\t\tint hdr = read_one_header_line(line_buf, sizeof(line_buf), fin);\n \t\tif (!hdr) {\n \t\t\tif (handle_multipart_one_part(&seen) < 0)\n \t\t\t\treturn;\n \t\t\t/* Reset per part headers */\n \t\t\ttransfer_encoding = TE_DONTCARE;\n-\t\t\tcharset[0] = 0;\n+\t\t\tcharset_buf[0] = 0;\n \t\t}\n \t\telse\n-\t\t\tcheck_subheader_line(line);\n+\t\t\tcheck_subheader_line(line_buf);\n \t}\n \tfclose(patchfile);\n \tif (!patch_lines) {\n@@ -818,7 +819,7 @@ int mailinfo(FILE *in, FILE *out, int ks\n \t\treturn -1;\n \t}\n \twhile (1) {\n-\t\tint hdr = read_one_header_line(line, sizeof(line), fin);\n+\t\tint hdr = read_one_header_line(line_buf, sizeof(line_buf), fin);\n \t\tif (!hdr) {\n \t\t\tif (multipart_boundary[0])\n \t\t\t\thandle_multipart_body();\n@@ -827,7 +828,7 @@ int mailinfo(FILE *in, FILE *out, int ks\n \t\t\thandle_info();\n \t\t\tbreak;\n \t\t}\n-\t\tcheck_header_line(line);\n+\t\tcheck_header_line(line_buf);\n \t}\n \n \treturn 0;\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex 62ae937..fdaf051 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -267,10 +267,10 @@ next:\n \t} else {\n \t\tfor (i = 0; i < changed.nr; i++) {\n \t\t\tconst char *path = changed.items[i].path;\n-\t\t\tint i = cache_name_pos(path, strlen(path));\n-\t\t\tstruct cache_entry *ce = active_cache[i];\n+\t\t\tint pos = cache_name_pos(path, strlen(path));\n+\t\t\tstruct cache_entry *ce = active_cache[pos];\n \n-\t\t\tif (i < 0)\n+\t\t\tif (pos < 0)\n \t\t\t\tdie (\"Huh? Cache entry for %s unknown?\", path);\n \t\t\trefresh_cache_entry(ce, 0);\n \t\t}\ndiff --git a/builtin-prune.c b/builtin-prune.c\nindex 6a86eb5..717e5dd 100644\n--- a/builtin-prune.c\n+++ b/builtin-prune.c\n@@ -143,19 +143,19 @@ static void process_tag(struct tag *tag,\n \tadd_object(tag->tagged, p, NULL, name);\n }\n \n-static void walk_commit_list(struct rev_info *revs)\n+static void walk_commit_list(struct rev_info *rev)\n {\n \tint i;\n \tstruct commit *commit;\n \tstruct object_array objects = { 0, 0, NULL };\n \n \t/* Walk all commits, process their trees */\n-\twhile ((commit = get_revision(revs)) != NULL)\n+\twhile ((commit = get_revision(rev)) != NULL)\n \t\tprocess_tree(commit->tree, &objects, NULL, \"\");\n \n \t/* Then walk all the pending objects, recursively processing them too */\n-\tfor (i = 0; i < revs->pending.nr; i++) {\n-\t\tstruct object_array_entry *pending = revs->pending.objects + i;\n+\tfor (i = 0; i < rev->pending.nr; i++) {\n+\t\tstruct object_array_entry *pending = rev->pending.objects + i;\n \t\tstruct object *obj = pending->item;\n \t\tconst char *name = pending->name;\n \t\tif (obj->type == OBJ_TAG) {\ndiff --git a/builtin-push.c b/builtin-push.c\nindex a824171..e768923 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -234,7 +234,7 @@ static int do_push(const char *repo)\n \tcommon_argc = argc;\n \n \tfor (i = 0; i < n; i++) {\n-\t\tint error;\n+\t\tint err;\n \t\tint dest_argc = common_argc;\n \t\tint dest_refspec_nr = refspec_nr;\n \t\tconst char **dest_refspec = refspec;\n@@ -250,10 +250,10 @@ static int do_push(const char *repo)\n \t\twhile (dest_refspec_nr--)\n \t\t\targv[dest_argc++] = *dest_refspec++;\n \t\targv[dest_argc] = NULL;\n-\t\terror = run_command_v(argc, argv);\n-\t\tif (!error)\n+\t\terr = run_command_v(argc, argv);\n+\t\tif (!err)\n \t\t\tcontinue;\n-\t\tswitch (error) {\n+\t\tswitch (err) {\n \t\tcase -ERR_RUN_COMMAND_FORK:\n \t\t\tdie(\"unable to fork for %s\", sender);\n \t\tcase -ERR_RUN_COMMAND_EXEC:\n@@ -264,7 +264,7 @@ static int do_push(const char *repo)\n \t\tcase -ERR_RUN_COMMAND_WAITPID_NOEXIT:\n \t\t\tdie(\"%s died with strange error\", sender);\n \t\tdefault:\n-\t\t\treturn -error;\n+\t\t\treturn -err;\n \t\t}\n \t}\n \treturn 0;\ndiff --git a/builtin-read-tree.c b/builtin-read-tree.c\nindex 49c10bf..7fb0bbc 100644\n--- a/builtin-read-tree.c\n+++ b/builtin-read-tree.c\n@@ -483,9 +483,9 @@ static void verify_absent(const char *pa\n \t\t    \"would be %s by merge.\", path, action);\n }\n \n-static int merged_entry(struct cache_entry *merge, struct cache_entry *old)\n+static int merged_entry(struct cache_entry *result, struct cache_entry *old)\n {\n-\tmerge->ce_flags |= htons(CE_UPDATE);\n+\tresult->ce_flags |= htons(CE_UPDATE);\n \tif (old) {\n \t\t/*\n \t\t * See if we can re-use the old CE directly?\n@@ -494,20 +494,20 @@ static int merged_entry(struct cache_ent\n \t\t * This also removes the UPDATE flag on\n \t\t * a match.\n \t\t */\n-\t\tif (same(old, merge)) {\n-\t\t\t*merge = *old;\n+\t\tif (same(old, result)) {\n+\t\t\t*result = *old;\n \t\t} else {\n \t\t\tverify_uptodate(old);\n \t\t\tinvalidate_ce_path(old);\n \t\t}\n \t}\n \telse {\n-\t\tverify_absent(merge->name, \"overwritten\");\n-\t\tinvalidate_ce_path(merge);\n+\t\tverify_absent(result->name, \"overwritten\");\n+\t\tinvalidate_ce_path(result);\n \t}\n \n-\tmerge->ce_flags &= ~htons(CE_STAGEMASK);\n-\tadd_cache_entry(merge, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);\n+\tresult->ce_flags &= ~htons(CE_STAGEMASK);\n+\tadd_cache_entry(result, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);\n \treturn 1;\n }\n \n@@ -547,7 +547,7 @@ #endif\n \n static int threeway_merge(struct cache_entry **stages)\n {\n-\tstruct cache_entry *index;\n+\tstruct cache_entry *cached;\n \tstruct cache_entry *head; \n \tstruct cache_entry *remote = stages[head_idx + 1];\n \tint count;\n@@ -572,7 +572,7 @@ static int threeway_merge(struct cache_e\n \t\t}\n \t}\n \n-\tindex = stages[0];\n+\tcached = stages[0];\n \thead = stages[head_idx];\n \n \tif (head == &df_conflict_entry) {\n@@ -585,8 +585,8 @@ static int threeway_merge(struct cache_e\n \t\tremote = NULL;\n \t}\n \n-\tif (!path && index)\n-\t\tpath = index->name;\n+\tif (!path && cached)\n+\t\tpath = cached->name;\n \tif (!path && head)\n \t\tpath = head->name;\n \tif (!path && remote)\n@@ -612,25 +612,25 @@ static int threeway_merge(struct cache_e\n \t */\n \t/* #14, #14ALT, #2ALT */\n \tif (remote && !df_conflict_head && head_match && !remote_match) {\n-\t\tif (index && !same(index, remote) && !same(index, head))\n-\t\t\treject_merge(index);\n-\t\treturn merged_entry(remote, index);\n+\t\tif (cached && !same(cached, remote) && !same(cached, head))\n+\t\t\treject_merge(cached);\n+\t\treturn merged_entry(remote, cached);\n \t}\n \t/*\n \t * If we have an entry in the index cache, then we want to\n \t * make sure that it matches head.\n \t */\n-\tif (index && !same(index, head)) {\n-\t\treject_merge(index);\n+\tif (cached && !same(cached, head)) {\n+\t\treject_merge(cached);\n \t}\n \n \tif (head) {\n \t\t/* #5ALT, #15 */\n \t\tif (same(head, remote))\n-\t\t\treturn merged_entry(head, index);\n+\t\t\treturn merged_entry(head, cached);\n \t\t/* #13, #3ALT */\n \t\tif (!df_conflict_remote && remote_match && !head_match)\n-\t\t\treturn merged_entry(head, index);\n+\t\t\treturn merged_entry(head, cached);\n \t}\n \n \t/* #1 */\n@@ -650,8 +650,8 @@ static int threeway_merge(struct cache_e\n \t\tif ((head_deleted && remote_deleted) ||\n \t\t    (head_deleted && remote && remote_match) ||\n \t\t    (remote_deleted && head && head_match)) {\n-\t\t\tif (index)\n-\t\t\t\treturn deleted_entry(index, index);\n+\t\t\tif (cached)\n+\t\t\t\treturn deleted_entry(cached, cached);\n \t\t\telse if (path)\n \t\t\t\tverify_absent(path, \"removed\");\n \t\t\treturn 0;\n@@ -660,7 +660,7 @@ static int threeway_merge(struct cache_e\n \t\t * Added in both, identically.\n \t\t */\n \t\tif (no_anc_exists && head && remote && same(head, remote))\n-\t\t\treturn merged_entry(head, index);\n+\t\t\treturn merged_entry(head, cached);\n \n \t}\n \n@@ -668,8 +668,8 @@ static int threeway_merge(struct cache_e\n \t * up-to-date to avoid the files getting overwritten with\n \t * conflict resolution files. \n \t */\n-\tif (index) {\n-\t\tverify_uptodate(index);\n+\tif (cached) {\n+\t\tverify_uptodate(cached);\n \t}\n \telse if (path)\n \t\tverify_absent(path, \"overwritten\");\n@@ -870,7 +870,7 @@ static const char read_tree_usage[] = \"g\n \n static struct lock_file lock_file;\n \n-int cmd_read_tree(int argc, const char **argv, const char *prefix)\n+int cmd_read_tree(int argc, const char **argv, const char *pfx)\n {\n \tint i, newfd, stage = 0;\n \tunsigned char sha1[20];\n@@ -921,9 +921,9 @@ int cmd_read_tree(int argc, const char *\n \t\t * given subdirectory.\n \t\t */\n \t\tif (!strncmp(arg, \"--prefix=\", 9)) {\n-\t\t\tif (stage || merge || prefix)\n+\t\t\tif (stage || merge || pfx)\n \t\t\t\tusage(read_tree_usage);\n-\t\t\tprefix = arg + 9;\n+\t\t\tpfx = arg + 9;\n \t\t\tmerge = 1;\n \t\t\tstage = 1;\n \t\t\tif (read_cache_unmerged())\n@@ -936,7 +936,7 @@ int cmd_read_tree(int argc, const char *\n \t\t * correspond to them.\n \t\t */\n \t\tif (!strcmp(arg, \"--reset\")) {\n-\t\t\tif (stage || merge || prefix)\n+\t\t\tif (stage || merge || pfx)\n \t\t\t\tusage(read_tree_usage);\n \t\t\treset = 1;\n \t\t\tmerge = 1;\n@@ -957,7 +957,7 @@ int cmd_read_tree(int argc, const char *\n \n \t\t/* \"-m\" stands for \"merge\", meaning we start in stage 1 */\n \t\tif (!strcmp(arg, \"-m\")) {\n-\t\t\tif (stage || merge || prefix)\n+\t\t\tif (stage || merge || pfx)\n \t\t\t\tusage(read_tree_usage);\n \t\t\tif (read_cache_unmerged())\n \t\t\t\tdie(\"you need to resolve your current index first\");\n@@ -979,23 +979,23 @@ int cmd_read_tree(int argc, const char *\n \tif ((update||index_only) && !merge)\n \t\tusage(read_tree_usage);\n \n-\tif (prefix) {\n-\t\tint pfxlen = strlen(prefix);\n+\tif (pfx) {\n+\t\tint pfxlen = strlen(pfx);\n \t\tint pos;\n-\t\tif (prefix[pfxlen-1] != '/')\n+\t\tif (pfx[pfxlen-1] != '/')\n \t\t\tdie(\"prefix must end with /\");\n \t\tif (stage != 2)\n \t\t\tdie(\"binding merge takes only one tree\");\n-\t\tpos = cache_name_pos(prefix, pfxlen);\n+\t\tpos = cache_name_pos(pfx, pfxlen);\n \t\tif (0 <= pos)\n \t\t\tdie(\"corrupt index file\");\n \t\tpos = -pos-1;\n \t\tif (pos < active_nr &&\n-\t\t    !strncmp(active_cache[pos]->name, prefix, pfxlen))\n-\t\t\tdie(\"subdirectory '%s' already exists.\", prefix);\n-\t\tpos = cache_name_pos(prefix, pfxlen-1);\n+\t\t    !strncmp(active_cache[pos]->name, pfx, pfxlen))\n+\t\t\tdie(\"subdirectory '%s' already exists.\", pfx);\n+\t\tpos = cache_name_pos(pfx, pfxlen-1);\n \t\tif (0 <= pos)\n-\t\t\tdie(\"file '%.*s' already exists.\", pfxlen-1, prefix);\n+\t\t\tdie(\"file '%.*s' already exists.\", pfxlen-1, pfx);\n \t}\n \n \tif (merge) {\n@@ -1003,7 +1003,7 @@ int cmd_read_tree(int argc, const char *\n \t\t\tdie(\"just how do you expect me to merge %d trees?\", stage-1);\n \t\tswitch (stage - 1) {\n \t\tcase 1:\n-\t\t\tfn = prefix ? bind_merge : oneway_merge;\n+\t\t\tfn = pfx ? bind_merge : oneway_merge;\n \t\t\tbreak;\n \t\tcase 2:\n \t\t\tfn = twoway_merge;\n@@ -1029,7 +1029,7 @@ int cmd_read_tree(int argc, const char *\n \t * valid cache-tree because the index must match exactly\n \t * what came from the tree.\n \t */\n-\tif (trees && trees->item && !prefix && (!merge || (stage == 2))) {\n+\tif (trees && trees->item && !pfx && (!merge || (stage == 2))) {\n \t\tcache_tree_free(&active_cache_tree);\n \t\tprime_cache_tree();\n \t}\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex 0dee173..5223504 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -151,18 +151,18 @@ static void process_tree(struct tree *tr\n \ttree->buffer = NULL;\n }\n \n-static void show_commit_list(struct rev_info *revs)\n+static void show_commit_list(struct rev_info *rev)\n {\n \tint i;\n \tstruct commit *commit;\n \tstruct object_array objects = { 0, 0, NULL };\n \n-\twhile ((commit = get_revision(revs)) != NULL) {\n+\twhile ((commit = get_revision(rev)) != NULL) {\n \t\tprocess_tree(commit->tree, &objects, NULL, \"\");\n \t\tshow_commit(commit);\n \t}\n-\tfor (i = 0; i < revs->pending.nr; i++) {\n-\t\tstruct object_array_entry *pending = revs->pending.objects + i;\n+\tfor (i = 0; i < rev->pending.nr; i++) {\n+\t\tstruct object_array_entry *pending = rev->pending.objects + i;\n \t\tstruct object *obj = pending->item;\n \t\tconst char *name = pending->name;\n \t\tif (obj->flags & (UNINTERESTING | SEEN))\ndiff --git a/builtin-show-branch.c b/builtin-show-branch.c\nindex 2a1b848..8bcf4e3 100644\n--- a/builtin-show-branch.c\n+++ b/builtin-show-branch.c\n@@ -475,7 +475,7 @@ static int show_merge_base(struct commit\n \n static int show_independent(struct commit **rev,\n \t\t\t    int num_rev,\n-\t\t\t    char **ref_name,\n+\t\t\t    char **unused_ref_name,\n \t\t\t    unsigned int *rev_mask)\n {\n \tint i;\n@@ -752,9 +752,10 @@ int cmd_show_branch(int ac, const char *\n \tall_revs = all_mask & ~((1u << REV_SHIFT) - 1);\n \n \twhile (seen) {\n-\t\tstruct commit *commit = pop_one_commit(&seen);\n-\t\tint this_flag = commit->object.flags;\n-\t\tint is_merge_point = ((this_flag & all_revs) == all_revs);\n+\t\tint this_flag, is_merge_point;\n+\t\tcommit = pop_one_commit(&seen);\n+\t\tthis_flag = commit->object.flags;\n+\t\tis_merge_point = ((this_flag & all_revs) == all_revs);\n \n \t\tshown_merge_point |= is_merge_point;\n \ndiff --git a/cache.h b/cache.h\nindex c575b8a..eb9a403 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -240,7 +240,7 @@ extern int check_sha1_signature(const un\n extern int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,\n \t\t\t      size_t bufsize, size_t *bufposn);\n extern int write_sha1_to_fd(int fd, const unsigned char *sha1);\n-extern int move_temp_to_file(const char *tmpfile, char *filename);\n+extern int move_temp_to_file(const char *tmp_file, char *filename);\n \n extern int has_sha1_pack(const unsigned char *sha1);\n extern int has_sha1_file(const unsigned char *sha1);\n@@ -268,8 +268,8 @@ extern void *read_object_with_reference(\n \t\t\t\t\tunsigned long *size,\n \t\t\t\t\tunsigned char *sha1_ret);\n \n-const char *show_date(unsigned long time, int timezone);\n-const char *show_rfc2822_date(unsigned long time, int timezone);\n+const char *show_date(unsigned long unix_time, int time_zone);\n+const char *show_rfc2822_date(unsigned long unix_time, int time_zone);\n int parse_date(const char *date, char *buf, int bufsize);\n void datestamp(char *buf, int bufsize);\n unsigned long approxidate(const char *);\ndiff --git a/config.c b/config.c\nindex 0ac6aeb..49c993e 100644\n--- a/config.c\n+++ b/config.c\n@@ -148,7 +148,7 @@ static int get_extended_base_var(char *n\n \tname[baselen++] = '.';\n \n \tfor (;;) {\n-\t\tint c = get_next_char();\n+\t\tc = get_next_char();\n \t\tif (c == '\\n')\n \t\t\treturn -1;\n \t\tif (c == '\"')\n@@ -618,7 +618,7 @@ int git_config_set_multivar(const char* \n \t} else{\n \t\tstruct stat st;\n \t\tchar* contents;\n-\t\tint i, copy_begin, copy_end, new_line = 0;\n+\t\tint copy_begin, copy_end, new_line = 0;\n \n \t\tif (value_regex == NULL)\n \t\t\tstore.value_regex = NULL;\ndiff --git a/convert-objects.c b/convert-objects.c\nindex ebea8e4..9b92560 100644\n--- a/convert-objects.c\n+++ b/convert-objects.c\n@@ -183,15 +183,15 @@ static unsigned long parse_oldstyle_date\n \t\t\t\treturn mktime(&tm);\n \t\t\tbuf = next;\n \t\t} else {\n-\t\t\tconst char **p = timezones;\n+\t\t\tconst char **tzp = timezones;\n \t\t\twhile (isspace(*buf))\n \t\t\t\tbuf++;\n-\t\t\twhile (*p) {\n-\t\t\t\tif (!memcmp(buf, *p, strlen(*p))) {\n-\t\t\t\t\tbuf += strlen(*p);\n+\t\t\twhile (*tzp) {\n+\t\t\t\tif (!memcmp(buf, *tzp, strlen(*tzp))) {\n+\t\t\t\t\tbuf += strlen(*tzp);\n \t\t\t\t\tbreak;\n \t\t\t\t}\n-\t\t\t\tp++;\n+\t\t\t\ttzp++;\n \t\t\t}\n \t\t}\n \t\tfmt++;\ndiff --git a/daemon.c b/daemon.c\nindex 810837f..ff21a43 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -630,8 +630,6 @@ static int service_loop(int socknum, int\n \tsignal(SIGCHLD, child_handler);\n \n \tfor (;;) {\n-\t\tint i;\n-\n \t\tif (poll(pfd, socknum, -1) < 0) {\n \t\t\tif (errno != EINTR) {\n \t\t\t\terror(\"poll failed, resuming: %s\",\ndiff --git a/date.c b/date.c\nindex 66be23a..c792a90 100644\n--- a/date.c\n+++ b/date.c\n@@ -42,7 +42,7 @@ static const char *weekday_names[] = {\n  * thing, which means that tz -0100 is passed in as the integer -100,\n  * even though it means \"sixty minutes off\"\n  */\n-static struct tm *time_to_tm(unsigned long time, int tz)\n+static struct tm *time_to_tm(unsigned long unix_time, int tz)\n {\n \ttime_t t;\n \tint minutes;\n@@ -50,16 +50,16 @@ static struct tm *time_to_tm(unsigned lo\n \tminutes = tz < 0 ? -tz : tz;\n \tminutes = (minutes / 100)*60 + (minutes % 100);\n \tminutes = tz < 0 ? -minutes : minutes;\n-\tt = time + minutes * 60;\n+\tt = unix_time + minutes * 60;\n \treturn gmtime(&t);\n }\n \n-const char *show_date(unsigned long time, int tz)\n+const char *show_date(unsigned long unix_time, int tz)\n {\n \tstruct tm *tm;\n \tstatic char timebuf[200];\n \n-\ttm = time_to_tm(time, tz);\n+\ttm = time_to_tm(unix_time, tz);\n \tif (!tm)\n \t\treturn NULL;\n \tsprintf(timebuf, \"%.3s %.3s %d %02d:%02d:%02d %d %+05d\",\n@@ -71,12 +71,12 @@ const char *show_date(unsigned long time\n \treturn timebuf;\n }\n \n-const char *show_rfc2822_date(unsigned long time, int tz)\n+const char *show_rfc2822_date(unsigned long unix_time, int tz)\n {\n \tstruct tm *tm;\n \tstatic char timebuf[200];\n \n-\ttm = time_to_tm(time, tz);\n+\ttm = time_to_tm(unix_time, tz);\n \tif (!tm)\n \t\treturn NULL;\n \tsprintf(timebuf, \"%.3s, %d %.3s %d %02d:%02d:%02d %+05d\",\n@@ -335,8 +335,8 @@ static int match_digit(const char *date,\n \t * Seconds since 1970? We trigger on that for anything after Jan 1, 2000\n \t */\n \tif (num > 946684800) {\n-\t\ttime_t time = num;\n-\t\tif (gmtime_r(&time, tm)) {\n+\t\ttime_t unix_time = num;\n+\t\tif (gmtime_r(&unix_time, tm)) {\n \t\t\t*tm_gmt = 1;\n \t\t\treturn end - date;\n \t\t}\n@@ -632,13 +632,13 @@ static const char *approxidate_alpha(con\n \tfor (i = 0; i < 7; i++) {\n \t\tint match = match_string(date, weekday_names[i]);\n \t\tif (match >= 3) {\n-\t\t\tint diff, n = *num -1;\n+\t\t\tint diff, wk = *num -1;\n \t\t\t*num = 0;\n \n \t\t\tdiff = tm->tm_wday - i;\n \t\t\tif (diff <= 0)\n-\t\t\t\tn++;\n-\t\t\tdiff += 7*n;\n+\t\t\t\twk++;\n+\t\t\tdiff += 7*wk;\n \n \t\t\tupdate_tm(tm, diff * 24 * 60 * 60);\n \t\t\treturn end;\n@@ -646,13 +646,13 @@ static const char *approxidate_alpha(con\n \t}\n \n \tif (match_string(date, \"months\") >= 5) {\n-\t\tint n = tm->tm_mon - *num;\n+\t\tint mo = tm->tm_mon - *num;\n \t\t*num = 0;\n-\t\twhile (n < 0) {\n-\t\t\tn += 12;\n+\t\twhile (mo < 0) {\n+\t\t\tmo += 12;\n \t\t\ttm->tm_year--;\n \t\t}\n-\t\ttm->tm_mon = n;\n+\t\ttm->tm_mon = mo;\n \t\treturn end;\n \t}\n \ndiff --git a/delta.h b/delta.h\nindex 7b3f86d..ae8cc47 100644\n--- a/delta.h\n+++ b/delta.h\n@@ -21,7 +21,7 @@ create_delta_index(const void *buf, unsi\n  *\n  * Given pointer must be what create_delta_index() returned, or NULL.\n  */\n-extern void free_delta_index(struct delta_index *index);\n+extern void free_delta_index(struct delta_index *);\n \n /*\n  * create_delta: create a delta from given index for the given buffer\n@@ -34,7 +34,7 @@ extern void free_delta_index(struct delt\n  * must be freed by the caller.\n  */\n extern void *\n-create_delta(const struct delta_index *index,\n+create_delta(const struct delta_index *,\n \t     const void *buf, unsigned long bufsize,\n \t     unsigned long *delta_size, unsigned long max_delta_size);\n \n@@ -51,11 +51,11 @@ diff_delta(const void *src_buf, unsigned\n \t   const void *trg_buf, unsigned long trg_bufsize,\n \t   unsigned long *delta_size, unsigned long max_delta_size)\n {\n-\tstruct delta_index *index = create_delta_index(src_buf, src_bufsize);\n-\tif (index) {\n-\t\tvoid *delta = create_delta(index, trg_buf, trg_bufsize,\n+\tstruct delta_index *delta_index = create_delta_index(src_buf, src_bufsize);\n+\tif (delta_index) {\n+\t\tvoid *delta = create_delta(delta_index, trg_buf, trg_bufsize,\n \t\t\t\t\t   delta_size, max_delta_size);\n-\t\tfree_delta_index(index);\n+\t\tfree_delta_index(delta_index);\n \t\treturn delta;\n \t}\n \treturn NULL;\ndiff --git a/diff-delta.c b/diff-delta.c\nindex 7da9205..dbefc2b 100644\n--- a/diff-delta.c\n+++ b/diff-delta.c\n@@ -139,7 +139,7 @@ struct delta_index * create_delta_index(\n {\n \tunsigned int i, hsize, hmask, entries, prev_val, *hash_count;\n \tconst unsigned char *data, *buffer = buf;\n-\tstruct delta_index *index;\n+\tstruct delta_index *delta_index;\n \tstruct index_entry *entry, **hash;\n \tvoid *mem;\n \tunsigned long memsize;\n@@ -157,27 +157,27 @@ struct delta_index * create_delta_index(\n \thmask = hsize - 1;\n \n \t/* allocate lookup index */\n-\tmemsize = sizeof(*index) +\n+\tmemsize = sizeof(*delta_index) +\n \t\t  sizeof(*hash) * hsize +\n \t\t  sizeof(*entry) * entries;\n \tmem = malloc(memsize);\n \tif (!mem)\n \t\treturn NULL;\n-\tindex = mem;\n-\tmem = index + 1;\n+\tdelta_index = mem;\n+\tmem = delta_index + 1;\n \thash = mem;\n \tmem = hash + hsize;\n \tentry = mem;\n \n-\tindex->src_buf = buf;\n-\tindex->src_size = bufsize;\n-\tindex->hash_mask = hmask;\n+\tdelta_index->src_buf = buf;\n+\tdelta_index->src_size = bufsize;\n+\tdelta_index->hash_mask = hmask;\n \tmemset(hash, 0, hsize * sizeof(*hash));\n \n \t/* allocate an array to count hash entries */\n \thash_count = calloc(hsize, sizeof(*hash_count));\n \tif (!hash_count) {\n-\t\tfree(index);\n+\t\tfree(delta_index);\n \t\treturn NULL;\n \t}\n \n@@ -230,12 +230,12 @@ struct delta_index * create_delta_index(\n \t}\n \tfree(hash_count);\n \n-\treturn index;\n+\treturn delta_index;\n }\n \n-void free_delta_index(struct delta_index *index)\n+void free_delta_index(struct delta_index *delta_index)\n {\n-\tfree(index);\n+\tfree(delta_index);\n }\n \n /*\n@@ -245,7 +245,7 @@ void free_delta_index(struct delta_index\n #define MAX_OP_SIZE\t(5 + 5 + 1 + RABIN_WINDOW + 7)\n \n void *\n-create_delta(const struct delta_index *index,\n+create_delta(const struct delta_index *delta_index,\n \t     const void *trg_buf, unsigned long trg_size,\n \t     unsigned long *delta_size, unsigned long max_size)\n {\n@@ -266,7 +266,7 @@ create_delta(const struct delta_index *i\n \t\treturn NULL;\n \n \t/* store reference buffer size */\n-\ti = index->src_size;\n+\ti = delta_index->src_size;\n \twhile (i >= 0x80) {\n \t\tout[outpos++] = i | 0x80;\n \t\ti >>= 7;\n@@ -281,8 +281,8 @@ create_delta(const struct delta_index *i\n \t}\n \tout[outpos++] = i;\n \n-\tref_data = index->src_buf;\n-\tref_top = ref_data + index->src_size;\n+\tref_data = delta_index->src_buf;\n+\tref_top = ref_data + delta_index->src_size;\n \tdata = trg_buf;\n \ttop = (const unsigned char *) trg_buf + trg_size;\n \n@@ -299,8 +299,8 @@ create_delta(const struct delta_index *i\n \t\tstruct index_entry *entry;\n \t\tval ^= U[data[-RABIN_WINDOW]];\n \t\tval = ((val << 8) | *data) ^ T[val >> RABIN_SHIFT];\n-\t\ti = val & index->hash_mask;\n-\t\tfor (entry = index->hash[i]; entry; entry = entry->next) {\n+\t\ti = val & delta_index->hash_mask;\n+\t\tfor (entry = delta_index->hash[i]; entry; entry = entry->next) {\n \t\t\tconst unsigned char *ref = entry->ptr;\n \t\t\tconst unsigned char *src = data;\n \t\t\tunsigned int ref_size = ref_top - ref;\ndiff --git a/fetch-clone.c b/fetch-clone.c\nindex 81d1371..7eab54e 100644\n--- a/fetch-clone.c\n+++ b/fetch-clone.c\n@@ -208,7 +208,7 @@ #define usec_to_binarymsec(x) ((int)(x) \n \n int receive_keep_pack(int xd[2], const char *me, int quiet, int sideband)\n {\n-\tchar tmpfile[PATH_MAX];\n+\tchar tmp_file[PATH_MAX];\n \tint ofd, ifd, fd[2];\n \tunsigned long total;\n \tstatic struct timeval prev_tv;\n@@ -222,11 +222,11 @@ int receive_keep_pack(int xd[2], const c\n \tsetup_sideband(sideband, me, fd, xd);\n \n \tifd = fd[0];\n-\tsnprintf(tmpfile, sizeof(tmpfile),\n+\tsnprintf(tmp_file, sizeof(tmp_file),\n \t\t \"%s/pack/tmp-XXXXXX\", get_object_directory());\n-\tofd = mkstemp(tmpfile);\n+\tofd = mkstemp(tmp_file);\n \tif (ofd < 0)\n-\t\treturn error(\"unable to create temporary file %s\", tmpfile);\n+\t\treturn error(\"unable to create temporary file %s\", tmp_file);\n \n \tgettimeofday(&prev_tv, NULL);\n \ttotal = 0;\n@@ -242,7 +242,7 @@ int receive_keep_pack(int xd[2], const c\n \t\t\tif (errno != EINTR && errno != EAGAIN) {\n \t\t\t\terror(\"error reading pack (%s)\", strerror(errno));\n \t\t\t\tclose(ofd);\n-\t\t\t\tunlink(tmpfile);\n+\t\t\t\tunlink(tmp_file);\n \t\t\t\treturn -1;\n \t\t\t}\n \t\t\tsz = 0;\n@@ -254,7 +254,7 @@ int receive_keep_pack(int xd[2], const c\n \t\t\t\terror(\"error writing pack (%s)\",\n \t\t\t\t      strerror(errno));\n \t\t\t\tclose(ofd);\n-\t\t\t\tunlink(tmpfile);\n+\t\t\t\tunlink(tmp_file);\n \t\t\t\treturn -1;\n \t\t\t}\n \t\t\tpos += wsz;\n@@ -295,5 +295,5 @@ int receive_keep_pack(int xd[2], const c\n \t\t}\n \t}\n \tclose(ofd);\n-\treturn finish_pack(tmpfile, me);\n+\treturn finish_pack(tmp_file, me);\n }\ndiff --git a/fetch.c b/fetch.c\nindex aeb6bf2..d9cc155 100644\n--- a/fetch.c\n+++ b/fetch.c\n@@ -48,9 +48,9 @@ static int process_tree(struct tree *tre\n \t\tstruct object *obj = NULL;\n \n \t\tif (S_ISDIR(entry.mode)) {\n-\t\t\tstruct tree *tree = lookup_tree(entry.sha1);\n-\t\t\tif (tree)\n-\t\t\t\tobj = &tree->object;\n+\t\t\tstruct tree *subtree = lookup_tree(entry.sha1);\n+\t\t\tif (subtree)\n+\t\t\t\tobj = &subtree->object;\n \t\t}\n \t\telse {\n \t\t\tstruct blob *blob = lookup_blob(entry.sha1);\ndiff --git a/fsck-objects.c b/fsck-objects.c\nindex e167f41..8432f5b 100644\n--- a/fsck-objects.c\n+++ b/fsck-objects.c\n@@ -579,7 +579,6 @@ int main(int argc, char **argv)\n \t}\n \n \tif (keep_cache_objects) {\n-\t\tint i;\n \t\tread_cache();\n \t\tfor (i = 0; i < active_nr; i++) {\n \t\t\tstruct blob *blob = lookup_blob(active_cache[i]->sha1);\ndiff --git a/git.c b/git.c\nindex 7321d6c..876cdee 100644\n--- a/git.c\n+++ b/git.c\n@@ -278,11 +278,11 @@ static void handle_internal_command(int \n \t\tif (p->prefix)\n \t\t\tprefix = setup_git_directory();\n \t\tif (getenv(\"GIT_TRACE\")) {\n-\t\t\tint i;\n+\t\t\tint j;\n \t\t\tfprintf(stderr, \"trace: built-in: git\");\n-\t\t\tfor (i = 0; i < argc; ++i) {\n+\t\t\tfor (j = 0; j < argc; j++) {\n \t\t\t\tfputc(' ', stderr);\n-\t\t\t\tsq_quote_print(stderr, argv[i]);\n+\t\t\t\tsq_quote_print(stderr, argv[j]);\n \t\t\t}\n \t\t\tputc('\\n', stderr);\n \t\t\tfflush(stderr);\ndiff --git a/http-fetch.c b/http-fetch.c\nindex 1aad39b..b8a2ee4 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -425,7 +425,7 @@ static int fetch_index(struct alt_base *\n \tchar *hex = sha1_to_hex(sha1);\n \tchar *filename;\n \tchar *url;\n-\tchar tmpfile[PATH_MAX];\n+\tchar tmp_file[PATH_MAX];\n \tlong prev_posn = 0;\n \tchar range[RANGE_HEADER_SIZE];\n \tstruct curl_slist *range_header = NULL;\n@@ -444,8 +444,8 @@ static int fetch_index(struct alt_base *\n \tsprintf(url, \"%s/objects/pack/pack-%s.idx\", repo->base, hex);\n \n \tfilename = sha1_pack_index_name(sha1);\n-\tsnprintf(tmpfile, sizeof(tmpfile), \"%s.temp\", filename);\n-\tindexfile = fopen(tmpfile, \"a\");\n+\tsnprintf(tmp_file, sizeof(tmp_file), \"%s.temp\", filename);\n+\tindexfile = fopen(tmp_file, \"a\");\n \tif (!indexfile)\n \t\treturn error(\"Unable to open local file %s for pack index\",\n \t\t\t     filename);\n@@ -485,7 +485,7 @@ static int fetch_index(struct alt_base *\n \n \tfclose(indexfile);\n \n-\treturn move_temp_to_file(tmpfile, filename);\n+\treturn move_temp_to_file(tmp_file, filename);\n }\n \n static int setup_index(struct alt_base *repo, unsigned char *sha1)\n@@ -966,7 +966,7 @@ static int fetch_pack(struct alt_base *r\n \tstruct packed_git **lst;\n \tFILE *packfile;\n \tchar *filename;\n-\tchar tmpfile[PATH_MAX];\n+\tchar tmp_file[PATH_MAX];\n \tint ret;\n \tlong prev_posn = 0;\n \tchar range[RANGE_HEADER_SIZE];\n@@ -993,8 +993,8 @@ static int fetch_pack(struct alt_base *r\n \t\trepo->base, sha1_to_hex(target->sha1));\n \n \tfilename = sha1_pack_name(target->sha1);\n-\tsnprintf(tmpfile, sizeof(tmpfile), \"%s.temp\", filename);\n-\tpackfile = fopen(tmpfile, \"a\");\n+\tsnprintf(tmp_file, sizeof(tmp_file), \"%s.temp\", filename);\n+\tpackfile = fopen(tmp_file, \"a\");\n \tif (!packfile)\n \t\treturn error(\"Unable to open local file %s for pack\",\n \t\t\t     filename);\n@@ -1034,7 +1034,7 @@ static int fetch_pack(struct alt_base *r\n \n \tfclose(packfile);\n \n-\tret = move_temp_to_file(tmpfile, filename);\n+\tret = move_temp_to_file(tmp_file, filename);\n \tif (ret)\n \t\treturn ret;\n \n@@ -1185,15 +1185,15 @@ static char *quote_ref_url(const char *b\n int fetch_ref(char *ref, unsigned char *sha1)\n {\n         char *url;\n-        char hex[42];\n+        char ref_hex[42];\n         struct buffer buffer;\n \tconst char *base = alt->base;\n \tstruct active_request_slot *slot;\n \tstruct slot_results results;\n         buffer.size = 41;\n         buffer.posn = 0;\n-        buffer.buffer = hex;\n-        hex[41] = '\\0';\n+        buffer.buffer = ref_hex;\n+        ref_hex[41] = '\\0';\n \n \turl = quote_ref_url(base, ref);\n \tslot = get_active_slot();\n@@ -1211,8 +1211,8 @@ int fetch_ref(char *ref, unsigned char *\n \t\treturn error(\"Unable to start request\");\n \t}\n \n-        hex[40] = '\\0';\n-        get_sha1_hex(hex, sha1);\n+        ref_hex[40] = '\\0';\n+        get_sha1_hex(ref_hex, sha1);\n         return 0;\n }\n \ndiff --git a/http-push.c b/http-push.c\nindex 4021e7d..6bfba58 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -908,7 +908,7 @@ static int fetch_index(unsigned char *sh\n \tchar *hex = sha1_to_hex(sha1);\n \tchar *filename;\n \tchar *url;\n-\tchar tmpfile[PATH_MAX];\n+\tchar tmp_file[PATH_MAX];\n \tlong prev_posn = 0;\n \tchar range[RANGE_HEADER_SIZE];\n \tstruct curl_slist *range_header = NULL;\n@@ -944,8 +944,8 @@ static int fetch_index(unsigned char *sh\n \tsprintf(url, \"%sobjects/pack/pack-%s.idx\", remote->url, hex);\n \n \tfilename = sha1_pack_index_name(sha1);\n-\tsnprintf(tmpfile, sizeof(tmpfile), \"%s.temp\", filename);\n-\tindexfile = fopen(tmpfile, \"a\");\n+\tsnprintf(tmp_file, sizeof(tmp_file), \"%s.temp\", filename);\n+\tindexfile = fopen(tmp_file, \"a\");\n \tif (!indexfile)\n \t\treturn error(\"Unable to open local file %s for pack index\",\n \t\t\t     filename);\n@@ -990,7 +990,7 @@ static int fetch_index(unsigned char *sh\n \tfree(url);\n \tfclose(indexfile);\n \n-\treturn move_temp_to_file(tmpfile, filename);\n+\treturn move_temp_to_file(tmp_file, filename);\n }\n \n static int setup_index(unsigned char *sha1)\n@@ -1123,15 +1123,15 @@ static char *quote_ref_url(const char *b\n int fetch_ref(char *ref, unsigned char *sha1)\n {\n         char *url;\n-        char hex[42];\n+        char ref_hex[42];\n         struct buffer buffer;\n \tchar *base = remote->url;\n \tstruct active_request_slot *slot;\n \tstruct slot_results results;\n         buffer.size = 41;\n         buffer.posn = 0;\n-        buffer.buffer = hex;\n-        hex[41] = '\\0';\n+        buffer.buffer = ref_hex;\n+        ref_hex[41] = '\\0';\n \n \turl = quote_ref_url(base, ref);\n \tslot = get_active_slot();\n@@ -1149,17 +1149,17 @@ int fetch_ref(char *ref, unsigned char *\n \t\treturn error(\"Unable to start request\");\n \t}\n \n-        hex[40] = '\\0';\n-        get_sha1_hex(hex, sha1);\n+        ref_hex[40] = '\\0';\n+        get_sha1_hex(ref_hex, sha1);\n         return 0;\n }\n \n-static void one_remote_object(const char *hex)\n+static void one_remote_object(const char *hex_name)\n {\n \tunsigned char sha1[20];\n \tstruct object *obj;\n \n-\tif (get_sha1_hex(hex, sha1) != 0)\n+\tif (get_sha1_hex(hex_name, sha1) != 0)\n \t\treturn;\n \n \tobj = lookup_object(sha1);\n@@ -1614,11 +1614,11 @@ static void remote_ls(const char *path, \n static void get_remote_object_list(unsigned char parent)\n {\n \tchar path[] = \"objects/XX/\";\n-\tstatic const char hex[] = \"0123456789abcdef\";\n+\tstatic const char lc_hex[] = \"0123456789abcdef\";\n \tunsigned int val = parent;\n \n-\tpath[8] = hex[val >> 4];\n-\tpath[9] = hex[val & 0xf];\n+\tpath[8] = lc_hex[val >> 4];\n+\tpath[9] = lc_hex[val & 0xf];\n \tremote_dir_exists[val] = 0;\n \tremote_ls(path, (PROCESS_FILES | PROCESS_DIRS),\n \t\t  process_ls_object, &val);\ndiff --git a/merge-tree.c b/merge-tree.c\nindex 7cf00be..cd932a1 100644\n--- a/merge-tree.c\n+++ b/merge-tree.c\n@@ -128,10 +128,10 @@ static void show_result_list(struct merg\n {\n \tprintf(\"%s\\n\", explanation(entry));\n \tdo {\n-\t\tstruct merge_list *link = entry->link;\n+\t\tstruct merge_list *lnk = entry->link;\n \t\tstatic const char *desc[4] = { \"result\", \"base\", \"our\", \"their\" };\n \t\tprintf(\"  %-6s %o %s %s\\n\", desc[entry->stage], entry->mode, sha1_to_hex(entry->blob->object.sha1), entry->path);\n-\t\tentry = link;\n+\t\tentry = lnk;\n \t} while (entry);\n }\n \n@@ -168,7 +168,7 @@ static struct merge_list *create_entry(u\n \treturn res;\n }\n \n-static void resolve(const char *base, struct name_entry *branch1, struct name_entry *result)\n+static void resolve(const char *base, struct name_entry *branch1, struct name_entry *res)\n {\n \tstruct merge_list *orig, *final;\n \tconst char *path;\n@@ -177,9 +177,9 @@ static void resolve(const char *base, st\n \tif (!branch1)\n \t\treturn;\n \n-\tpath = strdup(mkpath(\"%s%s\", base, result->path));\n+\tpath = strdup(mkpath(\"%s%s\", base, res->path));\n \torig = create_entry(2, branch1->mode, branch1->sha1, path);\n-\tfinal = create_entry(0, result->mode, result->sha1, path);\n+\tfinal = create_entry(0, res->mode, res->sha1, path);\n \n \tfinal->link = orig;\n \n@@ -226,7 +226,7 @@ static int unresolved_directory(const ch\n static struct merge_list *link_entry(unsigned stage, const char *base, struct name_entry *n, struct merge_list *entry)\n {\n \tconst char *path;\n-\tstruct merge_list *link;\n+\tstruct merge_list *lnk;\n \n \tif (!n->mode)\n \t\treturn entry;\n@@ -234,9 +234,9 @@ static struct merge_list *link_entry(uns\n \t\tpath = entry->path;\n \telse\n \t\tpath = strdup(mkpath(\"%s%s\", base, n->path));\n-\tlink = create_entry(stage, n->mode, n->sha1, path);\n-\tlink->link = entry;\n-\treturn link;\n+\tlnk = create_entry(stage, n->mode, n->sha1, path);\n+\tlnk->link = entry;\n+\treturn lnk;\n }\n \n static void unresolved(const char *base, struct name_entry n[3])\ndiff --git a/pack-check.c b/pack-check.c\nindex 3a62e1b..2188382 100644\n--- a/pack-check.c\n+++ b/pack-check.c\n@@ -41,7 +41,6 @@ static int verify_packfile(struct packed\n \t * we do not do scan-streaming check on the pack file.\n \t */\n \tfor (i = err = 0; i < nr_objects; i++) {\n-\t\tunsigned char sha1[20];\n \t\tstruct pack_entry e;\n \t\tvoid *data;\n \t\tchar type[20];\ndiff --git a/pack-objects.c b/pack-objects.c\nindex 861c7f0..f13dc74 100644\n--- a/pack-objects.c\n+++ b/pack-objects.c\n@@ -153,11 +153,11 @@ static void prepare_pack_revindex(struct\n \tstruct packed_git *p = rix->p;\n \tint num_ent = num_packed_objects(p);\n \tint i;\n-\tvoid *index = p->index_base + 256;\n+\tvoid *idx = p->index_base + 256;\n \n \trix->revindex = xmalloc(sizeof(unsigned long) * (num_ent + 1));\n \tfor (i = 0; i < num_ent; i++) {\n-\t\tunsigned int hl = *((unsigned int *)((char *) index + 24*i));\n+\t\tunsigned int hl = *((unsigned int *)((char *) idx + 24*i));\n \t\trix->revindex[i] = ntohl(hl);\n \t}\n \t/* This knows the pack format -- the 20-byte trailer\n@@ -682,18 +682,18 @@ static void add_pbase_object(struct tree\n \t\t}\n \t\tif (!strcmp(type, tree_type)) {\n \t\t\tstruct tree_desc sub;\n-\t\t\tstruct pbase_tree_cache *tree;\n+\t\t\tstruct pbase_tree_cache *subtree;\n \t\t\tconst char *down = name+cmplen+1;\n \t\t\tint downlen = name_cmp_len(down);\n \n-\t\t\ttree = pbase_tree_get(entry.sha1);\n-\t\t\tif (!tree)\n+\t\t\tsubtree = pbase_tree_get(entry.sha1);\n+\t\t\tif (!subtree)\n \t\t\t\treturn;\n-\t\t\tsub.buf = tree->tree_data;\n-\t\t\tsub.size = tree->tree_size;\n+\t\t\tsub.buf = subtree->tree_data;\n+\t\t\tsub.size = subtree->tree_size;\n \n \t\t\tadd_pbase_object(&sub, down, downlen, fullname);\n-\t\t\tpbase_tree_put(tree);\n+\t\t\tpbase_tree_put(subtree);\n \t\t}\n \t}\n }\n@@ -1058,10 +1058,10 @@ static void progress_interval(int signum\n \tprogress_update = 1;\n }\n \n-static void find_deltas(struct object_entry **list, int window, int depth)\n+static void find_deltas(struct object_entry **list, int win, int depth)\n {\n \tint i, idx;\n-\tunsigned int array_size = window * sizeof(struct unpacked);\n+\tunsigned int array_size = win * sizeof(struct unpacked);\n \tstruct unpacked *array = xmalloc(array_size);\n \tunsigned processed = 0;\n \tunsigned last_percent = 999;\n@@ -1104,12 +1104,12 @@ static void find_deltas(struct object_en\n \t\tn->data = NULL;\n \t\tn->entry = entry;\n \n-\t\tj = window;\n+\t\tj = win;\n \t\twhile (--j > 0) {\n \t\t\tunsigned int other_idx = idx + j;\n \t\t\tstruct unpacked *m;\n-\t\t\tif (other_idx >= window)\n-\t\t\t\tother_idx -= window;\n+\t\t\tif (other_idx >= win)\n+\t\t\t\tother_idx -= win;\n \t\t\tm = array + other_idx;\n \t\t\tif (!m->entry)\n \t\t\t\tbreak;\n@@ -1124,26 +1124,26 @@ static void find_deltas(struct object_en\n \t\t\tcontinue;\n \n \t\tidx++;\n-\t\tif (idx >= window)\n+\t\tif (idx >= win)\n \t\t\tidx = 0;\n \t}\n \n \tif (progress)\n \t\tfputc('\\n', stderr);\n \n-\tfor (i = 0; i < window; ++i) {\n+\tfor (i = 0; i < win; ++i) {\n \t\tfree_delta_index(array[i].index);\n \t\tfree(array[i].data);\n \t}\n \tfree(array);\n }\n \n-static void prepare_pack(int window, int depth)\n+static void prepare_pack(int win, int depth)\n {\n \tget_object_details();\n \tsorted_by_type = create_sorted_list(type_size_sort);\n-\tif (window && depth)\n-\t\tfind_deltas(sorted_by_type, window+1, depth);\n+\tif (win && depth)\n+\t\tfind_deltas(sorted_by_type, win+1, depth);\n }\n \n static int reuse_cached_pack(unsigned char *sha1, int pack_to_stdout)\ndiff --git a/path-list.c b/path-list.c\nindex f15a10d..38aac10 100644\n--- a/path-list.c\n+++ b/path-list.c\n@@ -30,36 +30,36 @@ static int get_entry_index(const struct \n static int add_entry(struct path_list *list, const char *path)\n {\n \tint exact_match;\n-\tint index = get_entry_index(list, path, &exact_match);\n+\tint idx = get_entry_index(list, path, &exact_match);\n \n \tif (exact_match)\n-\t\treturn -1 - index;\n+\t\treturn -1 - idx;\n \n \tif (list->nr + 1 >= list->alloc) {\n \t\tlist->alloc += 32;\n \t\tlist->items = xrealloc(list->items, list->alloc\n \t\t\t\t* sizeof(struct path_list_item));\n \t}\n-\tif (index < list->nr)\n-\t\tmemmove(list->items + index + 1, list->items + index,\n-\t\t\t\t(list->nr - index)\n+\tif (idx < list->nr)\n+\t\tmemmove(list->items + idx + 1, list->items + idx,\n+\t\t\t\t(list->nr - idx)\n \t\t\t\t* sizeof(struct path_list_item));\n-\tlist->items[index].path = list->strdup_paths ?\n+\tlist->items[idx].path = list->strdup_paths ?\n \t\tstrdup(path) : (char *)path;\n-\tlist->items[index].util = NULL;\n+\tlist->items[idx].util = NULL;\n \tlist->nr++;\n \n-\treturn index;\n+\treturn idx;\n }\n \n struct path_list_item *path_list_insert(const char *path, struct path_list *list)\n {\n-\tint index = add_entry(list, path);\n+\tint idx = add_entry(list, path);\n \n-\tif (index < 0)\n-\t\tindex = 1 - index;\n+\tif (idx < 0)\n+\t\tidx = 1 - idx;\n \n-\treturn list->items + index;\n+\treturn list->items + idx;\n }\n \n int path_list_has_path(const struct path_list *list, const char *path)\ndiff --git a/revision.c b/revision.c\nindex a58257a..225913b 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -82,7 +82,7 @@ void mark_parents_uninteresting(struct c\n \tstruct commit_list *parents = commit->parents;\n \n \twhile (parents) {\n-\t\tstruct commit *commit = parents->item;\n+\t\tcommit = parents->item;\n \t\tif (!(commit->object.flags & UNINTERESTING)) {\n \t\t\tcommit->object.flags |= UNINTERESTING;\n \ndiff --git a/setup.c b/setup.c\nindex 358e139..62d77df 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -162,7 +162,7 @@ const char *setup_git_directory_gently(i\n \t */\n \tif (getenv(GIT_DIR_ENVIRONMENT)) {\n \t\tchar path[PATH_MAX];\n-\t\tint len = strlen(getenv(GIT_DIR_ENVIRONMENT));\n+\t\tlen = strlen(getenv(GIT_DIR_ENVIRONMENT));\n \t\tif (sizeof(path) - 40 < len)\n \t\t\tdie(\"'$%s' too big\", GIT_DIR_ENVIRONMENT);\n \t\tmemcpy(path, getenv(GIT_DIR_ENVIRONMENT), len);\ndiff --git a/sha1_file.c b/sha1_file.c\nindex 43bc2ea..08ddf7a 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -382,7 +382,7 @@ static int check_packed_git_idx(const ch\n \t\t\t\tvoid **idx_map_)\n {\n \tvoid *idx_map;\n-\tunsigned int *index;\n+\tunsigned int *idx;\n \tunsigned long idx_size;\n \tint nr, i;\n \tint fd = open(path, O_RDONLY);\n@@ -399,7 +399,7 @@ static int check_packed_git_idx(const ch\n \tif (idx_map == MAP_FAILED)\n \t\treturn -1;\n \n-\tindex = idx_map;\n+\tidx = idx_map;\n \t*idx_map_ = idx_map;\n \t*idx_size_ = idx_size;\n \n@@ -408,7 +408,7 @@ static int check_packed_git_idx(const ch\n \t\treturn error(\"index file too small\");\n \tnr = 0;\n \tfor (i = 0; i < 256; i++) {\n-\t\tunsigned int n = ntohl(index[i]);\n+\t\tunsigned int n = ntohl(idx[i]);\n \t\tif (n < nr)\n \t\t\treturn error(\"non-monotonic index\");\n \t\tnr = n;\n@@ -689,7 +689,7 @@ static int unpack_sha1_header(z_stream *\n \tunsigned char c;\n \tunsigned int word, bits;\n \tunsigned long size;\n-\tstatic const char *typename[8] = {\n+\tstatic const char *type_check[8] = {\n \t\tNULL,\t/* OBJ_EXT */\n \t\t\"commit\", \"tree\", \"blob\", \"tag\",\n \t\tNULL, NULL, NULL\n@@ -716,7 +716,7 @@ static int unpack_sha1_header(z_stream *\n \n \tc = *map++;\n \tmapsize--;\n-\ttype = typename[(c >> 4) & 7];\n+\ttype = type_check[(c >> 4) & 7];\n \tif (!type)\n \t\treturn -1;\n \n@@ -1180,10 +1180,10 @@ int num_packed_objects(const struct pack\n int nth_packed_object_sha1(const struct packed_git *p, int n,\n \t\t\t   unsigned char* sha1)\n {\n-\tvoid *index = p->index_base + 256;\n+\tvoid *idx = p->index_base + 256;\n \tif (n < 0 || num_packed_objects(p) <= n)\n \t\treturn -1;\n-\tmemcpy(sha1, (char *) index + (24 * n) + 4, 20);\n+\tmemcpy(sha1, (char *) idx + (24 * n) + 4, 20);\n \treturn 0;\n }\n \n@@ -1193,13 +1193,13 @@ int find_pack_entry_one(const unsigned c\n \tunsigned int *level1_ofs = p->index_base;\n \tint hi = ntohl(level1_ofs[*sha1]);\n \tint lo = ((*sha1 == 0x0) ? 0 : ntohl(level1_ofs[*sha1 - 1]));\n-\tvoid *index = p->index_base + 256;\n+\tvoid *idx = p->index_base + 256;\n \n \tdo {\n \t\tint mi = (lo + hi) / 2;\n-\t\tint cmp = memcmp((char *) index + (24 * mi) + 4, sha1, 20);\n+\t\tint cmp = memcmp((char *) idx + (24 * mi) + 4, sha1, 20);\n \t\tif (!cmp) {\n-\t\t\te->offset = ntohl(*((unsigned int *) ((char *) index + (24 * mi))));\n+\t\t\te->offset = ntohl(*((unsigned int *) ((char *) idx + (24 * mi))));\n \t\t\tmemcpy(e->sha1, sha1, 20);\n \t\t\te->p = p;\n \t\t\treturn 1;\n@@ -1376,12 +1376,12 @@ char *write_sha1_file_prepare(void *buf,\n  *\n  * Returns the errno on failure, 0 on success.\n  */\n-static int link_temp_to_file(const char *tmpfile, char *filename)\n+static int link_temp_to_file(const char *tmp_file, char *filename)\n {\n \tint ret;\n \tchar *dir;\n \n-\tif (!link(tmpfile, filename))\n+\tif (!link(tmp_file, filename))\n \t\treturn 0;\n \n \t/*\n@@ -1399,7 +1399,7 @@ static int link_temp_to_file(const char \n \t\tif (adjust_shared_perm(filename))\n \t\t\treturn -2;\n \t\t*dir = '/';\n-\t\tif (!link(tmpfile, filename))\n+\t\tif (!link(tmp_file, filename))\n \t\t\treturn 0;\n \t\tret = errno;\n \t}\n@@ -1409,9 +1409,9 @@ static int link_temp_to_file(const char \n /*\n  * Move the just written object into its final resting place\n  */\n-int move_temp_to_file(const char *tmpfile, char *filename)\n+int move_temp_to_file(const char *tmp_file, char *filename)\n {\n-\tint ret = link_temp_to_file(tmpfile, filename);\n+\tint ret = link_temp_to_file(tmp_file, filename);\n \n \t/*\n \t * Coda hack - coda doesn't like cross-directory links,\n@@ -1425,11 +1425,11 @@ int move_temp_to_file(const char *tmpfil\n \t * left to unlink.\n \t */\n \tif (ret && ret != EEXIST) {\n-\t\tif (!rename(tmpfile, filename))\n+\t\tif (!rename(tmp_file, filename))\n \t\t\treturn 0;\n \t\tret = errno;\n \t}\n-\tunlink(tmpfile);\n+\tunlink(tmp_file);\n \tif (ret) {\n \t\tif (ret != EEXIST) {\n \t\t\tfprintf(stderr, \"unable to write sha1 filename %s: %s\\n\", filename, strerror(ret));\n@@ -1510,7 +1510,7 @@ int write_sha1_file(void *buf, unsigned \n \tz_stream stream;\n \tunsigned char sha1[20];\n \tchar *filename;\n-\tstatic char tmpfile[PATH_MAX];\n+\tstatic char tmp_file[PATH_MAX];\n \tunsigned char hdr[50];\n \tint fd, hdrlen;\n \n@@ -1537,11 +1537,11 @@ int write_sha1_file(void *buf, unsigned \n \t\treturn -1;\n \t}\n \n-\tsnprintf(tmpfile, sizeof(tmpfile), \"%s/obj_XXXXXX\", get_object_directory());\n+\tsnprintf(tmp_file, sizeof(tmp_file), \"%s/obj_XXXXXX\", get_object_directory());\n \n-\tfd = mkstemp(tmpfile);\n+\tfd = mkstemp(tmp_file);\n \tif (fd < 0) {\n-\t\tfprintf(stderr, \"unable to create temporary sha1 filename %s: %s\\n\", tmpfile, strerror(errno));\n+\t\tfprintf(stderr, \"unable to create temporary sha1 filename %s: %s\\n\", tmp_file, strerror(errno));\n \t\treturn -1;\n \t}\n \n@@ -1574,7 +1574,7 @@ int write_sha1_file(void *buf, unsigned \n \tclose(fd);\n \tfree(compressed);\n \n-\treturn move_temp_to_file(tmpfile, filename);\n+\treturn move_temp_to_file(tmp_file, filename);\n }\n \n /*\n@@ -1646,7 +1646,7 @@ int write_sha1_to_fd(int fd, const unsig\n int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,\n \t\t       size_t bufsize, size_t *bufposn)\n {\n-\tchar tmpfile[PATH_MAX];\n+\tchar tmp_file[PATH_MAX];\n \tint local;\n \tz_stream stream;\n \tunsigned char real_sha1[20];\n@@ -1654,12 +1654,12 @@ int write_sha1_from_fd(const unsigned ch\n \tint ret;\n \tSHA_CTX c;\n \n-\tsnprintf(tmpfile, sizeof(tmpfile), \"%s/obj_XXXXXX\", get_object_directory());\n+\tsnprintf(tmp_file, sizeof(tmp_file), \"%s/obj_XXXXXX\", get_object_directory());\n \n-\tlocal = mkstemp(tmpfile);\n+\tlocal = mkstemp(tmp_file);\n \tif (local < 0)\n \t\treturn error(\"Couldn't open %s for %s\",\n-\t\t\t     tmpfile, sha1_to_hex(sha1));\n+\t\t\t     tmp_file, sha1_to_hex(sha1));\n \n \tmemset(&stream, 0, sizeof(stream));\n \n@@ -1690,7 +1690,7 @@ int write_sha1_from_fd(const unsigned ch\n \t\tsize = read(fd, buffer + *bufposn, bufsize - *bufposn);\n \t\tif (size <= 0) {\n \t\t\tclose(local);\n-\t\t\tunlink(tmpfile);\n+\t\t\tunlink(tmp_file);\n \t\t\tif (!size)\n \t\t\t\treturn error(\"Connection closed?\");\n \t\t\tperror(\"Reading from connection\");\n@@ -1703,15 +1703,15 @@ int write_sha1_from_fd(const unsigned ch\n \tclose(local);\n \tSHA1_Final(real_sha1, &c);\n \tif (ret != Z_STREAM_END) {\n-\t\tunlink(tmpfile);\n+\t\tunlink(tmp_file);\n \t\treturn error(\"File %s corrupted\", sha1_to_hex(sha1));\n \t}\n \tif (memcmp(sha1, real_sha1, 20)) {\n-\t\tunlink(tmpfile);\n+\t\tunlink(tmp_file);\n \t\treturn error(\"File %s has bad hash\", sha1_to_hex(sha1));\n \t}\n \n-\treturn move_temp_to_file(tmpfile, sha1_file_name(sha1));\n+\treturn move_temp_to_file(tmp_file, sha1_file_name(sha1));\n }\n \n int has_pack_index(const unsigned char *sha1)\ndiff --git a/tree-walk.c b/tree-walk.c\nindex 3f83e98..9033c94 100644\n--- a/tree-walk.c\n+++ b/tree-walk.c\n@@ -113,7 +113,7 @@ void traverse_trees(int n, struct tree_d\n \tstruct name_entry *entry = xmalloc(n*sizeof(*entry));\n \n \tfor (;;) {\n-\t\tstruct name_entry entry[3];\n+\t\tstruct name_entry ent[3];\n \t\tunsigned long mask = 0;\n \t\tint i, last;\n \n@@ -121,9 +121,9 @@ void traverse_trees(int n, struct tree_d\n \t\tfor (i = 0; i < n; i++) {\n \t\t\tif (!t[i].size)\n \t\t\t\tcontinue;\n-\t\t\tentry_extract(t+i, entry+i);\n+\t\t\tentry_extract(t+i, ent+i);\n \t\t\tif (last >= 0) {\n-\t\t\t\tint cmp = entry_compare(entry+i, entry+last);\n+\t\t\t\tint cmp = entry_compare(ent+i, ent+last);\n \n \t\t\t\t/*\n \t\t\t\t * Is the new name bigger than the old one?\n@@ -153,9 +153,9 @@ void traverse_trees(int n, struct tree_d\n \t\t\t\tupdate_tree_entry(t+i);\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tentry_clear(entry + i);\n+\t\t\tentry_clear(ent + i);\n \t\t}\n-\t\tcallback(n, mask, entry, base);\n+\t\tcallback(n, mask, ent, base);\n \t}\n \tfree(entry);\n }\ndiff --git a/xdiff/xprepare.c b/xdiff/xprepare.c\nindex 1be7b31..4fa55bd 100644\n--- a/xdiff/xprepare.c\n+++ b/xdiff/xprepare.c\n@@ -145,7 +145,7 @@ static int xdl_prepare_ctx(mmfile_t *mf,\n \txrecord_t **rhash;\n \tunsigned long *ha;\n \tchar *rchg;\n-\tlong *rindex;\n+\tlong *r_idx;\n \n \tif (xdl_cha_init(&xdf->rcha, sizeof(xrecord_t), narec / 4 + 1) < 0) {\n \n@@ -220,7 +220,7 @@ static int xdl_prepare_ctx(mmfile_t *mf,\n \t}\n \tmemset(rchg, 0, (nrec + 2) * sizeof(char));\n \n-\tif (!(rindex = (long *) xdl_malloc((nrec + 1) * sizeof(long)))) {\n+\tif (!(r_idx = (long *) xdl_malloc((nrec + 1) * sizeof(long)))) {\n \n \t\txdl_free(rchg);\n \t\txdl_free(rhash);\n@@ -230,7 +230,7 @@ static int xdl_prepare_ctx(mmfile_t *mf,\n \t}\n \tif (!(ha = (unsigned long *) xdl_malloc((nrec + 1) * sizeof(unsigned long)))) {\n \n-\t\txdl_free(rindex);\n+\t\txdl_free(r_idx);\n \t\txdl_free(rchg);\n \t\txdl_free(rhash);\n \t\txdl_free(recs);\n@@ -243,7 +243,7 @@ static int xdl_prepare_ctx(mmfile_t *mf,\n \txdf->hbits = hbits;\n \txdf->rhash = rhash;\n \txdf->rchg = rchg + 1;\n-\txdf->rindex = rindex;\n+\txdf->rindex = r_idx;\n \txdf->nreff = 0;\n \txdf->ha = ha;\n \txdf->dstart = 0;\n-- \n1.4.2.rc2.gfbfdd\n"},{"id":"24465","messageId":"Pine.LNX.4.64.0607311508060.4168@g5.osdl.org","threadId":"5062","inReplyTo":"7v7j1t5tgj.fsf@assigned-by-dhcp.cox.net","subject":"Re: Fix up some fallout from \"setup_git_directory()\" cleanups","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-31T22:21:04Z","receivedAt":"2006-07-31T22:21:04Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 31 Jul 2006, Junio C Hamano wrote:\n> \n> This would have been prevented if the rest of the sources were -Wshadow\n> clean.\n\nWell, the _real_ problem is that \"-Wshadow\" is such a crappy switch.\n\nFor example, there is absolutely no reason to warn about every local \nvariable called \"link\", just because it shadows the unistd.h \"link()\" \nfunction.\n\nSo I tend to think that -Wshadow is actively wrong, because it makes \npeople write crappier code by forcing them to avoid not just the (few) C \nkeywords as variable names, but also the _millions_ of names exported by \nvarious standard header files.\n\nWhich is sad. \"-Wshadow\" _would_ be useful, if it had been designed right. \nBut that definitely implies _not_ warning about name clashes that are also \nobvious type clashes.\n\nFor example, there's basically absolutely zero reason to warn about \nsomething clashing with a function. If you are crazy and use nested \nfunctions in gcc, it's still obvious _which_ function you'd ever mean. So \n\"-Wshadow\" simply should _never_ warn about clashing with the external \n\"link()\" declaration, and certainly not for a regular \"int link\" kind of \nautomatic variable definition.\n\nThere's also seldom (if ever) any reason to warn about a pointer variable \nbeing shadowed by an integer one. If you use the wrong one, you'll get a \ntype warning, so why would you really care? \n\n> I once tried to clean things up, but there are tons of\n> warnings in the current code [*1*].\n\nAnd, looking at your patch, they all (or a huge majority of them) seem to \nbe totally bogus (ie the code is fine, the -Wshadow warning is crap).\n\n> Another thing that would help us is to have more tests that run\n> things from subdirectories.  Any takers?\n\nThis, btw, didn't just hit \"git ls-files\" when run in a subdirectory, it \nhit pretty much any use of \"git ls-files\" with a path specifier that \nincluded a directory. I don't think we have many uses of that, and at \nleast one of the few tests for path specifiers (t3002) only tests in the \ncurrent directory, no paths.\n\n\t\t\tLinus\n"},{"id":"24471","messageId":"Pine.LNX.4.63.0608010118280.27436@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5062","inReplyTo":"Pine.LNX.4.64.0607311508060.4168@g5.osdl.org","subject":"Re: Fix up some fallout from \"setup_git_directory()\" cleanups","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-31T23:19:17Z","receivedAt":"2006-07-31T23:19:17Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 31 Jul 2006, Linus Torvalds wrote:\n\n> \"-Wshadow\" _would_ be useful, if it had been designed right. But that \n> definitely implies _not_ warning about name clashes that are also \n> obvious type clashes.\n\nWouldn't this just be a _perfect_ task for 'sparse'?\n\nCiao,\nDscho\n"},{"id":"24488","messageId":"Pine.LNX.4.64.0607312215120.4168@g5.osdl.org","threadId":"5062","inReplyTo":"Pine.LNX.4.63.0608010118280.27436@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Fix up some fallout from \"setup_git_directory()\" cleanups","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-08-01T05:15:50Z","receivedAt":"2006-08-01T05:15:50Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 1 Aug 2006, Johannes Schindelin wrote:\n> \n> Wouldn't this just be a _perfect_ task for 'sparse'?\n\nSomething like this?\n\n\t\tLinus\n---\nbuiltin-diff.c:266:7: warning: symbol 'i' shadows an earlier one\nbuiltin-diff.c:226:6: originally declared here\n\nbuiltin-fmt-merge-msg.c:141:7: warning: symbol 'len' shadows an earlier one\nbuiltin-fmt-merge-msg.c:75:9: originally declared here\n\nbuiltin-fmt-merge-msg.c:341:17: warning: symbol 'head' shadows an earlier one\nbuiltin-fmt-merge-msg.c:252:13: originally declared here\n\nbuiltin-mv.c:270:8: warning: symbol 'i' shadows an earlier one\nbuiltin-mv.c:61:6: originally declared here\n\nbuiltin-show-branch.c:755:17: warning: symbol 'commit' shadows an earlier one\nbuiltin-show-branch.c:555:32: originally declared here\n\nconvert-objects.c:186:15: warning: symbol 'p' shadows an earlier one\nconvert-objects.c:154:10: originally declared here\n\ndate.c:635:14: warning: symbol 'n' shadows an earlier one\ndate.c:587:6: originally declared here\n\ndate.c:649:7: warning: symbol 'n' shadows an earlier one\ndate.c:587:6: originally declared here\n\nfetch.c:51:16: warning: symbol 'tree' shadows an earlier one\nfetch.c:37:37: originally declared here\n\nfsck-objects.c:582:7: warning: symbol 'i' shadows an earlier one\nfsck-objects.c:485:6: originally declared here\n\ngit.c:281:8: warning: symbol 'i' shadows an earlier one\ngit.c:263:6: originally declared here\n\npack-check.c:44:17: warning: symbol 'sha1' shadows an earlier one\npack-check.c:9:16: originally declared here\n\npack-objects.c:685:28: warning: symbol 'tree' shadows an earlier one\npack-objects.c:662:47: originally declared here\n\nrevision.c:85:17: warning: symbol 'commit' shadows an earlier one\nrevision.c:80:47: originally declared here\n\nsetup.c:165:7: warning: symbol 'len' shadows an earlier one\nsetup.c:156:6: originally declared here\n\ntree-walk.c:116:21: warning: symbol 'entry' shadows an earlier one\ntree-walk.c:113:20: originally declared here\n"}]}