← Back to context

Comment by ninkendo

4 hours ago

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.

From the article, try J and K instead of j and k; that moves to next/previous hunk, not next/previous unreviewed hunk.

  • 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.)

From skimming through the article, isn't that what the uppercase variants do?