• 1 Post
  • 72 Comments
Joined 3 years ago
cake
Cake day: June 1st, 2023

help-circle



  • GissaMittJobb@lemmy.mltoSelfhosted@lemmy.worldAWS is having a bad day
    link
    fedilink
    English
    arrow-up
    60
    arrow-down
    1
    ·
    1 month ago

    It’s mostly a skill issue for services that go down when USE-1 has issues in AWS - if you actually know your shit, then you don’t get these kinds of issues.

    Case in point: Netflix runs on AWS and experienced no issues during this thing.

    And yes, it’s scary that so many high-profile companies are this bad at the thing they spend all day doing




  • What’s your mental model for a Git commit, and a Git branch?

    Once I properly learned those two concepts, understanding rebases became a lot easier.

    I’ll try to explain it to the best of my abilities.

    • Think of a commit being a patch - a description of how to take a particular file from one state to another
    • A branch is a list of patches to be applied in order, from the point where the branch was created until the last commit on the branch

    When you rebase a particular branch, what you’re essentially doing is taking all of the commits that are currently on your branch, checking out the other branch, and then applying each of the patches in order on that new branch.

    A rebase can be cleanly applied if the premise for each commit has not changed when applied, but if the premise has changed, you get a conflict to be resolved before being able to continue the rebase.

    I mentally model a rebase a bit as a fast version of how it would look like to build the branch I was on, but on top of the branch I’m rebasing on.


  • I’m guessing this is in reference to a scenario where a review of the PR has already been performed, and the rebase+force push is made to introduce new changes to the PR, possibly to address PR feedback.

    I agree that these changes should be made in separate commits, for the benefit of the reviewer.

    There are other scenarios where rebases are appropriate though, such as getting potentially incompatible changes from the main branch into the PR, and here I believe a rebase+force push is the right tool for the job.














  • That kind of commit quality should only really be permissible on private projects, and as a reviewer, it’s arguably acceptable to reject PRs with this kind of history.

    You should be writing your commits to the benefit of the code reviewer - structure them in a logical fashion to tell the story about the changes you want to get merged.

    For non-trivial branches I usually soft reset to the point where all code is unstaged and uncommitted and then curate the commits to align with what the reviewer should be reading. It’s not uncommon for me to have several branches containing a single “wip”-commit which I amend onto while building up the full code for the branch.