{"thread":{"id":"51652","subject":"Git Test Coverage Report (Thursday, Aug 15)","startedAt":"2019-08-16T02:01:10Z","lastAt":"2019-08-20T12:54:24Z","messageCount":4,"participants":["Derrick Stolee","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"380533","messageId":"6dd8797a-289d-cabb-d4c3-761b9f9d3ca0@gmail.com","threadId":"51652","inReplyTo":null,"subject":"Git Test Coverage Report (Thursday, Aug 15)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-08-16T02:01:04Z","receivedAt":"2019-08-16T02:01:10Z","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\nThanks,\n-Stolee\n\n[1] https://derrickstolee.github.io/git-test-coverage/reports/2019-08-15.htm\n[2] https://derrickstolee.github.io/git-test-coverage/reports/2019-08-15.txt\n\n---\n\npu\t6cf2e4a04610efe882eb663cd36436b80b343fa0\njch\ta23f79a350684bab247289060a5727857a3f9b40\nnext\te5444969c986fc1503282c63d33931021c78d991\nmaster\tff66981f4593aec0f3b3eeace0eacb7dbe44fd8c\nmaster@{1}\t7c20df84bd21ec0215358381844274fa10515017\n\n\nUncovered code in 'pu' not in 'jch'\n--------------------------------------------------------\n\nbuiltin/fetch-pack.c\n\nbuiltin/fetch.c\n8751f4c4 1403) warning(_(\"not setting upstream for a remote remote-tracking branch\"));\n\nbuiltin/pack-objects.c\n820a5361 862) BUG(\"configured exclusion wasn't configured\");\n820a5361 2788) die(_(\"value of uploadpack.blobpackfileuri must be \"\n820a5361 2791) die(_(\"object already configured in another \"\n\nbuiltin/rebase.c\ne191cc8b 129) strbuf_addstr(&buf, strategy_opts);\nb7e690b4 543) opts.committer_date_is_author_date = 0;\n58b3bc40 546) opts.flags |= REBASE_FORCE;\n526c03b5 1305) goto done;\n10572de1 1321) goto done;\ne191cc8b 1903) die(_(\"cannot combine '--rebase-merges' with \"\n\nbuiltin/remote.c\nf39a9c65 1551) die(_(\"--save-to-push cannot be used with other options\"));\nf39a9c65 1575) die(_(\"--save-to-push can only be used when only one url is defined\"));\n\nfetch-pack.c\naaf633c2 921) else if (args->depth > 0 || is_repository_shallow(r))\n820a5361 1397) die(\"expected '<hash> <uri>', got: %s\\n\", reader->line);\n820a5361 1402) die(\"expected DELIM\");\n820a5361 1530) die(\"fetch-pack: unable to spawn http-fetch\");\n820a5361 1534) die(\"fetch-pack: expected keep then TAB at start of http-fetch output\");\n820a5361 1539) die(\"fetch-pack: expected hash then LF at end of http-fetch output\");\n820a5361 1546) die(\"fetch-pack: unable to finish http-fetch\");\n820a5361 1550) die(\"fetch-pack: pack downloaded from %s does not match expected hash %.*s\",\n820a5361 1551)     uri, (int) the_hash_algo->hexsz,\n820a5361 1552)     packfile_uris.items[i].string);\n\nhttp-fetch.c\n\nhttp.c\n18ae2f5f 2304) target ? hash_to_hex(target->hash) : base_url,\n\npackfile.c\nd6f3fabd 1457) return;\n\npath.c\ne951d019 1234) return -1;\ne951d019 1238) return -1;\ne951d019 1247) return -1;\n\nprotocol.c\n\nremote-curl.c\n\nrepo-settings.c\naaf633c2 43) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;\naaf633c2 53) UPDATE_DEFAULT_BOOL(r->settings.pack_use_sparse, 1);\naaf633c2 54) UPDATE_DEFAULT_BOOL(r->settings.fetch_negotiation_algorithm, FETCH_NEGOTIATION_SKIPPING);\n\nsequencer.c\nda4b9f56 833) free(kv.items[name_i].util);\nda4b9f56 837) free(kv.items[email_i].util);\nda4b9f56 841) free(kv.items[date_i].util);\n58b3bc40 885) static char *read_author_date_or_null(void)\n58b3bc40 889) if (read_author_script(rebase_path_author_script(),\n58b3bc40 891) return NULL;\n58b3bc40 892) return date;\nb7e690b4 937) static void push_dates(struct child_process *child)\nb7e690b4 939) time_t now = time(NULL);\nb7e690b4 940) struct strbuf date = STRBUF_INIT;\nb7e690b4 942) strbuf_addf(&date, \"@%\"PRIuMAX, (uintmax_t)now);\nb7e690b4 943) argv_array_pushf(&child->args, \"--date=%s\", date.buf);\nb7e690b4 944) argv_array_pushf(&child->env_array, \"GIT_COMMITTER_DATE=%s\", date.buf);\nb7e690b4 945) strbuf_release(&date);\nb7e690b4 946) }\n58b3bc40 1007) int res = -1;\n58b3bc40 1008) struct strbuf datebuf = STRBUF_INIT;\n58b3bc40 1009) char *date = read_author_date_or_null();\n58b3bc40 1011) strbuf_addf(&datebuf, \"@%s\", date);\n58b3bc40 1012) free(date);\n58b3bc40 1014) date = strbuf_detach(&datebuf, &len);\n58b3bc40 1016) if (len > 1)\n58b3bc40 1017) res = setenv(\"GIT_COMMITTER_DATE\", date, 1);\n58b3bc40 1019) free(date);\n58b3bc40 1021) if (res)\n58b3bc40 1022) return -1;\nb7e690b4 1051) if (!author)\nb7e690b4 1052) BUG(\"ignore-date can only be used with \"\nb7e690b4 1055) ignore_author_date(&author);\nb7e690b4 1091) push_dates(&cmd);\n58b3bc40 1504) return error(_(\"corrupted author without date information\"));\nb7e690b4 3663) push_dates(&cmd);\n\nsha1-file.c\nd6f3fabd 1572) return;\nd6f3fabd 1581) return;\n\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\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, \" | \");\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, ']');\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\nupload-pack.c\na8d662e3 130) return readsz;\n820a5361 149) BUG(\"packfile_uris requires sideband-all\");\na8d662e3 354) send_client_data(1, output_state.buffer, output_state.used);\n820a5361 1387) string_list_clear(&data->uri_protocols, 0);\n\nCommits introducting uncovered code:\nbrian m. carlson\te951d019 path: add a function to check for path suffix\nCorentin BOMPARD\t8751f4c4 pull, fetch: add --set-upstream option\nDenton Liu\t526c03b5 rebase: refactor can_fast_forward into goto tower\nDenton Liu\t10572de1 rebase: fast-forward --onto in more cases\nDenton Liu\tf39a9c65 remote: add --save-to-push option to git remote set-url\nDerrick Stolee\taaf633c2 repo-settings: create feature.experimental setting\nJeff Hostetler\tda4589ce trace2: trim whitespace in region messages in perf target format\nJeff Hostetler\t742ed633 trace2: cleanup whitespace in perf format\nJeff Hostetler\t371df1be trace2: cleanup column alignment in perf target format\nJeff Hostetler\te3443055 trace2: cleanup whitespace in normal format\nJonathan Tan\t820a5361 upload-pack: send part of packfile response as uri\nJonathan Tan\ta8d662e3 upload-pack: refactor reading of pack-objects out\nJunio C Hamano\t18ae2f5f Merge branch 'jt/fetch-cdn-offload' into pu\nMatheus Tavares\td6f3fabd object-store: add lock to read_object_file_extended()\nRohit Ashiwal\t58b3bc40 rebase -i: support --committer-date-is-author-date\nRohit Ashiwal\tb7e690b4 rebase -i: support --ignore-date\nRohit Ashiwal\te191cc8b rebase -i: add --ignore-whitespace flag\nRohit Ashiwal\tda4b9f56 sequencer: add NULL checks under read_author_script\n\n\nUncovered code in 'jch' not in 'next'\n--------------------------------------------------------\n\nadd-interactive.c\nd31f31d1 20) static void init_color(struct repository *r, struct add_i_state *s,\nd31f31d1 24) char *key = xstrfmt(\"color.interactive.%s\", slot_name);\nd31f31d1 27) if (!s->use_color)\nd31f31d1 28) dst[0] = '\\0';\nd31f31d1 29) else if (repo_config_get_value(r, key, &value) ||\nd31f31d1 30)  color_parse(value, dst))\nd31f31d1 31) strlcpy(dst, default_color, COLOR_MAXLEN);\nd31f31d1 33) free(key);\nd31f31d1 34) }\nd31f31d1 36) static int init_add_i_state(struct repository *r, struct add_i_state *s)\nd31f31d1 40) s->r = r;\nd31f31d1 42) if (repo_config_get_value(r, \"color.interactive\", &value))\nd31f31d1 43) s->use_color = -1;\nd31f31d1 45) s->use_color =\nd31f31d1 46) git_config_colorbool(\"color.interactive\", value);\nd31f31d1 47) s->use_color = want_color(s->use_color);\nd31f31d1 49) init_color(r, s, \"header\", s->header_color, GIT_COLOR_BOLD);\nec4ddbf6 50) init_color(r, s, \"help\", s->help_color, GIT_COLOR_BOLD_RED);\n253cdc20 51) init_color(r, s, \"prompt\", s->prompt_color, GIT_COLOR_BOLD_BLUE);\n253cdc20 52) init_color(r, s, \"error\", s->error_color, GIT_COLOR_BOLD_RED);\n253cdc20 53) init_color(r, s, \"reset\", s->reset_color, GIT_COLOR_RESET);\nd31f31d1 55) return 0;\n928e9d0d 58) static ssize_t find_unique(const char *string,\n928e9d0d 61) ssize_t found = -1, i;\n928e9d0d 63) for (i = 0; i < nr; i++) {\n928e9d0d 64) struct prefix_item *item = list[i];\n928e9d0d 65) if (!starts_with(item->name, string))\n928e9d0d 66) continue;\n928e9d0d 67) if (found >= 0)\n928e9d0d 68) return -1;\n928e9d0d 69) found = i;\n928e9d0d 72) return found;\n928e9d0d 83) static void list(struct prefix_item **list, size_t nr,\n81e604c5 86) int i, last_lf = 0;\nbcbdcd36 88) if (!nr)\nbcbdcd36 89) return;\nbcbdcd36 91) if (opts->header)\nd31f31d1 92) color_fprintf_ln(stdout, s->header_color,\nbcbdcd36 95) for (i = 0; i < nr; i++) {\nbcbdcd36 96) opts->print_item(i, list[i], opts->print_item_data);\n81e604c5 98) if ((opts->columns) && ((i + 1) % (opts->columns))) {\n81e604c5 99) putchar('\\t');\n81e604c5 100) last_lf = 0;\n81e604c5 103) putchar('\\n');\n81e604c5 104) last_lf = 1;\n81e604c5 108) if (!last_lf)\nbcbdcd36 109) putchar('\\n');\n928e9d0d 127) static ssize_t list_and_choose(struct prefix_item **items, size_t nr,\n81e604c5 131) struct strbuf input = STRBUF_INIT;\n81e604c5 132) ssize_t res = LIST_AND_CHOOSE_ERROR;\n928e9d0d 134) find_unique_prefixes(items, nr, 1, 4);\n81e604c5 139) strbuf_reset(&input);\n81e604c5 141) list(items, nr, s, &opts->list_opts);\n253cdc20 143) color_fprintf(stdout, s->prompt_color, \"%s\", opts->prompt);\n253cdc20 144) fputs(\"> \", stdout);\n81e604c5 145) fflush(stdout);\n81e604c5 147) if (strbuf_getline(&input, stdin) == EOF) {\n81e604c5 148) putchar('\\n');\n81e604c5 149) res = LIST_AND_CHOOSE_QUIT;\n81e604c5 150) break;\n81e604c5 152) strbuf_trim(&input);\n81e604c5 154) if (!input.len)\n81e604c5 155) break;\nec4ddbf6 157) if (!strcmp(input.buf, \"?\")) {\nec4ddbf6 158) opts->print_help(s);\nec4ddbf6 159) continue;\n81e604c5 162) p = input.buf;\n81e604c5 164) size_t sep = strcspn(p, \" \\t\\r\\n,\");\n81e604c5 165) ssize_t index = -1;\n81e604c5 167) if (!sep) {\n81e604c5 168) if (!*p)\n81e604c5 169) break;\n81e604c5 170) p++;\n81e604c5 171) continue;\n81e604c5 174) if (isdigit(*p)) {\n81e604c5 175) index = strtoul(p, &endp, 10) - 1;\n81e604c5 176) if (endp != p + sep)\n81e604c5 177) index = -1;\n81e604c5 180) p[sep] = '\\0';\n928e9d0d 181) if (index < 0)\n928e9d0d 182) index = find_unique(p, items, nr);\n81e604c5 184) if (index < 0 || index >= nr)\n253cdc20 185) color_fprintf_ln(stdout, s->error_color,\n81e604c5 188) res = index;\n81e604c5 189) break;\n81e604c5 192) p += sep + 1;\n81e604c5 193) }\n81e604c5 195) if (res != LIST_AND_CHOOSE_ERROR)\n81e604c5 196) break;\nbcbdcd36 197) }\n81e604c5 199) strbuf_release(&input);\n81e604c5 200) return res;\nbcbdcd36 216) static void add_file_item(struct file_list *list, const char *name)\nbcbdcd36 220) FLEXPTR_ALLOC_STR(item, item.name, name);\nbcbdcd36 222) ALLOC_GROW(list->file, list->nr + 1, list->alloc);\nbcbdcd36 223) list->file[list->nr++] = item;\nbcbdcd36 224) }\nbcbdcd36 226) static void reset_file_list(struct file_list *list)\nbcbdcd36 230) for (i = 0; i < list->nr; i++)\nbcbdcd36 231) free(list->file[i]);\nbcbdcd36 232) list->nr = 0;\nbcbdcd36 233) }\nbcbdcd36 235) static void release_file_list(struct file_list *list)\nbcbdcd36 237) reset_file_list(list);\nbcbdcd36 238) FREE_AND_NULL(list->file);\nbcbdcd36 239) list->alloc = 0;\nbcbdcd36 240) }\nbcbdcd36 242) static int file_item_cmp(const void *a, const void *b)\nbcbdcd36 244) const struct file_item * const *f1 = a;\nbcbdcd36 245) const struct file_item * const *f2 = b;\nbcbdcd36 247) return strcmp((*f1)->item.name, (*f2)->item.name);\nbcbdcd36 256) static int pathname_entry_cmp(const void *unused_cmp_data,\nbcbdcd36 260) const struct pathname_entry *e1 = entry, *e2 = entry_or_key;\nbcbdcd36 262) return strcmp(e1->pathname,\nbcbdcd36 275) static void collect_changes_cb(struct diff_queue_struct *q,\nbcbdcd36 279) struct collection_status *s = data;\nbcbdcd36 280) struct diffstat_t stat = { 0 };\nbcbdcd36 283) if (!q->nr)\nbcbdcd36 284) return;\nbcbdcd36 286) compute_diffstat(options, &stat, q);\nbcbdcd36 288) for (i = 0; i < stat.nr; i++) {\nbcbdcd36 289) const char *name = stat.files[i]->name;\nbcbdcd36 290) int hash = strhash(name);\nbcbdcd36 296) entry = hashmap_get_from_hash(&s->file_map, hash, name);\nbcbdcd36 297) if (entry)\nbcbdcd36 298) file_index = entry->index;\nbcbdcd36 300) FLEX_ALLOC_STR(entry, pathname, name);\nbcbdcd36 301) hashmap_entry_init(entry, hash);\nbcbdcd36 302) entry->index = file_index = s->list->nr;\nbcbdcd36 303) hashmap_add(&s->file_map, entry);\nbcbdcd36 305) add_file_item(s->list, name);\nbcbdcd36 307) file = s->list->file[file_index];\nbcbdcd36 309) adddel = s->phase == FROM_INDEX ? &file->index : &file->worktree;\nbcbdcd36 310) adddel->seen = 1;\nbcbdcd36 311) adddel->add = stat.files[i]->added;\nbcbdcd36 312) adddel->del = stat.files[i]->deleted;\nbcbdcd36 313) if (stat.files[i]->is_binary)\nbcbdcd36 314) adddel->binary = 1;\nbcbdcd36 318) static int get_modified_files(struct repository *r, struct file_list *list,\nbcbdcd36 322) int is_initial = !resolve_ref_unsafe(\"HEAD\", RESOLVE_REF_READING,\nbcbdcd36 324) struct collection_status s = { FROM_WORKTREE };\nbcbdcd36 326) if (repo_read_index_preload(r, ps, 0) < 0)\nbcbdcd36 327) return error(_(\"could not read index\"));\nbcbdcd36 329) s.list = list;\nbcbdcd36 330) hashmap_init(&s.file_map, pathname_entry_cmp, NULL, 0);\nbcbdcd36 332) for (s.phase = FROM_WORKTREE; s.phase <= FROM_INDEX; s.phase++) {\nbcbdcd36 334) struct setup_revision_opt opt = { 0 };\nbcbdcd36 336) opt.def = is_initial ?\nbcbdcd36 337) empty_tree_oid_hex() : oid_to_hex(&head_oid);\nbcbdcd36 339) init_revisions(&rev, NULL);\nbcbdcd36 340) setup_revisions(0, NULL, &rev, &opt);\nbcbdcd36 342) rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;\nbcbdcd36 343) rev.diffopt.format_callback = collect_changes_cb;\nbcbdcd36 344) rev.diffopt.format_callback_data = &s;\nbcbdcd36 346) if (ps)\nbcbdcd36 347) copy_pathspec(&rev.prune_data, ps);\nbcbdcd36 349) if (s.phase == FROM_INDEX)\nbcbdcd36 350) run_diff_index(&rev, 1);\nbcbdcd36 352) rev.diffopt.flags.ignore_dirty_submodules = 1;\nbcbdcd36 353) run_diff_files(&rev, 0);\nbcbdcd36 356) hashmap_free(&s.file_map, 1);\nbcbdcd36 359) QSORT(list->file, list->nr, file_item_cmp);\nbcbdcd36 361) return 0;\nbcbdcd36 364) static void populate_wi_changes(struct strbuf *buf,\nbcbdcd36 367) if (ad->binary)\nbcbdcd36 368) strbuf_addstr(buf, _(\"binary\"));\nbcbdcd36 369) else if (ad->seen)\nbcbdcd36 370) strbuf_addf(buf, \"+%\"PRIuMAX\"/-%\"PRIuMAX,\nbcbdcd36 371)     (uintmax_t)ad->add, (uintmax_t)ad->del);\nbcbdcd36 373) strbuf_addstr(buf, no_changes);\nbcbdcd36 374) }\n928e9d0d 377) static int is_valid_prefix(const char *prefix, size_t prefix_len)\n928e9d0d 379) return prefix_len && prefix &&\n928e9d0d 385) strcspn(prefix, \" \\t\\r\\n,\") >= prefix_len &&\t/* separators */\n928e9d0d 386) *prefix != '-' &&\t\t\t\t/* deselection */\n928e9d0d 387) !isdigit(*prefix) &&\t\t\t\t/* selection */\n928e9d0d 388) (prefix_len != 1 ||\n928e9d0d 389)  (*prefix != '*' &&\t\t\t\t/* \"all\" wildcard */\n928e9d0d 390)   *prefix != '?'));\t\t\t\t/* prompt help */\n928e9d0d 398) static void print_file_item(int i, struct prefix_item *item,\nbcbdcd36 401) struct file_item *c = (struct file_item *)item;\nbcbdcd36 402) struct print_file_item_data *d = print_file_item_data;\nbcbdcd36 404) strbuf_reset(&d->index);\nbcbdcd36 405) strbuf_reset(&d->worktree);\nbcbdcd36 406) strbuf_reset(&d->buf);\nbcbdcd36 408) populate_wi_changes(&d->worktree, &c->worktree, _(\"nothing\"));\nbcbdcd36 409) populate_wi_changes(&d->index, &c->index, _(\"unchanged\"));\nbcbdcd36 410) strbuf_addf(&d->buf, d->modified_fmt,\nbcbdcd36 413) printf(\" %2d: %s\", i + 1, d->buf.buf);\nbcbdcd36 414) }\nd31f31d1 416) static int run_status(struct add_i_state *s, const struct pathspec *ps,\nbcbdcd36 419) reset_file_list(files);\nd31f31d1 421) if (get_modified_files(s->r, files, ps) < 0)\nbcbdcd36 422) return -1;\nbcbdcd36 424) if (files->nr)\n928e9d0d 425) list((struct prefix_item **)files->file, files->nr, s, opts);\nbcbdcd36 426) putchar('\\n');\nbcbdcd36 428) return 0;\nf3665cfd 431) static int run_help(struct add_i_state *s, const struct pathspec *ps,\nf3665cfd 434) const char *help_color = s->help_color;\nf3665cfd 436) color_fprintf_ln(stdout, help_color, \"status        - %s\",\nf3665cfd 438) color_fprintf_ln(stdout, help_color, \"update        - %s\",\nf3665cfd 440) color_fprintf_ln(stdout, help_color, \"revert        - %s\",\nf3665cfd 442) color_fprintf_ln(stdout, help_color, \"patch         - %s\",\nf3665cfd 444) color_fprintf_ln(stdout, help_color, \"diff          - %s\",\nf3665cfd 446) color_fprintf_ln(stdout, help_color, \"add untracked - %s\",\nf3665cfd 449) return 0;\n928e9d0d 456) static void print_command_item(int i, struct prefix_item *item,\n253cdc20 459) struct print_command_item_data *d = print_command_item_data;\n928e9d0d 461) if (!item->prefix_length ||\n928e9d0d 462)     !is_valid_prefix(item->name, item->prefix_length))\n928e9d0d 463) printf(\" %2d: %s\", i + 1, item->name);\n253cdc20 465) printf(\" %2d: %s%.*s%s%s\", i + 1,\n253cdc20 466)        d->color, (int)item->prefix_length, item->name, d->reset,\n928e9d0d 467)        item->name + item->prefix_length);\n81e604c5 468) }\nec4ddbf6 476) static void command_prompt_help(struct add_i_state *s)\nec4ddbf6 478) const char *help_color = s->help_color;\nec4ddbf6 479) color_fprintf_ln(stdout, help_color, \"%s\", _(\"Prompt help:\"));\nec4ddbf6 480) color_fprintf_ln(stdout, help_color, \"1          - %s\",\nec4ddbf6 482) color_fprintf_ln(stdout, help_color, \"foo        - %s\",\nec4ddbf6 484) color_fprintf_ln(stdout, help_color, \"           - %s\",\nec4ddbf6 486) }\ndb07a815 488) int run_add_i(struct repository *r, const struct pathspec *ps)\nd31f31d1 490) struct add_i_state s = { NULL };\n81e604c5 492) struct list_and_choose_options main_loop_opts = {\nf3665cfd 497) status = { { \"status\" }, run_status },\nf3665cfd 498) help = { { \"help\" }, run_help };\n81e604c5 499) struct command_item *commands[] = {\nbcbdcd36 504) struct print_file_item_data print_file_item_data = {\nbcbdcd36 507) struct list_options opts = {\nbcbdcd36 510) struct strbuf header = STRBUF_INIT;\nbcbdcd36 511) struct file_list files = { NULL };\nbcbdcd36 513) int res = 0;\nd31f31d1 515) if (init_add_i_state(r, &s))\nd31f31d1 516) return error(\"could not parse `add -i` config\");\n253cdc20 522) if (s.use_color) {\n253cdc20 523) data.color = s.prompt_color;\n253cdc20 524) data.reset = s.reset_color;\n253cdc20 526) data.color = \"[\";\n253cdc20 527) data.reset = \"]\";\nbcbdcd36 530) strbuf_addstr(&header, \"      \");\nbcbdcd36 531) strbuf_addf(&header, print_file_item_data.modified_fmt,\nbcbdcd36 533) opts.header = header.buf;\n74265dd7 535) repo_refresh_and_write_index(r, REFRESH_QUIET, 1);\nd31f31d1 536) if (run_status(&s, ps, &files, &opts) < 0)\n74265dd7 537) res = -1;\n928e9d0d 540) i = list_and_choose((struct prefix_item **)commands,\n81e604c5 542) if (i == LIST_AND_CHOOSE_QUIT) {\n81e604c5 543) printf(_(\"Bye.\\n\"));\n81e604c5 544) res = 0;\n81e604c5 545) break;\n81e604c5 547) if (i != LIST_AND_CHOOSE_ERROR)\n81e604c5 548) res = commands[i]->command(&s, ps, &files, &opts);\n81e604c5 549) }\nbcbdcd36 551) release_file_list(&files);\nbcbdcd36 552) strbuf_release(&print_file_item_data.buf);\nbcbdcd36 553) strbuf_release(&print_file_item_data.index);\nbcbdcd36 554) strbuf_release(&print_file_item_data.worktree);\nbcbdcd36 555) strbuf_release(&header);\nbcbdcd36 557) return res;\n\nbuiltin/add.c\ndb07a815 196) return !!run_add_i(the_repository, pathspec);\n\nbuiltin/cat-file.c\nb14ed5ad 529) warning(\"This repository uses promisor remotes. Some objects may not be loaded.\");\n\nbuiltin/rev-list.c\ncf9ceb5a 476) die(\n\nlist-objects-filter-options.c\nf56f7642 44) BUG(\"filter_options already populated\");\nf56f7642 236) die(_(\"multiple filter-specs cannot be combined\"));\ncf9ceb5a 286) BUG(\"no filter_spec available for this filter\");\ne987df5f 321) return;\n\nlist-objects-filter.c\ne987df5f 585) BUG(\"expected oidset to be cleared already\");\n\nlist-objects.c\n9430147c 210) ctx->show_object(obj, base->buf, ctx->show_data);\n\nprefix-map.c\n1f3e3049 48) break;\n1f3e3049 61) continue; /* non-unique prefix */\n1f3e3049 64) BUG(\"unexpected prefix length: %d != %d (%s != %s)\",\n\npromisor-remote.c\ndb27dca5 25) die(_(\"Remote with no URL\"));\n48de3158 61) warning(_(\"promisor remote name cannot begin with '/': %s\"),\n48de3158 63) return NULL;\nfaf2abf4 93) previous->next = r->next;\n4ca9474e 108) return git_config_string(&core_partial_clone_filter_default,\nfa3d1b63 139) return 0;\n9e27beaa 202) static int remove_fetched_oids(struct repository *repo,\n9e27beaa 206) int i, remaining_nr = 0;\n9e27beaa 207) int *remaining = xcalloc(oid_nr, sizeof(*remaining));\n9e27beaa 208) struct object_id *old_oids = *oids;\n9e27beaa 211) for (i = 0; i < oid_nr; i++)\n9e27beaa 212) if (oid_object_info_extended(repo, &old_oids[i], NULL,\n9e27beaa 214) remaining[i] = 1;\n9e27beaa 215) remaining_nr++;\n9e27beaa 218) if (remaining_nr) {\n9e27beaa 219) int j = 0;\n9e27beaa 220) new_oids = xcalloc(remaining_nr, sizeof(*new_oids));\n9e27beaa 221) for (i = 0; i < oid_nr; i++)\n9e27beaa 222) if (remaining[i])\n9e27beaa 223) oidcpy(&new_oids[j++], &old_oids[i]);\n9e27beaa 224) *oids = new_oids;\n9e27beaa 225) if (to_free)\n9e27beaa 226) free(old_oids);\n9e27beaa 229) free(remaining);\n9e27beaa 231) return remaining_nr;\n9e27beaa 248) if (remaining_nr == 1)\n9e27beaa 249) continue;\n9e27beaa 250) remaining_nr = remove_fetched_oids(repo, &remaining_oids,\n9e27beaa 252) if (remaining_nr) {\n9e27beaa 253) to_free = 1;\n9e27beaa 254) continue;\n9e27beaa 262) free(remaining_oids);\n\nread-cache.c\nee70c128 1723) if (advice_unknown_index_extension) {\nee70c128 1724) warning(_(\"ignoring optional %.4s index extension\"), ext);\nee70c128 1725) advise(_(\"This is likely due to the file having been written by a newer\\n\"\n\nrepository.c\n74265dd7 279) int repo_refresh_and_write_index(struct repository *r,\n74265dd7 282) struct lock_file lock_file = LOCK_INIT;\n74265dd7 285) if (repo_read_index_preload(r, NULL, 0) < 0)\n74265dd7 286) return error(_(\"could not read index\"));\n74265dd7 287) fd = repo_hold_locked_index(r, &lock_file, 0);\n74265dd7 288) if (!gentle && fd < 0)\n74265dd7 289) return error(_(\"could not lock index for writing\"));\n74265dd7 290) refresh_index(r->index, flags, NULL, NULL, NULL);\n74265dd7 291) if (0 <= fd)\n74265dd7 292) repo_update_index_if_able(r, &lock_file);\n74265dd7 293) rollback_lock_file(&lock_file);\n74265dd7 295) return 0;\n\nsequencer.c\ne145d993 3368) (!opts->strategy || !strcmp(opts->strategy, \"recursive\")) ?\n\nt/helper/test-prefix-map.c\n1f3e3049 16) va_start(ap, fmt);\n1f3e3049 17) fprintf(stderr, \"%s:%d: \", file, (int)line_no);\n1f3e3049 18) vfprintf(stderr, fmt, ap);\n1f3e3049 19) fputc('\\n', stderr);\n1f3e3049 20) va_end(ap);\n1f3e3049 22) failed_count++;\n\nupload-pack.c\ncf9ceb5a 148) sq_quote_buf(&buf, spec);\n\nwrapper.c\n9827d4c1 31) die(\"Out of memory, strdup failed\");\n9827d4c1 45) if (!gentle)\n9827d4c1 46) die(\"Out of memory, malloc failed (tried to allocate %lu bytes)\",\n9827d4c1 49) error(\"Out of memory, malloc failed (tried to allocate %lu bytes)\",\n9827d4c1 51) return NULL;\n9827d4c1 117) die(\"Out of memory, realloc failed\");\n9827d4c1 133) die(\"Out of memory, calloc failed\");\n\nCommits introducting uncovered code:\nChristian Couder\t9e27beaa promisor-remote: implement promisor_remote_get_direct()\nChristian Couder\tfa3d1b63 promisor-remote: parse remote.*.partialclonefilter\nChristian Couder\t4ca9474e Move core_partial_clone_filter_default to promisor-remote.c\nChristian Couder\tfaf2abf4 promisor-remote: use repository_format_partial_clone\nChristian Couder\t48de3158 Add initial support for many promisor remotes\nChristian Couder\tdb27dca5 Remove fetch-object.{c,h} in favor of promisor-remote.{c,h}\nChristian Couder\tb14ed5ad Use promisor_remote_get_direct() and has_promisor_remote()\nDaniel Ferreira\tbcbdcd36 built-in add -i: implement the `status` command\nJeff King\t9827d4c1 packfile: drop release_pack_memory()\nJohannes Schindelin\te145d993 rebase -r: support merge strategies other than `recursive`\nJohannes Schindelin\td31f31d1 built-in add -i: color the header in the `status` command\nJohannes Schindelin\t74265dd7 built-in add -i: refresh the index before running `status`\nJohannes Schindelin\tdb07a815 Start to implement a built-in version of `git add --interactive`\nJohannes Schindelin\tf3665cfd built-in add -i: implement the `help` command\nJohannes Schindelin\t81e604c5 built-in add -i: implement the main loop\nJohannes Schindelin\tec4ddbf6 built-in add -i: support `?` (prompt help)\nJonathan Nieder\tee70c128 index: offer advice for unknown index extensions\nMatthew DeVore\te987df5f list-objects-filter: implement composite filters\nMatthew DeVore\t9430147c list-objects-filter: encapsulate filter components\nMatthew DeVore\tcf9ceb5a list-objects-filter-options: make filter_spec a string_list\nMatthew DeVore\tf56f7642 list-objects-filter-options: move error check up\nSlavica Djukic\t1f3e3049 Add a function to determine unique prefixes for a list of strings\nSlavica Djukic\t928e9d0d built-in add -i: show unique prefixes of the commands\nSlavica Djukic\t253cdc20 built-in add -i: use color in the main loop\n\n\nUncovered code in 'next' not in 'master'\n--------------------------------------------------------\n\ntree-walk.c\n5aa02f98 194) BUG(\"too small buffer passed to make_traverse_path\");\n5aa02f98 199) BUG(\"traverse_info pathlen does not match strings\");\n5aa02f98 208) BUG(\"traverse_info ran out of list items\");\n\nunpack-trees.c\n90553847 1145) if (*info->prev->name)\n90553847 1148) printf(\"%s\", info->name);\n\nCommits introducting uncovered code:\nJeff King\t5aa02f98 tree-walk: harden make_traverse_path() length computations\nJeff King\t90553847 tree-walk: drop oid from traverse_info\n\n\nUncovered code in 'master' not in 'master@{1}'\n--------------------------------------------------------\n\nbuiltin/fetch.c\n182f59da 1019) warning(_(warn_time_show_forced_updates),\n\nCommits introducting uncovered code:\nJean-Noël Avila\t182f59da l10n: reformat some localized strings for v2.23.0\n\n"},{"id":"380541","messageId":"20190816181103.GA13894@sigill.intra.peff.net","threadId":"51652","inReplyTo":"6dd8797a-289d-cabb-d4c3-761b9f9d3ca0@gmail.com","subject":"Re: Git Test Coverage Report (Thursday, Aug 15)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-08-16T18:11:03Z","receivedAt":"2019-08-16T18:11:06Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 15, 2019 at 10:01:04PM -0400, Derrick Stolee wrote:\n\n> Here is today's test coverage report.\n\nAre the scripts you use to generate these available somewhere?\n\nI think it's useful to look at uncovered code, but I often struggle to\nfigure out whether the parts attached to my name are relevant. In\nparticular, I think two changes to the report format might help:\n\n  1. Include names alongside commit ids when listing uncovered lines. I\n     know that will end up with some overly-long lines, but it makes it\n     easy to grep for one's name to find relevant sections of the file\n     (as opposed to finding your name at the bottom and\n     cross-referencing with actual content lines).\n\n     Seeing that an uncovered line is a BUG(), for example, makes it\n     easy to know that it's not really an interesting uncovered case in\n     the code.\n\n  2. Include more context. Just taking a random example from this email:\n\n> builtin/rebase.c\n> e191cc8b 129) strbuf_addstr(&buf, strategy_opts);\n\nWe know what the uncovered line was trying to do, but more interesting\nis likely the conditional that causes it to be uncovered. In this case\nthe surrounding code is:\n\n          if (opts->ignore_whitespace) {\n                  struct strbuf buf = STRBUF_INIT;\n  \n                  if (strategy_opts)\n                          strbuf_addstr(&buf, strategy_opts);\n  \n                  strbuf_addstr(&buf, \" --ignore-space-change\");\n                  free(strategy_opts);\n                  strategy_opts = strbuf_detach(&buf, NULL);\n          }\n\neven the usual 3 lines of diff context would make it a lot quicker to\nunderstand what's going on (it only kicks in when multiple strategy\noptions are used).\n\n(As an aside, this code leaks the newly allocated buffer and leaves a\ndangling pointer in opts->strategy_opts, but that's all orthogonal to\nthe uncovered line; I'll send a separate message to the original\nauthor).\n\n\nAnyway, I wonder if we could adjust the output of the script to make\nreading it that way a bit easier.\n\n-Peff\n"},{"id":"380542","messageId":"20190816181515.GA15741@sigill.intra.peff.net","threadId":"51652","inReplyTo":"20190816181103.GA13894@sigill.intra.peff.net","subject":"Re: Git Test Coverage Report (Thursday, Aug 15)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-08-16T18:15:16Z","receivedAt":"2019-08-16T18:15:18Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Aug 16, 2019 at 02:11:03PM -0400, Jeff King wrote:\n\n>           if (opts->ignore_whitespace) {\n>                   struct strbuf buf = STRBUF_INIT;\n>   \n>                   if (strategy_opts)\n>                           strbuf_addstr(&buf, strategy_opts);\n>   \n>                   strbuf_addstr(&buf, \" --ignore-space-change\");\n>                   free(strategy_opts);\n>                   strategy_opts = strbuf_detach(&buf, NULL);\n>           }\n> [...]\n> (As an aside, this code leaks the newly allocated buffer and leaves a\n> dangling pointer in opts->strategy_opts, but that's all orthogonal to\n> the uncovered line; I'll send a separate message to the original\n> author).\n\nIn case any of you were on the edge of your seat waiting for more\ndiscussion, it turns out that Phillip already noticed this problem\nduring review:\n\n  https://public-inbox.org/git/a505fdf3-5926-9765-21ef-b82334a3fba4@gmail.com/\n\nSo nothing to see here. :)\n\n-Peff\n"},{"id":"380798","messageId":"a081ccdb-bb0d-00a1-136a-c8fa54296639@gmail.com","threadId":"51652","inReplyTo":"20190816181103.GA13894@sigill.intra.peff.net","subject":"Re: Git Test Coverage Report (Thursday, Aug 15)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-08-20T12:54:20Z","receivedAt":"2019-08-20T12:54:24Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 8/16/2019 2:11 PM, Jeff King wrote:\n> On Thu, Aug 15, 2019 at 10:01:04PM -0400, Derrick Stolee wrote:\n> \n>> Here is today's test coverage report.\n> \n> Are the scripts you use to generate these available somewhere?\n\nThe scripts I originally used are available in contrib/coverage-diff.sh.\n\nHowever, to allow for some more advanced workflows, I created the following\nC# project: https://github.com/derrickstolee/git-test-coverage/tree/master/TestCoverageReport\n\nThe runs are done via the following Azure Pipelines build:\nhttps://dev.azure.com/git/git/_build/results?buildId=879\n\nThere, you can see how the code is built, tested, and the gcov output\nis collected in the TestCoverageReport tool to generate the .txt and .htm\nfiles.\n \n> I think it's useful to look at uncovered code, but I often struggle to\n> figure out whether the parts attached to my name are relevant. In\n> particular, I think two changes to the report format might help:\n> \n>   1. Include names alongside commit ids when listing uncovered lines. I\n>      know that will end up with some overly-long lines, but it makes it\n>      easy to grep for one's name to find relevant sections of the file\n>      (as opposed to finding your name at the bottom and\n>      cross-referencing with actual content lines).\n> \n>      Seeing that an uncovered line is a BUG(), for example, makes it\n>      easy to know that it's not really an interesting uncovered case in\n>      the code.\n\nThe HTML reports [1] have the following feature: click on a commit in the\ncommit summary and it highlights the lines from that commit.\n\n[1] https://derrickstolee.github.io/git-test-coverage/reports/2019-08-15.htm\n\nHowever, the plain-text report _could_ add names. Maybe instead the report\nshould just group the output by commit instead of branch.\n\n>   2. Include more context. Just taking a random example from this email:\n> \n>> builtin/rebase.c\n>> e191cc8b 129) strbuf_addstr(&buf, strategy_opts);\n> \n> We know what the uncovered line was trying to do, but more interesting\n> is likely the conditional that causes it to be uncovered. In this case\n> the surrounding code is:\n> \n>           if (opts->ignore_whitespace) {\n>                   struct strbuf buf = STRBUF_INIT;\n>   \n>                   if (strategy_opts)\n>                           strbuf_addstr(&buf, strategy_opts);\n>   \n>                   strbuf_addstr(&buf, \" --ignore-space-change\");\n>                   free(strategy_opts);\n>                   strategy_opts = strbuf_detach(&buf, NULL);\n>           }\n> \n> even the usual 3 lines of diff context would make it a lot quicker to\n> understand what's going on (it only kicks in when multiple strategy\n> options are used).\n\nIn this case, the additional context helps, but only if you expand by\nseveral lines. In other cases, the necessary context could be dozens of\nlines.\n\nPerhaps a deeper report could include something like \"git format-patch\n--function-context\" to naturally extend to the appropriate context. It\nmay be better to have a \"block context\" for these conditionals. In such\na case, it would be important to mark the \"new\" lines explicitly so the\ncontext lines don't become too noisy.\n\n> (As an aside, this code leaks the newly allocated buffer and leaves a\n> dangling pointer in opts->strategy_opts, but that's all orthogonal to\n> the uncovered line; I'll send a separate message to the original\n> author).\n> \n> \n> Anyway, I wonder if we could adjust the output of the script to make\n> reading it that way a bit easier.\n\nI'll think about this, for sure. When I have time to go deep into the\nreport (not just the code I wrote) I look for lines that seem to be\nnon-trivial, then go find their context by looking at the commit.\nHere is another example of why the HTML report is helpful: it will\nlink to the commit diff view [2] or the exact line of the file [3].\n(Note: the exact line link only works if we point to the branch that\nwas tested, not the commit that made the change.)\n\n[2] https://github.com/git/git/commit/e191cc8b8080f63a0080031bf1276269c6bf42dd\n[3] https://github.com/git/git/blob/6cf2e4a04610efe882eb663cd36436b80b343fa0/builtin/rebase.c#L129\n\nThanks,\n-Stolee\n"}]}