Last updated May 9, 2013.
Git helps us to give better attribution for code contributors.
How it happens
A commit has two roles involved: author and committer.
The author is the one who makes the changes, and the committer is the one who adds those changes to the repository. Naturally, each of them can be separate identities.
How to give authorship attribution from a patch
The way to give the author attribution depends on how the patch was created.
The patch is git aware
The author has created the patch with
git format-patch, a command that includes git metadata in the patch. You must make sure you have configured your git global or project email address to match one of the ones in your Drupal profile OR the anonymous style "UserName@353190.no-reply.drupal.org" address seen on your profile page.
git format-patch it is a good idea to use Dreditor to create the commit message as it allows the format many maintainers prefer and it will give them more incentive to apply these types of patches directly.
When posting your patch make sure to specify that you created an advanced patch with
git format-patch and that the patch should be applied with
git am <patch-name> to apply your patch.
The patch is a common patch
In this case, the author has used another method like the
diff command, or the patch has been applied with
git apply, so there is no git metadata.
In this case, the author's drupal.org user name can be used for attribution.
- Apply the patch with your common method
- Stage changes to be committed
- Commit, using the author option with an anonymous email address of the form “[username]@[uid].no-reply.drupal.org”, for example
git commit --author="scor <firstname.lastname@example.org>"
The exact option to use can be seen in the author's user profile or you can use Dreditor to create the commit message exactly according to Drupal standards and specify one --author to the commit (highly recommended).
For more details on using
git commit, check the related page Maintaining a Drupal.org project.