Jump to: navigation, search

Difference between revisions of "Development Resources/Contributing via Git"

Line 100: Line 100:
  
 
The "Signed-off-by" entry must be in the ''footer'' of the commit message. This is the last block of text in the commit message; it cannot contain blank lines. See {{Bug|412140}}.
 
The "Signed-off-by" entry must be in the ''footer'' of the commit message. This is the last block of text in the commit message; it cannot contain blank lines. See {{Bug|412140}}.
 +
 +
For example, pushing the following commit to Gerrit will fail because the "Signed-off-by" entry is not considered part of the footter (it is separated from the footer by a blank line):
 +
 +
<pre>commit 862e6ff22ad56c10df6de3385ffa4c7d02363d1d
 +
Author: Joe Somebody <somebody@someplace.net>
 +
Date:  Mon Jun 17 17:19:38 2013 -0700
 +
 +
    [410937] Auto share multiple projects in single job
 +
   
 +
    When multiple projects are imported together, perform all the necessary
 +
    auto shares in a single job rather than spawning a separate job for each
 +
    project.
 +
   
 +
    Signed-off-by: Joe Somebody <somebody@someplace.net>
 +
 +
    Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=410937
 +
    Also-by: Some Otherperson <otherperson@someplace.net></pre>
  
 
<hr/>
 
<hr/>

Revision as of 15:30, 3 July 2013

This page is for individuals who want to make a contribution to an Eclipse project via Git or Gerrit.

There's more information for committers on the Handling Git Contributions page.

Communication

If you want to contribute to an Eclipse project, you should first communicate with that project. Communication takes many forms, but generally occurs on a project's "dev" list, or via Bugzilla.

You can find the appropriate entry points on the project's page on the forge:

Eclipse Foundation Contributor License Agreement

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

To create a CLA:

  • Create an account with the Eclipse Foundation if you have not already done so;
    An Eclipse Account will grant you access to Gerrit, Bugzilla, and other Eclipse Foundation web resources.
    Use the same account to contribute to Eclipse, LocationTech, and PolarSys projects.
  • Sign a CLA.

Be sure to use the same email address when you register for the account that you intend to use on Git commit records.

The Commit Record

If a project supports Gerrit, you can push directly to that project's repository. Alternatively, if you have a public Git repository, a project committer can pull your contribution.

Minimally, your Git commit record must have the following:

  • Your credentials (email address) captured in the "Author" field;
  • A single line summary in the message field, followed by a more detailed descriptive paragraph; and
  • A "Signed-off-by" entry with matching credentials in the message footer.

If applicable, a link to the Bug that is addressed by the commit should be included in the message footer. The id (bug number) of the bug should also be included in the message summary (in square braces).

You can specify additional authors using one or more "Also-by" entries in the message footer.

For example:

commit 862e6ff22ad56c10df6de3385ffa4c7d02363d1d
Author: Joe Somebody <somebody@someplace.net>
Date:   Mon Jun 17 17:19:38 2013 -0700

    [410937] Auto share multiple projects in single job
    
    When multiple projects are imported together, perform all the necessary
    auto shares in a single job rather than spawning a separate job for each
    project.
    
    Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=410937
    Also-by: Some Otherperson <otherperson@someplace.net>
    Signed-off-by: Joe Somebody <somebody@someplace.net>

The "Signed-off-by" entry is required. By including this, you confirm that you are in compliance with the Certificate of Origin.

Note that the footer entries must occur at the bottom of the commit message and must not include any blank lines.

Signing off on a commit

Both Git and EGit have built-in support for signing off on a commit.

From command-line Git, add -s to the command:

git commit -s -m "Auto share multiple projects in single job"

From EGit, there is a handy button in the commit dialog box:

Signed-off-by.png

EGit can also be configured to sign-off all commits you create from EGit automatically:

  • click "Preferences > Team > Git > Commit Dialog"
  • check "Footers > Insert Signed-off-by"

Contributing via Bugzilla

If you cannot push to a project's Gerrit repository, or do not have a public Git repository from which a project committer can pull, you can submit your contribution as a patch attachment on a Bugzilla record.

You must have a signed CLA on file.

Further, you need to sign-off on the Certificate of Origin in a comment on the bug. For example:

This contribution complies with http://www.eclipse.org/legal/CoO.php

A Word about Eclipse Foundation Accounts

The Eclipse Foundation maintains multiple separate forges. The same user account applies for all forges. If you, for example, create an account on eclipse.org, that same account can be used on LocationTech or PolarSys. A signed CLA is connected to your Eclipse Foundation account; this means that with the single valid CLA on file, you can contribute to any project on any of the forges.

Frequently Asked Questions

I have a CLA; why can't I push to Gerrit?

First check the email address that you're using on the commit record. It must match the email address you use on your Eclipse Foundation account.

We have noticed an issue with Gerrit caching that sometimes introduces latency in the ability for Gerrit to recognize that you have a CLA. This may affect you if you've very recently signed a CLA. Please see bug 407114.

The commit is properly signed-off; why is it being rejected?

The "Signed-off-by" entry must be in the footer of the commit message. This is the last block of text in the commit message; it cannot contain blank lines. See bug 412140.

For example, pushing the following commit to Gerrit will fail because the "Signed-off-by" entry is not considered part of the footter (it is separated from the footer by a blank line):

commit 862e6ff22ad56c10df6de3385ffa4c7d02363d1d
Author: Joe Somebody <somebody@someplace.net>
Date:   Mon Jun 17 17:19:38 2013 -0700

    [410937] Auto share multiple projects in single job
    
    When multiple projects are imported together, perform all the necessary
    auto shares in a single job rather than spawning a separate job for each
    project.
    
    Signed-off-by: Joe Somebody <somebody@someplace.net>

    Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=410937
    Also-by: Some Otherperson <otherperson@someplace.net>

This page is moderated by the EMO.