Working with lots of changes in parallel on git can be painful. You end up juggling branches and commits, and running scary rebase -i commands that can leave your tree in a half-broken state if you so much as sneeze.

jj, an alternative to git, gets discussed a lot these days (1, 2, 3, 4) and is often pitched as a solution. While I’m very sold on the problems jj is trying to solve, the way it solves them hasn’t quite hit home with me. Every 3 months, for the last 1.5 years, I try it out for a few days, really trying to make it part of my workflow but eventually I give up and go back to git.

That’s where git history comes in.

  • Alex@lemmy.ml
    link
    fedilink
    arrow-up
    9
    ·
    3 days ago

    The last big update to my git workflow was when I discovered --update-refs as it makes maintaining a stack of feature branches much easier. So far I really only have one “main” dev branch and then peel off the sub-branches at they need merging upstream.

    However I shall have to investigate how the history commands are exposed in magit. I can see it being useful if you have long held branches that take a while to upstream but are useful to have in your trees.

    • eleijeep@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      3 days ago

      You might find topgit useful for maintaining separate interdependent feature branches: https://mackyle.github.io/topgit/topgit.html
      https://github.com/mackyle/topgit

      It adds some simple commands that manage all of the base and head refs of the branches and automatically propagates merges up the tree when you modify a branch lower down. It has been around for quite a while so it’s fairly stable by now.

      Most importantly, it doesn’t do any history rewriting, so you keep the full commit history of your branches while making it easy for other contributors to make commits to the same set of feature branches concurrently.

      • hallettj@leminal.space
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        Oh, nice! Does this do something like Git Butler where you can have multiple branches “checked out” simultaneously, and keep track of which changes belong to which of those branches as you work? But maybe without the commitment that Git Butler requires to using its tooling?

        • eleijeep@piefed.social
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          I’ve never used Git Butler, but looking at their site it looks like a whole UI layer on top of git.

          Topgit is just a small set of shell scripts that implement the various tg commands for managing your patch branches.

          It’s based around the idea of patch queues, but since it’s using git branches you can have a tree of patch branches instead of just a linear patch queue.