Skip to content
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

Support empty patches #45

Closed
neurosnap opened this issue Jul 14, 2024 · 4 comments · Fixed by #46
Closed

Support empty patches #45

neurosnap opened this issue Jul 14, 2024 · 4 comments · Fixed by #46

Comments

@neurosnap
Copy link

neurosnap commented Jul 14, 2024

Hi!

We are using this lib over at https://pr.pico.sh and so far haven't had any issues. So thank you for your hard work!

We are trying to support cover letters in our patch request workflow, but it looks like since the patch itself is empty, go-gitdiff skips over it and returns empty header data. Ideally this lib would still process the empty patch even if there aren't any diffs in it.

I'm curious what you think about adding support for empty patches?

@bluekeyes
Copy link
Owner

This sounds like something that would be reasonable to support, but I'm a little unclear on exactly what an empty patch looks like in this case. Do you have an example patch I could look at to test the current behavior and verify any changes?

@neurosnap
Copy link
Author

neurosnap commented Jul 14, 2024

https://github.com/picosh/git-pr/blob/main/fixtures/with-cover.patch

That was generated by git format-patch --stdout

@bluekeyes
Copy link
Owner

This should be fixed in the latest commit. Please try it out and if it works the way you expected, I'll tag a new release.

@neurosnap
Copy link
Author

This worked for me, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants