Re: Git Test Coverage Report (October 11)

2019-10-23 Thread Derrick Stolee
On 10/23/2019 1:00 PM, Torsten Bögershausen wrote:
> On Fri, Oct 11, 2019 at 09:33:11AM -0400, Derrick Stolee wrote:
>> Here is today's test coverage report. The usual report format is
>> available online [1], [2]. The report listed below is a new format
>> that groups lines by the commit that introduced them [3]. Thanks
>> Peff for the feedback on that idea.
>>
> 
> []
>>
>> Torsten Bögershausen ebb8d2c9 mingw: support UNC in git clone 
>> file://server/share/repo
>> connect.c
>> ebb8d2c9 921) path = host - 2; /* include the leading "//" */
>>
> 
> I actually looked into this one, and my understanding is that the code path
> makes only sense for windows and is only tested on Windows in t5500.
> (Linux/Unix/POSIX don't use UNC path names starting with "//" )
> 
> How can we avoid those "not covered by test" warnings?
> 
> One solution could be to use
> 
> #ifndef has_dos_drive_prefix
> #define has_dos_drive_prefix(a) 0
> #endif
> 
> in git-compat-util.h and hope that the compiler is smart enough
> to optimize away that line of code.
> 
> Another way could be to have #ifdefs in connect.c, so that it
> is clear "this is Windows only".
> 
> Or make a comment for the "cover report" saying "not covered".
> 
> Are there any good or better thoughts on this ?

One way to avoid this is to add ignored lines to the test-coverage
repo [1]. These only work if the exact contents match on a specific
line number, but can be a way to stop noise in the short-term.

For example, I added a few lines to ignore in commit-graph.c [2],
but I haven't added ignored lines in a while.

I'm happy to take a PR including the lines you want to ignore, or
I could take inventory of the lines in the current report before regenerating
a test for -rc1.

Thanks,
-Stolee

[1] https://github.com/derrickstolee/git-test-coverage

[2] 
https://github.com/derrickstolee/git-test-coverage/blob/master/ignored/commit-graph.c


Re: Git Test Coverage Report (October 11)

2019-10-23 Thread Torsten Bögershausen
On Fri, Oct 11, 2019 at 09:33:11AM -0400, Derrick Stolee wrote:
> Here is today's test coverage report. The usual report format is
> available online [1], [2]. The report listed below is a new format
> that groups lines by the commit that introduced them [3]. Thanks
> Peff for the feedback on that idea.
>

[]
>
> Torsten Bögershausen  ebb8d2c9 mingw: support UNC in git clone 
> file://server/share/repo
> connect.c
> ebb8d2c9 921) path = host - 2; /* include the leading "//" */
>

I actually looked into this one, and my understanding is that the code path
makes only sense for windows and is only tested on Windows in t5500.
(Linux/Unix/POSIX don't use UNC path names starting with "//" )

How can we avoid those "not covered by test" warnings?

One solution could be to use

#ifndef has_dos_drive_prefix
#define has_dos_drive_prefix(a) 0
#endif

in git-compat-util.h and hope that the compiler is smart enough
to optimize away that line of code.

Another way could be to have #ifdefs in connect.c, so that it
is clear "this is Windows only".

Or make a comment for the "cover report" saying "not covered".

Are there any good or better thoughts on this ?






Re: Git Test Coverage Report (October 11)

2019-10-16 Thread Jeff King
On Fri, Oct 11, 2019 at 09:33:11AM -0400, Derrick Stolee wrote:

> Here is today's test coverage report. The usual report format is
> available online [1], [2]. The report listed below is a new format
> that groups lines by the commit that introduced them [3]. Thanks
> Peff for the feedback on that idea.

Thanks. FWIW, I did find this one easier to scan through looking for my
own bits.

-Peff


Git Test Coverage Report (October 11)

2019-10-11 Thread Derrick Stolee
Here is today's test coverage report. The usual report format is
available online [1], [2]. The report listed below is a new format
that groups lines by the commit that introduced them [3]. Thanks
Peff for the feedback on that idea.

Note: the pu branch does not build due to interactions between
ds/sparse-cone and ew/hashmap, so no coverage is reported.

-Stolee

[1] https://derrickstolee.github.io/git-test-coverage/reports/2019-10-11.htm
[2] https://derrickstolee.github.io/git-test-coverage/reports/2019-10-11.txt
[3] 
https://derrickstolee.github.io/git-test-coverage/reports/2019-10-11-commits.txt


pu  ef2d425e4a47a663fe2d4a09888b231d2e3b973e
jch d1237310799dc8d0e6bb8d079c2803e120cac8cc
nextb869b98d4c7f0f91d905d76a6c8ba9b8799289b6
master  08da6496b61341ec45eac36afcc8f94242763468
master@{1}  4c86140027f4a0d2caaa3ab4bd8bfc5ce3c11c8a


Uncovered code in 'pu' not in 'jch'


Commits introducting uncovered code:


Uncovered code in 'jch' not in 'next'


Commits introducting uncovered code:
William Baker   070a4226 fsmonitor: don't fill bitmap with entries to be removed
fsmonitor.c
070a4226 20) BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" 
>= %u)",
070a4226 59) BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" > 
%u)",
070a4226 87) BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" > 
%u)",
070a4226 256) BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" 
> %u)",



Uncovered code in 'next' not in 'master'


Commits introducting uncovered code:
Elijah Newren   65c01c64 checkout: provide better conflict hunk description 
with detached HEAD
builtin/checkout.c
65c01c64 766) strbuf_add_unique_abbrev(&old_commit_shortname,
65c01c64 767)  &old_branch_info->commit->object.oid,
65c01c64 769) o.ancestor = old_commit_shortname.buf;

Elijah Newren   ff1bfa2c merge-recursive: use common name for 
ancestors/common/base_list
merge-recursive.c
ff1bfa2c 3757)oid_to_hex(merge_bases[i]));

Elijah Newren   f836bf39 merge-recursive: future-proof update_file_flags() 
against memory leaks
merge-recursive.c
f836bf39 960) ret = err(opt, _("cannot read object %s '%s'"),
f836bf39 962) goto free_buf;

Elijah Newren   3164e6bd fast-import: fix handling of deleted tags
fast-import.c
3164e6bd 2835) first_tag = t->next_tag;

Elijah Newren   b8f50e5b fast-import: add support for new 'alias' command
fast-import.c
b8f50e5b 2528) die("Invalid ref name or SHA1 expression: %s", objectish);
b8f50e5b 2554) return 0;
b8f50e5b 3118) die(_("Expected 'mark' command, got %s"), command_buf.buf);
b8f50e5b 3123) die(_("Expected 'to' command, got %s"), command_buf.buf);

Elijah Newren   724dd767 cache-tree: share code between functions writing an 
index as a tree
cache-tree.c
724dd767 619) cache_tree_free(&index_state->cache_tree);
724dd767 620) cache_tree_valid = 0;
724dd767 633) return WRITE_TREE_PREFIX_ERROR;
724dd767 653) fprintf(stderr, "BUG: There are unmerged index entries:\n");
724dd767 654) for (i = 0; i < index_state->cache_nr; i++) {
724dd767 655) const struct cache_entry *ce = index_state->cache[i];
724dd767 656) if (ce_stage(ce))
724dd767 657) fprintf(stderr, "BUG: %d %.*s\n", ce_stage(ce),
724dd767 658) (int)ce_namelen(ce), ce->name);
724dd767 660) BUG("unmerged index entries when writing inmemory index");

Elijah Newren   98a1d3d8 merge-recursive: exit early if index != head
merge-recursive.c
98a1d3d8 3692) return -1;

Elijah Newren   9822175d Ensure index matches head before invoking merge 
machinery, round N
builtin/merge-recursive.c
9822175d 68) die_resolve_conflict("merge");

Elijah Newren   208d6924 fast-export: add support for --import-marks-if-exists
builtin/fast-export.c
208d6924 1220) die(_("Cannot pass both --import-marks and 
--import-marks-if-exists"));

Elijah Newren   941790d7 fast-export: handle nested tags
builtin/fast-export.c
941790d7 852) die(_("Error: Cannot export nested tags unless --mark-tags is 
specified."));
941790d7 864) tagged_mark = get_object_mark(tagged);

Eric Wong   28ee7941 hashmap_remove takes "const struct hashmap_entry *"
name-hash.c
28ee7941 100) hashmap_remove(&istate->dir_hash, &dir->ent, NULL);

Eric Wong   d22245a2 hashmap_entry_init takes "struct hashmap_entry *"
t/helper/test-hashmap.c
d22245a2 109) hashmap_entry_init(&entries[i]->ent, hashes[i]);
d22245a2 122) hashmap_entry_init(&entries[i]->ent, hashes[i]);

Eric Wong   b94e5c1d hashmap_add takes "struct hashmap_entry *"
t/helper/test-hashmap.c
b94e5c1d 110) hashmap_add(&map, &entries[i]->ent);
b94e5c1d 123) hashmap_add(&map, &entries[i]->ent);

Eric Wong   c8e424c9 hashmap: introduce hashmap_free_entries
t/helper/test-hashmap.c
c8e424c9 113) hashmap_free(&map);
c8e424c9 133) hashmap_free(&map);

Eric Wong   87571c3f hashmap: use *_entry APIs for iteration
t/helper/test-lazy-init-na