July 15th, 2024

Pull Requests via Git Push

Steinar H. Gunderson introduced a new method on git.sesse.net, enabling pull requests via git push through email. This simplifies patch submissions, despite limitations like no multipush support and potential errors. Security measures are highlighted.

Read original articleLink Icon
Pull Requests via Git Push

Steinar H. Gunderson shared a new approach on July 15, 2024, regarding pull requests via git push on git.sesse.net. By allowing git push to create pull requests via email, contributors can now submit patches more easily without relying on custom SSH-facing code. The process involves setting up a pre-receive hook to handle incoming pushes, which triggers an email with the patch for review. This method simplifies the contribution process, although it has limitations like no support for multipush and potential errors when pushing to non-existing branches. Despite drawbacks such as limited spam control and fixed committer email, this system enables seamless patch submission for review and potential inclusion. Steinar H. Gunderson emphasizes the security measures in place to address any potential vulnerabilities.

Link Icon 3 comments
By @qhwudbebd - 7 months
Nice! A couple of thoughts re. your "It's not perfect" which wouldn't add real extra complexity:

Using --from with git-format-patch will add the From: header to the commit message body in the standard way when emailing a patch written by someone else, which would allow you to preserve this easily without risking excitement from injection attacks into email headers.

Maybe the right behaviour for all-zero $oldsha is to quietly turn format-patch $oldsha..$newsha into format-patch --root $newsha?

By @codetrotter - 7 months

    echo 'The push will now exit with an error. No commits have actually been pushed.'
Is this part so that the temporary git objects are cleaned up? Or is there some other reason that it has to exit with error?