News for hackers. Stuff that matters.
Re:Jujutsu for Busy Devs by Zambyte on Tuesday July 22, 2025 @09:57AM (#44646979)
> because there's no single thing that you can do with jj that you can't with git.

- jj undo, jj op restore, and jj --at-op to reset or view the repo at a previous state

- create multiple directories (workspaces) backed by a single repository at different commits

These are the only things I can think of off the top of my head that you can do with jj that you can't do with git.

Re:Jujutsu for Busy Devs by IshKebab on Tuesday July 22, 2025 @10:49AM (#44647627)
> create multiple directories (workspaces) backed by a single repository at different commits

This is `git worktree`.

They don't work with submodules but submodules are a disaster that should be avoided anyway so probably no big loss there.

Re:Jujutsu for Busy Devs by Zambyte on Tuesday July 22, 2025 @11:54AM (#44648775)
Ah, I was not familiar with that feature in git. In that case, I'll swap out jj workspaces for sparse checkouts :-)
Re:Jujutsu for Busy Devs by Zambyte on Tuesday July 22, 2025 @03:04PM (#44651608)
Apparently git sparse-checkout exists! I'm going to stop guessing features that git doesn't have now.
Re:Jujutsu for Busy Devs by palata on Tuesday July 22, 2025 @10:02AM (#44647032)
> to reset or view the repo at a previous state

What about `git reflog`?

Re:Jujutsu for Busy Devs by Zambyte on Tuesday July 22, 2025 @10:06AM (#44647082)
That lets you see previously checked out revisions. Jujutsu keeps track of all previous repo state. In git, you can pull a new remote branch, delete that branch, and push the deletion. If you want to get that branch back, git reflog will only save you if you checked out that commit. If you didn't, you're SOL. Jujutsu will let you undo the delete operation, restore the repo to a state where the branch existed, or view the repo at a state where the branch existed, and create a new branch at the same revision that the old branch was before it was deleted.
Re:Jujutsu for Busy Devs by 0points on Tuesday July 22, 2025 @12:10PM (#44649091)
That might be cool, actually.

FWIW, I cheated on a previous job for months by working 10% or so, then faking git commit data to spread it out across the week before sending a PR.

Thank you "git commit --amend --no-edit --date xxx"

Re:Jujutsu for Busy Devs by palata on Tuesday July 22, 2025 @10:39AM (#44647472)
This is interesting, thanks!
Re:Jujutsu for Busy Devs by Moomoomoo309 on Tuesday July 22, 2025 @01:17PM (#44650274)
What if you commit secrets to the repo by accident?
Re:Jujutsu for Busy Devs by Zambyte on Tuesday July 22, 2025 @02:30PM (#44651174)
Jujutsu repos only exists locally. There are no Jujutsu remotes, only git remotes. Repo properties unique to Jujutsu (repo history, stable revision IDs) are not pushed to git remotes.
Re:Jujutsu for Busy Devs by gkbrk on Tuesday July 22, 2025 @01:18PM (#44650295)
Just edit it out and don't push it to upstream?
Re:Jujutsu for Busy Devs by BeetleB on Tuesday July 22, 2025 @07:29PM (#44654186)
> jj undo

Yeah - the other day I did a fetch, and then decided I didn't want to fetch. I simply ran "jj undo" to undo the fetch.