Live data from Hacker News

Abandoning Gitflow and GitHub in favour of Gerrit

beepsend.com

151–160 of 168 posts

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#151

Gerrit is the wrong solution for truly agile software development. I had a client ask my team to use it, and it was a real PITA. The fact that one commit = one merge is ridiculous. It encourages monolithic commits for no reason other than that the tool demands it. It's unrealistic to ask someone to code review multiple commits per feature, and if you tie in your CI it doesn't make any sense to run your build over and…

> if you push multiple dependent commits to Gerrit, and one of the early ones gets merged, all of the later ones now have to be rebased because Gerrit created a merge commit in the middle. Someone didn't spend time configuring gerrit or configured it wrong for your use cases. You can solve this in one of two ways: you either fast-forward when possible (gerrit can attempt a trivial rebase) or you commit a change set,…

It's also possible that they used Gerrit before those features were added which was maybe two years ago.

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#152

Earlier quoted context omitted.

If you have push access to the repository sure. What if you don't have push access?

You don't give your employees push access to their repos?

By default, only admins have push access to all the repo's for an organization.

Everyone else, by default, has read-only access to the entire organizations private repos.

Each product team is allowed to specify how their own teams can access repos.

We also have 3rd party contractors and vendors work on portions, and they don't have push access.

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#153

Gerrit is the wrong solution for truly agile software development. I had a client ask my team to use it, and it was a real PITA. The fact that one commit = one merge is ridiculous. It encourages monolithic commits for no reason other than that the tool demands it. It's unrealistic to ask someone to code review multiple commits per feature, and if you tie in your CI it doesn't make any sense to run your build over and…

> if you push multiple dependent commits to Gerrit, and one of the early ones gets merged, all of the later ones now have to be rebased because Gerrit created a merge commit in the middle. Someone didn't spend time configuring gerrit or configured it wrong for your use cases. You can solve this in one of two ways: you either fast-forward when possible (gerrit can attempt a trivial rebase) or you commit a change set,…

Your argument would be better received sans-ridicule.

I think the OP's point was that Garret hides a lot of features that are built into git and then attempts to paper over that fact by re-implemting those features within its own system.

In your first paragraph, you defend Garrit's rebasing procedure and then you implicitly accuse the OP of not being willing to "suck it up and learn something new".

Why should we learn a new tool that makes (arguably poor) attempts at re-implementing the features of a tool that we already know and love?

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#154
post #39

Earlier quoted context omitted.

Exactly. There's multiple way of working together with Git/Hub. Gitflow is not a bible, but a customization workflow that should be adopted to the team.

There are far fewer reasons not to use Gitflow than you might initially think.

I personally don't have any issues with Gitflow but it seems the OP does.

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#155
post #47

Earlier quoted context omitted.

Would you care to elaborate what you find wrong/bad about "parallel histories"? I'm curious.

This is related to the conversation about squash that happened last week. Basically, the moment two or more people try to work on something outside of the trunk line of code (trunk/master/whatever), there is no version of their commit history that will be pretty, and so squashing the branch at the end seems like a good idea, even though it produces objectively worse code over the long run. To wit: There comes a point…

> This is related to the conversation about squash that happened last week.

> Basically, the moment two or more people try to work on something outside of the trunk line of code (trunk/master/whatever), there is no version of their commit history that will be pretty, and so squashing the branch at the end seems like a good idea, even though it produces objectively worse code over the long run.

I don't like squashing at all, unless you're squashing commits locally because you fixed a bug in a previous commit that only exists in your local branch. Because in that case, it doesn't make sense to pollute the history with commits that were known to be broken when merged (this causes issues with bisecting).

> I want to tell one little white lie with the code: I want to pretend like Joe and Tim wrote their entire feature after my bug fix and before Steven's, even though they worked on it all week. I want them to be able to commit it as a single transaction but with all the intermediate steps.

> When I say 'parallel history' I mean I want Joe to be able to rebase the branch on top of my changes, without having to go apologize to Tim for making his snapshot into mincemeat.

I had to read your comment several times and I still don't think I understand what you mean by "parallel history". Are you saying that A and B are working on a feature concurrently (but not by merging into a central place)? If they were merging into a central place than that central place can be rebased to get in line with C's bugfix. Then A and B can rebase their local branches with the central branch.

It's also possible to do all of the rebasing locally, then once one pushes the other needs to rebase. But I don't think that works well.

Essentially you need to treat people collaborating on a branch the same way you consider it as collaborating on a project.

But maybe I misunderstood what you meant.

> Or, I want us to stop pretending like feature branches fix all of our problems, with no serious consequences.

Looks like I did misunderstand.

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#156
post #77

I don't really see what's different. Both github and gerrit have voting and you're still creating a pull request like in github. The only difference is that this pull request is restricted to a single commit. Not very flexible, I see a lot of churn of invalid pull requests with this design if they aren't allowed to grow into complete features..

> Not very flexible, I see a lot of churn of invalid pull requests with this design if they aren't allowed to grow into complete features.. Actually, Gerrit really encourages growing a patchset ("pull request") into a complete feature. It allows you update your change over and over, addressing review comments as they come in. Once done, you have a clean "Add support for use of XYZ by ABC" commit - and not a pile of h…

> > Not very flexible, I see a lot of churn of invalid pull requests with this design if they aren't allowed to grow into complete features..

> Actually, Gerrit really encourages growing a patchset ("pull request") into a complete feature. It allows you update your change over and over, addressing review comments as they come in.

> Once done, you have a clean "Add support for use of XYZ by ABC" commit - and not a pile of half baked commits - I cringe when I see things like this: "Add framework for XYZ", "Define Config for XYZ", "Correct typos", "Add tests", "Rework XYZ to be standards compliant", "Correct typos", "Fix tests"

I don't like commits like that either. But almost all real pull requests require more than one commit (so future generations can bisect the repo properly without then needing to bisect patches as well). A nice pull request is something like this:

server: add statistics monitoring framework

server: component a: hook into statistics monitoring

api: expose statistics monitoring

integration: add tests for statistics

Each commit works as intended and does exactly one thing. I tried to do something like this on Gerrit (was contributing to the TWRP recovery) and it was such a pain that I collapsed everything to one commit. That's not how things should be dealt with (I needed to improve the pattern decryption to support N*N patterns and it required a bunch of UI, internals and other changes that all got squashed together).

I also didn't like the fact that anybody could overwrite your PR's commit with their own crap. Why is that a feature?

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#157

What I got from this article is idea to squash every pull req into a single commit. I think this is valuable idea.

As someone who does a lot of git bisecting, this is a horrible idea. Only do it on a case-by-case basis. If it takes 5 commits to make 5 complete changes that implement something, keep them as 5 commits.

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#158
Exactly why I'm frustrated with GitHub's PR:

> As soon as someone added changes to their pull request – either by rebasing in the new changes or making it as a new commit – you lost track of the comments in the code and viewing what had actually changed since the last update became really hard

Re: Abandoning Gitflow and GitHub in favour of Gerrit

#159

Earlier quoted context omitted.

> if you push multiple dependent commits to Gerrit, and one of the early ones gets merged, all of the later ones now have to be rebased because Gerrit created a merge commit in the middle. Someone didn't spend time configuring gerrit or configured it wrong for your use cases. You can solve this in one of two ways: you either fast-forward when possible (gerrit can attempt a trivial rebase) or you commit a change set,…

Your argument would be better received sans-ridicule. I think the OP's point was that Garret hides a lot of features that are built into git and then attempts to paper over that fact by re-implemting those features within its own system. In your first paragraph, you defend Garrit's rebasing procedure and then you implicitly accuse the OP of not being willing to "suck it up and learn something new". Why should we lear…

There's nothing ridiculous in xyzzy_plugh's argument.

The discussed tool is not "Garret" or "Garrit", it's Gerrit, which makes me wonder if you used it before commenting.

As far as I know, Gerrit doesn't reimplement git's features. Rebasing is done using git rebase.

Gerrit is a system for code review, just like GitHub's PR, but with a different approach.

Post reply on HN