News for hackers. Stuff that matters.
Re:Show HN: `Git add -p` with multiple buckets by renewiltord on Saturday March 19, 2022 @03:18PM (#30736785)
Oh this is interesting. Sometimes I make unrelated changes and then I want to tease the things apart at commit time. And when I do I find that I don’t just want to stage or skip staging. Worth a shot but I’d prefer if I could put it into secondary staging and post-commit the first of those becomes staged.

Probably doable and shiftable to a git-splitpatch too.

Re:Show HN: `Git add -p` with multiple buckets by Sharlin on Saturday March 19, 2022 @04:33PM (#30737349)
In modern gits you can also `git stash -p` allowing you to use (named if needed) stashes for that purpose.
Re:Show HN: `Git add -p` with multiple buckets by aleclm on Saturday March 19, 2022 @05:41PM (#30737819)
This is different.

The key value of `split-patch` is that you can create as many patches (commits) as you want by doing a single pass over the (potentially large) patchset.

If you're willing to do multiple passes over the patchset, you could `git commit` right away.

Anyway, cool, I didn't know you could name stashes!

Re:Show HN: `Git add -p` with multiple buckets by chx on Saturday March 19, 2022 @04:12PM (#30737151)
perhaps as branches? then we can cherry pick those as needed.
Re:Show HN: `Git add -p` with multiple buckets by OJFord on Saturday March 19, 2022 @05:03PM (#30737569)
Stashes are more appropriate; since they're really just handier references to commits they can be cherry-picked too, as `stash@{N}` where N is the zero-based integer for which one you want.

(You can even `git cherry-pick stash@{0}^` for the commit the stash was made at. It really is just a commit made at that point, with that parent, only without updating HEAD, or the checked-out branch.)

Re:Show HN: `Git add -p` with multiple buckets by chx on Saturday March 19, 2022 @07:54PM (#30738680)
Thanks for reminding me, I have used arbitrarily named refs before just slipped my mind. So it could be like 'refs/patches' or whatever. I used refs/backups in my safety net https://gist.github.com/chx/3a694c2a077451e3d446f85546bb9278