Remix.run Logo
gpm 3 days ago

The default command you should reach for with jj to checkout a branch is `jj new branch` which creates a new commit to store your debug prints. You shouldn't do a two step process where you can forget the second step in the first place.

That said, if you do for whatever reason run `jj edit branch` instead (which enables the case you are discussing), jj will have snapshotted the previous change so you can still automatically revert the debug prints using

   jj evolog; jj restore --from old_commit_id
IshKebab 3 days ago | parent [-]

Ah interesting. That makes sense, thanks!

kps 3 days ago | parent [-]

Better still, you can keep your debug printfs around on top of your ‘pushable’ work, and they'll be automatically be rebased as the tree changes underneath. If there are conflicts, you don't have to deal with them unless and until you actually want to use the conflicted code again.