Scenario: There is an issue with a patch. Perhaps the patch edits a module's composer.json for Drupal 9 compatibility such that the recommended way to use the patch is as an issue fork.

What is the best way (most polite, easiest, most technically sound) way to make a GitLab issue fork with the latest patch included? Or maybe more specifically i'm wondering:

  1. There's no automated "Create issue fork from patch" button somewhere that i'm missing?
  2. Applying the latest patch to an issue fork should be announced as identical to the latest patch in the issue? Or is it evident enough?
  3. Are there plans or an effort to automate patch-to-fork (forks can already be used as patches)?


1 Answer 1


The user interface for an issue branch doesn't show, to users who can push code in it, a button to automatically apply a patch to the issue branch.

Supposing the issue branch doesn't exist, you can create it and apply the branch following these steps.

  • Create the issue branch by clicking on the Create issue fork button that appears on the issue after the issue summary
  • Follow the instructions given on Creating issue forks and merge requests » Cloning and committing code to an issue fork to set up the local repository for the issue branch
  • Use curl [patch-link] | git apply - or wget -q -O - [patch-link] | git apply - to apply the patch to the issue branch local repository
  • Push the changes in the issue branch

[patch-link], for patches attached to issues on drupal.org is, for example, https://www.drupal.org/files/issues/2021-08-28/2557319-17.patch, not https://www.drupal.org/files/2557319-17.patch as Applying a patch in a feature branch seems to imply.

Posting a comment that explains you created the issue branch and applied the patch is fine. Users could find out the issue branch includes the patch, or assume you did that; commenting about what you did isn't wrong.

Looking at the issues for the project containing the drupal.org custom code, the ones for Gitlab integration, I don't see any issue for adding a button to apply a patch directly from the issue branch user interface, probably because it requires changing the Gitlab code, or it's not considered a necessary feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.