Duplicate entries in git log

96 views
Skip to first unread message

Lokesh Loki

unread,
Nov 15, 2023, 12:01:12 AM11/15/23
to Repo and Gerrit Discussion
Hi,

We are using Gerrit 3.8.1 version and we observed that there are two entries getting recorded for same commit as follows:
for example, i have uploaded my changes for review and it was reviewed and merged. In the git log there are two entries :

1. commit message 
2.Merge "commit message" ( it seems it is getting autogenerated by gerrit and author name for this commit is displayed as userame(who merged the change) and commiter is Gerrit code review) . This entry in git log is not getting recorded for all changes.

Note: Multiple users(uploader/non-uploader) will be involved during review.

As it is a bit confusing , please correct me if my understanding is in wrong direction?
1. Only single entry against author name will be shown if there is no other commits pushed to same repo in between the code push and merge?
2. If there are changes pushed between commit by author and submit by reviewer/approver, this will show up Merge entry with reviewer name who does submit?
3. In above case both entries will be updated/displayed on web at the same time when “Merge” /submit is done (commit entry will be updated based on timestamp of commit done) ?

Thanks and Regards,
Lokesh

Edwin Kempin

unread,
Nov 15, 2023, 2:22:21 AM11/15/23
to Lokesh Loki, Repo and Gerrit Discussion
What happens on submit of a change depends on the submit action (aka submit type aka submit strategy) that is configured for the project, see:
 

Thanks and Regards,
Lokesh

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/03803d39-5d63-44ef-bacd-b1598048605fn%40googlegroups.com.

Sven Selberg

unread,
Nov 15, 2023, 2:42:28 AM11/15/23
to Repo and Gerrit Discussion
On Wednesday, November 15, 2023 at 8:22:21 AM UTC+1 Edwin Kempin wrote:
On Wed, Nov 15, 2023 at 6:01 AM Lokesh Loki <lokeshl...@gmail.com> wrote:
Hi,

We are using Gerrit 3.8.1 version and we observed that there are two entries getting recorded for same commit as follows:
for example, i have uploaded my changes for review and it was reviewed and merged. In the git log there are two entries :

1. commit message 
2.Merge "commit message" ( it seems it is getting autogenerated by gerrit and author name for this commit is displayed as userame(who merged the change) and commiter is Gerrit code review) . This entry in git log is not getting recorded for all changes.

Note: Multiple users(uploader/non-uploader) will be involved during review.

As it is a bit confusing , please correct me if my understanding is in wrong direction?
1. Only single entry against author name will be shown if there is no other commits pushed to same repo in between the code push and merge?
2. If there are changes pushed between commit by author and submit by reviewer/approver, this will show up Merge entry with reviewer name who does submit?
3. In above case both entries will be updated/displayed on web at the same time when “Merge” /submit is done (commit entry will be updated based on timestamp of commit done) ?

What happens on submit of a change depends on the submit action (aka submit type aka submit strategy) that is configured for the project, see:

I.e. what you are noticing is that if the submit-strategy is `Merge if Necessary` and the parent of the latest patchset isn't the tip of the target branch a merge commit will be created to integrate the change into target.
The merge commit contains data about which changes were integrated by the merge commit.

commit <- previous-master <- merge-commit
                 \ ---patchset1--------/

If you want a more straight commit history you can choose submit-strategy `Rebase if Necessary` which will create a new patchset that is rebased onto target on submit.

commit <- previous-master <- patchset2 (created upon submit)
                 \ ---patchset1
Reply all
Reply to author
Forward
0 new messages