mailman: check for cover letter#142
Merged
Merged
Conversation
charliemirabile
requested changes
Jul 29, 2024
charliemirabile
left a comment
Contributor
There was a problem hiding this comment.
Minor style tweaks to make the code match the rest of the file, but I tested it and it works
849df51 to
810ad9d
Compare
The first patch recieved should be a cover letter. We can check this by trying to apply it once without the --empty=keep option, and trying to apply it again with the --empty=keep option. We know the patch is empty if the first apply (WITHOUT empty=keep) fails, but the second apply (WITH empty=keep) works. If the first check fails we know that what should be the cover letter isn't empty and actually makes changes. If the second check fails, that means this is probably a patch that is meant to have changes, but this patch is messed up in some way.
810ad9d to
d2e6762
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #134
I chose to include the cover letter at the beginning of the git log as including it at the end would involve two different scenarios where we'd have to check for a missing cover letter: if the patches fail for some reason or if the patches all apply successfully. The patches could fail if what we call
cover_letterisn't actually a cover letter, so we can avoid that scenario altogether by checking at the beginning.