Skip to content

Commit 202e607

Browse files
[DeveloperPolicy] Update information on commit authorship (llvm#191220)
The sections on commit authorship have not been updated since the transition to Github for PRs. This patch attempts to update them. This is aimed at addressing questions recently raised in https://discourse.llvm.org/t/attributing-a-commit-to-a-different-author/90490. I guess this is technically a policy change, but does not change anything *de facto* as far as I can tell. --------- Co-authored-by: Petr Hosek <phosek@google.com>
1 parent 0ec2f03 commit 202e607

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

llvm/docs/DeveloperPolicy.rst

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -365,17 +365,13 @@ Below are some guidelines about the format of the message itself:
365365

366366
* Separate the commit message into title and body separated by a blank line.
367367

368-
* If you're not the original author, ensure the 'Author' property of the commit is
369-
set to the original author and the 'Committer' property is set to yourself.
370-
You can use a command similar to
371-
``git commit --amend --author="John Doe <jdoe@llvm.org>"`` to correct the
372-
author property if it is incorrect. See `Attribution of Changes`_ for more
373-
information including the method we used for attribution before the project
374-
migrated to git.
375-
376-
In the rare situation where there are multiple authors, please use the `git
368+
* In the situation where there are multiple authors, or in the rare situation
369+
you are submitting a change for someone else (e.g., after putting an old
370+
patch from someone else through review yourself), please use the `git
377371
tag 'Co-authored-by:' to list the additional authors
378372
<https://github.blog/2018-01-29-commit-together-with-co-authors/>`_.
373+
See `Attribution of Changes`_ for more information including the method we
374+
used for attribution before the project migrated to git.
379375

380376
* The title should be concise. Because all commits are emailed to the list with
381377
the first line as the subject, long titles are frowned upon. Short titles
@@ -718,23 +714,23 @@ Attribution of Changes
718714
----------------------
719715

720716
When contributors submit a patch to an LLVM project, other developers with
721-
commit access may commit it for the author once appropriate (based on the
722-
progression of code review, etc.). When doing so, it is important to retain
723-
correct attribution of contributions to their contributors. However, we do not
724-
want the source code to be littered with random attributions "this code written
725-
by J. Random Hacker" (this is noisy and distracting). In practice, the revision
726-
control system keeps a perfect history of who changed what, and the CREDITS.txt
727-
file describes higher-level contributions. If you commit a patch for someone
728-
else, please follow the attribution of changes in the simple manner as outlined
729-
by the `commit messages`_ section. Overall, please do not add contributor names
730-
to the source code.
717+
commit access may merge the PR for the author (based on the
718+
progression of code review, etc.). GitHub will automatically ensure that
719+
authorship is preserved, and one does not need to take any further action. We
720+
do not want the source code to be littered with random attributions "this code
721+
written by J. Random Hacker" (this is noisy and distracting). In practice, the
722+
revision control system keeps a perfect history of who changed what, and the
723+
CREDITS.txt file describes higher-level contributions. If you need to adjust
724+
authorship for any reason, please follow the attribution of changes in the
725+
simple manner as outlined by the `commit messages`_ section. Overall, please do
726+
not add contributor names to the source code.
731727

732728
Also, don't commit patches authored by others unless they have submitted the
733729
patch to the project or you have been authorized to submit them on their behalf
734730
(you work together and your company authorized you to contribute the patches,
735-
etc.). The author should first submit them to the relevant project's commit
736-
list, development list, or LLVM bug tracker component. If someone sends you
737-
a patch privately, encourage them to submit it to the appropriate list first.
731+
etc.). The author should first submit them as a GitHub issue, to the relevant
732+
category on Discourse, or ideally as a GitHub Pull Request. If someone sends you
733+
a patch privately, encourage them to submit it as a GitHub PR first.
738734

739735
Our previous version control system (subversion) did not distinguish between the
740736
author and the committer like git does. As such, older commits used a different

0 commit comments

Comments
 (0)