Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 388266

Summary: Author field not preserved when merging a contributed patch.
Product: Community Reporter: Pawel Piech <pawel.1.piech>
Component: GerritAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn, mober.at+eclipse, scott.tepavich
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Pawel Piech CLA 2012-08-28 15:34:39 EDT
I have a case where I merged a contribution through gerrit expecting that the git author field would be retained with the contributor's email.  Instead, my email was used for Author field, and "Gerrit Code Review @ Eclipse.org" was set as committer name.  This is likely a problem with user preferences or project settings, but I don't see what setting would be responsible for this problem

The gerrit contribution is at https://git.eclipse.org/r/#/c/7441/ and the commit at http://git.eclipse.org/c/tcf/org.eclipse.tcf.git/commit/?id=7e8472bdfd58005936a94974049adb6e776b2355.
Comment 1 Matthias Sohn CLA 2012-09-10 15:14:16 EDT
Your project is configured in Gerrit to use the merge strategy "Merge if necessary" [1]. This means [2] that if the change being submitted can't be fast-forward merged, Gerrit will try a path-based merge and create a merge commit on behalf of the user submitting the change, in this case the author is the user who clicked the submit button and Gerrit itself is the committer creating the merge commit. 

In your case change https://git.eclipse.org/r/#/c/7441/ was accepted as commit a3ea713f7fc398cfd483b8e589fb4e233b08ab16. Commit http://git.eclipse.org/c/tcf/org.eclipse.tcf.git/commit/?id=7e8472bdfd58005936a94974049adb6e776b2355 is the merge commit created by Gerrit, commit a3ea713f7fc398cfd483b8e589fb4e233b08ab16 is one of the parent commits for this merge commit and you are the author of the merge commit since you submitted the change which led to the merge commit.

So I think everything worked as designed.

[1] https://git.eclipse.org/r/#/admin/projects/tcf/org.eclipse.tcf
[2] https://git.eclipse.org/r/Documentation/project-setup.html#submit_type
Comment 2 Pawel Piech CLA 2012-09-10 15:19:33 EDT
Can you confirm then that we need to select cherry-pick as the merge strategy in order to have gerrit preserve the contributing author's name for the IP log.

Thanks,
Pawel