Rendered at 22:49:42 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
BeetleB 11 minutes ago [-]
> If you’re not already using git add -p to stage your commits then you’re missing out.
After switching to jujutsu, I assure you I don't miss this feature.
jj takes the opposite approach. It keeps staging things, and you use split whenever you want to separate things out.
(And yes, it stores the staged changes as revisions, so you can always back out to a previous staged state).
pmarreck 7 minutes ago [-]
I've sadly had to back out of using jj after leaning into LLM coding assistance, as, even with an extremely well-written jj guide in its context (and literally blocking the use of git), it never failed to screw things up more than if I was just using git (I call this an "LLMpedance mismatch" problem)
If LLM coding assistance continues to increase, it's going to be a rather large speed bump to cross
One of the biggest problems is actually unsolvable if you want to keep colocated Git and git tooling around, because it has to do with how jj fundamentally works: detached HEADs, detached HEADs everywhere
You yourself may not use AI, this is for those who do and are interested in switching to jj
BeetleB 3 minutes ago [-]
I don't let LLMs make commits for me - git or jj.
OK, OK - I lie. For personal projects I do - some handle jj decently well. But at work I don't let it make any commits ... and it never tries to.
What tools are you using that won't work with detached heads?
ninkendo 5 minutes ago [-]
[delayed]
chriswarbo 23 minutes ago [-]
Magit allows selective staging/unstaging, either of hunks, or by selecting lines (AKA Emacs's "region"). I avoid staging from the git commandline, unless I'm just doing whole files.
PS: Majutsu provides this too (a magit-like tool for jj)
natbennett 45 minutes ago [-]
In the case of a newly committed file you can add just the file with
git add . -N
And then review the text itself as part of the git add -p workflow
goosejuice 11 minutes ago [-]
I always use git add -i which is just one level up. The tui is pretty intuitive for day to day tasks, including staging partial chunks or lines of code.
zikohh 53 minutes ago [-]
I find splitting hunks a pain. I wish I could just split by line, would be a great feature.
KwanEsq 11 minutes ago [-]
Mercurial's `hg commit -i` with the curses interface is so much better for this it's not even funny. Fortunately I'd assume Jujutsu's UX is similar, based on arccy's comment.
LVB 44 minutes ago [-]
Use 'e' in -p mode and you can edit the hunks as you wish, choose lines, etc.
embedding-shape 36 minutes ago [-]
The whole "Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P,?]?" line is pretty intimidating, but I urge anyone who still wants to understand git and be able to (themselves) use it effectively, to do "?" when you see it, read through what each action does and forcefully try them out to see what they do, in some low stakes project. Ends up being a super quick way of staging a whole bunch of work and avoiding staging other, but it's pretty weird at first glance.
petepete 45 minutes ago [-]
I've used tig for longer than I can remember for my selective staging needs.
arccy 25 minutes ago [-]
use jj, the default is to select by line
Topgamer7 4 days ago [-]
I find grepdiff and this function are pretty useful if you want to pull certain hunks out of a large change set:
#!/bin/bash
# Put this into your .bashrc, or whatever.
function git-add-regex {
git diff -U0 | grepdiff -E "$1" --output-matching=hunk | git apply --cached --unidiff-zero
}
After switching to jujutsu, I assure you I don't miss this feature.
jj takes the opposite approach. It keeps staging things, and you use split whenever you want to separate things out.
(And yes, it stores the staged changes as revisions, so you can always back out to a previous staged state).
If LLM coding assistance continues to increase, it's going to be a rather large speed bump to cross
One of the biggest problems is actually unsolvable if you want to keep colocated Git and git tooling around, because it has to do with how jj fundamentally works: detached HEADs, detached HEADs everywhere
You yourself may not use AI, this is for those who do and are interested in switching to jj
OK, OK - I lie. For personal projects I do - some handle jj decently well. But at work I don't let it make any commits ... and it never tries to.
What tools are you using that won't work with detached heads?
PS: Majutsu provides this too (a magit-like tool for jj)
git add . -N
And then review the text itself as part of the git add -p workflow
Also, you can use -p for stash push