4 ms·
Also check out lazyjj: https://github.com/Cretezy/lazyjj https://github.com/Cretezy/lazyjj
by eterps 2y ago
Also check out lazyjj: https://github.com/Cretezy/lazyjj https://github.com/Cretezy/lazyjj
- 0cf8612b2e1e 2y agoThe readme did not make it clear: does this have a TUI workflow for moving line chunks around? That is my one reluctance towards jj is that my (bad practices?) frequently have me touch a few different unrelated bits simultaneously (eg editing foo, but fix a typo in bar) which I use stage to iteratively commit. From the jj stuff I have read thus far, my workflow would be a bit clunky to adapt.
- steveklabnik 2y ago> frequently have me touch a few different unrelated bits simultaneously (eg editing foo, but fix a typo in bar) which I use stage to iteratively commit. From the jj stuff I have read thus far, my workflow would be a bit clunky to adapt. I do this too! I find it easier in jj than in git. I wrote out a lengthy thing about the "oh I found a typo" use case here: https://lobste.rs/s/yjqd6d/against_names#c_7yfw7g https://lobste.rs/s/yjqd6d/against_names#c_7yfw7g
- 0cf8612b2e1e 2y agoThanks for the write up, but that’s a bit more care and thought than I usually have. The outlined workflow is more, “I see a second change I need to do how should I prep for it”. Whereas I am more likely to do a bunch of work and try to separate it later. Again, not defending my workflow, just what I end up doing. The other response with the ‘jj split’ example is exactly the kind of workflow I envisioned where you can supposedly move the chunks between commits.
- steveklabnik 2y agoAhh yeah, if you want to take things apart after the fact, split is what you want. No need to be defensive about workflows! The fact that you don’t need to plan ahead is a strength of a tool, in my mind, not a weakness. Nobody would claim that someone is a bad engineer for saving a file when their work is in progress, and the same is true for version control as far as I’m concerned.
- aseipp 2y ago`jj split --interactive` is built in, and will handle that exact case for you. It also comes with a built in TUI so you can select lines right from the terminal immediately. You can even do `jj split --parallel` which will not only split the changes into two commits, but then make the commits siblings (instead of child/parent), so you can immediately push things if they're easy fixes. I have a base of B with my commit @ that contains a bunch of changes. B --> @ `jj split` will give me this graph, where `X` contains the changes I selected, and `@` contains all the changes I didn't select: B --> X --> @ Instead, if I did `jj split --parallel`, I would get this: B --> @ \ --> X Let's say `X` is a typofix and @ contains your feature you're not done with yet. OK, just run `jj git push -c X` and jj will create a branch name for you, and push it to the remote for code review. Done. You don't have to switch branches or do anything. You basically can just stop thinking about X since it will probably get merged.
- 0cf8612b2e1e 2y agoGreat visual and I will definitely have to check it out now.