Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [] Playing with gerrit


A gerrit "review" is tied to this Id, which also
mandates that one review = one commit. This is also what allows you to
simply cherry-pick said commit from gerrit, change it, then push it
again to update the review with your own changes.

To be honest I don't like this. Merging a potential long bunch of commits, in which everyone has its purpose and comments, in just one, makes me lose one of the essence of this agile quick changes oriented methodology which I love.

I am not a fan of that requirement from gerrit myself, but one could argue that it makes for a much more legible history, since you have your features properly isolated in their commits. You do not lose the history of who did what, theirs comments and why they changed a particular review : that history is logged on gerrit instead, through the comments and various patch sets. For example, on, you can see a "big" feature-introducing commit. Gerrit keeps an history of the four distinct patch sets that have been created for that particular feature along with the comments we made during the reviews (on each patch set).

One would just need to look at the OCL repository's history to feel that gerrit is an improvement :p. I really have trouble finding out what commit introduced what change for which purpose in the (too) many branches in there. Gerrit's "one commit for a change" tends to make for a much clearer policy.

I'll try this squeezed commit, perhaps it's the cause of the push rejection. I guess that EGit doesn't have a way to this via UI, does it ?

That, I do not know. I rarely squash commits into one. Amending is usually much easier when you work on a change :).

Some feelings I've got so far. It also requires be more careful when committing/pushing, which could be error prone. Now we have push and push to gerrit, I'm used to "commit and push" button (a normal push). It sounds dangerous.

True enough, even very recently I've pushed to the repository a few changes for which the review had not been completed. But that can be avoided through a number of means :
  • disable the force push on your repository (you can no longer bypass gerrit)
    • On Compare, we've kept the force-push ability in order to avoid gerrit reviews when pushing the stream of very small changes I usually need when fixing build errors
  • Make it so that your "normal" remote's push configuration is for gerrit. If your look at, we add a "review" remote to our repositories so that we can push to gerrit via "git push review". This configuration can also be made to be your default instead of a new remote, so that "git push" pushes on gerrit directly.

Laurent Goubet

fn:Laurent Goubet
org:<a href="";>Obeo</a>

Back to the top