[openstack-dev] [git-review] Supporting development in local branches

Yuriy Taraday yorik.sar at gmail.com
Tue Aug 5 19:51:31 UTC 2014


On Tue, Aug 5, 2014 at 5:27 PM, Sylvain Bauza <sbauza at redhat.com> wrote:
>
> -1 to this as git-review default behaviour.


I don't suggest to make it the default behavior. As I wrote there will
definitely be a config option that would turn it on.


> Ideally, branches should be identical in between Gerrit and local Git.
>

The thing is that there's no feature branches in Gerrit. Just some number
of independent commits (patchsets). And you'll even get log of those
locally in special refs!


> I can understand some exceptions where developers want to work on
> intermediate commits and squash them before updating Gerrit, but in that
> case, I can't see why it needs to be kept locally. If a new patchset has to
> be done on patch A, then the local branch can be rebased interactively on
> last master, edit patch A by doing an intermediate patch, then squash the
> change, and pick the later patches (B to E)
>

And that works up to the point when your change requests evolves for
several months and there's no easy way to dig up why did you change that
default or how did this algorithm ended up in such shape. You can't simply
run bisect to find what did you break since 10 patchsets ago. Git has been
designed to be super easy to keep branches and most of them - locally. And
we can't properly use them.


> That said, I can also understand that developers work their way, and so
> could dislike squashing commits, hence my proposal to have a --no-squash
> option when uploading, but use with caution (for a single branch, how many
> dependencies are outdated in Gerrit because developers work on separate
> branches for each single commit while they could work locally on a single
> branch ? I can't iimagine how often errors could happen if we don't force
> by default to squash commits before sending them to Gerrit)
>

I don't quite get the reason for --no-squash option. With current
git-review there's no squashing at all. You either upload all outstanding
commits or you go a change smth by yourself. With my suggested approach you
don't squash (in terms of rebasing) anything, you just create a new commit
with the very same contents as in your branch.

-- 

Kind regards, Yuriy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140805/8a67aff0/attachment.html>


More information about the OpenStack-dev mailing list