1. 43

  2. 12

    Honestly, in practice I haven’t found a single valid use-case for octopus merges which aren’t already covered by sequencing a series of merges, one after the other. Perhaps there are some integration use-cases out there which really let’s the octopus merge strategy shine. Let me know!

    The use case I usually see this come up in, and have used myself, is splitting files while preserving git history in each split. If, for each destination split, you make separate branches with separate commits to move and trim down the file, then merge all the branches together, the result is git being able to track each individual split file as having been a rename of the original file, and therefore the blame isn’t clobbered by the split.

    1. 4

      Empty commit can be pretty useful if you are using IaC and want to fix drifts

      1. 3

        Also when GitHub actions get stuck (happens to me frequently) and I need to trigger a re-run.

        Edit: To expand, this happens whenever my “prettier” action has prettified the code and committed it back to the branch. It seems to trigger another run of the actions (there are three) but these will be stuck on Expected — Waiting for status to be reported until I push an empty commit.

        1. 2

          I do work on multiple fixes/chores in parallel but during development I’m too lazy to create branches and switch between them so I just have one big develop branch and make a visual separation between groups of commits with a git commit --allow-empty -m -----------. That also makes it easy to rebase and check conflicts for everything at once.

          1. 1

            Drifts by committing something empty and having git-ops do the enforcement of repo state?

            1. 1

              Yes, sort of, plus if you’re using Github/Gitlab etc you’d have the commit in the repo pointing to the PR for audit/history purposes. See Atlantis for example for such workflow.