Git log show patchset and submitted changes

477 views
Skip to first unread message

sam sam

unread,
Jun 18, 2018, 5:15:22 PM6/18/18
to Repo and Gerrit Discussion
Hello,

I am running version 2.14.6. After i clone from Gerrit Server and review  "git log"  from git bash. I see  some commits that show  the initial patchset and the merge(submit)   showing in the git log. Is this expected behavior. I don't have "merge commit" allowed in access control.This does not happen to all commits.


392c6fa7d (HEAD -> master, origin/master, origin/HEAD)  Edited Jenkins File
f89ef7dfe Merge "Sprint 106 : USP-4419 Utilization Data: Output Files for Posting" --------> submit of patchset
n95c8e496 Sprint 106 : USP-4419  Utilization Data: Output Files for Posting -----------------> Initial Patchset

Andrew Grimberg

unread,
Jun 18, 2018, 5:29:46 PM6/18/18
to sam sam, Repo and Gerrit Discussion
On 06/18/2018 02:15 PM, sam sam wrote:
> Hello,
>
> I am running version 2.14.6. After i clone from Gerrit Server and
> review  "git log"  from git bash. I see  some commits that show  the
> initial patchset and the merge(submit)   showing in the git log. Is this
> expected behavior. I don't have "merge commit" allowed in access
> control.This does not happen to all commits.
>
>
> 392c6fa7d (HEAD -> master, origin/master, origin/HEAD)  Edited Jenkins File
> *f89ef7dfe Merge "Sprint 106 : USP-4419 Utilization Data: Output Files
> for Posting" --------> submit of patchset*
> *n95c8e496 Sprint 106 : USP-4419  Utilization Data: Output Files for
> Posting -----------------> Initial Patchset*

The default submit policy for Gerrit repositories is 'Merge if
Necessary' which ends up giving you that sort of merge history.

If you want to get rid of it you need to change your submit type to one
of the other policies. Check the docs for the different types and what
they do.

I've had plenty of developers want to switch to something like 'Rebase
if Necessary' but I personally dislike that since it throws away
information like PGP signatures if they exist.

-Andy-

signature.asc

David Pursehouse

unread,
Jun 18, 2018, 10:04:06 PM6/18/18
to sam sam, Repo and Gerrit Discussion
On Tue, Jun 19, 2018 at 6:15 AM sam sam <ydsa...@gmail.com> wrote:
Hello,

I am running version 2.14.6. After i clone from Gerrit Server and review  "git log"  from git bash. I see  some commits that show  the initial patchset and the merge(submit)   showing in the git log. Is this expected behavior. I don't have "merge commit" allowed in access control.This does not happen to all commits.

The "push merge commit"  controls whether developers can push merge commits for review.  It is unrelated to what you are seeing here.
 


392c6fa7d (HEAD -> master, origin/master, origin/HEAD)  Edited Jenkins File
f89ef7dfe Merge "Sprint 106 : USP-4419 Utilization Data: Output Files for Posting" --------> submit of patchset
n95c8e496 Sprint 106 : USP-4419  Utilization Data: Output Files for Posting -----------------> Initial Patchset


This happens when you have the "Merge if Necessary" submit strategy and the destination branch advances before the change is submitted.  Then Gerrit creates a merge commit when submitting the change.

If you want to avoid this, you can manually rebase the change before submitting it (you will see a marker in the UI indicating that the parent is outdated), or change the submit strategy as mentioned by Andrew Grimberg in another reply.
 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages