{"thread":{"id":"52416","subject":"Git Test Coverage Report (Mon. Dec 9)","startedAt":"2019-12-09T15:36:18Z","lastAt":"2019-12-09T20:17:18Z","messageCount":7,"participants":["Derrick Stolee","René Scharfe","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"387790","messageId":"903fcdea-6f08-caf5-77a4-2e82b8585edf@gmail.com","threadId":"52416","inReplyTo":null,"subject":"Git Test Coverage Report (Mon. Dec 9)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-09T15:36:12Z","receivedAt":"2019-12-09T15:36:18Z","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-12-09.htm\n[2] https://derrickstolee.github.io/git-test-coverage/reports/2019-12-09-commits.txt\n\n---\n\npu\t6111d532a73feb1d5c4a6b07265ca282f4807b39\njch\teba02921db5f965dd3f07ce03b80b85082414d1c\nnext\te0522318ac56aeb88f14e72ba2db25912e9972de\nmaster\t083378cc35c4dbcc607e4cdd24a5fca440163d17\nmaster@{1}\td9f6f3b6195a0ca35642561e530798ad1469bd41\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\nJohannes Schindelin\tb4bbbbd5 apply --allow-overlap: fix a corner case\napply.c\nb4bbbbd5 2672) match_beginning = 0;\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 1465) return;\n\nsha1-file.c\nbeebb9d2 1431) return;\nbeebb9d2 1440) return;\n\nPhillip Wood\t430b75f7 commit: give correct advice for empty commit during a rebase\nsequencer.c\n430b75f7 1583)     return -1;\n\n\n\nUncovered code in 'jch' not in 'next'\n--------------------------------------------------------\n\nCommits introducing uncovered code:\nAlban Gruin\t0d50cf5e sequencer: move check_todo_list_from_file() to rebase-interactive.c\nrebase-interactive.c\n0d50cf5e 210) goto out;\n0d50cf5e 215) goto out;\n0d50cf5e 224) fprintf(stderr, _(edit_todo_list_advice));\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\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\n\n\nUncovered code in 'next' not in 'master'\n--------------------------------------------------------\n\nCommits introducing uncovered code:\nAlban Gruin\t393adf7a sequencer: directly call pick_commits() from complete_action()\nsequencer.c\n393adf7a 5272) goto cleanup;\n\nDaniel Ferreira\t5e82b9e4 built-in add -i: implement the `status` command\nadd-interactive.c\n5e82b9e4 629) return -1;\n5e82b9e4 632) putchar('\\n');\n5e82b9e4 634) return 0;\n\nDerrick Stolee\t44a4693b progress: create GIT_PROGRESS_DELAY\nprogress.c\n44a4693b 308) return start_progress_delay(title, total, get_default_delay(), 1);\n\nHans Jerry Illikainen\t72b006f4 gpg-interface: prefer check_signature() for GPG verification\nbuiltin/fmt-merge-msg.c\n72b006f4 511) strbuf_addstr(&sig, \"gpg verification failed.\\n\");\n\ngpg-interface.c\n72b006f4 223) return error_errno(_(\"could not create temporary file\"));\n72b006f4 226) error_errno(_(\"failed writing detached signature to '%s'\"),\n72b006f4 228) delete_tempfile(&temp);\n72b006f4 229) return -1;\n72b006f4 244) gpg_status = &buf;\n\nlog-tree.c\n72b006f4 461) show_sig_lines(opt, status, \"No signature\\n\");\n72b006f4 535) } else if (verify_message.len <= gpg_message_offset)\n\nJeff King\t7b143c16 pack-bitmap: introduce bitmap_walk_contains()\npack-bitmap.c\n7b143c16 903) return 0;\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\nJohannes Schindelin\td7633578 built-in add -i: re-implement the `diff` command\nadd-interactive.c\nd7633578 934) static int run_diff(struct add_i_state *s, const struct pathspec *ps,\nd7633578 938) int res = 0;\nd7633578 942) int is_initial = !resolve_ref_unsafe(\"HEAD\", RESOLVE_REF_READING, &oid,\nd7633578 944) if (get_modified_files(s->r, INDEX_ONLY, files, ps, NULL, NULL) < 0)\nd7633578 945) return -1;\nd7633578 947) if (!files->items.nr) {\nd7633578 948) putchar('\\n');\nd7633578 949) return 0;\nd7633578 952) opts->prompt = N_(\"Review diff\");\nd7633578 953) opts->flags = IMMEDIATE;\nd7633578 954) count = list_and_choose(s, files, opts);\nd7633578 955) opts->flags = 0;\nd7633578 956) if (count >= 0) {\nd7633578 957) struct argv_array args = ARGV_ARRAY_INIT;\nd7633578 959) argv_array_pushl(&args, \"git\", \"diff\", \"-p\", \"--cached\",\nd7633578 961)     s->r->hash_algo->empty_tree),\nd7633578 963) for (i = 0; i < files->items.nr; i++)\nd7633578 964) if (files->selected[i])\nd7633578 965) argv_array_push(&args,\nd7633578 966) files->items.items[i].string);\nd7633578 967) res = run_command_v_opt(args.argv, 0);\nd7633578 968) argv_array_clear(&args);\nd7633578 971) putchar('\\n');\nd7633578 972) return res;\n\nJohannes Schindelin\tc54ef5e4 built-in add -i: re-implement `revert` in C\nadd-interactive.c\nc54ef5e4 686) static void revert_from_diff(struct diff_queue_struct *q,\nc54ef5e4 689) int i, add_flags = ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE;\nc54ef5e4 691) for (i = 0; i < q->nr; i++) {\nc54ef5e4 692) struct diff_filespec *one = q->queue[i]->one;\nc54ef5e4 695) if (!(one->mode && !is_null_oid(&one->oid))) {\nc54ef5e4 696) remove_file_from_index(opt->repo->index, one->path);\nc54ef5e4 697) printf(_(\"note: %s is untracked now.\\n\"), one->path);\nc54ef5e4 699) ce = make_cache_entry(opt->repo->index, one->mode,\nc54ef5e4 700)       &one->oid, one->path, 0, 0);\nc54ef5e4 701) if (!ce)\nc54ef5e4 704) add_index_entry(opt->repo->index, ce, add_flags);\nc54ef5e4 707) }\nc54ef5e4 709) static int run_revert(struct add_i_state *s, const struct pathspec *ps,\nc54ef5e4 713) int res = 0, fd;\nc54ef5e4 717) int is_initial = !resolve_ref_unsafe(\"HEAD\", RESOLVE_REF_READING, &oid,\nc54ef5e4 722) struct diff_options diffopt = { NULL };\nc54ef5e4 725) return -1;\nc54ef5e4 727) if (!files->items.nr) {\nc54ef5e4 728) putchar('\\n');\nc54ef5e4 729) return 0;\nc54ef5e4 732) opts->prompt = N_(\"Revert\");\nc54ef5e4 733) count = list_and_choose(s, files, opts);\nc54ef5e4 734) if (count <= 0)\nc54ef5e4 735) goto finish_revert;\nc54ef5e4 737) fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);\nc54ef5e4 738) if (fd < 0) {\nc54ef5e4 739) res = -1;\nc54ef5e4 740) goto finish_revert;\nc54ef5e4 743) if (is_initial)\nc54ef5e4 744) oidcpy(&oid, s->r->hash_algo->empty_tree);\nc54ef5e4 746) tree = parse_tree_indirect(&oid);\nc54ef5e4 747) if (!tree) {\nc54ef5e4 749) goto finish_revert;\nc54ef5e4 751) oidcpy(&oid, &tree->object.oid);\nc54ef5e4 754) ALLOC_ARRAY(paths, count + 1);\nc54ef5e4 755) for (i = j = 0; i < files->items.nr; i++)\nc54ef5e4 756) if (files->selected[i])\nc54ef5e4 757) paths[j++] = files->items.items[i].string;\nc54ef5e4 758) paths[j] = NULL;\nc54ef5e4 760) parse_pathspec(&diffopt.pathspec, 0,\nc54ef5e4 764) diffopt.output_format = DIFF_FORMAT_CALLBACK;\nc54ef5e4 765) diffopt.format_callback = revert_from_diff;\nc54ef5e4 766) diffopt.flags.override_submodule_config = 1;\nc54ef5e4 767) diffopt.repo = s->r;\nc54ef5e4 769) if (do_diff_cache(&oid, &diffopt))\nc54ef5e4 770) res = -1;\nc54ef5e4 772) diffcore_std(&diffopt);\nc54ef5e4 773) diff_flush(&diffopt);\nc54ef5e4 775) free(paths);\nc54ef5e4 776) clear_pathspec(&diffopt.pathspec);\nc54ef5e4 778) if (!res && write_locked_index(s->r->index, &index_lock,\nc54ef5e4 780) res = -1;\nc54ef5e4 782) res = repo_refresh_and_write_index(s->r, REFRESH_QUIET, 0, 1,\nc54ef5e4 785) if (!res)\nc54ef5e4 786) printf(Q_(\"reverted %d path\\n\",\nc54ef5e4 791) return res;\n\nJohannes Schindelin\tab1e1ccc built-in add -i: re-implement `add-untracked` in C\nadd-interactive.c\nab1e1ccc 609) if (d->only_names) {\nab1e1ccc 610) printf(\"%c%2d: %s\", selected ? '*' : ' ', i + 1,\nab1e1ccc 612) return;\nab1e1ccc 794) static int get_untracked_files(struct repository *r,\nab1e1ccc 798) struct dir_struct dir = { 0 };\nab1e1ccc 800) struct strbuf buf = STRBUF_INIT;\nab1e1ccc 802) if (repo_read_index(r) < 0)\nab1e1ccc 805) prefix_item_list_clear(files);\nab1e1ccc 806) setup_standard_excludes(&dir);\nab1e1ccc 807) add_pattern_list(&dir, EXC_CMDL, \"--exclude option\");\nab1e1ccc 808) fill_directory(&dir, r->index, ps);\nab1e1ccc 810) for (i = 0; i < dir.nr; i++) {\nab1e1ccc 811) struct dir_entry *ent = dir.entries[i];\nab1e1ccc 813) if (index_name_is_other(r->index, ent->name, ent->len)) {\nab1e1ccc 814) strbuf_reset(&buf);\nab1e1ccc 815) strbuf_add(&buf, ent->name, ent->len);\nab1e1ccc 816) add_file_item(&files->items, buf.buf);\nab1e1ccc 820) strbuf_release(&buf);\nab1e1ccc 824) static int run_add_untracked(struct add_i_state *s, const struct pathspec *ps,\nab1e1ccc 828) struct print_file_item_data *d = opts->list_opts.print_item_data;\nab1e1ccc 829) int res = 0, fd;\nab1e1ccc 833) if (get_untracked_files(s->r, files, ps) < 0)\nab1e1ccc 834) return -1;\nab1e1ccc 836) if (!files->items.nr) {\nab1e1ccc 837) printf(_(\"No untracked files.\\n\"));\nab1e1ccc 838) goto finish_add_untracked;\nab1e1ccc 841) opts->prompt = N_(\"Add untracked\");\nab1e1ccc 842) d->only_names = 1;\nab1e1ccc 843) count = list_and_choose(s, files, opts);\nab1e1ccc 844) d->only_names = 0;\nab1e1ccc 845) if (count <= 0)\nab1e1ccc 846) goto finish_add_untracked;\nab1e1ccc 848) fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);\nab1e1ccc 849) if (fd < 0) {\nab1e1ccc 850) res = -1;\nab1e1ccc 851) goto finish_add_untracked;\nab1e1ccc 854) for (i = 0; i < files->items.nr; i++) {\nab1e1ccc 855) const char *name = files->items.items[i].string;\nab1e1ccc 856) if (files->selected[i] &&\nab1e1ccc 857)     add_file_to_index(s->r->index, name, 0) < 0) {\nab1e1ccc 859) break;\nab1e1ccc 863) if (!res &&\nab1e1ccc 864)     write_locked_index(s->r->index, &index_lock, COMMIT_LOCK) < 0)\nab1e1ccc 867) if (!res)\nab1e1ccc 868) printf(Q_(\"added %d path\\n\",\nab1e1ccc 872) putchar('\\n');\nab1e1ccc 873) return res;\n\nJohannes Schindelin\t0c3944a6 add-interactive: make sure to release `rev.prune_data`\nadd-interactive.c\n0c3944a6 538) if (ps)\n0c3944a6 539) clear_pathspec(&rev.prune_data);\n\nJohannes Schindelin\ta8c45be9 built-in add -i: implement the `update` command\nadd-interactive.c\na8c45be9 504) prefix_item_list_clear(files);\na8c45be9 505) s.files = &files->items;\na8c45be9 548) string_list_sort(&files->items);\na8c45be9 593) const char *highlighted = NULL;\na8c45be9 600) if (c->prefix_length > 0 &&\na8c45be9 601)     is_valid_prefix(item->string, c->prefix_length)) {\na8c45be9 602) strbuf_reset(&d->name);\na8c45be9 603) strbuf_addf(&d->name, \"%s%.*s%s%s\", d->color,\na8c45be9 604)     (int)c->prefix_length, item->string, d->reset,\na8c45be9 605)     item->string + c->prefix_length);\na8c45be9 606) highlighted = d->name.buf;\na8c45be9 618) strbuf_addf(&d->buf, d->modified_fmt, d->index.buf, d->worktree.buf,\na8c45be9 631) list(s, &files->items, NULL, &opts->list_opts);\na8c45be9 637) static int run_update(struct add_i_state *s, const struct pathspec *ps,\na8c45be9 641) int res = 0, fd;\na8c45be9 648) if (!files->items.nr) {\na8c45be9 649) putchar('\\n');\na8c45be9 650) return 0;\na8c45be9 653) opts->prompt = N_(\"Update\");\na8c45be9 654) count = list_and_choose(s, files, opts);\na8c45be9 655) if (count <= 0) {\na8c45be9 656) putchar('\\n');\na8c45be9 657) return 0;\na8c45be9 660) fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);\na8c45be9 661) if (fd < 0) {\na8c45be9 662) putchar('\\n');\na8c45be9 663) return -1;\na8c45be9 666) for (i = 0; i < files->items.nr; i++) {\na8c45be9 667) const char *name = files->items.items[i].string;\na8c45be9 668) if (files->selected[i] &&\na8c45be9 669)     add_file_to_index(s->r->index, name, 0) < 0) {\na8c45be9 671) break;\na8c45be9 675) if (!res && write_locked_index(s->r->index, &index_lock, COMMIT_LOCK) < 0)\na8c45be9 678) if (!res)\na8c45be9 679) printf(Q_(\"updated %d path\\n\",\na8c45be9 682) putchar('\\n');\na8c45be9 683) return res;\na8c45be9 995) static void choose_prompt_help(struct add_i_state *s)\na8c45be9 997) color_fprintf_ln(stdout, s->help_color, \"%s\",\na8c45be9 999) color_fprintf_ln(stdout, s->help_color, \"1          - %s\",\na8c45be9 1001) color_fprintf_ln(stdout, s->help_color, \"3-5        - %s\",\na8c45be9 1003) color_fprintf_ln(stdout, s->help_color, \"2-3,6-9    - %s\",\na8c45be9 1005) color_fprintf_ln(stdout, s->help_color, \"foo        - %s\",\na8c45be9 1007) color_fprintf_ln(stdout, s->help_color, \"-...       - %s\",\na8c45be9 1009) color_fprintf_ln(stdout, s->help_color, \"*          - %s\",\na8c45be9 1011) color_fprintf_ln(stdout, s->help_color, \"           - %s\",\na8c45be9 1013) }\na8c45be9 1083) struct list_and_choose_options opts = {\na8c45be9 1088) struct prefix_item_list files = PREFIX_ITEM_LIST_INIT;\na8c45be9 1109) print_file_item_data.color = data.color;\na8c45be9 1110) print_file_item_data.reset = data.reset;\na8c45be9 1115) opts.list_opts.header = header.buf;\na8c45be9 1144) prefix_item_list_clear(&files);\na8c45be9 1146) strbuf_release(&print_file_item_data.name);\n\nJohannes Schindelin\t8746e072 built-in add -i: implement the `patch` command\nadd-interactive.c\n8746e072 462) other_adddel = s->mode == FROM_INDEX ?\n8746e072 463) &file_item->worktree : &file_item->index;\n8746e072 467) if (stat.files[i]->is_binary) {\n8746e072 468) if (!other_adddel->binary)\n8746e072 469) s->binary_count++;\n8746e072 472) if (stat.files[i]->is_unmerged) {\n8746e072 473) if (!other_adddel->unmerged)\n8746e072 474) s->unmerged_count++;\n8746e072 475) adddel->unmerged = 1;\n8746e072 542) if (unmerged_count)\n8746e072 543) *unmerged_count = s.unmerged_count;\n8746e072 544) if (binary_count)\n8746e072 545) *binary_count = s.binary_count;\n8746e072 628) if (get_modified_files(s->r, NO_FILTER, files, ps, NULL, NULL) < 0)\n8746e072 645) if (get_modified_files(s->r, WORKTREE_ONLY, files, ps, NULL, NULL) < 0)\n8746e072 724) if (get_modified_files(s->r, INDEX_ONLY, files, ps, NULL, NULL) < 0)\n8746e072 876) static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n8746e072 880) int res = 0;\n8746e072 882) size_t unmerged_count = 0, binary_count = 0;\n8746e072 884) if (get_modified_files(s->r, WORKTREE_ONLY, files, ps,\n8746e072 886) return -1;\n8746e072 888) if (unmerged_count || binary_count) {\n8746e072 889) for (i = j = 0; i < files->items.nr; i++) {\n8746e072 890) struct file_item *item = files->items.items[i].util;\n8746e072 892) if (item->index.binary || item->worktree.binary) {\n8746e072 893) free(item);\n8746e072 894) free(files->items.items[i].string);\n8746e072 895) } else if (item->index.unmerged ||\n8746e072 897) color_fprintf_ln(stderr, s->error_color,\n8746e072 899)  files->items.items[i].string);\n8746e072 900) free(item);\n8746e072 901) free(files->items.items[i].string);\n8746e072 903) files->items.items[j++] = files->items.items[i];\n8746e072 905) files->items.nr = j;\n8746e072 908) if (!files->items.nr) {\n8746e072 909) if (binary_count)\n8746e072 910) fprintf(stderr, _(\"Only binary files changed.\\n\"));\n8746e072 912) fprintf(stderr, _(\"No changes.\\n\"));\n8746e072 913) return 0;\n8746e072 916) opts->prompt = N_(\"Patch update\");\n8746e072 917) count = list_and_choose(s, files, opts);\n8746e072 918) if (count >= 0) {\n8746e072 919) struct argv_array args = ARGV_ARRAY_INIT;\n8746e072 921) argv_array_pushl(&args, \"git\", \"add--interactive\", \"--patch\",\n8746e072 923) for (i = 0; i < files->items.nr; i++)\n8746e072 924) if (files->selected[i])\n8746e072 925) argv_array_push(&args,\n8746e072 926) files->items.items[i].string);\n8746e072 927) res = run_command_v_opt(args.argv, 0);\n8746e072 928) argv_array_clear(&args);\n8746e072 931) return res;\n\nJohannes Schindelin\tc08171d1 built-in add -i: allow filtering the modified files list\nadd-interactive.c\nc08171d1 447) if (s->skip_unseen)\nc08171d1 448) continue;\nc08171d1 460) adddel = s->mode == FROM_INDEX ?\nc08171d1 487) static int get_modified_files(struct repository *r,\nc08171d1 497) struct collection_status s = { 0 };\nc08171d1 508) for (i = 0; i < 2; i++) {\nc08171d1 512) if (filter == INDEX_ONLY)\nc08171d1 513) s.mode = (i == 0) ? FROM_INDEX : FROM_WORKTREE;\nc08171d1 515) s.mode = (i == 0) ? FROM_WORKTREE : FROM_INDEX;\nc08171d1 516) s.skip_unseen = filter && i;\nc08171d1 531) if (s.mode == FROM_INDEX)\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\t2e697ced built-in add -i: offer the `quit` command\nadd-interactive.c\n2e697ced 1129) if (i < 0 || i >= commands.items.nr)\n2e697ced 1130) util = NULL;\n2e697ced 1132) util = commands.items.items[i].util;\n2e697ced 1134) if (i == LIST_AND_CHOOSE_QUIT || (util && !util->command)) {\n2e697ced 1140) if (util)\n\nJohannes Schindelin\tf37c2264 built-in add -i: prepare for multi-selection commands\nadd-interactive.c\nf37c2264 88) FREE_AND_NULL(list->selected);\nf37c2264 195) static void list(struct add_i_state *s, struct string_list *list, int *selected,\nf37c2264 208) opts->print_item(i, selected ? selected[i] : 0, list->items + i,\nf37c2264 249) int singleton = opts->flags & SINGLETON;\nf37c2264 250) int immediate = opts->flags & IMMEDIATE;\nf37c2264 253) ssize_t res = singleton ? LIST_AND_CHOOSE_ERROR : 0;\nf37c2264 255) if (!singleton) {\nf37c2264 256) free(items->selected);\nf37c2264 257) CALLOC_ARRAY(items->selected, items->items.nr);\nf37c2264 260) if (singleton && !immediate)\nf37c2264 270) list(s, &items->items, items->selected, &opts->list_opts);\nf37c2264 273) fputs(singleton ? \"> \" : \">> \", stdout);\nf37c2264 278) if (immediate)\nf37c2264 279) res = LIST_AND_CHOOSE_QUIT;\nf37c2264 295) int choose = 1;\nf37c2264 297) ssize_t from = -1, to = -1;\nf37c2264 307) if (*p == '-') {\nf37c2264 308) choose = 0;\nf37c2264 309) p++;\nf37c2264 310) sep--;\nf37c2264 313) if (sep == 1 && *p == '*') {\nf37c2264 314) from = 0;\nf37c2264 315) to = items->items.nr;\nf37c2264 316) } else if (isdigit(*p)) {\nf37c2264 327) from = strtoul(p, &endp, 10) - 1;\nf37c2264 328) if (endp == p + sep)\nf37c2264 329) to = from + 1;\nf37c2264 330) else if (*endp == '-') {\nf37c2264 331) to = strtoul(++endp, &endp, 10);\nf37c2264 333) if (endp != p + sep)\nf37c2264 334) from = -1;\nf37c2264 340) if (from < 0) {\nf37c2264 341) from = find_unique(p, items);\nf37c2264 342) if (from >= 0)\nf37c2264 343) to = from + 1;\nf37c2264 346) if (from < 0 || from >= items->items.nr ||\nf37c2264 347)     (singleton && from + 1 != to)) {\nf37c2264 350) break;\nf37c2264 351) } else if (singleton) {\nf37c2264 352) res = from;\nf37c2264 356) if (to > items->items.nr)\nf37c2264 357) to = items->items.nr;\nf37c2264 359) for (; from < to; from++)\nf37c2264 360) if (items->selected[from] != choose) {\nf37c2264 361) items->selected[from] = choose;\nf37c2264 362) res += choose ? +1 : -1;\nf37c2264 368) if ((immediate && res != LIST_AND_CHOOSE_ERROR) ||\nf37c2264 369)     !strcmp(input.buf, \"*\"))\nf37c2264 588) static void print_file_item(int i, int selected, struct string_list_item *item,\nf37c2264 621) printf(\"%c%2d: %s\", selected ? '*' : ' ', i + 1, d->buf.buf);\nf37c2264 1028) static void print_command_item(int i, int selected,\n\nRené Scharfe\t0bb313a5 xdiff: unignore changes in function context\nxdiff/xemit.c\n0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n0bb313a5 225) xchp = xchp->next;\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 'master' not in 'master@{1}'\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\t67a6ea63 gpg-interface: limit search for primary key fingerprint\ngpg-interface.c\n67a6ea63 184) replace_cstring(field, NULL, NULL);\n\nHans Jerry Illikainen\t392b862e gpg-interface: refactor the free-and-xmemdupz pattern\ngpg-interface.c\n392b862e 115) *field = 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\t228c78fb commit, tag: don't set parsed bit for parse failures\ntag.c\n228c78fb 152) FREE_AND_NULL(item->tag);\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\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\tb8b00f16 fsck: drop blob struct from fsck_finish()\nfsck.c\nb8b00f16 1027) if (is_promisor_object(oid))\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\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\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\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\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\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\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\tcc579000 fsck: don't require an object struct in verify_headers()\nfsck.c\ncc579000 717) return report(options, oid, type,\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\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\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"},{"id":"387807","messageId":"e47b77b4-7b7a-3d59-9e24-934528c5e297@web.de","threadId":"52416","inReplyTo":"903fcdea-6f08-caf5-77a4-2e82b8585edf@gmail.com","subject":"Re: Git Test Coverage Report (Mon. Dec 9)","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-12-09T17:10:41Z","receivedAt":"2019-12-09T17:11:19Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 09.12.19 um 16:36 schrieb Derrick Stolee:\n> Uncovered code in 'next' not in 'master'\n> --------------------------------------------------------\n\n> René Scharfe\t0bb313a5 xdiff: unignore changes in function context\n> xdiff/xemit.c\n> 0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n> 0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n> 0bb313a5 225) xchp = xchp->next;\n\nHmm, line 223 *is* exercised by t4015.85.\n\nThat loop skips ignored changes before function context -- we don't want\nthose.  t4015.85 only has an ignored change within function context and\n0bb313a5 reveals it, as intended.  So for better test coverage we could\ndo something like this.  Does it help?  (It should, but I'm mystified\nwhy 223 shows up in the report.)\n\n-- >8 --\nSubject: [PATCH] t4015: improve coverage of function context test\n\nInclude an actual function line in the test files to check if context is\nexpanded to include the whole function, and add an ignored change before\nfunction context to check if that one stays hidden, while the originally\nignored change within function context is shown.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n t/t4015-diff-whitespace.sh | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 5888ae5ed3..7a13e1de62 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -2026,19 +2026,24 @@ test_expect_success 'compare mixed whitespace delta across moved blocks' '\n '\n\n test_expect_success 'combine --ignore-blank-lines with --function-context' '\n-\ttest_write_lines 1 \"\" 2 3 4 5 >a &&\n-\ttest_write_lines 1    2 3 4   >b &&\n+\ttest_write_lines    1 2 3 \"\" function 1 2 3 4 5 \"\" 6 7 8 9 >a &&\n+\ttest_write_lines \"\" 1 2 3 \"\" function 1 2 3 4 5    6 7 8   >b &&\n \ttest_must_fail git diff --no-index \\\n \t\t--ignore-blank-lines --function-context a b >actual.raw &&\n \tsed -n \"/@@/,\\$p\" <actual.raw >actual &&\n \tcat <<-\\EOF >expect &&\n-\t@@ -1,6 +1,4 @@\n+\t@@ -5,11 +6,9 @@\n+\t function\n \t 1\n-\t-\n \t 2\n \t 3\n \t 4\n-\t-5\n+\t 5\n+\t-\n+\t 6\n+\t 7\n+\t 8\n+\t-9\n \tEOF\n \ttest_cmp expect actual\n '\n--\n2.24.0\n"},{"id":"387808","messageId":"CAPig+cTrAsn64S0Qm7PdJVFhsquVA3+ugwngLpo1S4yUjMcrGA@mail.gmail.com","threadId":"52416","inReplyTo":"e47b77b4-7b7a-3d59-9e24-934528c5e297@web.de","subject":"Re: Git Test Coverage Report (Mon. Dec 9)","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-12-09T17:19:59Z","receivedAt":"2019-12-09T17:20:13Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Dec 9, 2019 at 12:11 PM René Scharfe <l.s.r@web.de> wrote:\n> Am 09.12.19 um 16:36 schrieb Derrick Stolee:\n> > René Scharfe  0bb313a5 xdiff: unignore changes in function context\n> > xdiff/xemit.c\n> > 0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n> > 0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n> > 0bb313a5 225) xchp = xchp->next;\n>\n> Hmm, line 223 *is* exercised by t4015.85.\n\nThis, along with Dscho's[1] review of an earlier coverage report,\nmakes one wonder if there is some off-by-one error in the reporting\nlogic, such that it is reporting the wrong lines as not covered.\n\nFootnotes:\n\n[1]: https://lore.kernel.org/git/nycvar.QRO.7.76.6.1911262116100.31080@tvgsbejvaqbjf.bet/\nwhich, among other seeming anomalies pointed out by Dscho, showed a\nclosing brace '}' not covered by a test:\n\n    > Johannes Schindelin 867bc1d2 rebase-merges: ...\n    > sequencer.c\n    > 867bc1d2 4539) }\n\n    Not sure why this closing parenthesis isn't covered :-D\n"},{"id":"387810","messageId":"58a3e2c4-4c5a-e276-f74e-128438f2ab40@gmail.com","threadId":"52416","inReplyTo":"CAPig+cTrAsn64S0Qm7PdJVFhsquVA3+ugwngLpo1S4yUjMcrGA@mail.gmail.com","subject":"Re: Git Test Coverage Report (Mon. Dec 9)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-09T17:44:30Z","receivedAt":"2019-12-09T17:44:34Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/9/2019 12:19 PM, Eric Sunshine wrote:\n> On Mon, Dec 9, 2019 at 12:11 PM René Scharfe <l.s.r@web.de> wrote:\n>> Am 09.12.19 um 16:36 schrieb Derrick Stolee:\n>>> René Scharfe  0bb313a5 xdiff: unignore changes in function context\n>>> xdiff/xemit.c\n>>> 0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n>>> 0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n>>> 0bb313a5 225) xchp = xchp->next;\n>>\n>> Hmm, line 223 *is* exercised by t4015.85.\n> \n> This, along with Dscho's[1] review of an earlier coverage report,\n> makes one wonder if there is some off-by-one error in the reporting\n> logic, such that it is reporting the wrong lines as not covered.\n\nThis is definitely possible. I'll see if I can locate the bug in\nmy report-generation code.\n\nHowever, line 222 is here [1]\n\n\twhile (xchp != xch &&\n\nSo if this is always false, then the rest of the while condition\nwill not be tested, nor will the body (line 225: xchp = xchp->next;).\n\nIf it's just an off-by-one error in either direction, then line 224\nstill is definitely not covered (which would imply that 225 is not\ncovered, either).\n \n> Footnotes:\n> \n> [1]: https://lore.kernel.org/git/nycvar.QRO.7.76.6.1911262116100.31080@tvgsbejvaqbjf.bet/\n> which, among other seeming anomalies pointed out by Dscho, showed a\n> closing brace '}' not covered by a test:\n> \n>     > Johannes Schindelin 867bc1d2 rebase-merges: ...\n>     > sequencer.c\n>     > 867bc1d2 4539) }\n> \n>     Not sure why this closing parenthesis isn't covered :-D\n\nThat closing paren is the end of a for loop [2] that has an if (*) break; inside.\nThe closing paren _could_ be uncovered if the \"break;\" is hit every time.\n\nSo, these seem like reasonable lines to report as uncovered. However, I'll\ncontinue to look for a problem in my code as I would hate to cause readers\nto stress over an actually-covered line.\n\nThanks,\n-Stolee\n\n[1] https://github.com/git/git/blob/e0522318ac56aeb88f14e72ba2db25912e9972de/xdiff/xemit.c#L223\n[2] https://github.com/git/git/blob/083378cc35c4dbcc607e4cdd24a5fca440163d17/sequencer.c#L4539\n"},{"id":"387811","messageId":"a9c2c409-778c-48e2-e6d5-229eab45a707@web.de","threadId":"52416","inReplyTo":"58a3e2c4-4c5a-e276-f74e-128438f2ab40@gmail.com","subject":"Re: Git Test Coverage Report (Mon. Dec 9)","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-12-09T18:10:10Z","receivedAt":"2019-12-09T18:10:22Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 09.12.19 um 18:44 schrieb Derrick Stolee:\n> On 12/9/2019 12:19 PM, Eric Sunshine wrote:\n>> On Mon, Dec 9, 2019 at 12:11 PM René Scharfe <l.s.r@web.de> wrote:\n>>> Am 09.12.19 um 16:36 schrieb Derrick Stolee:\n>>>> René Scharfe  0bb313a5 xdiff: unignore changes in function context\n>>>> xdiff/xemit.c\n>>>> 0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n>>>> 0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n>>>> 0bb313a5 225) xchp = xchp->next;\n>>>\n>>> Hmm, line 223 *is* exercised by t4015.85.\n>>\n>> This, along with Dscho's[1] review of an earlier coverage report,\n>> makes one wonder if there is some off-by-one error in the reporting\n>> logic, such that it is reporting the wrong lines as not covered.\n>\n> This is definitely possible. I'll see if I can locate the bug in\n> my report-generation code.\n>\n> However, line 222 is here [1]\n>\n> \twhile (xchp != xch &&\n>\n> So if this is always false, then the rest of the while condition\n> will not be tested, nor will the body (line 225: xchp = xchp->next;).\n\n0bb313a5 also added lines 228 and 229, which are not in the report, so\nxchp != xch must be true at least once (it is, in t4015.85).\n\n222)\t\t\t\twhile (xchp != xch &&\n223)\t\t\t\t       xchp->i1 + xchp->chg1 <= s1 &&\n224)\t\t\t\t       xchp->i2 + xchp->chg2 <= s2)\n225)\t\t\t\t\txchp = xchp->next;\n226)\n227)\t\t\t\t/* If so, show it after all. */\n228)\t\t\t\tif (xchp != xch) {\n229)\t\t\t\t\txch = xchp;\n\n> If it's just an off-by-one error in either direction, then line 224\n> still is definitely not covered (which would imply that 225 is not\n> covered, either).\n\nRight, hence the patch for t4015 I sent with my first reply.\n\nRené\n"},{"id":"387812","messageId":"676dc5c1-5823-ac83-878b-995f3793bfb8@gmail.com","threadId":"52416","inReplyTo":"a9c2c409-778c-48e2-e6d5-229eab45a707@web.de","subject":"Re: Git Test Coverage Report (Mon. Dec 9)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-09T18:23:22Z","receivedAt":"2019-12-09T18:23:28Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/9/2019 1:10 PM, René Scharfe wrote:\n> Am 09.12.19 um 18:44 schrieb Derrick Stolee:\n>> On 12/9/2019 12:19 PM, Eric Sunshine wrote:\n>>> On Mon, Dec 9, 2019 at 12:11 PM René Scharfe <l.s.r@web.de> wrote:\n>>>> Am 09.12.19 um 16:36 schrieb Derrick Stolee:\n>>>>> René Scharfe  0bb313a5 xdiff: unignore changes in function context\n>>>>> xdiff/xemit.c\n>>>>> 0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n>>>>> 0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n>>>>> 0bb313a5 225) xchp = xchp->next;\n>>>>\n>>>> Hmm, line 223 *is* exercised by t4015.85.\n>>>\n>>> This, along with Dscho's[1] review of an earlier coverage report,\n>>> makes one wonder if there is some off-by-one error in the reporting\n>>> logic, such that it is reporting the wrong lines as not covered.\n>>\n>> This is definitely possible. I'll see if I can locate the bug in\n>> my report-generation code.\n>>\n>> However, line 222 is here [1]\n>>\n>> \twhile (xchp != xch &&\n>>\n>> So if this is always false, then the rest of the while condition\n>> will not be tested, nor will the body (line 225: xchp = xchp->next;).\n> \n> 0bb313a5 also added lines 228 and 229, which are not in the report, so\n> xchp != xch must be true at least once (it is, in t4015.85).\n> \n> 222)\t\t\t\twhile (xchp != xch &&\n> 223)\t\t\t\t       xchp->i1 + xchp->chg1 <= s1 &&\n> 224)\t\t\t\t       xchp->i2 + xchp->chg2 <= s2)\n> 225)\t\t\t\t\txchp = xchp->next;\n> 226)\n> 227)\t\t\t\t/* If so, show it after all. */\n> 228)\t\t\t\tif (xchp != xch) {\n> 229)\t\t\t\t\txch = xchp;\n\nThanks for pointing out that context.\n\nMy guess is that gcov is marking the line as uncovered because the &&\noperator is on that line. I'm testing [1] by breaking style conventions\nand using the following:\n\n\t\t\t\twhile (xchp != xch\n\t\t\t\t       && xchp->i1 + xchp->chg1 <= s1\n\t\t\t\t       && xchp->i2 + xchp->chg2 <= s2)\n\t\t\t\t\txchp = xchp->next;\n\n[1] https://dev.azure.com/git/git/_build/results?buildId=1453\n"},{"id":"387829","messageId":"944d66f0-7745-b70f-bec8-1d3610e7b8d0@gmail.com","threadId":"52416","inReplyTo":"676dc5c1-5823-ac83-878b-995f3793bfb8@gmail.com","subject":"Re: Git Test Coverage Report (Mon. Dec 9)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-12-09T20:17:12Z","receivedAt":"2019-12-09T20:17:18Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 12/9/2019 1:23 PM, Derrick Stolee wrote:\n> On 12/9/2019 1:10 PM, René Scharfe wrote:\n>> Am 09.12.19 um 18:44 schrieb Derrick Stolee:\n>>> On 12/9/2019 12:19 PM, Eric Sunshine wrote:\n>>>> On Mon, Dec 9, 2019 at 12:11 PM René Scharfe <l.s.r@web.de> wrote:\n>>>>> Am 09.12.19 um 16:36 schrieb Derrick Stolee:\n>>>>>> René Scharfe  0bb313a5 xdiff: unignore changes in function context\n>>>>>> xdiff/xemit.c\n>>>>>> 0bb313a5 223)        xchp->i1 + xchp->chg1 <= s1 &&\n>>>>>> 0bb313a5 224)        xchp->i2 + xchp->chg2 <= s2)\n>>>>>> 0bb313a5 225) xchp = xchp->next;\n>>>>>\n>>>>> Hmm, line 223 *is* exercised by t4015.85.\n>>>>\n>>>> This, along with Dscho's[1] review of an earlier coverage report,\n>>>> makes one wonder if there is some off-by-one error in the reporting\n>>>> logic, such that it is reporting the wrong lines as not covered.\n>>>\n>>> This is definitely possible. I'll see if I can locate the bug in\n>>> my report-generation code.\n>>>\n>>> However, line 222 is here [1]\n>>>\n>>> \twhile (xchp != xch &&\n>>>\n>>> So if this is always false, then the rest of the while condition\n>>> will not be tested, nor will the body (line 225: xchp = xchp->next;).\n>>\n>> 0bb313a5 also added lines 228 and 229, which are not in the report, so\n>> xchp != xch must be true at least once (it is, in t4015.85).\n>>\n>> 222)\t\t\t\twhile (xchp != xch &&\n>> 223)\t\t\t\t       xchp->i1 + xchp->chg1 <= s1 &&\n>> 224)\t\t\t\t       xchp->i2 + xchp->chg2 <= s2)\n>> 225)\t\t\t\t\txchp = xchp->next;\n>> 226)\n>> 227)\t\t\t\t/* If so, show it after all. */\n>> 228)\t\t\t\tif (xchp != xch) {\n>> 229)\t\t\t\t\txch = xchp;\n> \n> Thanks for pointing out that context.\n> \n> My guess is that gcov is marking the line as uncovered because the &&\n> operator is on that line. I'm testing [1] by breaking style conventions\n> and using the following:\n> \n> \t\t\t\twhile (xchp != xch\n> \t\t\t\t       && xchp->i1 + xchp->chg1 <= s1\n> \t\t\t\t       && xchp->i2 + xchp->chg2 <= s2)\n> \t\t\t\t\txchp = xchp->next;\n> \n> [1] https://dev.azure.com/git/git/_build/results?buildId=1453\n\nConfirmed:\n\ntarget\tfork/test-gcov\nbase\te0522318ac56aeb88f14e72ba2db25912e9972de\n\n\nUncovered code in 'target' not in 'base'\n--------------------------------------------------------\n\nxdiff/xemit.c\nddd5ad00 224)        && xchp->i2 + xchp->chg2 <= s2)\n\nCommits introducing uncovered code:\nDerrick Stolee\tddd5ad00 TEST: switch position of &&\n\n\nFor future reference: having the \"&&\" at the end of the\nline will mark the line as uncovered if the right-hand\nside of the && is uncovered. The same holds for other\nshort-circuit operators.\n\nThanks,\n-Stolee\n"}]}