Live data from Hacker News

jj – the CLI for Jujutsu

steveklabnik.github.io

511–517 of 517 posts

Re: jj – the CLI for Jujutsu

#511

I'm giving jj a try but one aspect of it I dislike is edits to files are automatically committed, so you need to defensively create empty new commits for your changes. As in, want to browse the repo from a commit 2 weeks ago? Well if you just checkout that commit and then edit a file, you've automatically changed that commit in your repo and rebased everything after it on top of your new changes. So instead you creat…

You can turn that off (I do). In your config file:

    [snapshot]
    auto-track = "none()"
Auto-tracking could be a great default in certain projects, and a terrible one in others. jj doesn't require it at all and is still awesome without it.

Bonus tips:

    # show help by default, as the subcommands do
    [ui]
    default-command = "-h"

    # more readable log (also affects jjui)
    [templates]
    log = 'builtin_log_oneline'

Re: jj – the CLI for Jujutsu

#512
post #48

Is there a concise introduction / overview of jj? I've read 8 pages of this link and the author is still in preambles and considerations... Not my favourite style of article!

I wrote a brief intro to Jujutsu here: https://mkaz.blog/code/jujutsu-vcs

This is great, thanks.

Re: jj – the CLI for Jujutsu

#513
post #428

Earlier quoted context omitted.

jj has far fewer warts than git. You don’t have to learn every jj idiom, you just have to find a workflow you like, which you will, quickly, because it’s so easy to use. Personally I don’t know why anyone uses `edit` but if they like it then I’m happy for them.

But I have a workflow I like with git and I can’t see how jj would be better. I’m genuinely curious as to whether it would be or not, but the behaviours people are describing are not things that interest me.

For me the killer feature of jj is how much easier it makes rebasing. With git, if I knew a coworker had recently merged changes to a file I’d been working on, I would really dread syncing because I knew there was a good chance I’d get stuck in rebase hell.

With jj, you still have to deal with conflicts, but you can do it on your own time, so I never fear syncing anymore. Also, on the rare occasion that I mess up a merge, I no longer have to pull out my git sorcerer hat to fix it. I just `jj undo` and it’s like it never happened.

Re: jj – the CLI for Jujutsu

#514

Earlier quoted context omitted.

I am dumb. why is that better than a git branch or a git worktree ?

In sort of the same way juggling apples is better than juggling hand grenades: it's mostly the same in the simple cases, but once you start doing the really fancy stuff, one of the two will get you a lot fewer messy explosions. (Your question is not dumb, BTW. The pithy answer is: UX matters , but it does so in ways that can be hard to convey since it's about the amount of cognition you need to put in a given thing t…

Thanks for the answer! To be honest, maybe because I've been using git for 16 years now, I find jj interface more confusing than git. All it takes to understand git, to me, is understanding the files and the operations.

There are annoying things for even experienced users like merging the history of merged repos, or sometimes patching a bisect for a bug.

Complex operations in git are complex and often there is nothing that makes them palatable enough to understand without really understanding git internal workings.

I will try once more when I feel my brain is more opened to the ideas jj is proposing. Thanks again

Re: jj – the CLI for Jujutsu

#515
post #408

Earlier quoted context omitted.

For what it's worth, you can have your own local gitignore by adding patterns to .git/info/exclude. It's quite useful in this exact situation.

I did try this, but for whatever reason it kept getting added back automatically. I forget the details of exactly why it was happening because it was close to a year ago, and in the compatibility guide it says this is supported, but I'm not sure if it was at the time or I was running into something different. This was a contract gig for me where I knew it would be ending within a month or so, which meant I didn't bot…

Interesting, I tried on a recent version so who knows? I do find that sometimes jj is a bit precious with ignored files if the file exists before the ignore rule, even if you untrack. In those situations I almost always "delete/recreate" after the rule is added.

Re: jj – the CLI for Jujutsu

#516

Earlier quoted context omitted.

In sort of the same way juggling apples is better than juggling hand grenades: it's mostly the same in the simple cases, but once you start doing the really fancy stuff, one of the two will get you a lot fewer messy explosions. (Your question is not dumb, BTW. The pithy answer is: UX matters , but it does so in ways that can be hard to convey since it's about the amount of cognition you need to put in a given thing t…

Thanks for the answer! To be honest, maybe because I've been using git for 16 years now, I find jj interface more confusing than git. All it takes to understand git, to me, is understanding the files and the operations. There are annoying things for even experienced users like merging the history of merged repos, or sometimes patching a bisect for a bug. Complex operations in git are complex and often there is nothin…

As a jj user, I would say I had the same experience for an entire year used it on and off, and then I just forced myself to use it, and it left a bad taste on the first week.

But on the second week I bungled a command that did some rebase and stuff and I paniced that I destroyed the work but alas it was all there.

I just hit jj undo and it all was there it snapshotted it all. I fell in love and just kept using it unafraid of making mistakes.

I think the worst part about git is being afraid to bungle up your work, jj makes obvious things obvious, asking someone in git land how to copy a commit as in duplicate it. And they might actually start crying even, if they have been using it for a while.

Generally you just create two branches but what if you want to copy and try to check which branch it would be easier to rebase on to, if you had to rebase.

This is not that hard if you have done it a couple times, but jj makes it so much easier, in big teams I feel like JJ is the only sane choice when git commands can get insane.

Also jj doesn't snapshot large files by default, aka, perfect no one mistakenly commiting a binary again. That is just unhinged when newbies do that and you need to flush that out of your git history.

Just the sane defaults + undo + obvious and simple commands was a huge sell for me and I grit my teeth and learnt it. And ofc in a jj git init repo you can always use git, best part often you can do all the simple operations in jj and then the hard one in git after creating a duplicate of the commit. To ensure nothing gets destroyed beyond recovery, further you can use jj state to recovery bad git state as well. It's all so nice that you will accept doing the harder stuff with git as well.

Re: jj – the CLI for Jujutsu

#517

Earlier quoted context omitted.

In sort of the same way juggling apples is better than juggling hand grenades: it's mostly the same in the simple cases, but once you start doing the really fancy stuff, one of the two will get you a lot fewer messy explosions. (Your question is not dumb, BTW. The pithy answer is: UX matters , but it does so in ways that can be hard to convey since it's about the amount of cognition you need to put in a given thing t…

Thanks for the answer! To be honest, maybe because I've been using git for 16 years now, I find jj interface more confusing than git. All it takes to understand git, to me, is understanding the files and the operations. There are annoying things for even experienced users like merging the history of merged repos, or sometimes patching a bisect for a bug. Complex operations in git are complex and often there is nothin…

My pleasure! FWIW I used git for just as long as you, and after a few months with jj I feel more proficient with it than I ever was with git. Somehow it clicked in a way the git commands and options never quite did. But git is not going anywhere either way and is still a good tool, so if it works for you, when it comes down to it, that's the important part.
Post reply on HN