How to use git format-patch with Drupal
So I was just working to submit a patch on a module that I fixed up a bug on, and one thing that’s important to know is the version control information Drupal provides for patching DOES NOT have any of your author information. So, the module maintainer can implement your code… and you potentially never get any credit where credit is due if they don't take the extra steps to attribute you for your work. Mind you this doesn’t presume evil intention, it just typically goes this way.
How to avoid that:
- Set your local variables for your repo of the code being worked on (IE: Module)
git config --local user.name usernamehere
git config --local user.email yourdrupalmail
- Checkout your own branch and commit your change. (Miles, your advice was very close!)
- Do not push, do not merge with 7.x-2.x… just create a branch, and do a commit to your new branch.
- Do not push, do not merge with 7.x-2.x… just create a branch, and do a commit to your new branch.
- Run the following (modify issue info as needed):
git format-patch 7.x-2.x --stdout >[description]-[issue-number]-[comment-number].patch
There you go! Submit that patch to the issue queue, and you will receive credit where credit is due for sure… unless they do something that is explicitly stealing!