-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitdiff should strip a/ b/ prefixes from --- +++ lines #317
Comments
Yes. I believe is should. |
Ah - I noticed a bug in Can you confirm that .../project/sourcefile.py is unmodified in your sandbox (diff for that file should be empty). |
"LCOV version 2.0-1" according to lcov --version. I see that this is outdated and I will update to at least 2.1 before filing any more bug reports.
Hm, no, and in particular --- /usr/share/lcov/support-scripts/gitdiff 2024-09-04 09:43:26.000000000 -0400
+++ gitdiff.HEAD 2024-09-05 10:52:05.899340859 -0400
...
@@ -85,7 +92,12 @@
s/\r//g;
my $line = $_;
- if ($line =~ /diff --git a\/(\S+) b\/(\S+)/) {
+ if ($line =~ /(^diff|\+\+\+|---) /) {
+ # remove the a/b leader from the
+ $line =~ s# [ab]/# $prefix#g;
+ }
+
+ if ($line =~ /^diff --git (\S+) (\S+)/) { And the newer gitdiff does indeed remove the a/ b/ prefixes from the --- and +++ lines.
No, the genhtml error happens on the first file that is modified. Both versions of gitdiff produce output like this for unmodified files:
but genhtml doesn't seem to care about the a/ b/ prefixes on the "diff --git" lines. |
For curiousity: I just noticed that the source file in question appears to be python...but I think I added the py2lcov translator to lcov after the 2.0 release. |
coverage.py can generate LCOV-format reports since version 6.3, but it's got some bugs (e.g. nedbat/coveragepy#1846) and it doesn't emit function coverage records. If you like, I can give py2lcov a try and see if it does a better job on my project. |
Sure...give it a try - perhaps, after your other issues are resolved.
|
I'm going to close this one because I think it was addressed (due to out-of-date version). |
I am getting errors like
The error goes away if I run the diff file through
sed 's@^\([-+]* \)[ab]/@\1@'
. However, I generated the diff using gitdiff - shouldn't it handle this for me?The text was updated successfully, but these errors were encountered: