News for hackers. Stuff that matters.
Re:The ideal PR is 50 lines long by stephenorr on Wednesday February 07, 2024 @11:58AM (#39290969)
An ex-manager (ex-Google, too) insisted we move from GitLab to Gerrit, and mandated that all commits be a maximum of 5 lines, ideally fewer.

This led to a complete loss of all context; without that overview, you might very well be releasing code faster, but it could be the wrong solution to the original problem - and crucially, you won't know until it's out in the wild.

A preference for smaller, more focused PRs is fine - it certainly makes them easier to review independently - but I think putting any sort of limit on the size makes your team more likely to omit things like tests and also to not have sufficient context to understand the overall problem space.

Re:The ideal PR is 50 lines long by tomjakubowski on Wednesday February 07, 2024 @02:28PM (#39293051)
> mandated that all commits be a maximum of 5 lines, ideally fewer

Yeesh. How would you ... rename anything? Imagine a linter rule which prevents referencing a given name on more than 5 different lines of code.

Re:The ideal PR is 50 lines long by bluGill on Wednesday February 07, 2024 @03:07PM (#39293591)
Many language allow an alias name. Which means you change the name and then alias the old name to the new line - 2 line PR. Then a bunch of one line PRs to change easy use of the old name. Finally a PR to remove the alias.

Which is why I don't have such a rule and would oppose it.

Re:The ideal PR is 50 lines long by stephenorr on Wednesday February 07, 2024 @03:47PM (#39294100)
The attitude might have been something to do with the individual's SRE background. In that context, I understand the desire to ship small changesets that have a limited blast radius.

It's just not really practical for actually building software.

Re:The ideal PR is 50 lines long by woooooo on Wednesday February 07, 2024 @02:29PM (#39293079)
5????

Please tell us more. Did 6 line commits get rejected? How did anything get done?

Re:The ideal PR is 50 lines long by stephenorr on Wednesday February 07, 2024 @03:40PM (#39294001)
Well, things did get done, but not the right things.

The rule wasn't hard and fast, but you had to have a damn good reason why you wanted to add bigger commits. Protobuf definitions didn't count, so you could get away with doing longer commits for those.

Tests were discouraged anyway ("Google just tests in production", we were told), so there wasn't a lot of that sort of thing.

Re:The ideal PR is 50 lines long by johnnyanmac on Wednesday February 07, 2024 @08:27PM (#39296703)
>"Google just tests in production", we were told

well that sadly explains a ton of little quirks Ive seen in all sorts of google software over the years. Chromecasting functions is especially egrigious and it feels like connecting/disconnecting does a different thing each time.

Re:The ideal PR is 50 lines long by wyldfire on Wednesday February 07, 2024 @02:32PM (#39293127)
This must be a typo - 50 or 500 lines maybe?

...or satire?

Re:The ideal PR is 50 lines long by stephenorr on Wednesday February 07, 2024 @03:43PM (#39294049)
I wish it had been satire. This was fundamentally one of the worst parts of my coding career, and it was disappointing because the company had been amazing to work for prior to this individual's arrival.

Post-arrival, I was ordered to rewrite a working, stable PHP web app into Go ("Google doesn't use PHP, because it doesn't scale"). We weren't allowed to write RESTful APIs any more, everything had to use Protobuf.

And there was a physical fight in the office one day between two of the developers, that culminated in one of them storming out and never coming back.

Re:The ideal PR is 50 lines long by stephenorr on Wednesday February 07, 2024 @04:13PM (#39294399)
I should probably also point out that the "improved" architecture turned out to be corrupting customer data for more than 6 months... which led to termination of that individual.

I'd already left by that point, after a heated conversation in which I was told "you're not half as good a software engineer as you think you are". Well, duh.

Amusingly, the PHP app is still running, still working.