git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

Loading a diff from a patch sent via mail

Open HerrMuellerluedenscheid opened this issue 3 years ago • 1 comments

Hey,

I would like to load a patch that was sent via email. I saw that formatting an email is implemented but parsing an email is not, is it? Can I simply use the from_buffer method to load the actual patch into a diff?

Best regards and thanks in advance!!

HerrMuellerluedenscheid avatar Sep 02 '22 21:09 HerrMuellerluedenscheid

I didn't know that I can just load the mbox formatted patch the same way as a non-mbox formatted patch. Lesson learned.

So what I'm trying to access is the header information to answer e.g. if the patch was signed off or not. Is there a way to access this already using git2-rs or libgit2? I didn't find a go-to solution in either of those. I would I have to use regex to parse the header?

Cheers

HerrMuellerluedenscheid avatar Sep 03 '22 00:09 HerrMuellerluedenscheid