News for hackers. Stuff that matters.
Re:Staging patches with Git add -p by ninkendo on Wednesday July 29, 2026 @06:44PM (#49104065)
My biggest problem with `add -p` is correcting any patches I added or rejected by accident. Often times I skip through dozens of things I don’t want to add, then realized that last hunk was something I did need. But I can’t re-visit it, I have to start over and try extra hard to not skip past it again.

I wish the j and k shortcuts could revisit hunks I’ve already added/rejected, not just ones I haven’t reviewed yet. On a large set of unstaged changes that you mostly don’t want, it really sucks to “lose your place” in the list of hunks.

Re:Staging patches with Git add -p by topsecret on Wednesday July 29, 2026 @07:20PM (#49104348)
From the article, try J and K instead of j and k; that moves to next/previous hunk, not next/previous unreviewed hunk.
Re:Staging patches with Git add -p by ninkendo on Wednesday July 29, 2026 @08:11PM (#49104692)
To you and the sibling commenter:

D’oh. I should have reviewed the docs better, you’re totally right. Now I feel dumb. Wish I would’ve learned this a long time ago. (Or maybe I did and forgot, perhaps multiple times. I’ve used git basically daily since 2006. I’ve forgotten a lot.)

Re:Staging patches with Git add -p by ghrl on Wednesday July 29, 2026 @07:09PM (#49104276)
From skimming through the article, isn't that what the uppercase variants do?