Jujutsu megamerges for fun and profit

(isaaccorbrey.com)

100 points | by icorbrey 3 hours ago

13 comments

  • nchmy 1 hour ago
    Some fantastic tricks in this article. Will definitely improve my Megamerge game. Thanks!

    Though, I'd be remiss not to mention that this (and any other) jj workflow would be much easier with jjui. It's the best TUI around, not just for jj

    I proposed incorporating some of this article into it. https://github.com/idursun/jjui/discussions/644

  • uhhhd 14 minutes ago
    I love this stuff as a hobbyist, but professionally I can't help but think this is all obsolete in the age of agent-driven development. I wish jj was around a decade ago.
    • MeetingsBrowser 6 minutes ago
      I disagree. Easily reviewing and combining multiple streams of parallel work is more valuable than ever.
  • VerTiGo_Etrex 2 hours ago
    Makes me happy to see the influx of jj posts as of late. Great tool. Roughly this workflow is how I convinced a few friends to finally loosen their death grip on git and try something new.
  • grim_io 2 hours ago
    If this works like I think it does, it might be the missing piece I've been waiting for, for actually trying jj. Thanks!
    • icorbrey 2 hours ago
      Awesome! Tbh other than GitButler idk where I'd even start if I had to recreate this with vanilla Git
  • nvahalik 2 hours ago
    Great article, Isaac!

    If anyone is JJ-curious, I also can't recommend the Discord[1] enough. The community is very helpful and welcoming.

    [1]: https://discord.com/invite/dkmfj3aGQN

  • taberiand 2 hours ago
    How does the megamerge handle the case where two included branches overlap in changes and a new commit is made that applies to the overlap?
    • icorbrey 1 hour ago
      This is something you have to generally handle manually since absorb won't squash hunks with ambiguous targets, but I typically stack these branches and accept the dependency. I have had instances where this has backfired a little bit re: ordering but thankfully with JJ and the very patient little man in my computer named Codex it's easy to reorder them and end up with the same diff
    • nvahalik 1 hour ago
      The mega merge wouldn't handle that based on the way the article shows. You COULD have a revset that includes stacked changes, though. That does work and is what I currently do.
  • dbt00 2 hours ago
    this is great stuff. I've been ad hoc building a version of this workflow, and it is quite fantastic.

    I'm still not as smooth at figuring out conflicts on mega-rebase.

  • forrestthewoods 47 minutes ago
    Great post. Thanks for sharing.
  • juped 1 hour ago
    It's interesting to see the strange workflows that come from jujutsu users, as someone who works on git workflows.

    There's some counterproductive stuff in there from my perspective but at its core you're keeping up a throwaway integration branch, which is helpful practice if you'll ever care about an integration. It's annoying with git because the interface for updating your throwaway integration branch is very clunky and easy to get wrong.

  • incognito124 2 hours ago
    Finally
    • icorbrey 2 hours ago
      Look man life gets busy and I'm horrible at accepting "good enough" lol
      • schpet 2 hours ago
        love to see it, been looking forward to this.
  • LoganDark 1 hour ago
    I saw Jujutsu on HN a few days ago and gave it a try. I picked a bunch of it up in just a couple hours and a couple days later I've completely switched to it for all my projects, it's not even close. Git is dead to me.

    I just wish Jujutsu supported git tags rather than only supporting bookmarks as branches. And I also wish that Jujutsu supported preserving commit dates during rebases.

    One of my absolute favorite things about Jujutsu is how easy it is to manipulate the commit graph remotely without having to manually checkout each commit first. I've been working on some pull requests to their built-in diff editor lately trying to improve the user experience enough that most conflicts will be fixable without having to use a text editor.

    Also, the lack of a special staging area means you also never have to fucking stash your changes before you can do practically anything. Your changes always have a place, you can always go somewhere else and you can always come back.

    • notmywalrus 37 minutes ago
      > git tags

      There are commands for manipulating tags (jj tag set, jj tag delete), and recently [1] support for fetching / pushing

      [1]: https://github.com/jj-vcs/jj/pull/9279

      • LoganDark 34 minutes ago
        Oh? That's incredibly recent. Thank you for letting me know. As it turns out, I just built jj from source earlier today, so ironically I should already have tags. I'll give it a try.
    • icorbrey 29 minutes ago
      Re: commit dates, fundamentally those always change when rebasing because you're rewriting the commit object, but we don't touch the author date unless you explicitly reset it with metaedit
  • techpulselab 28 minutes ago
    [dead]
  • huflungdung 21 minutes ago
    [dead]