{"thread":{"id":"52332","subject":"Git Test Coverage Report (Nov 25)","startedAt":"2019-11-25T15:33:49Z","lastAt":"2019-11-28T22:05:00Z","messageCount":6,"participants":["Derrick Stolee","Johannes Schindelin","Phillip Wood"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"387002","messageId":"1cb7ddbf-020e-d63a-85b6-5a9267c0a5a3@gmail.com","threadId":"52332","inReplyTo":null,"subject":"Git Test Coverage Report (Nov 25)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-11-25T15:33:41Z","receivedAt":"2019-11-25T15:33:49Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"Here is today's test coverage report.\n\nSorry for the delay, but I had some issues working out the new\n\"ignored lines\" logic. Now there are a few phrases that are\nignored automatically, including \"BUG(\" or \"die(\".\n\nThanks,\n-Stolee\n\n[1] https://derrickstolee.github.io/git-test-coverage/reports/2019-11-25.htm\n[2] https://derrickstolee.github.io/git-test-coverage/reports/2019-11-25.txt\n[3] https://derrickstolee.github.io/git-test-coverage/reports/2019-11-25-commits.txt\n\n--- \n\npu\t28de5786e631095b76bbdbda51d874e6bee6cb70\njch\t3cd56eb17de579e1687a705ccad9e58dca9f3dba\nnext\t34dc348eaf04483f062911e310f14c9f4e8ddf1e\nmaster\td9f6f3b6195a0ca35642561e530798ad1469bd41\nmaster@{1}\torigin/maint\n\n\nUncovered code in 'pu' not in 'jch'\n--------------------------------------------------------\n\nCommits introducing uncovered code:\nDerrick Stolee\td89f09c8 clone: add --sparse mode\nbuiltin/clone.c\nd89f09c8 753) result = 1;\nd89f09c8 1136) return 1;\n\nDerrick Stolee\te091228e sparse-checkout: update working directory in-process\nbuiltin/sparse-checkout.c\ne091228e 85) return 0;\n\nDerrick Stolee\tbab3c359 sparse-checkout: create 'init' subcommand\nbuiltin/sparse-checkout.c\nbab3c359 221) return 1;\nbab3c359 275) return 1;\n\nDerrick Stolee\taf09ce24 sparse-checkout: init and set in cone mode\nbuiltin/sparse-checkout.c\naf09ce24 346) return;\n\nDerrick Stolee\t96cc8ab5 sparse-checkout: use hashmaps for cone patterns\ndir.c\n96cc8ab5 654) pl->use_cone_patterns = 0;\n96cc8ab5 656) goto clear_hashmaps;\n96cc8ab5 678) hashmap_add(&pl->parent_hashmap, &translated->ent);\n96cc8ab5 679) hashmap_remove(&pl->recursive_hashmap, &translated->ent, &data);\n96cc8ab5 680) free(data);\n96cc8ab5 681) return;\n96cc8ab5 687) goto clear_hashmaps;\n96cc8ab5 703) hashmap_remove(&pl->parent_hashmap, &translated->ent, &data);\n96cc8ab5 704) free(data);\n96cc8ab5 705) free(translated);\n96cc8ab5 1264) return MATCHED;\n\nDerrick Stolee\t69dbc5db progress: create GIT_PROGRESS_DELAY\nprogress.c\n69dbc5db 308) return start_progress_delay(title, total, get_default_delay(), 1);\n\nJonathan Nieder\tee70c128 index: offer advice for unknown index extensions\nread-cache.c\nee70c128 1745) if (advice_unknown_index_extension) {\n\nJosh Steadmon\t6da1f1a9 protocol: advertise multiple supported versions\nremote-curl.c\n6da1f1a9 354) return 0;\n\nMatheus Tavares\tbeebb9d2 object-store: allow threaded access to object reading\npackfile.c\nbeebb9d2 1464) return;\n\nsha1-file.c\nbeebb9d2 1431) return;\nbeebb9d2 1440) return;\n\n\n\nUncovered code in 'jch' not in 'next'\n--------------------------------------------------------\n\nCommits introducing uncovered code:\nAlban Gruin\t393adf7a sequencer: directly call pick_commits() from complete_action()\nsequencer.c\n393adf7a 5270) goto cleanup;\n\nDaniel Ferreira\t5e82b9e4 built-in add -i: implement the `status` command\nadd-interactive.c\n5e82b9e4 626) return -1;\n5e82b9e4 629) putchar('\\n');\n5e82b9e4 631) return 0;\n\nJohannes Schindelin\teea4a7f4 mingw: demonstrate that all file handles are inherited by child processes\nt/helper/test-run-command.c\neea4a7f4 203) static int inherit_handle(const char *argv0)\neea4a7f4 205) struct child_process cp = CHILD_PROCESS_INIT;\neea4a7f4 210) xsnprintf(path, sizeof(path), \"out-XXXXXX\");\neea4a7f4 211) tmp = xmkstemp(path);\neea4a7f4 213) argv_array_pushl(&cp.args,\neea4a7f4 215) cp.in = -1;\neea4a7f4 216) cp.no_stdout = cp.no_stderr = 1;\neea4a7f4 217) if (start_command(&cp) < 0)\neea4a7f4 221) close(tmp);\neea4a7f4 222) if (unlink(path))\neea4a7f4 225) if (close(cp.in) < 0 || finish_command(&cp) < 0)\neea4a7f4 228) return 0;\neea4a7f4 231) static int inherit_handle_child(void)\neea4a7f4 233) struct strbuf buf = STRBUF_INIT;\neea4a7f4 235) if (strbuf_read(&buf, 0, 0) < 0)\neea4a7f4 237) printf(\"Received %s\\n\", buf.buf);\neea4a7f4 238) strbuf_release(&buf);\neea4a7f4 240) return 0;\neea4a7f4 251) exit(inherit_handle(argv[0]));\neea4a7f4 253) exit(inherit_handle_child());\n\nJohannes Schindelin\t116a408b commit: give correct advice for empty commit during a rebase\nbuiltin/commit.c\n116a408b 478) else if (whence == FROM_CHERRY_PICK) {\n116a408b 479) if (rebase_in_progress && !sequencer_in_use)\n116a408b 1186) else if (whence == FROM_CHERRY_PICK) {\n116a408b 1187) if (rebase_in_progress && !sequencer_in_use)\n\nJohannes Schindelin\t0de7b036 built-in add -i: offer the `quit` command\nadd-interactive.c\n0de7b036 1126) if (i < 0 || i >= commands.items.nr)\n0de7b036 1127) util = NULL;\n0de7b036 1129) util = commands.items.items[i].util;\n0de7b036 1131) if (i == LIST_AND_CHOOSE_QUIT || (util && !util->command)) {\n0de7b036 1137) if (util)\n\nJohannes Schindelin\td17e3a76 built-in add -i: prepare for multi-selection commands\nadd-interactive.c\nd17e3a76 88) FREE_AND_NULL(list->selected);\nd17e3a76 195) static void list(struct add_i_state *s, struct string_list *list, int *selected,\nd17e3a76 208) opts->print_item(i, selected ? selected[i] : 0, list->items + i,\nd17e3a76 249) int singleton = opts->flags & SINGLETON;\nd17e3a76 250) int immediate = opts->flags & IMMEDIATE;\nd17e3a76 253) ssize_t res = singleton ? LIST_AND_CHOOSE_ERROR : 0;\nd17e3a76 255) if (!singleton) {\nd17e3a76 256) free(items->selected);\nd17e3a76 257) CALLOC_ARRAY(items->selected, items->items.nr);\nd17e3a76 260) if (singleton && !immediate)\nd17e3a76 270) list(s, &items->items, items->selected, &opts->list_opts);\nd17e3a76 273) fputs(singleton ? \"> \" : \">> \", stdout);\nd17e3a76 278) if (immediate)\nd17e3a76 279) res = LIST_AND_CHOOSE_QUIT;\nd17e3a76 295) int choose = 1;\nd17e3a76 297) ssize_t from = -1, to = -1;\nd17e3a76 307) if (*p == '-') {\nd17e3a76 308) choose = 0;\nd17e3a76 309) p++;\nd17e3a76 310) sep--;\nd17e3a76 313) if (sep == 1 && *p == '*') {\nd17e3a76 314) from = 0;\nd17e3a76 315) to = items->items.nr;\nd17e3a76 316) } else if (isdigit(*p)) {\nd17e3a76 327) from = strtoul(p, &endp, 10) - 1;\nd17e3a76 328) if (endp == p + sep)\nd17e3a76 329) to = from + 1;\nd17e3a76 330) else if (*endp == '-') {\nd17e3a76 331) to = strtoul(++endp, &endp, 10);\nd17e3a76 333) if (endp != p + sep)\nd17e3a76 334) from = -1;\nd17e3a76 340) if (from < 0) {\nd17e3a76 341) from = find_unique(p, items);\nd17e3a76 342) if (from >= 0)\nd17e3a76 343) to = from + 1;\nd17e3a76 346) if (from < 0 || from >= items->items.nr ||\nd17e3a76 347)     (singleton && from + 1 != to)) {\nd17e3a76 350) break;\nd17e3a76 351) } else if (singleton) {\nd17e3a76 352) res = from;\nd17e3a76 356) if (to > items->items.nr)\nd17e3a76 357) to = items->items.nr;\nd17e3a76 359) for (; from < to; from++)\nd17e3a76 360) if (items->selected[from] != choose) {\nd17e3a76 361) items->selected[from] = choose;\nd17e3a76 362) res += choose ? +1 : -1;\nd17e3a76 368) if ((immediate && res != LIST_AND_CHOOSE_ERROR) ||\nd17e3a76 369)     !strcmp(input.buf, \"*\"))\nd17e3a76 585) static void print_file_item(int i, int selected, struct string_list_item *item,\nd17e3a76 618) printf(\"%c%2d: %s\", selected ? '*' : ' ', i + 1, d->buf.buf);\nd17e3a76 1025) static void print_command_item(int i, int selected,\n\nJohannes Schindelin\tdea080c8 built-in add -i: re-implement `revert` in C\nadd-interactive.c\ndea080c8 683) static void revert_from_diff(struct diff_queue_struct *q,\ndea080c8 686) int i, add_flags = ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE;\ndea080c8 688) for (i = 0; i < q->nr; i++) {\ndea080c8 689) struct diff_filespec *one = q->queue[i]->one;\ndea080c8 692) if (!(one->mode && !is_null_oid(&one->oid))) {\ndea080c8 693) remove_file_from_index(opt->repo->index, one->path);\ndea080c8 694) printf(_(\"note: %s is untracked now.\\n\"), one->path);\ndea080c8 696) ce = make_cache_entry(opt->repo->index, one->mode,\ndea080c8 697)       &one->oid, one->path, 0, 0);\ndea080c8 698) if (!ce)\ndea080c8 701) add_index_entry(opt->repo->index, ce, add_flags);\ndea080c8 704) }\ndea080c8 706) static int run_revert(struct add_i_state *s, const struct pathspec *ps,\ndea080c8 710) int res = 0, fd;\ndea080c8 714) int is_initial = !resolve_ref_unsafe(\"HEAD\", RESOLVE_REF_READING, &oid,\ndea080c8 719) struct diff_options diffopt = { NULL };\ndea080c8 724) if (!files->items.nr) {\ndea080c8 725) putchar('\\n');\ndea080c8 726) return 0;\ndea080c8 729) opts->prompt = N_(\"Revert\");\ndea080c8 730) count = list_and_choose(s, files, opts);\ndea080c8 731) if (count <= 0)\ndea080c8 732) goto finish_revert;\ndea080c8 734) fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);\ndea080c8 735) if (fd < 0) {\ndea080c8 736) res = -1;\ndea080c8 737) goto finish_revert;\ndea080c8 740) if (is_initial)\ndea080c8 741) oidcpy(&oid, s->r->hash_algo->empty_tree);\ndea080c8 743) tree = parse_tree_indirect(&oid);\ndea080c8 744) if (!tree) {\ndea080c8 746) goto finish_revert;\ndea080c8 748) oidcpy(&oid, &tree->object.oid);\ndea080c8 751) ALLOC_ARRAY(paths, count + 1);\ndea080c8 752) for (i = j = 0; i < files->items.nr; i++)\ndea080c8 753) if (files->selected[i])\ndea080c8 754) paths[j++] = files->items.items[i].string;\ndea080c8 755) paths[j] = NULL;\ndea080c8 757) parse_pathspec(&diffopt.pathspec, 0,\ndea080c8 761) diffopt.output_format = DIFF_FORMAT_CALLBACK;\ndea080c8 762) diffopt.format_callback = revert_from_diff;\ndea080c8 763) diffopt.flags.override_submodule_config = 1;\ndea080c8 764) diffopt.repo = s->r;\ndea080c8 766) if (do_diff_cache(&oid, &diffopt))\ndea080c8 767) res = -1;\ndea080c8 769) diffcore_std(&diffopt);\ndea080c8 770) diff_flush(&diffopt);\ndea080c8 772) free(paths);\ndea080c8 773) clear_pathspec(&diffopt.pathspec);\ndea080c8 775) if (!res && write_locked_index(s->r->index, &index_lock,\ndea080c8 777) res = -1;\ndea080c8 779) res = repo_refresh_and_write_index(s->r, REFRESH_QUIET, 0, 1,\ndea080c8 782) if (!res)\ndea080c8 783) printf(Q_(\"reverted %d path\\n\",\ndea080c8 788) return res;\n\nJohannes Schindelin\tdaabf56b built-in add -i: re-implement `add-untracked` in C\nadd-interactive.c\ndaabf56b 606) if (d->only_names) {\ndaabf56b 607) printf(\"%c%2d: %s\", selected ? '*' : ' ', i + 1,\ndaabf56b 609) return;\ndaabf56b 791) static int get_untracked_files(struct repository *r,\ndaabf56b 795) struct dir_struct dir = { 0 };\ndaabf56b 797) struct strbuf buf = STRBUF_INIT;\ndaabf56b 799) if (repo_read_index(r) < 0)\ndaabf56b 802) prefix_item_list_clear(files);\ndaabf56b 803) setup_standard_excludes(&dir);\ndaabf56b 804) add_pattern_list(&dir, EXC_CMDL, \"--exclude option\");\ndaabf56b 805) fill_directory(&dir, r->index, ps);\ndaabf56b 807) for (i = 0; i < dir.nr; i++) {\ndaabf56b 808) struct dir_entry *ent = dir.entries[i];\ndaabf56b 810) if (index_name_is_other(r->index, ent->name, ent->len)) {\ndaabf56b 811) strbuf_reset(&buf);\ndaabf56b 812) strbuf_add(&buf, ent->name, ent->len);\ndaabf56b 813) add_file_item(&files->items, buf.buf);\ndaabf56b 817) strbuf_release(&buf);\ndaabf56b 821) static int run_add_untracked(struct add_i_state *s, const struct pathspec *ps,\ndaabf56b 825) struct print_file_item_data *d = opts->list_opts.print_item_data;\ndaabf56b 826) int res = 0, fd;\ndaabf56b 830) if (get_untracked_files(s->r, files, ps) < 0)\ndaabf56b 831) return -1;\ndaabf56b 833) if (!files->items.nr) {\ndaabf56b 834) printf(_(\"No untracked files.\\n\"));\ndaabf56b 835) goto finish_add_untracked;\ndaabf56b 838) opts->prompt = N_(\"Add untracked\");\ndaabf56b 839) d->only_names = 1;\ndaabf56b 840) count = list_and_choose(s, files, opts);\ndaabf56b 841) d->only_names = 0;\ndaabf56b 842) if (count <= 0)\ndaabf56b 843) goto finish_add_untracked;\ndaabf56b 845) fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);\ndaabf56b 846) if (fd < 0) {\ndaabf56b 847) res = -1;\ndaabf56b 848) goto finish_add_untracked;\ndaabf56b 851) for (i = 0; i < files->items.nr; i++) {\ndaabf56b 852) const char *name = files->items.items[i].string;\ndaabf56b 853) if (files->selected[i] &&\ndaabf56b 854)     add_file_to_index(s->r->index, name, 0) < 0) {\ndaabf56b 856) break;\ndaabf56b 860) if (!res &&\ndaabf56b 861)     write_locked_index(s->r->index, &index_lock, COMMIT_LOCK) < 0)\ndaabf56b 864) if (!res)\ndaabf56b 865) printf(Q_(\"added %d path\\n\",\ndaabf56b 869) putchar('\\n');\ndaabf56b 870) return res;\n\nJohannes Schindelin\t4ba7c22a built-in add -i: implement the `update` command\nadd-interactive.c\n4ba7c22a 504) prefix_item_list_clear(files);\n4ba7c22a 505) s.files = &files->items;\n4ba7c22a 545) string_list_sort(&files->items);\n4ba7c22a 590) const char *highlighted = NULL;\n4ba7c22a 597) if (c->prefix_length > 0 &&\n4ba7c22a 598)     is_valid_prefix(item->string, c->prefix_length)) {\n4ba7c22a 599) strbuf_reset(&d->name);\n4ba7c22a 600) strbuf_addf(&d->name, \"%s%.*s%s%s\", d->color,\n4ba7c22a 601)     (int)c->prefix_length, item->string, d->reset,\n4ba7c22a 602)     item->string + c->prefix_length);\n4ba7c22a 603) highlighted = d->name.buf;\n4ba7c22a 615) strbuf_addf(&d->buf, d->modified_fmt, d->index.buf, d->worktree.buf,\n4ba7c22a 628) list(s, &files->items, NULL, &opts->list_opts);\n4ba7c22a 634) static int run_update(struct add_i_state *s, const struct pathspec *ps,\n4ba7c22a 638) int res = 0, fd;\n4ba7c22a 643) return -1;\n4ba7c22a 645) if (!files->items.nr) {\n4ba7c22a 646) putchar('\\n');\n4ba7c22a 647) return 0;\n4ba7c22a 650) opts->prompt = N_(\"Update\");\n4ba7c22a 651) count = list_and_choose(s, files, opts);\n4ba7c22a 652) if (count <= 0) {\n4ba7c22a 653) putchar('\\n');\n4ba7c22a 654) return 0;\n4ba7c22a 657) fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);\n4ba7c22a 658) if (fd < 0) {\n4ba7c22a 659) putchar('\\n');\n4ba7c22a 660) return -1;\n4ba7c22a 663) for (i = 0; i < files->items.nr; i++) {\n4ba7c22a 664) const char *name = files->items.items[i].string;\n4ba7c22a 665) if (files->selected[i] &&\n4ba7c22a 666)     add_file_to_index(s->r->index, name, 0) < 0) {\n4ba7c22a 668) break;\n4ba7c22a 672) if (!res && write_locked_index(s->r->index, &index_lock, COMMIT_LOCK) < 0)\n4ba7c22a 675) if (!res)\n4ba7c22a 676) printf(Q_(\"updated %d path\\n\",\n4ba7c22a 679) putchar('\\n');\n4ba7c22a 680) return res;\n4ba7c22a 992) static void choose_prompt_help(struct add_i_state *s)\n4ba7c22a 994) color_fprintf_ln(stdout, s->help_color, \"%s\",\n4ba7c22a 996) color_fprintf_ln(stdout, s->help_color, \"1          - %s\",\n4ba7c22a 998) color_fprintf_ln(stdout, s->help_color, \"3-5        - %s\",\n4ba7c22a 1000) color_fprintf_ln(stdout, s->help_color, \"2-3,6-9    - %s\",\n4ba7c22a 1002) color_fprintf_ln(stdout, s->help_color, \"foo        - %s\",\n4ba7c22a 1004) color_fprintf_ln(stdout, s->help_color, \"-...       - %s\",\n4ba7c22a 1006) color_fprintf_ln(stdout, s->help_color, \"*          - %s\",\n4ba7c22a 1008) color_fprintf_ln(stdout, s->help_color, \"           - %s\",\n4ba7c22a 1010) }\n4ba7c22a 1080) struct list_and_choose_options opts = {\n4ba7c22a 1085) struct prefix_item_list files = PREFIX_ITEM_LIST_INIT;\n4ba7c22a 1106) print_file_item_data.color = data.color;\n4ba7c22a 1107) print_file_item_data.reset = data.reset;\n4ba7c22a 1112) opts.list_opts.header = header.buf;\n4ba7c22a 1141) prefix_item_list_clear(&files);\n4ba7c22a 1143) strbuf_release(&print_file_item_data.name);\n\nJohannes Schindelin\t9d86921e built-in add -i: implement the `patch` command\nadd-interactive.c\n9d86921e 462) other_adddel = s->phase == FROM_INDEX ?\n9d86921e 463) &file_item->worktree : &file_item->index;\n9d86921e 467) if (stat.files[i]->is_binary) {\n9d86921e 468) if (!other_adddel->binary)\n9d86921e 469) s->binary_count++;\n9d86921e 472) if (stat.files[i]->is_unmerged) {\n9d86921e 473) if (!other_adddel->unmerged)\n9d86921e 474) s->unmerged_count++;\n9d86921e 475) adddel->unmerged = 1;\n9d86921e 539) if (unmerged_count)\n9d86921e 540) *unmerged_count = s.unmerged_count;\n9d86921e 541) if (binary_count)\n9d86921e 542) *binary_count = s.binary_count;\n9d86921e 625) if (get_modified_files(s->r, NO_FILTER, files, ps, NULL, NULL) < 0)\n9d86921e 642) if (get_modified_files(s->r, WORKTREE_ONLY, files, ps, NULL, NULL) < 0)\n9d86921e 721) if (get_modified_files(s->r, INDEX_ONLY, files, ps, NULL, NULL) < 0)\n9d86921e 873) static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n9d86921e 877) int res = 0;\n9d86921e 879) size_t unmerged_count = 0, binary_count = 0;\n9d86921e 881) if (get_modified_files(s->r, WORKTREE_ONLY, files, ps,\n9d86921e 883) return -1;\n9d86921e 885) if (unmerged_count || binary_count) {\n9d86921e 886) for (i = j = 0; i < files->items.nr; i++) {\n9d86921e 887) struct file_item *item = files->items.items[i].util;\n9d86921e 889) if (item->index.binary || item->worktree.binary) {\n9d86921e 890) free(item);\n9d86921e 891) free(files->items.items[i].string);\n9d86921e 892) } else if (item->index.unmerged ||\n9d86921e 894) color_fprintf_ln(stderr, s->error_color,\n9d86921e 896)  files->items.items[i].string);\n9d86921e 897) free(item);\n9d86921e 898) free(files->items.items[i].string);\n9d86921e 900) files->items.items[j++] = files->items.items[i];\n9d86921e 902) files->items.nr = j;\n9d86921e 905) if (!files->items.nr) {\n9d86921e 906) if (binary_count)\n9d86921e 907) fprintf(stderr, _(\"Only binary files changed.\\n\"));\n9d86921e 909) fprintf(stderr, _(\"No changes.\\n\"));\n9d86921e 910) return 0;\n9d86921e 913) opts->prompt = N_(\"Patch update\");\n9d86921e 914) count = list_and_choose(s, files, opts);\n9d86921e 915) if (count >= 0) {\n9d86921e 916) struct argv_array args = ARGV_ARRAY_INIT;\n9d86921e 918) argv_array_pushl(&args, \"git\", \"add--interactive\", \"--patch\",\n9d86921e 920) for (i = 0; i < files->items.nr; i++)\n9d86921e 921) if (files->selected[i])\n9d86921e 922) argv_array_push(&args,\n9d86921e 923) files->items.items[i].string);\n9d86921e 924) res = run_command_v_opt(args.argv, 0);\n9d86921e 925) argv_array_clear(&args);\n9d86921e 928) return res;\n\nJohannes Schindelin\ta5ced6db built-in add -i: allow filtering the modified files list\nadd-interactive.c\na5ced6db 447) if (s->skip_unseen)\na5ced6db 448) continue;\na5ced6db 487) static int get_modified_files(struct repository *r,\na5ced6db 508) for (i = 0; i < 2; i++) {\na5ced6db 512) if (filter == INDEX_ONLY)\na5ced6db 513) s.phase = i ? FROM_WORKTREE : FROM_INDEX;\na5ced6db 515) s.phase = i ? FROM_INDEX : FROM_WORKTREE;\na5ced6db 516) s.skip_unseen = filter && i;\n\nJohannes Schindelin\t465a9699 built-in add -i: re-implement the `diff` command\nadd-interactive.c\n465a9699 931) static int run_diff(struct add_i_state *s, const struct pathspec *ps,\n465a9699 935) int res = 0;\n465a9699 939) int is_initial = !resolve_ref_unsafe(\"HEAD\", RESOLVE_REF_READING, &oid,\n465a9699 941) if (get_modified_files(s->r, INDEX_ONLY, files, ps, NULL, NULL) < 0)\n465a9699 942) return -1;\n465a9699 944) if (!files->items.nr) {\n465a9699 945) putchar('\\n');\n465a9699 946) return 0;\n465a9699 949) opts->prompt = N_(\"Review diff\");\n465a9699 950) opts->flags = IMMEDIATE;\n465a9699 951) count = list_and_choose(s, files, opts);\n465a9699 952) opts->flags = 0;\n465a9699 953) if (count >= 0) {\n465a9699 954) struct argv_array args = ARGV_ARRAY_INIT;\n465a9699 956) argv_array_pushl(&args, \"git\", \"diff\", \"-p\", \"--cached\",\n465a9699 958)     s->r->hash_algo->empty_tree),\n465a9699 960) for (i = 0; i < files->items.nr; i++)\n465a9699 961) if (files->selected[i])\n465a9699 962) argv_array_push(&args,\n465a9699 963) files->items.items[i].string);\n465a9699 964) res = run_command_v_opt(args.argv, 0);\n465a9699 965) argv_array_clear(&args);\n465a9699 968) putchar('\\n');\n465a9699 969) return res;\n\nMartin Ågren\t3bcdd852 builtin/config: extract `handle_value_regex()` from `get_value()`\nbuiltin/config.c\n3bcdd852 330) return CONFIG_INVALID_PATTERN;\n3bcdd852 375) goto free_strings;\n\nMartin Ågren\t3bf986d6 builtin/config: collect \"value_regexp\" data in a struct\nbuiltin/config.c\n3bf986d6 329) FREE_AND_NULL(cmd_line_value.regexp);\n\nMike Hommey\t0aa0c2b2 revision: free topo_walk_info before creating a new one in init_topo_walk\nrevision.c\n0aa0c2b2 3214) static void reset_topo_walk(struct rev_info *revs)\n0aa0c2b2 3216) struct topo_walk_info *info = revs->topo_walk_info;\n0aa0c2b2 3218) clear_prio_queue(&info->explore_queue);\n0aa0c2b2 3219) clear_prio_queue(&info->indegree_queue);\n0aa0c2b2 3220) clear_prio_queue(&info->topo_queue);\n0aa0c2b2 3221) clear_indegree_slab(&info->indegree);\n0aa0c2b2 3222) clear_author_date_slab(&info->author_date);\n0aa0c2b2 3224) FREE_AND_NULL(revs->topo_walk_info);\n0aa0c2b2 3225) }\n0aa0c2b2 3232) reset_topo_walk(revs);\n\nRohit Ashiwal\tc068bcc5 sequencer: allow callers of read_author_script() to ignore fields\nsequencer.c\nc068bcc5 840) free(kv.items[date_i].util);\n\nRohit Ashiwal\tcbd8db17 rebase -i: support --committer-date-is-author-date\nsequencer.c\ncbd8db17 890) return NULL;\ncbd8db17 989) return -1;\ncbd8db17 1428) goto out;\ncbd8db17 1432) goto out;\ncbd8db17 2603) opts->allow_ff = 0;\ncbd8db17 2604) opts->committer_date_is_author_date = 1;\n\nRohit Ashiwal\t08187b4c rebase -i: support --ignore-date\nsequencer.c\n08187b4c 903) return NULL;\n08187b4c 920) argv_array_pushf(&child->env_array, \"GIT_COMMITTER_DATE=%s\", date.buf);\n08187b4c 1508) res = -1;\n08187b4c 1509) goto out;\n08187b4c 2608) opts->allow_ff = 0;\n08187b4c 2609) opts->ignore_date = 1;\n08187b4c 3639) push_dates(&cmd, opts->committer_date_is_author_date);\n\n\n\nUncovered code in 'next' not in 'master'\n--------------------------------------------------------\n\nCommits introducing uncovered code:\nDaniel Ferreira\t5e82b9e4 built-in add -i: implement the `status` command\nadd-interactive.c\n5e82b9e4 36) static void init_add_i_state(struct add_i_state *s, struct repository *r)\n5e82b9e4 54) }\n5e82b9e4 194) if (!list->nr)\n5e82b9e4 195) return;\n5e82b9e4 197) if (opts->header)\n5e82b9e4 201) for (i = 0; i < list->nr; i++) {\n5e82b9e4 202) opts->print_item(i, list->items + i, opts->print_item_data);\n5e82b9e4 215) putchar('\\n');\n5e82b9e4 305) }\n5e82b9e4 320) static void add_file_item(struct string_list *files, const char *name)\n5e82b9e4 322) struct file_item *item = xcalloc(sizeof(*item), 1);\n5e82b9e4 324) string_list_append(files, name)->util = item;\n5e82b9e4 325) }\n5e82b9e4 333) static int pathname_entry_cmp(const void *unused_cmp_data,\n5e82b9e4 338) const struct pathname_entry *e1 =\n5e82b9e4 340) const struct pathname_entry *e2 =\n5e82b9e4 343) return strcmp(e1->name, name ? (const char *)name : e2->name);\n5e82b9e4 355) static void collect_changes_cb(struct diff_queue_struct *q,\n5e82b9e4 359) struct collection_status *s = data;\n5e82b9e4 360) struct diffstat_t stat = { 0 };\n5e82b9e4 363) if (!q->nr)\n5e82b9e4 364) return;\n5e82b9e4 366) compute_diffstat(options, &stat, q);\n5e82b9e4 368) for (i = 0; i < stat.nr; i++) {\n5e82b9e4 369) const char *name = stat.files[i]->name;\n5e82b9e4 370) int hash = strhash(name);\n5e82b9e4 375) entry = hashmap_get_entry_from_hash(&s->file_map, hash, name,\n5e82b9e4 377) if (!entry) {\n5e82b9e4 378) add_file_item(s->files, name);\n5e82b9e4 380) entry = xcalloc(sizeof(*entry), 1);\n5e82b9e4 381) hashmap_entry_init(&entry->ent, hash);\n5e82b9e4 382) entry->name = s->files->items[s->files->nr - 1].string;\n5e82b9e4 383) entry->item = s->files->items[s->files->nr - 1].util;\n5e82b9e4 384) hashmap_add(&s->file_map, &entry->ent);\n5e82b9e4 387) file_item = entry->item;\n5e82b9e4 388) adddel = s->phase == FROM_INDEX ?\n5e82b9e4 389) &file_item->index : &file_item->worktree;\n5e82b9e4 390) adddel->seen = 1;\n5e82b9e4 391) adddel->add = stat.files[i]->added;\n5e82b9e4 392) adddel->del = stat.files[i]->deleted;\n5e82b9e4 393) if (stat.files[i]->is_binary)\n5e82b9e4 394) adddel->binary = 1;\n5e82b9e4 396) free_diffstat_info(&stat);\n5e82b9e4 399) static int get_modified_files(struct repository *r, struct string_list *files,\n5e82b9e4 403) int is_initial = !resolve_ref_unsafe(\"HEAD\", RESOLVE_REF_READING,\n5e82b9e4 405) struct collection_status s = { FROM_WORKTREE };\n5e82b9e4 407) if (discard_index(r->index) < 0 ||\n5e82b9e4 408)     repo_read_index_preload(r, ps, 0) < 0)\n5e82b9e4 411) string_list_clear(files, 1);\n5e82b9e4 412) s.files = files;\n5e82b9e4 413) hashmap_init(&s.file_map, pathname_entry_cmp, NULL, 0);\n5e82b9e4 415) for (s.phase = FROM_WORKTREE; s.phase <= FROM_INDEX; s.phase++) {\n5e82b9e4 417) struct setup_revision_opt opt = { 0 };\n5e82b9e4 419) opt.def = is_initial ?\n5e82b9e4 420) empty_tree_oid_hex() : oid_to_hex(&head_oid);\n5e82b9e4 422) init_revisions(&rev, NULL);\n5e82b9e4 423) setup_revisions(0, NULL, &rev, &opt);\n5e82b9e4 425) rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;\n5e82b9e4 426) rev.diffopt.format_callback = collect_changes_cb;\n5e82b9e4 427) rev.diffopt.format_callback_data = &s;\n5e82b9e4 429) if (ps)\n5e82b9e4 430) copy_pathspec(&rev.prune_data, ps);\n5e82b9e4 432) if (s.phase == FROM_INDEX)\n5e82b9e4 433) run_diff_index(&rev, 1);\n5e82b9e4 435) rev.diffopt.flags.ignore_dirty_submodules = 1;\n5e82b9e4 436) run_diff_files(&rev, 0);\n5e82b9e4 439) hashmap_free_entries(&s.file_map, struct pathname_entry, ent);\n5e82b9e4 442) string_list_sort(files);\n5e82b9e4 444) return 0;\n5e82b9e4 447) static void render_adddel(struct strbuf *buf,\n5e82b9e4 450) if (ad->binary)\n5e82b9e4 451) strbuf_addstr(buf, _(\"binary\"));\n5e82b9e4 452) else if (ad->seen)\n5e82b9e4 453) strbuf_addf(buf, \"+%\"PRIuMAX\"/-%\"PRIuMAX,\n5e82b9e4 454)     (uintmax_t)ad->add, (uintmax_t)ad->del);\n5e82b9e4 456) strbuf_addstr(buf, no_changes);\n5e82b9e4 457) }\n5e82b9e4 481) static void print_file_item(int i, struct string_list_item *item,\n5e82b9e4 484) struct file_item *c = item->util;\n5e82b9e4 485) struct print_file_item_data *d = print_file_item_data;\n5e82b9e4 487) strbuf_reset(&d->index);\n5e82b9e4 488) strbuf_reset(&d->worktree);\n5e82b9e4 489) strbuf_reset(&d->buf);\n5e82b9e4 491) render_adddel(&d->worktree, &c->worktree, _(\"nothing\"));\n5e82b9e4 492) render_adddel(&d->index, &c->index, _(\"unchanged\"));\n5e82b9e4 493) strbuf_addf(&d->buf, d->modified_fmt,\n5e82b9e4 496) printf(\" %2d: %s\", i + 1, d->buf.buf);\n5e82b9e4 497) }\n5e82b9e4 499) static int run_status(struct add_i_state *s, const struct pathspec *ps,\n5e82b9e4 502) if (get_modified_files(s->r, files, ps) < 0)\n5e82b9e4 503) return -1;\n5e82b9e4 506) putchar('\\n');\n5e82b9e4 508) return 0;\n5e82b9e4 573) struct add_i_state s = { NULL };\n5e82b9e4 588) struct print_file_item_data print_file_item_data = {\n5e82b9e4 591) struct list_options opts = {\n5e82b9e4 594) struct strbuf header = STRBUF_INIT;\n5e82b9e4 595) struct string_list files = STRING_LIST_INIT_DUP;\n5e82b9e4 597) int res = 0;\n5e82b9e4 606) init_add_i_state(&s, r);\n5e82b9e4 617) strbuf_addstr(&header, \"      \");\n5e82b9e4 618) strbuf_addf(&header, print_file_item_data.modified_fmt,\n5e82b9e4 620) opts.header = header.buf;\n5e82b9e4 622) if (discard_index(r->index) < 0 ||\n5e82b9e4 623)     repo_read_index(r) < 0 ||\n5e82b9e4 624)     repo_refresh_and_write_index(r, REFRESH_QUIET, 0, 1,\n5e82b9e4 628) res = run_status(&s, ps, &files, &opts);\n5e82b9e4 644) string_list_clear(&files, 1);\n5e82b9e4 645) strbuf_release(&print_file_item_data.buf);\n5e82b9e4 646) strbuf_release(&print_file_item_data.index);\n5e82b9e4 647) strbuf_release(&print_file_item_data.worktree);\n5e82b9e4 648) strbuf_release(&header);\n5e82b9e4 651) return res;\n\nDerrick Stolee\t4bd0593e test-tool: use 'read-graph' helper\nt/helper/test-read-graph.c\n4bd0593e 23) die_errno(_(\"Could not open commit-graph '%s'\"), graph_name);\n4bd0593e 27) return 1;\n\nHans Jerry Illikainen\t392b862e gpg-interface: refactor the free-and-xmemdupz pattern\ngpg-interface.c\n392b862e 115) *field = NULL;\n\nHans Jerry Illikainen\t67a6ea63 gpg-interface: limit search for primary key fingerprint\ngpg-interface.c\n67a6ea63 184) replace_cstring(field, NULL, NULL);\n\nJames Coglan\tfbccf255 graph: automatically track display width of graph lines\ngraph.c\nfbccf255 904) graph_line_write_column(line, col, '|');\n\nJames Coglan\t0195285b graph: rename `new_mapping` to `old_mapping`\ngraph.c\n0195285b 421) REALLOC_ARRAY(graph->old_mapping, graph->column_capacity * 2);\n\nJeff King\t103fb6d4 fsck: accept an oid instead of a \"struct tag\" for fsck_tag()\nfsck.c\n103fb6d4 837) ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_OBJECT, \"invalid format - expected 'object' line\");\n103fb6d4 841) ret = report(options, oid, OBJ_TAG, FSCK_MSG_BAD_OBJECT_SHA1, \"invalid 'object' line format - bad sha1\");\n103fb6d4 848) ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TYPE_ENTRY, \"invalid format - expected 'type' line\");\n103fb6d4 853) ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TYPE, \"invalid format - unexpected end after 'type' line\");\n103fb6d4 857) ret = report(options, oid, OBJ_TAG, FSCK_MSG_BAD_TYPE, \"invalid 'type' value\");\n103fb6d4 863) ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TAG_ENTRY, \"invalid format - expected 'tag' line\");\n103fb6d4 868) ret = report(options, oid, OBJ_TAG, FSCK_MSG_MISSING_TAG, \"invalid format - unexpected end after 'type' line\");\n\nJeff King\t6da40b22 fsck: accept an oid instead of a \"struct blob\" for fsck_blob()\nfsck.c\n6da40b22 958) return report(options, oid, OBJ_BLOB,\n\nJeff King\t38370253 fsck: don't require an object struct for report()\nfsck.c\n38370253 980) return report(options, NULL, OBJ_NONE, FSCK_MSG_BAD_OBJECT_SHA1, \"no valid object to fsck\");\n38370253 991) return report(options, &obj->oid, obj->type,\n38370253 994)       obj->type);\n38370253 1029) ret |= report(options,\n\nJeff King\tb8b00f16 fsck: drop blob struct from fsck_finish()\nfsck.c\nb8b00f16 1027) if (is_promisor_object(oid))\n\nJeff King\tc5b4269b fsck: accept an oid instead of a \"struct commit\" for fsck_commit()\nfsck.c\nc5b4269b 781) return report(options, oid, OBJ_COMMIT, FSCK_MSG_MISSING_TREE, \"invalid format - expected 'tree' line\");\nc5b4269b 783) err = report(options, oid, OBJ_COMMIT, FSCK_MSG_BAD_TREE_SHA1, \"invalid 'tree' line format - bad sha1\");\nc5b4269b 790) err = report(options, oid, OBJ_COMMIT, FSCK_MSG_BAD_PARENT_SHA1, \"invalid 'parent' line format - bad sha1\");\nc5b4269b 804) err = report(options, oid, OBJ_COMMIT, FSCK_MSG_MISSING_AUTHOR, \"invalid format - expected 'author' line\");\nc5b4269b 810) return report(options, oid, OBJ_COMMIT, FSCK_MSG_MISSING_COMMITTER, \"invalid format - expected 'committer' line\");\n\nJeff King\t7b143c16 pack-bitmap: introduce bitmap_walk_contains()\npack-bitmap.c\n7b143c16 903) return 0;\n\nJeff King\tf66e0401 pack-objects: avoid pointless oe_map_new_pack() calls\npack-objects.c\nf66e0401 122) if (pack->in_pack)\nf66e0401 125) ALLOC_ARRAY(pack->in_pack, pack->nr_alloc);\n\nJeff King\tad7a4032 send-pack: check remote ref status on pack-objects failure\nsend-pack.c\nad7a4032 580) receive_status(&reader, remote_refs);\n\nJeff King\t228c78fb commit, tag: don't set parsed bit for parse failures\ntag.c\n228c78fb 152) FREE_AND_NULL(item->tag);\n\nJeff King\t78543993 fsck: don't require an object struct for fsck_ident()\nfsck.c\n78543993 733) return report(options, oid, type, FSCK_MSG_MISSING_NAME_BEFORE_EMAIL, \"invalid author/committer line - missing space before email\");\n78543993 740) return report(options, oid, type, FSCK_MSG_MISSING_SPACE_BEFORE_EMAIL, \"invalid author/committer line - missing space before email\");\n78543993 744) return report(options, oid, type, FSCK_MSG_BAD_EMAIL, \"invalid author/committer line - bad email\");\n78543993 750) return report(options, oid, type, FSCK_MSG_ZERO_PADDED_DATE, \"invalid author/committer line - zero-padded date\");\n78543993 754) return report(options, oid, type, FSCK_MSG_BAD_DATE, \"invalid author/committer line - bad date\");\n78543993 762) return report(options, oid, type, FSCK_MSG_BAD_TIMEZONE, \"invalid author/committer line - bad time zone\");\n\nJeff King\tcc579000 fsck: don't require an object struct in verify_headers()\nfsck.c\ncc579000 717) return report(options, oid, type,\n\nJeff King\t73390290 fsck: use oids rather than objects for object_name API\nfsck.c\n73390290 400) fsck_put_object_name(options, &entry.oid, \"%s%s/\",\n73390290 469) fsck_put_object_name(options, oid, \"%s^%d\",\n73390290 472) fsck_put_object_name(options, oid, \"%.*s~%d\",\n73390290 495) fsck_put_object_name(options, &tag->tagged->oid, \"%s\", name);\n\nJeff King\t7cb9754e pack-objects: introduce pack.allowPackReuse\nbuiltin/pack-objects.c\n7cb9754e 2834) allow_pack_reuse = git_config_bool(k, v);\n7cb9754e 2835) return 0;\n\nJeff King\t4f0bd8b9 pack-objects: improve partial packfile reuse\nbuiltin/pack-objects.c\n4f0bd8b9 1124) return 1;\n4f0bd8b9 2681) (reuse_packfile_bitmap &&\n4f0bd8b9 2682)  bitmap_walk_contains(bitmap_git, reuse_packfile_bitmap, oid));\n\npack-bitmap.c\n4f0bd8b9 808) return;\n4f0bd8b9 811) return;\n4f0bd8b9 823) return;\n4f0bd8b9 861) i = bitmap_git->pack->num_objects / BITS_IN_EWORD;\n\nJeff King\t82ef89b3 fsck: don't require object structs for display functions\nbuiltin/fsck.c\n82ef89b3 64) type = oid_object_info(the_repository, oid, NULL);\n82ef89b3 309) printf_ln(_(\"unreachable %s %s\"),\n82ef89b3 310)   printable_type(&obj->oid, obj->type),\n82ef89b3 311)   describe_object(&obj->oid));\n82ef89b3 367) fprintf_ln(stderr, _(\"Checking %s\"), describe_object(&obj->oid));\n82ef89b3 425)    printable_type(&obj->oid, obj->type),\n82ef89b3 426)    describe_object(&obj->oid));\n82ef89b3 439)   describe_object(&commit->object.oid));\n\nJeff King\tb2f2039c fsck: accept an oid instead of a \"struct tree\" for fsck_tree()\nfsck.c\nb2f2039c 622) retval += report(options, oid, OBJ_TREE, FSCK_MSG_BAD_TREE, \"cannot be parsed as a tree\");\nb2f2039c 669) retval += report(options, oid, OBJ_TREE, FSCK_MSG_FULL_PATHNAME, \"contains full pathnames\");\nb2f2039c 671) retval += report(options, oid, OBJ_TREE, FSCK_MSG_EMPTY_NAME, \"contains empty pathname\");\nb2f2039c 679) retval += report(options, oid, OBJ_TREE, FSCK_MSG_ZERO_PADDED_FILEMODE, \"contains zero-padded file modes\");\nb2f2039c 681) retval += report(options, oid, OBJ_TREE, FSCK_MSG_BAD_FILEMODE, \"contains bad file modes\");\nb2f2039c 685) retval += report(options, oid, OBJ_TREE, FSCK_MSG_TREE_NOT_SORTED, \"not properly sorted\");\n\nJohannes Schindelin\t68db1cbf built-in add -i: support `?` (prompt help)\nadd-interactive.c\n68db1cbf 50) init_color(r, s, \"help\", s->help_color, GIT_COLOR_BOLD_RED);\n68db1cbf 263) if (!strcmp(input.buf, \"?\")) {\n68db1cbf 264) opts->print_help(s);\n68db1cbf 265) continue;\n68db1cbf 559) static void command_prompt_help(struct add_i_state *s)\n68db1cbf 561) const char *help_color = s->help_color;\n68db1cbf 562) color_fprintf_ln(stdout, help_color, \"%s\", _(\"Prompt help:\"));\n68db1cbf 563) color_fprintf_ln(stdout, help_color, \"1          - %s\",\n68db1cbf 565) color_fprintf_ln(stdout, help_color, \"foo        - %s\",\n68db1cbf 567) color_fprintf_ln(stdout, help_color, \"           - %s\",\n68db1cbf 569) }\n\nJohannes Schindelin\t76b74323 built-in add -i: show unique prefixes of the commands\nadd-interactive.c\n76b74323 80) static void prefix_item_list_clear(struct prefix_item_list *list)\n76b74323 82) string_list_clear(&list->items, 1);\n76b74323 83) string_list_clear(&list->sorted, 0);\n76b74323 84) }\n76b74323 86) static void extend_prefix_length(struct string_list_item *p,\n76b74323 89) size_t *len = p->util;\n76b74323 91) if (!*len || memcmp(p->string, other_string, *len))\n76b74323 92) return;\n76b74323 95) char c = p->string[*len];\n76b74323 103) if (!c || ++*len > max_length || !isascii(c)) {\n76b74323 104) *len = 0;\n76b74323 105) break;\n76b74323 108) if (c != other_string[*len - 1])\n76b74323 109) break;\n76b74323 110) }\n76b74323 113) static void find_unique_prefixes(struct prefix_item_list *list)\n76b74323 117) if (list->sorted.nr == list->items.nr)\n76b74323 118) return;\n76b74323 120) string_list_clear(&list->sorted, 0);\n76b74323 122) list->sorted.items = xmalloc(st_mult(sizeof(*list->sorted.items),\n76b74323 123)      list->items.nr));\n76b74323 124) list->sorted.nr = list->sorted.alloc = list->items.nr;\n76b74323 126) for (i = 0; i < list->items.nr; i++) {\n76b74323 127) list->sorted.items[i].string = list->items.items[i].string;\n76b74323 128) list->sorted.items[i].util = list->items.items + i;\n76b74323 131) string_list_sort(&list->sorted);\n76b74323 133) for (i = 0; i < list->sorted.nr; i++) {\n76b74323 134) struct string_list_item *sorted_item = list->sorted.items + i;\n76b74323 135) struct string_list_item *item = sorted_item->util;\n76b74323 136) size_t *len = item->util;\n76b74323 138) *len = 0;\n76b74323 139) while (*len < list->min_length) {\n76b74323 140) char c = item->string[(*len)++];\n76b74323 142) if (!c || !isascii(c)) {\n76b74323 143) *len = 0;\n76b74323 144) break;\n76b74323 148) if (i > 0)\n76b74323 149) extend_prefix_length(item, sorted_item[-1].string,\n76b74323 151) if (i + 1 < list->sorted.nr)\n76b74323 152) extend_prefix_length(item, sorted_item[1].string,\n76b74323 157) static ssize_t find_unique(const char *string, struct prefix_item_list *list)\n76b74323 159) int index = string_list_find_insert_index(&list->sorted, string, 1);\n76b74323 162) if (list->items.nr != list->sorted.nr)\n76b74323 167) if (index < 0)\n76b74323 168) item = list->sorted.items[-1 - index].util;\n76b74323 169) else if (index > 0 &&\n76b74323 170)  starts_with(list->sorted.items[index - 1].string, string))\n76b74323 171) return -1;\n76b74323 172) else if (index + 1 < list->sorted.nr &&\n76b74323 173)  starts_with(list->sorted.items[index + 1].string, string))\n76b74323 174) return -1;\n76b74323 175) else if (index < list->sorted.nr)\n76b74323 176) item = list->sorted.items[Index].util;\n76b74323 178) return -1;\n76b74323 179) return item - list->items.items;\n76b74323 233) static ssize_t list_and_choose(struct add_i_state *s,\n76b74323 240) find_unique_prefixes(items);\n76b74323 247) list(s, &items->items, &opts->list_opts);\n76b74323 289) if (index < 0)\n76b74323 290) index = find_unique(p, items);\n76b74323 292) if (index < 0 || index >= items->items.nr)\n76b74323 460) static int is_valid_prefix(const char *prefix, size_t prefix_len)\n76b74323 462) return prefix_len && prefix &&\n76b74323 468) strcspn(prefix, \" \\t\\r\\n,\") >= prefix_len &&\t/* separators */\n76b74323 469) *prefix != '-' &&\t\t\t\t/* deselection */\n76b74323 470) !isdigit(*prefix) &&\t\t\t\t/* selection */\n76b74323 471) (prefix_len != 1 ||\n76b74323 472)  (*prefix != '*' &&\t\t\t\t/* \"all\" wildcard */\n76b74323 473)   *prefix != '?'));\t\t\t\t/* prompt help */\n76b74323 548) struct command_item *util = item->util;\n76b74323 550) if (!util->prefix_length ||\n76b74323 551)     !is_valid_prefix(item->string, util->prefix_length))\n76b74323 552) printf(\" %2d: %s\", i + 1, item->string);\n76b74323 586) struct prefix_item_list commands = PREFIX_ITEM_LIST_INIT;\n76b74323 599) for (i = 0; i < ARRAY_SIZE(command_list); i++) {\n76b74323 600) struct command_item *util = xcalloc(sizeof(*util), 1);\n76b74323 601) util->command = command_list[i].command;\n76b74323 602) string_list_append(&commands.items, command_list[i].string)\n76b74323 603) ->util = util;\n76b74323 638) struct command_item *util =\n76b74323 639) commands.items.items[i].util;\n76b74323 640) res = util->command(&s, ps, &files, &opts);\n76b74323 649) prefix_item_list_clear(&commands);\n\nJohannes Schindelin\t867bc1d2 rebase-merges: move labels' whitespace mangling into `label_oid()`\nsequencer.c\n867bc1d2 4539) }\n\nJohannes Schindelin\t6348bfba built-in add -i: implement the main loop\nadd-interactive.c\n6348bfba 192) int i, last_lf = 0;\n6348bfba 204) if ((opts->columns) && ((i + 1) % (opts->columns))) {\n6348bfba 205) putchar('\\t');\n6348bfba 206) last_lf = 0;\n6348bfba 209) putchar('\\n');\n6348bfba 210) last_lf = 1;\n6348bfba 214) if (!last_lf)\n6348bfba 237) struct strbuf input = STRBUF_INIT;\n6348bfba 238) ssize_t res = LIST_AND_CHOOSE_ERROR;\n6348bfba 245) strbuf_reset(&input);\n6348bfba 251) fflush(stdout);\n6348bfba 253) if (strbuf_getline(&input, stdin) == EOF) {\n6348bfba 254) putchar('\\n');\n6348bfba 255) res = LIST_AND_CHOOSE_QUIT;\n6348bfba 256) break;\n6348bfba 258) strbuf_trim(&input);\n6348bfba 260) if (!input.len)\n6348bfba 261) break;\n6348bfba 268) p = input.buf;\n6348bfba 270) size_t sep = strcspn(p, \" \\t\\r\\n,\");\n6348bfba 271) ssize_t index = -1;\n6348bfba 273) if (!sep) {\n6348bfba 274) if (!*p)\n6348bfba 275) break;\n6348bfba 276) p++;\n6348bfba 277) continue;\n6348bfba 280) if (isdigit(*p)) {\n6348bfba 282) index = strtoul(p, &endp, 10) - 1;\n6348bfba 283) if (endp != p + sep)\n6348bfba 284) index = -1;\n6348bfba 287) if (p[sep])\n6348bfba 288) p[sep++] = '\\0';\n6348bfba 296) res = index;\n6348bfba 297) break;\n6348bfba 300) p += sep;\n6348bfba 301) }\n6348bfba 303) if (res != LIST_AND_CHOOSE_ERROR)\n6348bfba 304) break;\n6348bfba 307) strbuf_release(&input);\n6348bfba 308) return res;\n6348bfba 544) static void print_command_item(int i, struct string_list_item *item,\n6348bfba 557) }\n6348bfba 575) struct list_and_choose_options main_loop_opts = {\n6348bfba 582) } command_list[] = {\n6348bfba 631) i = list_and_choose(&s, &commands, &main_loop_opts);\n6348bfba 632) if (i == LIST_AND_CHOOSE_QUIT) {\n6348bfba 633) printf(_(\"Bye.\\n\"));\n6348bfba 634) res = 0;\n6348bfba 635) break;\n6348bfba 637) if (i != LIST_AND_CHOOSE_ERROR) {\n6348bfba 642) }\n\nJohannes Schindelin\t4d17fd25 remote-curl: unbreak http.extraHeader with custom allocators\nhttp.c\n4d17fd25 417) string_list_clear(&extra_http_headers, 0);\n\nJohannes Schindelin\t2e0afafe Add git-bundle: move objects and references by archive\nbuiltin/bundle.c\n2e0afafe 115) return 1;\n\nJohannes Schindelin\t116d1fa6 vreportf(): avoid relying on stdio buffering\nusage.c\n116d1fa6 16) fprintf(stderr, \"BUG!!! too long a prefix '%s'\\n\", prefix);\n116d1fa6 17) abort();\n116d1fa6 22) *p = '\\0'; /* vsnprintf() failed, clip at prefix */\n\nJohannes Schindelin\tf83dff60 Start to implement a built-in version of `git add --interactive`\nadd-interactive.c\nf83dff60 571) int run_add_i(struct repository *r, const struct pathspec *ps)\n\nbuiltin/add.c\nf83dff60 197) return !!run_add_i(the_repository, pathspec);\n\nMatthew Rogers\tcd552227 rebase -r: let `label` generate safer labels\nsequencer.c\ncd552227 4514) strbuf_addstr(buf, \"rev-\");\ncd552227 4515) strbuf_add_unique_abbrev(buf, oid, default_abbrev);\n\nPhillip Wood\t2d05ef27 sequencer: fix empty commit check when amending\nsequencer.c\n2d05ef27 1361) goto out;\n\nRobin H. Johnson\t73c3253d bundle: framework for options before bundle file\nbuiltin/bundle.c\n73c3253d 138) return 1;\n73c3253d 143) static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix) {\n73c3253d 145) int bundle_fd = -1;\n73c3253d 147) struct option options[] = {\n73c3253d 152) argc = parse_options_cmd_bundle(argc, argv, prefix,\n73c3253d 156) memset(&header, 0, sizeof(header));\n73c3253d 157) if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0)\n73c3253d 158) return 1;\n73c3253d 159) if (!startup_info->have_repository)\n73c3253d 161) return !!unbundle(the_repository, &header, bundle_fd, 0) ||\n73c3253d 162) list_bundle_refs(&header, argc, argv);\n73c3253d 187) else if (!strcmp(argv[0], \"unbundle\"))\n73c3253d 188) result = cmd_bundle_unbundle(argc, argv, prefix);\n\nRobin H. Johnson\t79862b6b bundle-create: progress output control\nbuiltin/bundle.c\n79862b6b 85) else if (progress == 1)\n79862b6b 86) argv_array_push(&pack_opts, \"--progress\");\n79862b6b 87) else if (progress == 2)\n79862b6b 88) argv_array_push(&pack_opts, \"--all-progress\");\n79862b6b 90) argv_array_push(&pack_opts, \"--all-progress-implied\");\n\nSlavica Đukić\t8c159044 built-in add -i: implement the `help` command\nadd-interactive.c\n8c159044 511) static int run_help(struct add_i_state *s, const struct pathspec *unused_ps,\n8c159044 515) color_fprintf_ln(stdout, s->help_color, \"status        - %s\",\n8c159044 517) color_fprintf_ln(stdout, s->help_color, \"update        - %s\",\n8c159044 519) color_fprintf_ln(stdout, s->help_color, \"revert        - %s\",\n8c159044 521) color_fprintf_ln(stdout, s->help_color, \"patch         - %s\",\n8c159044 523) color_fprintf_ln(stdout, s->help_color, \"diff          - %s\",\n8c159044 525) color_fprintf_ln(stdout, s->help_color, \"add untracked - %s\",\n8c159044 528) return 0;\n\nSlavica Đukić\t3d965c76 built-in add -i: use color in the main loop\nadd-interactive.c\n3d965c76 51) init_color(r, s, \"prompt\", s->prompt_color, GIT_COLOR_BOLD_BLUE);\n3d965c76 52) init_color(r, s, \"error\", s->error_color, GIT_COLOR_BOLD_RED);\n3d965c76 53) init_color(r, s, \"reset\", s->reset_color, GIT_COLOR_RESET);\n3d965c76 249) color_fprintf(stdout, s->prompt_color, \"%s\", opts->prompt);\n3d965c76 250) fputs(\"> \", stdout);\n3d965c76 293) color_fprintf_ln(stdout, s->error_color,\n3d965c76 547) struct print_command_item_data *d = print_command_item_data;\n3d965c76 554) printf(\" %2d: %s%.*s%s%s\", i + 1,\n3d965c76 555)        d->color, (int)util->prefix_length, item->string,\n3d965c76 556)        d->reset, item->string + util->prefix_length);\n3d965c76 574) struct print_command_item_data data = { \"[\", \"]\" };\n3d965c76 612) if (s.use_color) {\n3d965c76 613) data.color = s.prompt_color;\n3d965c76 614) data.reset = s.reset_color;\n\nSlavica Đukić\t1daaebca built-in add -i: color the header in the `status` command\nadd-interactive.c\n1daaebca 20) static void init_color(struct repository *r, struct add_i_state *s,\n1daaebca 24) char *key = xstrfmt(\"color.interactive.%s\", slot_name);\n1daaebca 27) if (!s->use_color)\n1daaebca 28) dst[0] = '\\0';\n1daaebca 29) else if (repo_config_get_value(r, key, &value) ||\n1daaebca 30)  color_parse(value, dst))\n1daaebca 31) strlcpy(dst, default_color, COLOR_MAXLEN);\n1daaebca 33) free(key);\n1daaebca 34) }\n1daaebca 40) s->r = r;\n1daaebca 42) if (repo_config_get_value(r, \"color.interactive\", &value))\n1daaebca 43) s->use_color = -1;\n1daaebca 45) s->use_color =\n1daaebca 46) git_config_colorbool(\"color.interactive\", value);\n1daaebca 47) s->use_color = want_color(s->use_color);\n1daaebca 49) init_color(r, s, \"header\", s->header_color, GIT_COLOR_BOLD);\n1daaebca 189) static void list(struct add_i_state *s, struct string_list *list,\n1daaebca 198) color_fprintf_ln(stdout, s->header_color,\n1daaebca 505) list(s, files, opts);\n\n\n\nUncovered code in 'master' not in 'master@{1}'\n--------------------------------------------------------\n\nCommits introducting uncovered code:\nAlex Henrie\tbaed6bbb diffcore-break: use a goto instead of a redundant if statement\ndiffcore-break.c\nbaed6bbb 295) diff_q(&outq, p);\n\nAli Utku Selen\tddb3c856 shallow.c: don't free unallocated slabs\nshallow.c\nddb3c856 157) continue;\n\nBrandon Casey\t040a6551 cleanup: use internal memory allocation wrapper functions everywhere\nstable-qsort.c\n040a6551 58) char *tmp = xmalloc(size);\n\nBrian Downing\t43fe901b compat: Add simplified merge sort implementation from glibc\nstable-qsort.c\n43fe901b 59) msort_with_tmp(b, n, s, cmp, tmp);\n43fe901b 60) free(tmp);\n\nbrian m. carlson\tce17feb1 path: add a function to check for path suffix\npath.c\nce17feb1 1246) return -1;\nce17feb1 1250) return -1;\nce17feb1 1259) return -1;\n\nbrian m. carlson\t6f119424 remote-curl: pass on atomic capability to remote side\nremote-curl.c\n6f119424 155) else if (!strcmp(value, \"false\"))\n6f119424 156) options.atomic = 0;\n6f119424 158) return -1;\n\nbrian m. carlson\t7e0d029f builtin/rev-parse: switch to use the_hash_algo\nbuiltin/rev-parse.c\n7e0d029f 735) abbrev = hexsz;\n\nbrian m. carlson\t8d4d86b0 cache: remove null_sha1\nbuiltin/submodule--helper.c\n8d4d86b0 427) printf(\"%06o %s U\\t\", ce->ce_mode, oid_to_hex(&null_oid));\n\nbrian m. carlson\t28ba1830 builtin/replace: make hash size independent\nbuiltin/replace.c\n28ba1830 275) if (strbuf_read(&result, cmd.out, the_hash_algo->hexsz + 1) < 0) {\n\nbrian m. carlson\tfabec2c5 builtin/receive-pack: switch to use the_hash_algo\nbuiltin/receive-pack.c\nfabec2c5 433) the_hash_algo->init_fn(&ctx);\nfabec2c5 434) the_hash_algo->update_fn(&ctx, key_in, key_len);\nfabec2c5 435) the_hash_algo->final_fn(key, &ctx);\n\nChristian Couder\t4ca9474e Move core_partial_clone_filter_default to promisor-remote.c\npromisor-remote.c\n4ca9474e 111) return git_config_string(&core_partial_clone_filter_default,\n\nChristian Couder\tfa3d1b63 promisor-remote: parse remote.*.partialclonefilter\npromisor-remote.c\nfa3d1b63 142) return 0;\n\nChristian Couder\t9e27beaa promisor-remote: implement promisor_remote_get_direct()\npromisor-remote.c\n9e27beaa 205) static int remove_fetched_oids(struct repository *repo,\n9e27beaa 209) int i, remaining_nr = 0;\n9e27beaa 210) int *remaining = xcalloc(oid_nr, sizeof(*remaining));\n9e27beaa 211) struct object_id *old_oids = *oids;\n9e27beaa 214) for (i = 0; i < oid_nr; i++)\n9e27beaa 215) if (oid_object_info_extended(repo, &old_oids[i], NULL,\n9e27beaa 217) remaining[i] = 1;\n9e27beaa 218) remaining_nr++;\n9e27beaa 221) if (remaining_nr) {\n9e27beaa 222) int j = 0;\n9e27beaa 223) new_oids = xcalloc(remaining_nr, sizeof(*new_oids));\n9e27beaa 224) for (i = 0; i < oid_nr; i++)\n9e27beaa 225) if (remaining[i])\n9e27beaa 226) oidcpy(&new_oids[j++], &old_oids[i]);\n9e27beaa 227) *oids = new_oids;\n9e27beaa 228) if (to_free)\n9e27beaa 229) free(old_oids);\n9e27beaa 232) free(remaining);\n9e27beaa 234) return remaining_nr;\n9e27beaa 251) if (remaining_nr == 1)\n9e27beaa 252) continue;\n9e27beaa 253) remaining_nr = remove_fetched_oids(repo, &remaining_oids,\n9e27beaa 255) if (remaining_nr) {\n9e27beaa 256) to_free = 1;\n9e27beaa 257) continue;\n9e27beaa 265) free(remaining_oids);\n\nChristian Couder\t48de3158 Add initial support for many promisor remotes\npromisor-remote.c\n48de3158 63) return NULL;\n\nChristian Couder\tfaf2abf4 promisor-remote: use repository_format_partial_clone\npromisor-remote.c\nfaf2abf4 95) if (previous)\nfaf2abf4 96) previous->next = r->next;\nfaf2abf4 98) promisors = r->next ? r->next : r;\nfaf2abf4 99) r->next = NULL;\nfaf2abf4 100) *promisors_tail = r;\nfaf2abf4 101) promisors_tail = &r->next;\n\nDenton Liu\tc0efb4c1 rebase: fast-forward --onto in more cases\nbuiltin/rebase.c\nc0efb4c1 1289) goto done;\n\nDenton Liu\t2b318aa6 rebase: refactor can_fast_forward into goto tower\nbuiltin/rebase.c\n2b318aa6 1273) goto done;\n\nDerrick Stolee\t50f26bd0 fetch: add fetch.writeCommitGraph config setting\nrepo-settings.c\n50f26bd0 57) UPDATE_DEFAULT_BOOL(r->settings.fetch_write_commit_graph, 1);\n\nDerrick Stolee\taaf633c2 repo-settings: create feature.experimental setting\nfetch-pack.c\naaf633c2 952) else if (args->depth > 0 || is_repository_shallow(r))\n\nrepo-settings.c\naaf633c2 43) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;\naaf633c2 55) UPDATE_DEFAULT_BOOL(r->settings.pack_use_sparse, 1);\naaf633c2 56) UPDATE_DEFAULT_BOOL(r->settings.fetch_negotiation_algorithm, FETCH_NEGOTIATION_SKIPPING);\n\nElijah Newren\tff1bfa2c merge-recursive: use common name for ancestors/common/base_list\nmerge-recursive.c\nff1bfa2c 3815)    oid_to_hex(merge_bases[i]));\n\nElijah Newren\tf836bf39 merge-recursive: future-proof update_file_flags() against memory leaks\nmerge-recursive.c\nf836bf39 960) ret = err(opt, _(\"cannot read object %s '%s'\"),\nf836bf39 962) goto free_buf;\n\nElijah Newren\t98a1d3d8 merge-recursive: exit early if index != head\nmerge-recursive.c\n98a1d3d8 3750) return -1;\n\nElijah Newren\t65c01c64 checkout: provide better conflict hunk description with detached HEAD\nbuiltin/checkout.c\n65c01c64 766) strbuf_add_unique_abbrev(&old_commit_shortname,\n65c01c64 767)  &old_branch_info->commit->object.oid,\n65c01c64 769) o.ancestor = old_commit_shortname.buf;\n\nElijah Newren\t941790d7 fast-export: handle nested tags\nbuiltin/fast-export.c\n941790d7 864) tagged_mark = get_object_mark(tagged);\n\nElijah Newren\t3164e6bd fast-import: fix handling of deleted tags\nfast-import.c\n3164e6bd 2835) first_tag = t->next_tag;\n\nElijah Newren\t9822175d Ensure index matches head before invoking merge machinery, round N\nbuiltin/merge-recursive.c\n9822175d 68) die_resolve_conflict(\"merge\");\n\nElijah Newren\tb8f50e5b fast-import: add support for new 'alias' command\nfast-import.c\nb8f50e5b 2554) return 0;\n\nElijah Newren\t724dd767 cache-tree: share code between functions writing an index as a tree\ncache-tree.c\n724dd767 619) cache_tree_free(&index_state->cache_tree);\n724dd767 620) cache_tree_valid = 0;\n724dd767 633) return WRITE_TREE_PREFIX_ERROR;\n724dd767 653) fprintf(stderr, \"BUG: There are unmerged index entries:\\n\");\n724dd767 654) for (i = 0; i < index_state->cache_nr; i++) {\n724dd767 655) const struct cache_entry *ce = index_state->cache[i];\n724dd767 656) if (ce_stage(ce))\n724dd767 657) fprintf(stderr, \"BUG: %d %.*s\\n\", ce_stage(ce),\n724dd767 658) (int)ce_namelen(ce), ce->name);\n\nElijah Newren\t89a1f4aa dir: if our pathspec might match files under a dir, recurse into it\ndir.c\n89a1f4aa 374) return MATCHED_RECURSIVELY_LEADING_PATHSPEC;\n\nEric Wong\tb94e5c1d hashmap_add takes \"struct hashmap_entry *\"\nt/helper/test-hashmap.c\nb94e5c1d 110) hashmap_add(&map, &entries[i]->ent);\nb94e5c1d 123) hashmap_add(&map, &entries[i]->ent);\n\nEric Wong\tc8e424c9 hashmap: introduce hashmap_free_entries\nt/helper/test-hashmap.c\nc8e424c9 113) hashmap_free(&map);\nc8e424c9 133) hashmap_free(&map);\n\nEric Wong\t87571c3f hashmap: use *_entry APIs for iteration\nt/helper/test-lazy-init-name-hash.c\n87571c3f 44) hashmap_for_each_entry(&the_index.dir_hash, &iter_dir, dir,\n87571c3f 48) hashmap_for_each_entry(&the_index.name_hash, &iter_cache, ce,\n\nEric Wong\t28ee7941 hashmap_remove takes \"const struct hashmap_entry *\"\nname-hash.c\n28ee7941 100) hashmap_remove(&istate->dir_hash, &dir->ent, NULL);\n\nEric Wong\td22245a2 hashmap_entry_init takes \"struct hashmap_entry *\"\nt/helper/test-hashmap.c\nd22245a2 109) hashmap_entry_init(&entries[i]->ent, hashes[i]);\nd22245a2 122) hashmap_entry_init(&entries[i]->ent, hashes[i]);\n\nJeff Hostetler\t742ed633 trace2: cleanup whitespace in perf format\ntrace2/tr2_tgt_perf.c\n742ed633 302) strbuf_addf(&buf_payload, \"alias:%s argv:[\", alias);\n742ed633 303) sq_append_quote_argv_pretty(&buf_payload, argv);\n742ed633 304) strbuf_addch(&buf_payload, ']');\n742ed633 335) strbuf_addstr(&buf_payload, \"git\");\n742ed633 336) if (cmd->argv[0])\n742ed633 337) strbuf_addch(&buf_payload, ' ');\n742ed633 391) strbuf_addstr(&buf_payload, \"argv:[\");\n742ed633 392) if (exe) {\n742ed633 393) strbuf_addstr(&buf_payload, exe);\n742ed633 394) if (argv[0])\n742ed633 395) strbuf_addch(&buf_payload, ' ');\n742ed633 397) sq_append_quote_argv_pretty(&buf_payload, argv);\n742ed633 398) strbuf_addch(&buf_payload, ']');\n\nJeff Hostetler\te3443055 trace2: cleanup whitespace in normal format\ntrace2/tr2_tgt_normal.c\ne3443055 189) strbuf_addf(&buf_payload, \"alias %s -> \", alias);\ne3443055 190) sq_append_quote_argv_pretty(&buf_payload, argv);\ne3443055 201) strbuf_addf(&buf_payload, \"child_start[%d]\", cmd->trace2_child_id);\ne3443055 204) strbuf_addstr(&buf_payload, \" cd \");\ne3443055 206) strbuf_addstr(&buf_payload, \";\");\ne3443055 214) strbuf_addch(&buf_payload, ' ');\ne3443055 216) strbuf_addstr(&buf_payload, \"git \");\ne3443055 217) sq_append_quote_argv_pretty(&buf_payload, cmd->argv);\ne3443055 242) if (exe) {\ne3443055 244) strbuf_addch(&buf_payload, ' ');\ne3443055 246) sq_append_quote_argv_pretty(&buf_payload, argv);\n\nJeff Hostetler\tda4589ce trace2: trim whitespace in region messages in perf target format\ntrace2/tr2_tgt_perf.c\nda4589ce 459) strbuf_addf(&buf_payload, \"label:%s\", label);\nda4589ce 460) if (fmt && *fmt) {\nda4589ce 461) strbuf_addch(&buf_payload, ' ');\nda4589ce 462) maybe_append_string_va(&buf_payload, fmt, ap);\nda4589ce 479) strbuf_addf(&buf_payload, \"label:%s\", label);\nda4589ce 480) if (fmt && *fmt) {\nda4589ce 481) strbuf_addch(&buf_payload, ' ' );\nda4589ce 482) maybe_append_string_va(&buf_payload, fmt, ap);\n\nJeff Hostetler\t371df1be trace2: cleanup column alignment in perf target format\ntrace2/tr2_tgt_perf.c\n371df1be 88) fl_end_col = buf->len + TR2FMT_PERF_FL_WIDTH;\n371df1be 90) if (file && *file) {\n371df1be 91) struct strbuf buf_fl = STRBUF_INIT;\n371df1be 93) strbuf_addf(&buf_fl, \"%s:%d\", file, line);\n371df1be 95) if (buf_fl.len <= TR2FMT_PERF_FL_WIDTH)\n371df1be 96) strbuf_addbuf(buf, &buf_fl);\n371df1be 98) size_t avail = TR2FMT_PERF_FL_WIDTH - 3;\n371df1be 99) strbuf_addstr(buf, \"...\");\n371df1be 100) strbuf_add(buf,\n371df1be 101)    &buf_fl.buf[buf_fl.len - avail],\n371df1be 105) strbuf_release(&buf_fl);\n371df1be 108) while (buf->len < fl_end_col)\n371df1be 111) strbuf_addstr(buf, \" | \");\n\nJeff King\t90553847 tree-walk: drop oid from traverse_info\nunpack-trees.c\n90553847 1144) if (*info->prev->name)\n90553847 1147) printf(\"%s\", info->name);\n\nJeff King\t0dfed92d git-am: handle missing \"author\" when parsing commit\nbuiltin/am.c\n0dfed92d 1263)       oid_to_hex(&commit->object.oid));\n\nJeff King\t9827d4c1 packfile: drop release_pack_memory()\nwrapper.c\n9827d4c1 45) if (!gentle)\n9827d4c1 51) return NULL;\n\nJohannes Schindelin\td54dea77 fetch: let --jobs=<n> parallelize --multiple, too\nbuiltin/fetch.c\nd54dea77 113) fetch_parallel_config = git_config_int(k, v);\nd54dea77 114) if (fetch_parallel_config < 0)\nd54dea77 116) return 0;\nd54dea77 1566) static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)\nd54dea77 1568) struct parallel_fetch_state *state = cb;\nd54dea77 1569) const char *remote = task_cb;\nd54dea77 1573) return 0;\n\nJohannes Schindelin\te145d993 rebase -r: support merge strategies other than `recursive`\nsequencer.c\ne145d993 3304) (!opts->strategy || !strcmp(opts->strategy, \"recursive\")) ?\n\nJohannes Schindelin\te2683d51 Fix .git/ discovery at the root of UNC shares\nsetup.c\ne2683d51 952)     !is_dir_sep(dir->buf[min_offset - 1])) {\ne2683d51 953) strbuf_addch(dir, '/');\ne2683d51 954) min_offset++;\n\nJohannes Schindelin\tbe5d88e1 test-tool run-command: learn to run (parts of) the testsuite\nt/helper/test-run-command.c\nbe5d88e1 66) static int next_test(struct child_process *cp, struct strbuf *err, void *cb,\nbe5d88e1 69) struct testsuite *suite = cb;\nbe5d88e1 71) if (suite->next >= suite->tests.nr)\nbe5d88e1 72) return 0;\nbe5d88e1 74) test = suite->tests.items[suite->next++].string;\nbe5d88e1 75) argv_array_pushl(&cp->args, \"sh\", test, NULL);\nbe5d88e1 76) if (suite->quiet)\nbe5d88e1 77) argv_array_push(&cp->args, \"--quiet\");\nbe5d88e1 78) if (suite->immediate)\nbe5d88e1 79) argv_array_push(&cp->args, \"-i\");\nbe5d88e1 80) if (suite->verbose)\nbe5d88e1 81) argv_array_push(&cp->args, \"-v\");\nbe5d88e1 82) if (suite->verbose_log)\nbe5d88e1 83) argv_array_push(&cp->args, \"-V\");\nbe5d88e1 84) if (suite->trace)\nbe5d88e1 85) argv_array_push(&cp->args, \"-x\");\nbe5d88e1 86) if (suite->write_junit_xml)\nbe5d88e1 87) argv_array_push(&cp->args, \"--write-junit-xml\");\nbe5d88e1 89) strbuf_addf(err, \"Output of '%s':\\n\", test);\nbe5d88e1 90) *task_cb = (void *)test;\nbe5d88e1 92) return 1;\nbe5d88e1 95) static int test_finished(int result, struct strbuf *err, void *cb,\nbe5d88e1 98) struct testsuite *suite = cb;\nbe5d88e1 99) const char *name = (const char *)task_cb;\nbe5d88e1 101) if (result)\nbe5d88e1 102) string_list_append(&suite->failed, name);\nbe5d88e1 104) strbuf_addf(err, \"%s: '%s'\\n\", result ? \"FAIL\" : \"SUCCESS\", name);\nbe5d88e1 106) return 0;\nbe5d88e1 109) static int test_failed(struct strbuf *out, void *cb, void *task_cb)\nbe5d88e1 111) struct testsuite *suite = cb;\nbe5d88e1 112) const char *name = (const char *)task_cb;\nbe5d88e1 114) string_list_append(&suite->failed, name);\nbe5d88e1 115) strbuf_addf(out, \"FAILED TO START: '%s'\\n\", name);\nbe5d88e1 117) return 0;\nbe5d88e1 125) static int testsuite(int argc, const char **argv)\nbe5d88e1 127) struct testsuite suite = TESTSUITE_INIT;\nbe5d88e1 128) int max_jobs = 1, i, ret;\nbe5d88e1 131) struct option options[] = {\nbe5d88e1 145) memset(&suite, 0, sizeof(suite));\nbe5d88e1 146) suite.tests.strdup_strings = suite.failed.strdup_strings = 1;\nbe5d88e1 148) argc = parse_options(argc, argv, NULL, options,\nbe5d88e1 151) if (max_jobs <= 0)\nbe5d88e1 152) max_jobs = online_cpus();\nbe5d88e1 154) dir = opendir(\".\");\nbe5d88e1 155) if (!dir)\nbe5d88e1 157) while ((d = readdir(dir))) {\nbe5d88e1 158) const char *p = d->d_name;\nbe5d88e1 160) if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||\nbe5d88e1 161)     !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||\nbe5d88e1 162)     !ends_with(p, \".sh\"))\nbe5d88e1 163) continue;\nbe5d88e1 166) if (!argc) {\nbe5d88e1 167) string_list_append(&suite.tests, p);\nbe5d88e1 168) continue;\nbe5d88e1 171) for (i = 0; i < argc; i++)\nbe5d88e1 172) if (!wildmatch(argv[i], p, 0)) {\nbe5d88e1 173) string_list_append(&suite.tests, p);\nbe5d88e1 174) break;\nbe5d88e1 177) closedir(dir);\nbe5d88e1 179) if (!suite.tests.nr)\nbe5d88e1 181) if (max_jobs > suite.tests.nr)\nbe5d88e1 182) max_jobs = suite.tests.nr;\nbe5d88e1 184) fprintf(stderr, \"Running %d tests (%d at a time)\\n\",\nbe5d88e1 187) ret = run_processes_parallel(max_jobs, next_test, test_failed,\nbe5d88e1 190) if (suite.failed.nr > 0) {\nbe5d88e1 191) ret = 1;\nbe5d88e1 192) fprintf(stderr, \"%d tests failed:\\n\\n\", suite.failed.nr);\nbe5d88e1 193) for (i = 0; i < suite.failed.nr; i++)\nbe5d88e1 194) fprintf(stderr, \"\\t%s\\n\", suite.failed.items[i].string);\nbe5d88e1 197) string_list_clear(&suite.tests, 0);\nbe5d88e1 198) string_list_clear(&suite.failed, 0);\nbe5d88e1 200) return !!ret;\nbe5d88e1 209) exit(testsuite(argc - 1, argv + 1));\n\nJosh Steadmon\t87db61a4 trace2: write discard message to sentinel files\ntrace2/tr2_dst.c\n87db61a4 136) strbuf_setlen(&path, base_path_len);\n87db61a4 137) strbuf_addf(&path, \".%d\", attempt_count);\n\nJosh Steadmon\t83e57b04 trace2: discard new traces if target directory has too many files\ntrace2/tr2_dst.c\n83e57b04 90) ret = 1;\n83e57b04 91) goto cleanup;\n83e57b04 145) strbuf_release(&path);\n83e57b04 151) return 0;\n\nJunio C Hamano\t360c7ba3 transport: push codepath can take arbitrary repository\ntransport.c\n360c7ba3 1200) trace2_region_leave(\"transport_push\", \"push_submodules\", r);\n\nMatthew DeVore\t9430147c list-objects-filter: encapsulate filter components\nlist-objects.c\n9430147c 210) ctx->show_object(obj, base->buf, ctx->show_data);\n\nMatthew DeVore\te987df5f list-objects-filter: implement composite filters\nlist-objects-filter-options.c\ne987df5f 311) return;\n\nMatthew DeVore\tcf9ceb5a list-objects-filter-options: make filter_spec a string_list\nupload-pack.c\ncf9ceb5a 148) sq_quote_buf(&buf, spec);\n\nMischa POSLAWSKY\t8b3f33ef ref-filter: initialize empty name or email fields\nref-filter.c\n8b3f33ef 1045) return xstrdup(\"\");\n\nPhillip Wood\t49697cb7 move run_commit_hook() to libgit and use it there\nsequencer.c\n49697cb7 1137) arg1 = \"commit\";\n49697cb7 1138) arg2 = commit;\n\nPhillip Wood\ta47ba3c7 rebase -i: check for updated todo after squash and reword\nsequencer.c\na47ba3c7 3915) res = error_errno(_(\"could not stat '%s'\"),\na47ba3c7 3921) res = -1; /* message was printed */\n\nRené Scharfe\t59fa5f5a sha1-name: check for overflow of N in \"foo^N\" and \"foo~N\"\nsha1-name.c\n59fa5f5a 1172) return MISSING_OBJECT;\n59fa5f5a 1178) return MISSING_OBJECT;\n\nRené Scharfe\t5cc6a4be http-push: simplify deleting a list item\nhttp-push.c\n5cc6a4be 984) prev->next = lock->next;\n\nSZEDER Gábor\tc72fc40d path.c: clarify two field names in 'struct common_dir'\npath.c\nc72fc40d 380) for (p = common_list; p->path; p++) {\nc72fc40d 381) const char *path = p->path;\n\nThomas Gummerer\t34933d0e stash: make sure to write refreshed cache\nbuiltin/stash.c\n34933d0e 1140) ret = -1;\n34933d0e 1141) goto done;\n\nThomas Gummerer\t22184497 factor out refresh_and_write_cache function\nread-cache.c\n22184497 1487) return -1;\n22184497 1491) ret = -1;\n\nWilliam Baker\t840cef0c midx: add progress to write_midx_file\nmidx.c\n840cef0c 973) progress = start_progress(_(\"Writing chunks to multi-pack-index\"),\n\n\n"},{"id":"387105","messageId":"nycvar.QRO.7.76.6.1911262116100.31080@tvgsbejvaqbjf.bet","threadId":"52332","inReplyTo":"1cb7ddbf-020e-d63a-85b6-5a9267c0a5a3@gmail.com","subject":"Re: Git Test Coverage Report (Nov 25)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-11-26T20:46:43Z","receivedAt":"2019-11-26T20:47:05Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Stolee,\n\nthank you for keeping doing these reports.\n\nOn Mon, 25 Nov 2019, Derrick Stolee wrote:\n\n> Here is today's test coverage report.\n>\n> Sorry for the delay, but I had some issues working out the new\n> \"ignored lines\" logic. Now there are a few phrases that are\n> ignored automatically, including \"BUG(\" or \"die(\".\n>\n> [...]\n> Johannes Schindelin\teea4a7f4 mingw: demonstrate that all file handles are inherited by child processes\n> t/helper/test-run-command.c\n> eea4a7f4 203) static int inherit_handle(const char *argv0)\n> eea4a7f4 205) struct child_process cp = CHILD_PROCESS_INIT;\n> eea4a7f4 210) xsnprintf(path, sizeof(path), \"out-XXXXXX\");\n> eea4a7f4 211) tmp = xmkstemp(path);\n> eea4a7f4 213) argv_array_pushl(&cp.args,\n> eea4a7f4 215) cp.in = -1;\n> eea4a7f4 216) cp.no_stdout = cp.no_stderr = 1;\n> eea4a7f4 217) if (start_command(&cp) < 0)\n> eea4a7f4 221) close(tmp);\n> eea4a7f4 222) if (unlink(path))\n> eea4a7f4 225) if (close(cp.in) < 0 || finish_command(&cp) < 0)\n> eea4a7f4 228) return 0;\n> eea4a7f4 231) static int inherit_handle_child(void)\n> eea4a7f4 233) struct strbuf buf = STRBUF_INIT;\n> eea4a7f4 235) if (strbuf_read(&buf, 0, 0) < 0)\n> eea4a7f4 237) printf(\"Received %s\\n\", buf.buf);\n> eea4a7f4 238) strbuf_release(&buf);\n> eea4a7f4 240) return 0;\n> eea4a7f4 251) exit(inherit_handle(argv[0]));\n> eea4a7f4 253) exit(inherit_handle_child());\n\nI think this is actually covered, but only in the Windows build.\n\n> Johannes Schindelin\t116a408b commit: give correct advice for empty commit during a rebase\n> builtin/commit.c\n> 116a408b 478) else if (whence == FROM_CHERRY_PICK) {\n> 116a408b 479) if (rebase_in_progress && !sequencer_in_use)\n> 116a408b 1186) else if (whence == FROM_CHERRY_PICK) {\n> 116a408b 1187) if (rebase_in_progress && !sequencer_in_use)\n\nMy understanding is that Phillip is working on a replacement for this\npatch, so I'll leave this as-is for now.\n\n> Johannes Schindelin\t0de7b036 built-in add -i: offer the `quit` command\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\td17e3a76 built-in add -i: prepare for multi-selection commands\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\tdea080c8 built-in add -i: re-implement `revert` in C\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\tdaabf56b built-in add -i: re-implement `add-untracked` in C\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\t4ba7c22a built-in add -i: implement the `update` command\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\t9d86921e built-in add -i: implement the `patch` command\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\ta5ced6db built-in add -i: allow filtering the modified files list\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\t465a9699 built-in add -i: re-implement the `diff` command\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\t68db1cbf built-in add -i: support `?` (prompt help)\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\t76b74323 built-in add -i: show unique prefixes of the commands\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\t6348bfba built-in add -i: implement the main loop\n> add-interactive.c\n> [...]\n>\n> Johannes Schindelin\tf83dff60 Start to implement a built-in version of `git add --interactive`\n> add-interactive.c\n> f83dff60 571) int run_add_i(struct repository *r, const struct pathspec *ps)\n>\n> builtin/add.c\n> f83dff60 197) return !!run_add_i(the_repository, pathspec);\n\nThis ginormous amount of code without test coverage is exactly the type of\nproblem I pointed out with the approach I had to take in the built-in add\n-i/-p series, and which I described in the commit message\nhttps://public-inbox.org/git/5d9962d4344fa182b37cd8d969da01bc603414be.1573648866.git.gitgitgadget@gmail.com/\nMost of it _will_ be covered by the tests, but _only_ at the very end,\nwhen all six patch series will be merged.\n\n> Johannes Schindelin\t867bc1d2 rebase-merges: move labels' whitespace mangling into `label_oid()`\n> sequencer.c\n> 867bc1d2 4539) }\n\nNot sure why this closing parenthesis isn't covered :-D\n\n> Johannes Schindelin\t4d17fd25 remote-curl: unbreak http.extraHeader with custom allocators\n> http.c\n> 4d17fd25 417) string_list_clear(&extra_http_headers, 0);\n\nI think it is okay to have that uncovered. This line is in the unlikely\ncode path where a user will try to unset the extra headers via `git -c\nhttp.extraHeaders [...]`, i.e. without setting a value for that setting.\n\n> Johannes Schindelin\t2e0afafe Add git-bundle: move objects and references by archive\n> builtin/bundle.c\n> 2e0afafe 115) return 1;\n\nI have to admit that I am slightly curious how this commit from 2007 ended\nup in this list: 2e0afafebd8 (Add git-bundle: move objects and references\nby archive, 2007-02-22). That's quite the blast of the past.\n\n> Johannes Schindelin\t116d1fa6 vreportf(): avoid relying on stdio buffering\n> usage.c\n> 116d1fa6 16) fprintf(stderr, \"BUG!!! too long a prefix '%s'\\n\", prefix);\n> 116d1fa6 17) abort();\n> 116d1fa6 22) *p = '\\0'; /* vsnprintf() failed, clip at prefix */\n\nThose are defensive programming, so this is expected not to be covered.\n\n> Johannes Schindelin\td54dea77 fetch: let --jobs=<n> parallelize --multiple, too\n> builtin/fetch.c\n> d54dea77 113) fetch_parallel_config = git_config_int(k, v);\n> d54dea77 114) if (fetch_parallel_config < 0)\n> d54dea77 116) return 0;\n> d54dea77 1566) static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)\n> d54dea77 1568) struct parallel_fetch_state *state = cb;\n> d54dea77 1569) const char *remote = task_cb;\n> d54dea77 1573) return 0;\n\nI guess that yes, this points out that setting the number of parallel\nfetches via `fetch.parallel` is untested... I am willing to leave it like\nthat until the time a regression is found in that code (if ever).\n\n> Johannes Schindelin\te145d993 rebase -r: support merge strategies other than `recursive`\n> sequencer.c\n> e145d993 3304) (!opts->strategy || !strcmp(opts->strategy, \"recursive\")) ?\n\nI am a bit puzzled by this because the added test case in t3430 should\ncover precisely this line.\n\n> Johannes Schindelin\te2683d51 Fix .git/ discovery at the root of UNC shares\n> setup.c\n> e2683d51 952)     !is_dir_sep(dir->buf[min_offset - 1])) {\n> e2683d51 953) strbuf_addch(dir, '/');\n> e2683d51 954) min_offset++;\n\nI think this is only tested on Windows.\n\n> Johannes Schindelin\tbe5d88e1 test-tool run-command: learn to run (parts of) the testsuite\n> t/helper/test-run-command.c\n> be5d88e1 66) static int next_test(struct child_process *cp, struct strbuf *err, void *cb,\n> be5d88e1 69) struct testsuite *suite = cb;\n> be5d88e1 71) if (suite->next >= suite->tests.nr)\n> be5d88e1 72) return 0;\n> be5d88e1 74) test = suite->tests.items[suite->next++].string;\n> be5d88e1 75) argv_array_pushl(&cp->args, \"sh\", test, NULL);\n> be5d88e1 76) if (suite->quiet)\n> be5d88e1 77) argv_array_push(&cp->args, \"--quiet\");\n> be5d88e1 78) if (suite->immediate)\n> be5d88e1 79) argv_array_push(&cp->args, \"-i\");\n> be5d88e1 80) if (suite->verbose)\n> be5d88e1 81) argv_array_push(&cp->args, \"-v\");\n> be5d88e1 82) if (suite->verbose_log)\n> be5d88e1 83) argv_array_push(&cp->args, \"-V\");\n> be5d88e1 84) if (suite->trace)\n> be5d88e1 85) argv_array_push(&cp->args, \"-x\");\n> be5d88e1 86) if (suite->write_junit_xml)\n> be5d88e1 87) argv_array_push(&cp->args, \"--write-junit-xml\");\n> be5d88e1 89) strbuf_addf(err, \"Output of '%s':\\n\", test);\n> be5d88e1 90) *task_cb = (void *)test;\n> be5d88e1 92) return 1;\n> be5d88e1 95) static int test_finished(int result, struct strbuf *err, void *cb,\n> be5d88e1 98) struct testsuite *suite = cb;\n> be5d88e1 99) const char *name = (const char *)task_cb;\n> be5d88e1 101) if (result)\n> be5d88e1 102) string_list_append(&suite->failed, name);\n> be5d88e1 104) strbuf_addf(err, \"%s: '%s'\\n\", result ? \"FAIL\" : \"SUCCESS\", name);\n> be5d88e1 106) return 0;\n> be5d88e1 109) static int test_failed(struct strbuf *out, void *cb, void *task_cb)\n> be5d88e1 111) struct testsuite *suite = cb;\n> be5d88e1 112) const char *name = (const char *)task_cb;\n> be5d88e1 114) string_list_append(&suite->failed, name);\n> be5d88e1 115) strbuf_addf(out, \"FAILED TO START: '%s'\\n\", name);\n> be5d88e1 117) return 0;\n> be5d88e1 125) static int testsuite(int argc, const char **argv)\n> be5d88e1 127) struct testsuite suite = TESTSUITE_INIT;\n> be5d88e1 128) int max_jobs = 1, i, ret;\n> be5d88e1 131) struct option options[] = {\n> be5d88e1 145) memset(&suite, 0, sizeof(suite));\n> be5d88e1 146) suite.tests.strdup_strings = suite.failed.strdup_strings = 1;\n> be5d88e1 148) argc = parse_options(argc, argv, NULL, options,\n> be5d88e1 151) if (max_jobs <= 0)\n> be5d88e1 152) max_jobs = online_cpus();\n> be5d88e1 154) dir = opendir(\".\");\n> be5d88e1 155) if (!dir)\n> be5d88e1 157) while ((d = readdir(dir))) {\n> be5d88e1 158) const char *p = d->d_name;\n> be5d88e1 160) if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||\n> be5d88e1 161)     !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||\n> be5d88e1 162)     !ends_with(p, \".sh\"))\n> be5d88e1 163) continue;\n> be5d88e1 166) if (!argc) {\n> be5d88e1 167) string_list_append(&suite.tests, p);\n> be5d88e1 168) continue;\n> be5d88e1 171) for (i = 0; i < argc; i++)\n> be5d88e1 172) if (!wildmatch(argv[i], p, 0)) {\n> be5d88e1 173) string_list_append(&suite.tests, p);\n> be5d88e1 174) break;\n> be5d88e1 177) closedir(dir);\n> be5d88e1 179) if (!suite.tests.nr)\n> be5d88e1 181) if (max_jobs > suite.tests.nr)\n> be5d88e1 182) max_jobs = suite.tests.nr;\n> be5d88e1 184) fprintf(stderr, \"Running %d tests (%d at a time)\\n\",\n> be5d88e1 187) ret = run_processes_parallel(max_jobs, next_test, test_failed,\n> be5d88e1 190) if (suite.failed.nr > 0) {\n> be5d88e1 191) ret = 1;\n> be5d88e1 192) fprintf(stderr, \"%d tests failed:\\n\\n\", suite.failed.nr);\n> be5d88e1 193) for (i = 0; i < suite.failed.nr; i++)\n> be5d88e1 194) fprintf(stderr, \"\\t%s\\n\", suite.failed.items[i].string);\n> be5d88e1 197) string_list_clear(&suite.tests, 0);\n> be5d88e1 198) string_list_clear(&suite.failed, 0);\n> be5d88e1 200) return !!ret;\n> be5d88e1 209) exit(testsuite(argc - 1, argv + 1));\n\nThis is exercised extensively in the Visual Studio job of our Azure\nPipeline.\n\nThanks,\nDschO\n"},{"id":"387158","messageId":"59ae5223-6dd8-00cd-4c39-b307f8364457@gmail.com","threadId":"52332","inReplyTo":"nycvar.QRO.7.76.6.1911262116100.31080@tvgsbejvaqbjf.bet","subject":"Re: Git Test Coverage Report (Nov 25)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-11-27T14:33:44Z","receivedAt":"2019-11-27T14:33:50Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 11/26/2019 3:46 PM, Johannes Schindelin wrote:\n> Hi Stolee,\n> \n> thank you for keeping doing these reports.\n\nThanks for reading it!\n\n> On Mon, 25 Nov 2019, Derrick Stolee wrote:\n> \n>> Here is today's test coverage report.\n>>\n>> Sorry for the delay, but I had some issues working out the new\n>> \"ignored lines\" logic. Now there are a few phrases that are\n>> ignored automatically, including \"BUG(\" or \"die(\".\n>>\n>> [...]\n>> Johannes Schindelin\teea4a7f4 mingw: demonstrate that all file handles are inherited by child processes\n>> t/helper/test-run-command.c\n>> eea4a7f4 203) static int inherit_handle(const char *argv0)\n>> eea4a7f4 205) struct child_process cp = CHILD_PROCESS_INIT;\n>> eea4a7f4 210) xsnprintf(path, sizeof(path), \"out-XXXXXX\");\n>> eea4a7f4 211) tmp = xmkstemp(path);\n>> eea4a7f4 213) argv_array_pushl(&cp.args,\n>> eea4a7f4 215) cp.in = -1;\n>> eea4a7f4 216) cp.no_stdout = cp.no_stderr = 1;\n>> eea4a7f4 217) if (start_command(&cp) < 0)\n>> eea4a7f4 221) close(tmp);\n>> eea4a7f4 222) if (unlink(path))\n>> eea4a7f4 225) if (close(cp.in) < 0 || finish_command(&cp) < 0)\n>> eea4a7f4 228) return 0;\n>> eea4a7f4 231) static int inherit_handle_child(void)\n>> eea4a7f4 233) struct strbuf buf = STRBUF_INIT;\n>> eea4a7f4 235) if (strbuf_read(&buf, 0, 0) < 0)\n>> eea4a7f4 237) printf(\"Received %s\\n\", buf.buf);\n>> eea4a7f4 238) strbuf_release(&buf);\n>> eea4a7f4 240) return 0;\n>> eea4a7f4 251) exit(inherit_handle(argv[0]));\n>> eea4a7f4 253) exit(inherit_handle_child());\n> \n> I think this is actually covered, but only in the Windows build.\n\nSorry that I have not set up a Windows build, but the Linux test-coverage\nbuild already takes a long time so adding Windows would be complicated.\n(Not to mention that merging the uncovered lines across two platforms would\nbe a huge challenge.)\n\nIf anyone wants to consider such an effort, I'm willing to play along.\n\n>> Johannes Schindelin\t116a408b commit: give correct advice for empty commit during a rebase\n>> builtin/commit.c\n>> 116a408b 478) else if (whence == FROM_CHERRY_PICK) {\n>> 116a408b 479) if (rebase_in_progress && !sequencer_in_use)\n>> 116a408b 1186) else if (whence == FROM_CHERRY_PICK) {\n>> 116a408b 1187) if (rebase_in_progress && !sequencer_in_use)\n> \n> My understanding is that Phillip is working on a replacement for this\n> patch, so I'll leave this as-is for now.\n> \n>> Johannes Schindelin\t0de7b036 built-in add -i: offer the `quit` command\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\td17e3a76 built-in add -i: prepare for multi-selection commands\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\tdea080c8 built-in add -i: re-implement `revert` in C\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\tdaabf56b built-in add -i: re-implement `add-untracked` in C\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\t4ba7c22a built-in add -i: implement the `update` command\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\t9d86921e built-in add -i: implement the `patch` command\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\ta5ced6db built-in add -i: allow filtering the modified files list\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\t465a9699 built-in add -i: re-implement the `diff` command\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\t68db1cbf built-in add -i: support `?` (prompt help)\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\t76b74323 built-in add -i: show unique prefixes of the commands\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\t6348bfba built-in add -i: implement the main loop\n>> add-interactive.c\n>> [...]\n>>\n>> Johannes Schindelin\tf83dff60 Start to implement a built-in version of `git add --interactive`\n>> add-interactive.c\n>> f83dff60 571) int run_add_i(struct repository *r, const struct pathspec *ps)\n>>\n>> builtin/add.c\n>> f83dff60 197) return !!run_add_i(the_repository, pathspec);\n> \n> This ginormous amount of code without test coverage is exactly the type of\n> problem I pointed out with the approach I had to take in the built-in add\n> -i/-p series, and which I described in the commit message\n> https://public-inbox.org/git/5d9962d4344fa182b37cd8d969da01bc603414be.1573648866.git.gitgitgadget@gmail.com/\n> Most of it _will_ be covered by the tests, but _only_ at the very end,\n> when all six patch series will be merged.\n\nI figured as much. When we have all six ready to go, then I can run a\n\"single branch\" test for the feature against the base to see what is\nuncovered from the entire effort.\n\n>> Johannes Schindelin\t\trebase-merges: move labels' whitespace mangling into `label_oid()`\n>> sequencer.c\n>> 867bc1d2 4539) }\n> \n> Not sure why this closing parenthesis isn't covered :-D\n>\n>> Johannes Schindelin\t4d17fd25 remote-curl: unbreak http.extraHeader with custom allocators\n>> http.c\n>> 4d17fd25 417) string_list_clear(&extra_http_headers, 0);\n> \n> I think it is okay to have that uncovered. This line is in the unlikely\n> code path where a user will try to unset the extra headers via `git -c\n> http.extraHeaders [...]`, i.e. without setting a value for that setting.\n> \n>> Johannes Schindelin\t2e0afafe Add git-bundle: move objects and references by archive\n>> builtin/bundle.c\n>> 2e0afafe 115) return 1;\n> \n> I have to admit that I am slightly curious how this commit from 2007 ended\n> up in this list: 2e0afafebd8 (Add git-bundle: move objects and references\n> by archive, 2007-02-22). That's quite the blast of the past.\n> \n>> Johannes Schindelin\t116d1fa6 vreportf(): avoid relying on stdio buffering\n>> usage.c\n>> 116d1fa6 16) fprintf(stderr, \"BUG!!! too long a prefix '%s'\\n\", prefix);\n>> 116d1fa6 17) abort();\n>> 116d1fa6 22) *p = '\\0'; /* vsnprintf() failed, clip at prefix */\n> \n> Those are defensive programming, so this is expected not to be covered.\n\nI wonder why we are not using BUG() here (for the fprintf and abort).\n \n>> Johannes Schindelin\td54dea77 fetch: let --jobs=<n> parallelize --multiple, too\n>> builtin/fetch.c\n>> d54dea77 113) fetch_parallel_config = git_config_int(k, v);\n>> d54dea77 114) if (fetch_parallel_config < 0)\n>> d54dea77 116) return 0;\n>> d54dea77 1566) static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)\n>> d54dea77 1568) struct parallel_fetch_state *state = cb;\n>> d54dea77 1569) const char *remote = task_cb;\n>> d54dea77 1573) return 0;\n> \n> I guess that yes, this points out that setting the number of parallel\n> fetches via `fetch.parallel` is untested... I am willing to leave it like\n> that until the time a regression is found in that code (if ever).\n\nI believe that anything that is multi-threaded is untested in this build\ntarget as to avoid issues with race conditions in the gcov data.\n\n>> Johannes Schindelin\te145d993 rebase -r: support merge strategies other than `recursive`\n>> sequencer.c\n>> e145d993 3304) (!opts->strategy || !strcmp(opts->strategy, \"recursive\")) ?\n> \n> I am a bit puzzled by this because the added test case in t3430 should\n> cover precisely this line.\n\nIt could be that we hit \"!opts->strategy\" and short-circuit the strcmp, which\nwould mark the line as uncovered.\n\n>> Johannes Schindelin\te2683d51 Fix .git/ discovery at the root of UNC shares\n>> setup.c\n>> e2683d51 952)     !is_dir_sep(dir->buf[min_offset - 1])) {\n>> e2683d51 953) strbuf_addch(dir, '/');\n>> e2683d51 954) min_offset++;\n> \n> I think this is only tested on Windows.\n> \n>> Johannes Schindelin\tbe5d88e1 test-tool run-command: learn to run (parts of) the testsuite\n>> t/helper/test-run-command.c\n>> be5d88e1 66) static int next_test(struct child_process *cp, struct strbuf *err, void *cb,\n>> be5d88e1 69) struct testsuite *suite = cb;\n>> be5d88e1 71) if (suite->next >= suite->tests.nr)\n>> be5d88e1 72) return 0;\n>> be5d88e1 74) test = suite->tests.items[suite->next++].string;\n>> be5d88e1 75) argv_array_pushl(&cp->args, \"sh\", test, NULL);\n>> be5d88e1 76) if (suite->quiet)\n>> be5d88e1 77) argv_array_push(&cp->args, \"--quiet\");\n>> be5d88e1 78) if (suite->immediate)\n>> be5d88e1 79) argv_array_push(&cp->args, \"-i\");\n>> be5d88e1 80) if (suite->verbose)\n>> be5d88e1 81) argv_array_push(&cp->args, \"-v\");\n>> be5d88e1 82) if (suite->verbose_log)\n>> be5d88e1 83) argv_array_push(&cp->args, \"-V\");\n>> be5d88e1 84) if (suite->trace)\n>> be5d88e1 85) argv_array_push(&cp->args, \"-x\");\n>> be5d88e1 86) if (suite->write_junit_xml)\n>> be5d88e1 87) argv_array_push(&cp->args, \"--write-junit-xml\");\n>> be5d88e1 89) strbuf_addf(err, \"Output of '%s':\\n\", test);\n>> be5d88e1 90) *task_cb = (void *)test;\n>> be5d88e1 92) return 1;\n>> be5d88e1 95) static int test_finished(int result, struct strbuf *err, void *cb,\n>> be5d88e1 98) struct testsuite *suite = cb;\n>> be5d88e1 99) const char *name = (const char *)task_cb;\n>> be5d88e1 101) if (result)\n>> be5d88e1 102) string_list_append(&suite->failed, name);\n>> be5d88e1 104) strbuf_addf(err, \"%s: '%s'\\n\", result ? \"FAIL\" : \"SUCCESS\", name);\n>> be5d88e1 106) return 0;\n>> be5d88e1 109) static int test_failed(struct strbuf *out, void *cb, void *task_cb)\n>> be5d88e1 111) struct testsuite *suite = cb;\n>> be5d88e1 112) const char *name = (const char *)task_cb;\n>> be5d88e1 114) string_list_append(&suite->failed, name);\n>> be5d88e1 115) strbuf_addf(out, \"FAILED TO START: '%s'\\n\", name);\n>> be5d88e1 117) return 0;\n>> be5d88e1 125) static int testsuite(int argc, const char **argv)\n>> be5d88e1 127) struct testsuite suite = TESTSUITE_INIT;\n>> be5d88e1 128) int max_jobs = 1, i, ret;\n>> be5d88e1 131) struct option options[] = {\n>> be5d88e1 145) memset(&suite, 0, sizeof(suite));\n>> be5d88e1 146) suite.tests.strdup_strings = suite.failed.strdup_strings = 1;\n>> be5d88e1 148) argc = parse_options(argc, argv, NULL, options,\n>> be5d88e1 151) if (max_jobs <= 0)\n>> be5d88e1 152) max_jobs = online_cpus();\n>> be5d88e1 154) dir = opendir(\".\");\n>> be5d88e1 155) if (!dir)\n>> be5d88e1 157) while ((d = readdir(dir))) {\n>> be5d88e1 158) const char *p = d->d_name;\n>> be5d88e1 160) if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||\n>> be5d88e1 161)     !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||\n>> be5d88e1 162)     !ends_with(p, \".sh\"))\n>> be5d88e1 163) continue;\n>> be5d88e1 166) if (!argc) {\n>> be5d88e1 167) string_list_append(&suite.tests, p);\n>> be5d88e1 168) continue;\n>> be5d88e1 171) for (i = 0; i < argc; i++)\n>> be5d88e1 172) if (!wildmatch(argv[i], p, 0)) {\n>> be5d88e1 173) string_list_append(&suite.tests, p);\n>> be5d88e1 174) break;\n>> be5d88e1 177) closedir(dir);\n>> be5d88e1 179) if (!suite.tests.nr)\n>> be5d88e1 181) if (max_jobs > suite.tests.nr)\n>> be5d88e1 182) max_jobs = suite.tests.nr;\n>> be5d88e1 184) fprintf(stderr, \"Running %d tests (%d at a time)\\n\",\n>> be5d88e1 187) ret = run_processes_parallel(max_jobs, next_test, test_failed,\n>> be5d88e1 190) if (suite.failed.nr > 0) {\n>> be5d88e1 191) ret = 1;\n>> be5d88e1 192) fprintf(stderr, \"%d tests failed:\\n\\n\", suite.failed.nr);\n>> be5d88e1 193) for (i = 0; i < suite.failed.nr; i++)\n>> be5d88e1 194) fprintf(stderr, \"\\t%s\\n\", suite.failed.items[i].string);\n>> be5d88e1 197) string_list_clear(&suite.tests, 0);\n>> be5d88e1 198) string_list_clear(&suite.failed, 0);\n>> be5d88e1 200) return !!ret;\n>> be5d88e1 209) exit(testsuite(argc - 1, argv + 1));\n> \n> This is exercised extensively in the Visual Studio job of our Azure\n> Pipeline.\n> \n> Thanks,\n> DschO\n\nThank you!\n-Stolee\n"},{"id":"387209","messageId":"nycvar.QRO.7.76.6.1911272029050.31080@tvgsbejvaqbjf.bet","threadId":"52332","inReplyTo":"59ae5223-6dd8-00cd-4c39-b307f8364457@gmail.com","subject":"Re: Git Test Coverage Report (Nov 25)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-11-27T19:32:51Z","receivedAt":"2019-11-27T19:33:10Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Stolee,\n\nOn Wed, 27 Nov 2019, Derrick Stolee wrote:\n\n> On 11/26/2019 3:46 PM, Johannes Schindelin wrote:\n>\n> > [...] the Windows build.\n>\n> Sorry that I have not set up a Windows build, but the Linux test-coverage\n> build already takes a long time so adding Windows would be complicated.\n> (Not to mention that merging the uncovered lines across two platforms would\n> be a huge challenge.)\n>\n> If anyone wants to consider such an effort, I'm willing to play along.\n\nI fear it is even worse: once upon a time, I tried to set up a gcov run\nwith mingw-w64-gcc, and it failed miserably (there was simply no output at\nall).\n\nSo I, for one, am completely comfortable with keeping the status quo for\nthe time being.\n\n> >> Johannes Schindelin\t116d1fa6 vreportf(): avoid relying on stdio buffering\n> >> usage.c\n> >> 116d1fa6 16) fprintf(stderr, \"BUG!!! too long a prefix '%s'\\n\", prefix);\n> >> 116d1fa6 17) abort();\n> >> 116d1fa6 22) *p = '\\0'; /* vsnprintf() failed, clip at prefix */\n> >\n> > Those are defensive programming, so this is expected not to be covered.\n>\n> I wonder why we are not using BUG() here (for the fprintf and abort).\n\nIt's because `BUG()` calls `vreportf()`, and even if the _current_ version\nwould bail out at some point, I would be uncomfortable calling `BUG()`\nfrom `vreportf()` and risk a (future-only) recursion ad infinitum.\n\nThanks!\nDscho\n"},{"id":"387273","messageId":"014924b0-f203-d3a3-f974-b1164511dbc6@gmail.com","threadId":"52332","inReplyTo":"nycvar.QRO.7.76.6.1911262116100.31080@tvgsbejvaqbjf.bet","subject":"Re: Git Test Coverage Report (Nov 25)","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2019-11-28T11:06:15Z","receivedAt":"2019-11-28T11:06:21Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 26/11/2019 20:46, Johannes Schindelin wrote:\n> Hi Stolee,\n> \n> thank you for keeping doing these reports.\n>\n\nYes thanks Stolee, these reports are really useful\n\n> On Mon, 25 Nov 2019, Derrick Stolee wrote:\n> \n>> Here is today's test coverage report.\n>>\n>> Sorry for the delay, but I had some issues working out the new\n>> \"ignored lines\" logic. Now there are a few phrases that are\n>> ignored automatically, including \"BUG(\" or \"die(\".\n>>\n>> [...]\n>> Johannes Schindelin\t116a408b commit: give correct advice for empty commit during a rebase\n>> builtin/commit.c\n>> 116a408b 478) else if (whence == FROM_CHERRY_PICK) {\n>> 116a408b 479) if (rebase_in_progress && !sequencer_in_use)\n>> 116a408b 1186) else if (whence == FROM_CHERRY_PICK) {\n>> 116a408b 1187) if (rebase_in_progress && !sequencer_in_use)\n> \n> My understanding is that Phillip is working on a replacement for this\n> patch, so I'll leave this as-is for now.\n\nI am, I'll add some tests to address this\n\nBest Wishes\n\nPhillip\n"},{"id":"387293","messageId":"b9515bf6-81ec-3b24-8982-5248e36306fe@gmail.com","threadId":"52332","inReplyTo":"nycvar.QRO.7.76.6.1911272029050.31080@tvgsbejvaqbjf.bet","subject":"Re: Git Test Coverage Report (Nov 25)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-11-28T22:04:50Z","receivedAt":"2019-11-28T22:05:00Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 11/27/2019 2:32 PM, Johannes Schindelin wrote:\n> Hi Stolee,\n> \n> On Wed, 27 Nov 2019, Derrick Stolee wrote:\n> \n>> On 11/26/2019 3:46 PM, Johannes Schindelin wrote:\n>>\n>>> [...] the Windows build.\n>>\n>> Sorry that I have not set up a Windows build, but the Linux test-coverage\n>> build already takes a long time so adding Windows would be complicated.\n>> (Not to mention that merging the uncovered lines across two platforms would\n>> be a huge challenge.)\n>>\n>> If anyone wants to consider such an effort, I'm willing to play along.\n> \n> I fear it is even worse: once upon a time, I tried to set up a gcov run\n> with mingw-w64-gcc, and it failed miserably (there was simply no output at\n> all).\n> \n> So I, for one, am completely comfortable with keeping the status quo for\n> the time being.\n> \n>>>> Johannes Schindelin\t116d1fa6 vreportf(): avoid relying on stdio buffering\n>>>> usage.c\n>>>> 116d1fa6 16) fprintf(stderr, \"BUG!!! too long a prefix '%s'\\n\", prefix);\n>>>> 116d1fa6 17) abort();\n>>>> 116d1fa6 22) *p = '\\0'; /* vsnprintf() failed, clip at prefix */\n>>>\n>>> Those are defensive programming, so this is expected not to be covered.\n>>\n>> I wonder why we are not using BUG() here (for the fprintf and abort).\n> \n> It's because `BUG()` calls `vreportf()`, and even if the _current_ version\n> would bail out at some point, I would be uncomfortable calling `BUG()`\n> from `vreportf()` and risk a (future-only) recursion ad infinitum.\n\nThat's a pretty good reason to not use BUG() here!\n"}]}