Hacker News new | past | comments | ask | show | jobs | submit | AnthOlei's comments login

I’ve recently spent time truly learning git, and I’m realizing how much better it is to take care of your commits in a PR even if you squash to main.

My reviewers love when I write “review commit by commit” in the PR description. Then each individual commit has its own reasoning, and you can mentally switch into reviewing if that commit does it’s one thing it’s supposed to do correctly. I will accept the argument that each commit should be its own PR though :)


This is so puzzling to me. It’s like people[1] get so stuck in the GitHub PR framework/mindset that they then, after realizing that GitHub PRs suck for reviewing individual commits, discard commits as the reviewable unit and then shoehorn one-commit-per-PR as a replacement.

The PR is just the best GitHub had to offer. There are other approaches to code review.

[1] Here we are generalizing.


I treat PRs like the email workflow. You send a diff my way for a particular changes, I either accept it or reject it. Or I suggest modifications. Recursively. It’s the whole patch I’m interested in, not the implementation history (I’m not your tutor). Once approved, I make a commit in main for this diff.

The classic email workflow is either one patch or a patch series. Where each patch becomes a commit. And each patch can be reviewed in isolation (like a commit).

It is not anemic like the squash workflow.


There’s nothing stopping anyone from creating a PR series. My reasoning for the squash workflow is described here[0]. I just equate a PR to a patch. And it becomes a commit in the main branch. I don’t really care about the commits in the PR, just like no one cares about the commits that produced the patch in the email workflow.

[0]: https://news.ycombinator.com/item?id=41839282


> I don’t really care about the commits in the PR, just like no one cares about the commits that produced the patch in the email workflow.

They do care. They go through the trouble of reviewing it so that the resulting commit[1] that lands in the upstream repository is good.

[1] Presumably you don’t mean “they don’t care about the commit that produced the patch”… since the patch is just a transport format for the commit.


> Presumably you don’t mean “they don’t care about the commit that produced the patch”… since the patch is just a transport format for the commit.

Commits. Not everyone will care to clean up their local history just to produce a single patch. You can git diff it out.

EDIT:

I was using "patch" for diff so scratch the above comment. Even then, when using a forge, I'd rather use squash unless everyone clean up their commit history when producing a PR.


Exactly! Stacked diffs/changes are the way, with one commit per PR. https://www.stacking.dev/

What’s the source of this? Where can I read more?



I was under the impression that you were referring to a specific event that happened over the weekend, not a general vibe you were feeling


Ha, I think this site is styled by a single-sheet CSS called Tufte.css


I don't think it is. In Tufte CSS, sidenotes are implemented using float: right [1], while here CSS Grid is used instead.

[1]: https://github.com/edwardtufte/tufte-css/blob/957e9c6dc3646a...


Oh wow. I went though some of the perl book you linked and I was noticing the examples were really familiar; I then realized you were the same guy who wrote the awk book I have been going though.

Your work is excellent! Thank you, I’ll buy a copy soon.


this is amazing! I guess I was searing the wrong keywords. Thanks, I’ll evaluate these.


I wonder: if we set a TTL on the image, and also make it require a signed link that gets copied the same way, is it now a secure & ephemeral service?


Gerrit for really fine grained control


How have meta employees stolen money?


> has caused far far far more net harm than


If you're experienced using nix, this article may be too simple - but hopefully this is helpful for people struggling to figure out some nix features.


For those of you who have a modern serverless architecture (lambda, dynamo, firebase etc.), how do the costs compare there? I’ve always thought serverless is cheaper, but I’ve never ran anything at scale.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: