r.avv85
r.avv85

Reputation: 77

git log to list only merged changes from gerrit

Not sure if it's bug, but running git log on particular branch lists down even non-approved changes.

Scenario:

Changes committed & pushed for review in Gerrit with below

git push origin HEAD:refs/for/dev_branch

Review is not yet done & is not merged to central repo image of dev_branch and is still appearing in 'open' changes in dashboard.

Running git log dev_branch enlists list hash of last committed files on local branch as well ( which is not approved & which has not made it's way to central repo).

Is there a filter by which we can restrict to get git log on only merged ones?

Upvotes: 0

Views: 680

Answers (1)

ElpieKay
ElpieKay

Reputation: 30878

dev_branch is a local branch that includes unreviewed commits. If you'd like to see the history of the branch dev_branch in the server side repository, which does not include those commits yet:

git fetch origin dev_branch
git log origin/dev_branch

In case dev_branch does not have an upstream origin/dev_branch for some reason, the following commands work in a more reliable way:

git fetch origin dev_branch
git log FETCH_HEAD

Upvotes: 1

Related Questions