fix: bugs in detecting empty git diffs and end of patch meta block #599
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves a few bugs in the
plugins/git
diff parser that I encountered while trying to runplugins/entropy
onnumpy@no version
.Our format specifier for
get_commits()
caused GPG key info to be printed and parsed, but locally I was getting an error in the GPG processing C code ingit
. Other team member got a different error, with git seemingly trying to do validation against GPG signatures in the git history when GPG was not set up on his machine.Some diffs that just delete a file do not have the 1-2 lines prefixed with
+++
or---
between the patch metadata and patch chunks. We were naively usingopt(line)
to capture these, which would eat up the start of anotherdiff
in some cases. Now we check for those lines explicitly.Some other commits (such as those just used to force the CI to re-run) have zero output in our customized
git log
invocation used for parsing diffs. Without any changes, we have no way to detect these commits, and our # parsed diffs != # num parsed commits. My solution was to add~~~
to this argument"--pretty=tformat:
, causing each diff to have a header of~~~
printed whether or not there is anything else to print for that diff. This way, we can at least count empty diffs. Now we successfully parse all commit diffs for a large repo likenumpy
which has 28,000+ commits