In the old days, before my time, rather than Discourse, there was a
mailing list called nix-dev. Sometimes people sent patches to the
mailing list.
When we moved to Discourse, the Patches category was created to
facilitate email patch submission. Recently, I’ve seen a number of
patches submitted this way, and that’s led me to the conclusion that the
way things currently are in this area isn’t fair to potential
contributors.
The way patches are generally sent over email is using git send-email.
This creates a message where the Subject is the first line of the commit
message, and then the rest of the commit message and the diff comprise
the message body. Reviewers can then reply, and use the quoted original
message inserted by their mail client to provide inline patch review.
Then, once the patch is ready to be merged, a committer can use git am
to apply to patch and push it.
This works very well with normal email, or over a mailing list, but
Discourse breaks it. When it receives a patch email, it will try to
interpret it as Markdown (or something), and this leads to the patch
being mangled to the point where it will likely be unreadable, and
almost certainly no longer apply. The alternative is to create a patch
file with git format-patch and attach it to an email, where it will be
turned into a Discourse attachment. Discourse won’t include the
attachment in notification emails it sends out, though, so to actually
review the patch, you have to go to Discourse in a web browser, download
the attachment, open it in a text editor, and copy the contents back
into Discourse or your mail client. Discourse will still try to
interpret the quoted code in your reply as Markdown, making it very
difficult to follow what the conversation actually is.
The huge headaches caused by Discourse here mean that patches submitted
this way are rarely reviewed, and almost never end up actually being
applied to Nixpkgs. I don’t think that this is because people aren’t
interested in reviewing them – I’ve seen other people try, and I’d be
extremely willing to, if Discourse didn’t make it so extremely
difficult. The fact that despite this, we get patches submitted this
way anyway proves that there is definitely demand from contributors for
this. But I don’t think it’s fair to potential contributors to have an
officially-sanctioned contribution mechanism that will almost never
result in their work being acknoweledged and reviewed.
So, I think we have two options here:
- Insist that potential contributions only come through GitHub.
- Have a mailing list (only) for patch submission.
I would be strongly opposed to 1., for several reasons. People clearly
want to be able to send patches over email, as the use of the category
shows. I don’t think people should have to sign a EULA to be able to
contribute to Nixpkgs. And, it’s much easier to explain the patch
workflow to a newbie than GitHub pull requests. It’s “clone, change,
stage, commit, git send-email (type in your smtp credentials)” compared
to “clone, change, create and check out branch, stage, commit, fork, add
remote, push, create pull request”, including several context switches
between terminal and browser.
I’d like to here @zimbatm’s thoughts especially, as the person I think
was largely behind the move to Discourse, and who wrote the description
we have for the Patches category1. Overall, the move to Discourse has
been fantastic for our community, but I think it would be a shame if
this had to fall by the wayside because of it – I don’t think there’s
any reason we can’t have Discourse for community discussions, and
working patch submission over email.