News for hackers. Stuff that matters.
Re:JJ Cheat Sheet by rtpg on Tuesday February 11, 2025 @09:04PM (#43020967)
Workflow-wise I was struggling a bit to figure out how to work with the bookmarks in jj not moving along.

I now have a bit of a new strategy:

- When starting up a branch, right up the "final commit message", along with a bunch of notes on what I think I need and other TODOs

- While working, when I want to checkpoint some work, I use jj split to chop up some chunk of work, describe it, and then edit up my TODOs

this way the tip of my branch is always this WIP commit describing my end goal, I can find it, and I can add a bookmark to it.

Instead of git "I add changes over time and make my commit graph move forward", it's "I have a final commit node and add commits _behind it_". Been working well enough.

Re:JJ Cheat Sheet by christophilus on Tuesday February 11, 2025 @09:25PM (#43021109)
I’ve been using it for a bit. It is magical. I had some merge conflicts in a GitHub PR. I pulled everything down with jj, and the conflicts were gone. Pushed and presto.

I do end up with descriptionless bookmarks that won’t push without a flag. So, I’m still doing something wrong.

But it’s already saved me a few times this week during some gnarly refactoring and merges.

Re:JJ Cheat Sheet by rtpg on Tuesday February 11, 2025 @10:08PM (#43021396)
Unfortunately my merging experience has been mixed. I find the idiosyncratic merge markers to be overtly futzy (why are you indenting everything by a single character?), and the conflict resolution still is quite hand-hold-y.

It's never been wrong, but I am slightly unconvinced at how well merge conflict resolution works relative to git + rerere.

Re:JJ Cheat Sheet by martinvonz on Wednesday February 12, 2025 @03:14AM (#43023059)
You can try a different conflict marker style: https://jj-vcs.github.io/jj/latest/config/#conflict-marker-s...
Re:JJ Cheat Sheet by steveklabnik on Tuesday February 11, 2025 @09:38PM (#43021205)
If you truly miss bookmarks moving like branches, you can give this configuration option a try: https://github.com/jj-vcs/jj/discussions/3549
Re:JJ Cheat Sheet by rtpg on Tuesday February 11, 2025 @10:05PM (#43021378)
I have been finding the workflow I described to be quite helpful, because it also provides me a scratchpad that I associate to the branch. And since the tip is never the git head so when I have to fallback to git I'm "sure" I'm not operating on that.

I'm still experimenting with things, but I think my overall takeaway is that in jj my working copy is "on branch", so I should lean into that rather than try to emulate my older workflows too much. And this new workflow... I just find it better!

Re:JJ Cheat Sheet by steveklabnik on Tuesday February 11, 2025 @10:08PM (#43021394)
Oh yeah, I don't think your workflow is bad, you're not the first person who I've heard of give it a try. Just wanting to make sure you knew it was possible!
Re:JJ Cheat Sheet by notmywalrus on Tuesday February 11, 2025 @09:22PM (#43021096)
You may be interested in the semi-standard `jj tug` alias [1], that moves "the most recent" bookmark up to `@-`

[1]: https://github.com/jj-vcs/jj/discussions/5568

Re:JJ Cheat Sheet by oniony on Tuesday February 11, 2025 @11:14PM (#43021813)
This is great, thanks.
Re:JJ Cheat Sheet by setheron on Wednesday February 12, 2025 @01:26AM (#43022487)
Amazing alias I've adopted. Should be standard.
Re:JJ Cheat Sheet by abound on Wednesday February 12, 2025 @09:31AM (#43025757)
This is excellent, thank you! I've had my own `jj bm` (for "bookmark move") alias to do this, but that implementation is way better.