{"thread":{"id":"5017","subject":"[PATCH 1/6] merge-recur: Convert variable names to lower_case","startedAt":"2006-07-27T17:12:29Z","lastAt":"2006-07-27T17:12:29Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"24224","messageId":"Pine.LNX.4.63.0607271912020.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5017","inReplyTo":null,"subject":"[PATCH 1/6] merge-recur: Convert variable names to lower_case","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-27T17:12:29Z","receivedAt":"2006-07-27T17:12:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n merge-recursive.c |  380 ++++++++++++++++++++++++++---------------------------\n 1 files changed, 189 insertions(+), 191 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 85bb47a..b0035cc 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -122,8 +122,8 @@ struct stage_data\n \tunsigned processed:1;\n };\n \n-static struct path_list currentFileSet = {NULL, 0, 0, 1};\n-static struct path_list currentDirectorySet = {NULL, 0, 0, 1};\n+static struct path_list current_file_set = {NULL, 0, 0, 1};\n+static struct path_list current_directory_set = {NULL, 0, 0, 1};\n \n static int output_indent = 0;\n \n@@ -335,9 +335,9 @@ static int save_files_dirs(const unsigne\n \tnewpath[baselen + len] = '\\0';\n \n \tif (S_ISDIR(mode))\n-\t\tpath_list_insert(newpath, &currentDirectorySet);\n+\t\tpath_list_insert(newpath, &current_directory_set);\n \telse\n-\t\tpath_list_insert(newpath, &currentFileSet);\n+\t\tpath_list_insert(newpath, &current_file_set);\n \tfree(newpath);\n \n \treturn READ_TREE_RECURSIVE;\n@@ -351,7 +351,7 @@ static int get_files_dirs(struct tree *t\n \t\tdebug(\"  get_files_dirs done (0)\\n\");\n \t\treturn 0;\n \t}\n-\tn = currentFileSet.nr + currentDirectorySet.nr;\n+\tn = current_file_set.nr + current_directory_set.nr;\n \tdebug(\"  get_files_dirs done (%d)\\n\", n);\n \treturn n;\n }\n@@ -378,7 +378,7 @@ static struct stage_data *insert_stage_d\n }\n \n /*\n- * Create a dictionary mapping file names to CacheEntry objects. The\n+ * Create a dictionary mapping file names to stage_data objects. The\n  * dictionary contains one entry for every path with a non-zero stage entry.\n  */\n static struct path_list *get_unmerged(void)\n@@ -420,15 +420,15 @@ struct rename\n };\n \n /*\n- * Get information of all renames which occured between 'oTree' and\n- * 'tree'. We need the three trees in the merge ('oTree', 'aTree' and\n- * 'bTree') to be able to associate the correct cache entries with\n- * the rename information. 'tree' is always equal to either aTree or bTree.\n+ * Get information of all renames which occured between 'o_tree' and\n+ * 'tree'. We need the three trees in the merge ('o_tree', 'a_tree' and\n+ * 'b_tree') to be able to associate the correct cache entries with\n+ * the rename information. 'tree' is always equal to either a_tree or b_tree.\n  */\n static struct path_list *get_renames(struct tree *tree,\n-\t\t\t\t\tstruct tree *oTree,\n-\t\t\t\t\tstruct tree *aTree,\n-\t\t\t\t\tstruct tree *bTree,\n+\t\t\t\t\tstruct tree *o_tree,\n+\t\t\t\t\tstruct tree *a_tree,\n+\t\t\t\t\tstruct tree *b_tree,\n \t\t\t\t\tstruct path_list *entries)\n {\n \tint i;\n@@ -437,7 +437,7 @@ static struct path_list *get_renames(str\n #ifdef DEBUG\n \ttime_t t = time(0);\n \n-\tdebug(\"getRenames ...\\n\");\n+\tdebug(\"get_renames ...\\n\");\n #endif\n \n \trenames = xcalloc(1, sizeof(struct path_list));\n@@ -447,7 +447,7 @@ #endif\n \topts.output_format = DIFF_FORMAT_NO_OUTPUT;\n \tif (diff_setup_done(&opts) < 0)\n \t\tdie(\"diff setup failed\");\n-\tdiff_tree_sha1(oTree->object.sha1, tree->object.sha1, \"\", &opts);\n+\tdiff_tree_sha1(o_tree->object.sha1, tree->object.sha1, \"\", &opts);\n \tdiffcore_std(&opts);\n \tfor (i = 0; i < diff_queued_diff.nr; ++i) {\n \t\tstruct path_list_item *item;\n@@ -463,14 +463,14 @@ #endif\n \t\titem = path_list_lookup(re->pair->one->path, entries);\n \t\tif (!item)\n \t\t\tre->src_entry = insert_stage_data(re->pair->one->path,\n-\t\t\t\t\toTree, aTree, bTree, entries);\n+\t\t\t\t\to_tree, a_tree, b_tree, entries);\n \t\telse\n \t\t\tre->src_entry = item->util;\n \n \t\titem = path_list_lookup(re->pair->two->path, entries);\n \t\tif (!item)\n \t\t\tre->dst_entry = insert_stage_data(re->pair->two->path,\n-\t\t\t\t\toTree, aTree, bTree, entries);\n+\t\t\t\t\to_tree, a_tree, b_tree, entries);\n \t\telse\n \t\t\tre->dst_entry = item->util;\n \t\titem = path_list_insert(pair->one->path, renames);\n@@ -480,7 +480,7 @@ #endif\n \tdiff_queued_diff.nr = 0;\n \tdiff_flush(&opts);\n #ifdef DEBUG\n-\tdebug(\"  getRenames done in %ld\\n\", time(0)-t);\n+\tdebug(\"  get_renames done in %ld\\n\", time(0)-t);\n #endif\n \treturn renames;\n }\n@@ -526,25 +526,23 @@ static int remove_path(const char *name)\n \treturn ret;\n }\n \n-/* General TODO: unC99ify the code: no declaration after code */\n-/* General TODO: no javaIfiCation: rename updateCache to update_cache */\n /*\n  * TODO: once we no longer call external programs, we'd probably be better off\n  * not setting / getting the environment variable GIT_INDEX_FILE all the time.\n  */\n int remove_file(int clean, const char *path)\n {\n-\tint updateCache = index_only || clean;\n-\tint updateWd = !index_only;\n+\tint update_cache = index_only || clean;\n+\tint update_working_directory = !index_only;\n \n-\tif (updateCache) {\n+\tif (update_cache) {\n \t\tif (!cache_dirty)\n \t\t\tread_cache_from(getenv(\"GIT_INDEX_FILE\"));\n \t\tcache_dirty++;\n \t\tif (remove_file_from_cache(path))\n \t\t\treturn -1;\n \t}\n-\tif (updateWd)\n+\tif (update_working_directory)\n \t{\n \t\tunlink(path);\n \t\tif (errno != ENOENT || errno != EISDIR)\n@@ -566,12 +564,12 @@ static char *unique_path(const char *pat\n \tfor (; *p; ++p)\n \t\tif ('/' == *p)\n \t\t\t*p = '_';\n-\twhile (path_list_has_path(&currentFileSet, newpath) ||\n-\t       path_list_has_path(&currentDirectorySet, newpath) ||\n+\twhile (path_list_has_path(&current_file_set, newpath) ||\n+\t       path_list_has_path(&current_directory_set, newpath) ||\n \t       lstat(newpath, &st) == 0)\n \t\tsprintf(p, \"_%d\", suffix++);\n \n-\tpath_list_insert(newpath, &currentFileSet);\n+\tpath_list_insert(newpath, &current_file_set);\n \treturn newpath;\n }\n \n@@ -784,22 +782,22 @@ static void conflict_rename_rename(struc\n \tint delp = 0;\n \tconst char *ren1_dst = ren1->pair->two->path;\n \tconst char *ren2_dst = ren2->pair->two->path;\n-\tconst char *dstName1 = ren1_dst;\n-\tconst char *dstName2 = ren2_dst;\n-\tif (path_list_has_path(&currentDirectorySet, ren1_dst)) {\n-\t\tdstName1 = del[delp++] = unique_path(ren1_dst, branch1);\n+\tconst char *dst_name1 = ren1_dst;\n+\tconst char *dst_name2 = ren2_dst;\n+\tif (path_list_has_path(&current_directory_set, ren1_dst)) {\n+\t\tdst_name1 = del[delp++] = unique_path(ren1_dst, branch1);\n \t\toutput(\"%s is a directory in %s adding as %s instead\",\n-\t\t       ren1_dst, branch2, dstName1);\n+\t\t       ren1_dst, branch2, dst_name1);\n \t\tremove_file(0, ren1_dst);\n \t}\n-\tif (path_list_has_path(&currentDirectorySet, ren2_dst)) {\n-\t\tdstName2 = del[delp++] = unique_path(ren2_dst, branch2);\n+\tif (path_list_has_path(&current_directory_set, ren2_dst)) {\n+\t\tdst_name2 = del[delp++] = unique_path(ren2_dst, branch2);\n \t\toutput(\"%s is a directory in %s adding as %s instead\",\n-\t\t       ren2_dst, branch1, dstName2);\n+\t\t       ren2_dst, branch1, dst_name2);\n \t\tremove_file(0, ren2_dst);\n \t}\n-\tupdate_stages(dstName1, NULL, ren1->pair->two, NULL, 1);\n-\tupdate_stages(dstName2, NULL, NULL, ren2->pair->two, 1);\n+\tupdate_stages(dst_name1, NULL, ren1->pair->two, NULL, 1);\n+\tupdate_stages(dst_name2, NULL, NULL, ren2->pair->two, 1);\n \twhile (delp--)\n \t\tfree(del[delp]);\n }\n@@ -807,11 +805,11 @@ static void conflict_rename_rename(struc\n static void conflict_rename_dir(struct rename *ren1,\n \t\t\t\tconst char *branch1)\n {\n-\tchar *newPath = unique_path(ren1->pair->two->path, branch1);\n-\toutput(\"Renaming %s to %s instead\", ren1->pair->one->path, newPath);\n+\tchar *new_path = unique_path(ren1->pair->two->path, branch1);\n+\toutput(\"Renaming %s to %s instead\", ren1->pair->one->path, new_path);\n \tremove_file(0, ren1->pair->two->path);\n-\tupdate_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, newPath);\n-\tfree(newPath);\n+\tupdate_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, new_path);\n+\tfree(new_path);\n }\n \n static void conflict_rename_rename_2(struct rename *ren1,\n@@ -819,74 +817,74 @@ static void conflict_rename_rename_2(str\n \t\t\t\t     struct rename *ren2,\n \t\t\t\t     const char *branch2)\n {\n-\tchar *newPath1 = unique_path(ren1->pair->two->path, branch1);\n-\tchar *newPath2 = unique_path(ren2->pair->two->path, branch2);\n+\tchar *new_path1 = unique_path(ren1->pair->two->path, branch1);\n+\tchar *new_path2 = unique_path(ren2->pair->two->path, branch2);\n \toutput(\"Renaming %s to %s and %s to %s instead\",\n-\t       ren1->pair->one->path, newPath1,\n-\t       ren2->pair->one->path, newPath2);\n+\t       ren1->pair->one->path, new_path1,\n+\t       ren2->pair->one->path, new_path2);\n \tremove_file(0, ren1->pair->two->path);\n-\tupdate_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, newPath1);\n-\tupdate_file(0, ren2->pair->two->sha1, ren2->pair->two->mode, newPath2);\n-\tfree(newPath2);\n-\tfree(newPath1);\n+\tupdate_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, new_path1);\n+\tupdate_file(0, ren2->pair->two->sha1, ren2->pair->two->mode, new_path2);\n+\tfree(new_path2);\n+\tfree(new_path1);\n }\n \n /* General TODO: get rid of all the debug messages */\n-static int process_renames(struct path_list *renamesA,\n-\t\t\t   struct path_list *renamesB,\n-\t\t\t   const char *branchNameA,\n-\t\t\t   const char *branchNameB)\n+static int process_renames(struct path_list *a_renames,\n+\t\t\t   struct path_list *b_renames,\n+\t\t\t   const char *a_branch,\n+\t\t\t   const char *b_branch)\n {\n-\tint cleanMerge = 1, i, j;\n-\tstruct path_list byDstA = {NULL, 0, 0, 0}, byDstB = {NULL, 0, 0, 0};\n+\tint clean_merge = 1, i, j;\n+\tstruct path_list a_by_dst = {NULL, 0, 0, 0}, b_by_dst = {NULL, 0, 0, 0};\n \tconst struct rename *sre;\n \n-\tfor (i = 0; i < renamesA->nr; i++) {\n-\t\tsre = renamesA->items[i].util;\n-\t\tpath_list_insert(sre->pair->two->path, &byDstA)->util\n+\tfor (i = 0; i < a_renames->nr; i++) {\n+\t\tsre = a_renames->items[i].util;\n+\t\tpath_list_insert(sre->pair->two->path, &a_by_dst)->util\n \t\t\t= sre->dst_entry;\n \t}\n-\tfor (i = 0; i < renamesB->nr; i++) {\n-\t\tsre = renamesB->items[i].util;\n-\t\tpath_list_insert(sre->pair->two->path, &byDstB)->util\n+\tfor (i = 0; i < b_renames->nr; i++) {\n+\t\tsre = b_renames->items[i].util;\n+\t\tpath_list_insert(sre->pair->two->path, &b_by_dst)->util\n \t\t\t= sre->dst_entry;\n \t}\n \n-\tfor (i = 0, j = 0; i < renamesA->nr || j < renamesB->nr;) {\n+\tfor (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {\n \t\tint compare;\n \t\tchar *src;\n \t\tstruct path_list *renames1, *renames2, *renames2Dst;\n \t\tstruct rename *ren1 = NULL, *ren2 = NULL;\n-\t\tconst char *branchName1, *branchName2;\n+\t\tconst char *branch1, *branch2;\n \t\tconst char *ren1_src, *ren1_dst;\n \n-\t\tif (i >= renamesA->nr) {\n+\t\tif (i >= a_renames->nr) {\n \t\t\tcompare = 1;\n-\t\t\tren2 = renamesB->items[j++].util;\n-\t\t} else if (j >= renamesB->nr) {\n+\t\t\tren2 = b_renames->items[j++].util;\n+\t\t} else if (j >= b_renames->nr) {\n \t\t\tcompare = -1;\n-\t\t\tren1 = renamesA->items[i++].util;\n+\t\t\tren1 = a_renames->items[i++].util;\n \t\t} else {\n-\t\t\tcompare = strcmp(renamesA->items[i].path,\n-\t\t\t\t\trenamesB->items[j].path);\n-\t\t\tren1 = renamesA->items[i++].util;\n-\t\t\tren2 = renamesB->items[j++].util;\n+\t\t\tcompare = strcmp(a_renames->items[i].path,\n+\t\t\t\t\tb_renames->items[j].path);\n+\t\t\tren1 = a_renames->items[i++].util;\n+\t\t\tren2 = b_renames->items[j++].util;\n \t\t}\n \n \t\t/* TODO: refactor, so that 1/2 are not needed */\n \t\tif (ren1) {\n-\t\t\trenames1 = renamesA;\n-\t\t\trenames2 = renamesB;\n-\t\t\trenames2Dst = &byDstB;\n-\t\t\tbranchName1 = branchNameA;\n-\t\t\tbranchName2 = branchNameB;\n+\t\t\trenames1 = a_renames;\n+\t\t\trenames2 = b_renames;\n+\t\t\trenames2Dst = &b_by_dst;\n+\t\t\tbranch1 = a_branch;\n+\t\t\tbranch2 = b_branch;\n \t\t} else {\n \t\t\tstruct rename *tmp;\n-\t\t\trenames1 = renamesB;\n-\t\t\trenames2 = renamesA;\n-\t\t\trenames2Dst = &byDstA;\n-\t\t\tbranchName1 = branchNameB;\n-\t\t\tbranchName2 = branchNameA;\n+\t\t\trenames1 = b_renames;\n+\t\t\trenames2 = a_renames;\n+\t\t\trenames2Dst = &a_by_dst;\n+\t\t\tbranch1 = b_branch;\n+\t\t\tbranch2 = a_branch;\n \t\t\ttmp = ren2;\n \t\t\tren2 = ren1;\n \t\t\tren1 = tmp;\n@@ -912,21 +910,21 @@ static int process_renames(struct path_l\n \t\t\tren2->dst_entry->processed = 1;\n \t\t\tren2->processed = 1;\n \t\t\tif (strcmp(ren1_dst, ren2_dst) != 0) {\n-\t\t\t\tcleanMerge = 0;\n+\t\t\t\tclean_merge = 0;\n \t\t\t\toutput(\"CONFLICT (rename/rename): \"\n \t\t\t\t       \"Rename %s->%s in branch %s \"\n \t\t\t\t       \"rename %s->%s in %s\",\n-\t\t\t\t       src, ren1_dst, branchName1,\n-\t\t\t\t       src, ren2_dst, branchName2);\n-\t\t\t\tconflict_rename_rename(ren1, branchName1, ren2, branchName2);\n+\t\t\t\t       src, ren1_dst, branch1,\n+\t\t\t\t       src, ren2_dst, branch2);\n+\t\t\t\tconflict_rename_rename(ren1, branch1, ren2, branch2);\n \t\t\t} else {\n-\t\t\t\tremove_file(1, ren1_src);\n \t\t\t\tstruct merge_file_info mfi;\n+\t\t\t\tremove_file(1, ren1_src);\n \t\t\t\tmfi = merge_file(ren1->pair->one,\n \t\t\t\t\t\t ren1->pair->two,\n \t\t\t\t\t\t ren2->pair->two,\n-\t\t\t\t\t\t branchName1,\n-\t\t\t\t\t\t branchName2);\n+\t\t\t\t\t\t branch1,\n+\t\t\t\t\t\t branch2);\n \t\t\t\tif (mfi.merge || !mfi.clean)\n \t\t\t\t\toutput(\"Renaming %s->%s\", src, ren1_dst);\n \n@@ -936,7 +934,7 @@ static int process_renames(struct path_l\n \t\t\t\tif (!mfi.clean) {\n \t\t\t\t\toutput(\"CONFLICT (content): merge conflict in %s\",\n \t\t\t\t\t       ren1_dst);\n-\t\t\t\t\tcleanMerge = 0;\n+\t\t\t\t\tclean_merge = 0;\n \n \t\t\t\t\tif (!index_only)\n \t\t\t\t\t\tupdate_stages(ren1_dst,\n@@ -952,7 +950,7 @@ static int process_renames(struct path_l\n \t\t\tstruct path_list_item *item;\n \t\t\t/* we only use sha1 and mode of these */\n \t\t\tstruct diff_filespec src_other, dst_other;\n-\t\t\tint tryMerge, stage = renamesA == renames1 ? 3: 2;\n+\t\t\tint try_merge, stage = a_renames == renames1 ? 3: 2;\n \n \t\t\tremove_file(1, ren1_src);\n \n@@ -963,52 +961,52 @@ static int process_renames(struct path_l\n \t\t\t\t\tren1->dst_entry->stages[stage].sha, 20);\n \t\t\tdst_other.mode = ren1->dst_entry->stages[stage].mode;\n \n-\t\t\ttryMerge = 0;\n+\t\t\ttry_merge = 0;\n \n-\t\t\tif (path_list_has_path(&currentDirectorySet, ren1_dst)) {\n-\t\t\t\tcleanMerge = 0;\n+\t\t\tif (path_list_has_path(&current_directory_set, ren1_dst)) {\n+\t\t\t\tclean_merge = 0;\n \t\t\t\toutput(\"CONFLICT (rename/directory): Rename %s->%s in %s \"\n \t\t\t\t       \" directory %s added in %s\",\n-\t\t\t\t       ren1_src, ren1_dst, branchName1,\n-\t\t\t\t       ren1_dst, branchName2);\n-\t\t\t\tconflict_rename_dir(ren1, branchName1);\n+\t\t\t\t       ren1_src, ren1_dst, branch1,\n+\t\t\t\t       ren1_dst, branch2);\n+\t\t\t\tconflict_rename_dir(ren1, branch1);\n \t\t\t} else if (sha_eq(src_other.sha1, null_sha1)) {\n-\t\t\t\tcleanMerge = 0;\n+\t\t\t\tclean_merge = 0;\n \t\t\t\toutput(\"CONFLICT (rename/delete): Rename %s->%s in %s \"\n \t\t\t\t       \"and deleted in %s\",\n-\t\t\t\t       ren1_src, ren1_dst, branchName1,\n-\t\t\t\t       branchName2);\n+\t\t\t\t       ren1_src, ren1_dst, branch1,\n+\t\t\t\t       branch2);\n \t\t\t\tupdate_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst);\n \t\t\t} else if (!sha_eq(dst_other.sha1, null_sha1)) {\n-\t\t\t\tconst char *newPath;\n-\t\t\t\tcleanMerge = 0;\n-\t\t\t\ttryMerge = 1;\n+\t\t\t\tconst char *new_path;\n+\t\t\t\tclean_merge = 0;\n+\t\t\t\ttry_merge = 1;\n \t\t\t\toutput(\"CONFLICT (rename/add): Rename %s->%s in %s. \"\n \t\t\t\t       \"%s added in %s\",\n-\t\t\t\t       ren1_src, ren1_dst, branchName1,\n-\t\t\t\t       ren1_dst, branchName2);\n-\t\t\t\tnewPath = unique_path(ren1_dst, branchName2);\n-\t\t\t\toutput(\"Adding as %s instead\", newPath);\n-\t\t\t\tupdate_file(0, dst_other.sha1, dst_other.mode, newPath);\n+\t\t\t\t       ren1_src, ren1_dst, branch1,\n+\t\t\t\t       ren1_dst, branch2);\n+\t\t\t\tnew_path = unique_path(ren1_dst, branch2);\n+\t\t\t\toutput(\"Adding as %s instead\", new_path);\n+\t\t\t\tupdate_file(0, dst_other.sha1, dst_other.mode, new_path);\n \t\t\t} else if ((item = path_list_lookup(ren1_dst, renames2Dst))) {\n \t\t\t\tren2 = item->util;\n-\t\t\t\tcleanMerge = 0;\n+\t\t\t\tclean_merge = 0;\n \t\t\t\tren2->processed = 1;\n \t\t\t\toutput(\"CONFLICT (rename/rename): Rename %s->%s in %s. \"\n \t\t\t\t       \"Rename %s->%s in %s\",\n-\t\t\t\t       ren1_src, ren1_dst, branchName1,\n-\t\t\t\t       ren2->pair->one->path, ren2->pair->two->path, branchName2);\n-\t\t\t\tconflict_rename_rename_2(ren1, branchName1, ren2, branchName2);\n+\t\t\t\t       ren1_src, ren1_dst, branch1,\n+\t\t\t\t       ren2->pair->one->path, ren2->pair->two->path, branch2);\n+\t\t\t\tconflict_rename_rename_2(ren1, branch1, ren2, branch2);\n \t\t\t} else\n-\t\t\t\ttryMerge = 1;\n+\t\t\t\ttry_merge = 1;\n \n-\t\t\tif (tryMerge) {\n+\t\t\tif (try_merge) {\n \t\t\t\tstruct diff_filespec *o, *a, *b;\n \t\t\t\tstruct merge_file_info mfi;\n \t\t\t\tsrc_other.path = (char *)ren1_src;\n \n \t\t\t\to = ren1->pair->one;\n-\t\t\t\tif (renamesA == renames1) {\n+\t\t\t\tif (a_renames == renames1) {\n \t\t\t\t\ta = ren1->pair->two;\n \t\t\t\t\tb = &src_other;\n \t\t\t\t} else {\n@@ -1016,7 +1014,7 @@ static int process_renames(struct path_l\n \t\t\t\t\ta = &src_other;\n \t\t\t\t}\n \t\t\t\tmfi = merge_file(o, a, b,\n-\t\t\t\t\t\tbranchNameA, branchNameB);\n+\t\t\t\t\t\ta_branch, b_branch);\n \n \t\t\t\tif (mfi.merge || !mfi.clean)\n \t\t\t\t\toutput(\"Renaming %s => %s\", ren1_src, ren1_dst);\n@@ -1025,7 +1023,7 @@ static int process_renames(struct path_l\n \t\t\t\tif (!mfi.clean) {\n \t\t\t\t\toutput(\"CONFLICT (rename/modify): Merge conflict in %s\",\n \t\t\t\t\t       ren1_dst);\n-\t\t\t\t\tcleanMerge = 0;\n+\t\t\t\t\tclean_merge = 0;\n \n \t\t\t\t\tif (!index_only)\n \t\t\t\t\t\tupdate_stages(ren1_dst,\n@@ -1035,12 +1033,12 @@ static int process_renames(struct path_l\n \t\t\t}\n \t\t}\n \t}\n-\tpath_list_clear(&byDstA, 0);\n-\tpath_list_clear(&byDstB, 0);\n+\tpath_list_clear(&a_by_dst, 0);\n+\tpath_list_clear(&b_by_dst, 0);\n \n \tif (cache_dirty)\n \t\tflush_cache();\n-\treturn cleanMerge;\n+\treturn clean_merge;\n }\n \n static unsigned char *has_sha(const unsigned char *sha)\n@@ -1057,116 +1055,116 @@ static int process_entry(const char *pat\n \tprintf(\"processing entry, clean cache: %s\\n\", index_only ? \"yes\": \"no\");\n \tprint_index_entry(\"\\tpath: \", entry);\n \t*/\n-\tint cleanMerge = 1;\n-\tunsigned char *oSha = has_sha(entry->stages[1].sha);\n-\tunsigned char *aSha = has_sha(entry->stages[2].sha);\n-\tunsigned char *bSha = has_sha(entry->stages[3].sha);\n-\tunsigned oMode = entry->stages[1].mode;\n-\tunsigned aMode = entry->stages[2].mode;\n-\tunsigned bMode = entry->stages[3].mode;\n-\n-\tif (oSha && (!aSha || !bSha)) {\n+\tint clean_merge = 1;\n+\tunsigned char *o_sha = has_sha(entry->stages[1].sha);\n+\tunsigned char *a_sha = has_sha(entry->stages[2].sha);\n+\tunsigned char *b_sha = has_sha(entry->stages[3].sha);\n+\tunsigned o_mode = entry->stages[1].mode;\n+\tunsigned a_mode = entry->stages[2].mode;\n+\tunsigned b_mode = entry->stages[3].mode;\n+\n+\tif (o_sha && (!a_sha || !b_sha)) {\n \t\t/* Case A: Deleted in one */\n-\t\tif ((!aSha && !bSha) ||\n-\t\t    (sha_eq(aSha, oSha) && !bSha) ||\n-\t\t    (!aSha && sha_eq(bSha, oSha))) {\n+\t\tif ((!a_sha && !b_sha) ||\n+\t\t    (sha_eq(a_sha, o_sha) && !b_sha) ||\n+\t\t    (!a_sha && sha_eq(b_sha, o_sha))) {\n \t\t\t/* Deleted in both or deleted in one and\n \t\t\t * unchanged in the other */\n-\t\t\tif (aSha)\n+\t\t\tif (a_sha)\n \t\t\t\toutput(\"Removing %s\", path);\n \t\t\tremove_file(1, path);\n \t\t} else {\n \t\t\t/* Deleted in one and changed in the other */\n-\t\t\tcleanMerge = 0;\n-\t\t\tif (!aSha) {\n+\t\t\tclean_merge = 0;\n+\t\t\tif (!a_sha) {\n \t\t\t\toutput(\"CONFLICT (delete/modify): %s deleted in %s \"\n \t\t\t\t       \"and modified in %s. Version %s of %s left in tree.\",\n \t\t\t\t       path, branch1Name,\n \t\t\t\t       branch2Name, branch2Name, path);\n-\t\t\t\tupdate_file(0, bSha, bMode, path);\n+\t\t\t\tupdate_file(0, b_sha, b_mode, path);\n \t\t\t} else {\n \t\t\t\toutput(\"CONFLICT (delete/modify): %s deleted in %s \"\n \t\t\t\t       \"and modified in %s. Version %s of %s left in tree.\",\n \t\t\t\t       path, branch2Name,\n \t\t\t\t       branch1Name, branch1Name, path);\n-\t\t\t\tupdate_file(0, aSha, aMode, path);\n+\t\t\t\tupdate_file(0, a_sha, a_mode, path);\n \t\t\t}\n \t\t}\n \n-\t} else if ((!oSha && aSha && !bSha) ||\n-\t\t   (!oSha && !aSha && bSha)) {\n+\t} else if ((!o_sha && a_sha && !b_sha) ||\n+\t\t   (!o_sha && !a_sha && b_sha)) {\n \t\t/* Case B: Added in one. */\n-\t\tconst char *addBranch;\n-\t\tconst char *otherBranch;\n+\t\tconst char *add_branch;\n+\t\tconst char *other_branch;\n \t\tunsigned mode;\n \t\tconst unsigned char *sha;\n \t\tconst char *conf;\n \n-\t\tif (aSha) {\n-\t\t\taddBranch = branch1Name;\n-\t\t\totherBranch = branch2Name;\n-\t\t\tmode = aMode;\n-\t\t\tsha = aSha;\n+\t\tif (a_sha) {\n+\t\t\tadd_branch = branch1Name;\n+\t\t\tother_branch = branch2Name;\n+\t\t\tmode = a_mode;\n+\t\t\tsha = a_sha;\n \t\t\tconf = \"file/directory\";\n \t\t} else {\n-\t\t\taddBranch = branch2Name;\n-\t\t\totherBranch = branch1Name;\n-\t\t\tmode = bMode;\n-\t\t\tsha = bSha;\n+\t\t\tadd_branch = branch2Name;\n+\t\t\tother_branch = branch1Name;\n+\t\t\tmode = b_mode;\n+\t\t\tsha = b_sha;\n \t\t\tconf = \"directory/file\";\n \t\t}\n-\t\tif (path_list_has_path(&currentDirectorySet, path)) {\n-\t\t\tconst char *newPath = unique_path(path, addBranch);\n-\t\t\tcleanMerge = 0;\n+\t\tif (path_list_has_path(&current_directory_set, path)) {\n+\t\t\tconst char *new_path = unique_path(path, add_branch);\n+\t\t\tclean_merge = 0;\n \t\t\toutput(\"CONFLICT (%s): There is a directory with name %s in %s. \"\n \t\t\t       \"Adding %s as %s\",\n-\t\t\t       conf, path, otherBranch, path, newPath);\n+\t\t\t       conf, path, other_branch, path, new_path);\n \t\t\tremove_file(0, path);\n-\t\t\tupdate_file(0, sha, mode, newPath);\n+\t\t\tupdate_file(0, sha, mode, new_path);\n \t\t} else {\n \t\t\toutput(\"Adding %s\", path);\n \t\t\tupdate_file(1, sha, mode, path);\n \t\t}\n-\t} else if (!oSha && aSha && bSha) {\n+\t} else if (!o_sha && a_sha && b_sha) {\n \t\t/* Case C: Added in both (check for same permissions). */\n-\t\tif (sha_eq(aSha, bSha)) {\n-\t\t\tif (aMode != bMode) {\n-\t\t\t\tcleanMerge = 0;\n+\t\tif (sha_eq(a_sha, b_sha)) {\n+\t\t\tif (a_mode != b_mode) {\n+\t\t\t\tclean_merge = 0;\n \t\t\t\toutput(\"CONFLICT: File %s added identically in both branches, \"\n \t\t\t\t       \"but permissions conflict %06o->%06o\",\n-\t\t\t\t       path, aMode, bMode);\n-\t\t\t\toutput(\"CONFLICT: adding with permission: %06o\", aMode);\n-\t\t\t\tupdate_file(0, aSha, aMode, path);\n+\t\t\t\t       path, a_mode, b_mode);\n+\t\t\t\toutput(\"CONFLICT: adding with permission: %06o\", a_mode);\n+\t\t\t\tupdate_file(0, a_sha, a_mode, path);\n \t\t\t} else {\n \t\t\t\t/* This case is handled by git-read-tree */\n \t\t\t\tassert(0 && \"This case must be handled by git-read-tree\");\n \t\t\t}\n \t\t} else {\n-\t\t\tconst char *newPath1, *newPath2;\n-\t\t\tcleanMerge = 0;\n-\t\t\tnewPath1 = unique_path(path, branch1Name);\n-\t\t\tnewPath2 = unique_path(path, branch2Name);\n+\t\t\tconst char *new_path1, *new_path2;\n+\t\t\tclean_merge = 0;\n+\t\t\tnew_path1 = unique_path(path, branch1Name);\n+\t\t\tnew_path2 = unique_path(path, branch2Name);\n \t\t\toutput(\"CONFLICT (add/add): File %s added non-identically \"\n \t\t\t       \"in both branches. Adding as %s and %s instead.\",\n-\t\t\t       path, newPath1, newPath2);\n+\t\t\t       path, new_path1, new_path2);\n \t\t\tremove_file(0, path);\n-\t\t\tupdate_file(0, aSha, aMode, newPath1);\n-\t\t\tupdate_file(0, bSha, bMode, newPath2);\n+\t\t\tupdate_file(0, a_sha, a_mode, new_path1);\n+\t\t\tupdate_file(0, b_sha, b_mode, new_path2);\n \t\t}\n \n-\t} else if (oSha && aSha && bSha) {\n+\t} else if (o_sha && a_sha && b_sha) {\n \t\t/* case D: Modified in both, but differently. */\n \t\tstruct merge_file_info mfi;\n \t\tstruct diff_filespec o, a, b;\n \n \t\toutput(\"Auto-merging %s\", path);\n \t\to.path = a.path = b.path = (char *)path;\n-\t\tmemcpy(o.sha1, oSha, 20);\n-\t\to.mode = oMode;\n-\t\tmemcpy(a.sha1, aSha, 20);\n-\t\ta.mode = aMode;\n-\t\tmemcpy(b.sha1, bSha, 20);\n-\t\tb.mode = bMode;\n+\t\tmemcpy(o.sha1, o_sha, 20);\n+\t\to.mode = o_mode;\n+\t\tmemcpy(a.sha1, a_sha, 20);\n+\t\ta.mode = a_mode;\n+\t\tmemcpy(b.sha1, b_sha, 20);\n+\t\tb.mode = b_mode;\n \t\t\n \t\tmfi = merge_file(&o, &a, &b,\n \t\t\t\t branch1Name, branch2Name);\n@@ -1174,14 +1172,14 @@ static int process_entry(const char *pat\n \t\tif (mfi.clean)\n \t\t\tupdate_file(1, mfi.sha, mfi.mode, path);\n \t\telse {\n-\t\t\tcleanMerge = 0;\n+\t\t\tclean_merge = 0;\n \t\t\toutput(\"CONFLICT (content): Merge conflict in %s\", path);\n \n \t\t\tif (index_only)\n \t\t\t\tupdate_file(0, mfi.sha, mfi.mode, path);\n \t\t\telse\n \t\t\t\tupdate_file_flags(mfi.sha, mfi.mode, path,\n-\t\t\t\t\t      0 /* updateCache */, 1 /* updateWd */);\n+\t\t\t\t\t      0 /* update_cache */, 1 /* update_working_directory */);\n \t\t}\n \t} else\n \t\tdie(\"Fatal merge failure, shouldn't happen.\");\n@@ -1189,7 +1187,7 @@ static int process_entry(const char *pat\n \tif (cache_dirty)\n \t\tflush_cache();\n \n-\treturn cleanMerge;\n+\treturn clean_merge;\n }\n \n static int merge_trees(struct tree *head,\n@@ -1218,8 +1216,8 @@ static int merge_trees(struct tree *head\n \tif (!*result) {\n \t\tstruct path_list *entries, *re_head, *re_merge;\n \t\tint i;\n-\t\tpath_list_clear(&currentFileSet, 1);\n-\t\tpath_list_clear(&currentDirectorySet, 1);\n+\t\tpath_list_clear(&current_file_set, 1);\n+\t\tpath_list_clear(&current_directory_set, 1);\n \t\tget_files_dirs(head);\n \t\tget_files_dirs(merge);\n \n@@ -1265,12 +1263,12 @@ int merge(struct commit *h1,\n \t\t\t  struct commit *h2,\n \t\t\t  const char *branch1Name,\n \t\t\t  const char *branch2Name,\n-\t\t\t  int callDepth /* =0 */,\n+\t\t\t  int call_depth /* =0 */,\n \t\t\t  struct commit *ancestor /* =None */,\n \t\t\t  struct commit **result)\n {\n \tstruct commit_list *ca = NULL, *iter;\n-\tstruct commit *mergedCA;\n+\tstruct commit *merged_common_ancestors;\n \tstruct tree *mrtree;\n \tint clean;\n \n@@ -1287,10 +1285,10 @@ int merge(struct commit *h1,\n \tfor (iter = ca; iter; iter = iter->next)\n \t\toutput_commit_title(iter->item);\n \n-\tmergedCA = pop_commit(&ca);\n+\tmerged_common_ancestors = pop_commit(&ca);\n \n \tfor (iter = ca; iter; iter = iter->next) {\n-\t\toutput_indent = callDepth + 1;\n+\t\toutput_indent = call_depth + 1;\n \t\t/*\n \t\t * When the merge fails, the result contains files\n \t\t * with conflict markers. The cleanness flag is\n@@ -1298,19 +1296,19 @@ int merge(struct commit *h1,\n \t\t * merge_trees has always overwritten it: the commited\n \t\t * \"conflicts\" were already resolved. \n \t\t */\n-\t\tmerge(mergedCA, iter->item,\n+\t\tmerge(merged_common_ancestors, iter->item,\n \t\t      \"Temporary merge branch 1\",\n \t\t      \"Temporary merge branch 2\",\n-\t\t      callDepth + 1,\n+\t\t      call_depth + 1,\n \t\t      NULL,\n-\t\t      &mergedCA);\n-\t\toutput_indent = callDepth;\n+\t\t      &merged_common_ancestors);\n+\t\toutput_indent = call_depth;\n \n-\t\tif (!mergedCA)\n+\t\tif (!merged_common_ancestors)\n \t\t\tdie(\"merge returned no commit\");\n \t}\n \n-\tif (callDepth == 0) {\n+\tif (call_depth == 0) {\n \t\tsetup_index(0 /* $GIT_DIR/index */);\n \t\tindex_only = 0;\n \t} else {\n@@ -1319,7 +1317,7 @@ int merge(struct commit *h1,\n \t\tindex_only = 1;\n \t}\n \n-\tclean = merge_trees(h1->tree, h2->tree, mergedCA->tree,\n+\tclean = merge_trees(h1->tree, h2->tree, merged_common_ancestors->tree,\n \t\t\t    branch1Name, branch2Name, &mrtree);\n \n \tif (!ancestor && (clean || index_only)) {\n-- \n1.4.2.rc2.g6a4e\n"}]}