Gerrit multiple commit causes multiple review requests

Source: Internet
Author: User

This is determined by the design of Gerrit, which is definitely not a bug. A change ID is generated each time a commit is sent, and the review request is bound to this change ID.

Two solutions:

1. Engineers should use less commit as much as possible. Each time they use git add to manage the work zone, they will call git commit once before git push review.

2. many people suggest that: Call git commit for the first time, and then use the GIT commit -- amend-m'' command to revise the previous commit to ensure that only one commit and the corresponding change ID are generated.

And then git push Review

In the review process:

If a review request is not approved by the approver, the review request adds a comment and requires that the code be modified again, the engineer should also use the second method, so that the change ID will not be changed.

In practice, I sent git commit -- Amend to generate a new change ID because the same commit ID does not mean that the change ID will not be generated again.

Solution:

Git commit -- ammend adds the following format string at the end of the comment:

Change-ID: i835802a16c90ea08d181b51facee7bd153ae9749

This change ID can be found on the Gerrit system site. Refer to the following.

The request is sent again as the patch of the review.

In the local git repository, you can use commands to observe the review tasks in the GIT repository maintained by remote Gerrit:

 git ls-remote origin8a0472420559380dc4fb0c67d7268d6b46a78888HEADae654d61b7d06e311ec1a6a9012df71f30f2f993refs/changes/16/116/18a0472420559380dc4fb0c67d7268d6b46a78888refs/heads/master32a17f0e3528aa25d90674b4836f1a91235122e2refs/meta/config

The above results show that the expected change ID is

ae654d61b7d06e311ec1a6a9012df71f30f2f993

Go to the Gerrit website and check:

Except for one more I, the change ID is the same.

You can also see the Patch Set

Refs/changes/16/116/1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.