Receiving Git Attribution for Your Drupal.org Patches
If you contribute patches to the Drupal issue queues, you often spend a lot of time and hard work getting that patch through the review process. Even though we do it for the good of the community, once it is all said and done, it's nice to get a little acknowledgement. While there is a page for module maintainers on how to properly attribute contributions to users, not all maintainers know about that, and it can often mean they have to spend a little extra time figuring out what your Drupal.org git email address is. But there is a quick way for us as patch contributors to make that easier for them.
Once you clone a contrib module repo, you should set the user.name and user.email for that repo and then use
git format-patch when creating your patch.
git config --local user.name jojonaloha git config --local user.email email@example.com
If you want to use these by default you can use the --global flag instead.
See http://drupal.org/project/drush_iq. This handy module makes it easy to create and apply patches. It will automatically use git format-patch when creating patches, and for maintainers, drush iq-apply-patch will automatically provide commit credit to the patch submitter, even if format-patch was not used to create the patch. Give it a try.
Thu, 04/04/2013 - 13:21
It's probably also worth mentioning that Dreditor creates a "Create commit message" feature in the issue queue to craft an appropriately attributed Git commit.
Thu, 04/04/2013 - 18:32
some maintainers have been kind to attribute my patches to me (both of them?) - these instructions make that easier, thanks Jonathan!
Mon, 04/15/2013 - 16:09
Just a heads up that it can be helpful to mention in the queue when you've used the
format-patch command instead of standard diff.
I started using
format-patch soon after the switch to git and people didn't realize that it separates your work into discrete commits within the file. While this separation is cool (and allows original authors of re-rolled patches to retain their credit too!), if someone wants to visually review the patch, they may consider it incomplete unless you instruct them to actually apply it then look at the full diff.
Mon, 04/15/2013 - 20:26
While format-patch output with multiple patches is sometimes used in the issue queue, it is more common for folks to go with the easier-to-read single-patch attachments. You can still create this kind of patch, with all changes rolled into a single diff, with git format-patch; however, doing so requires that you create a new branch first, and then use git merge --squash to merge and combine the commits together. If you use drush iq-diff, it will automatically squash your commit before creating it with format-patch, so you will get an easy-to-read patch file that also contains commit credit. Even better, if you use the new drush iq-submit command, it will also create an interdiff for you.
For a description of the Drush IQ workflow, see: http://drupalcode.org/project/drush_iq.git/blob_plain/refs/heads/7.x-1…
Tue, 02/18/2014 - 18:07
Good info on how to make it work... but finding notes on how to properly use git format-patch is proving crappy!
Tue, 02/18/2014 - 18:38
So I found the documentation out there for how to properly use git format patch rather spares, and not particularly applicable to our situation. Using your article, and another article (http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/) I was able to figure out the proper way to generate everything. I wrote a blog post on it.
Wed, 04/03/2013 - 21:17