4 ms·
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
by renewiltord 5y ago
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.
- chx 5y agoperhaps as branches? then we can cherry pick those as needed.
- OJFord 5y agoStashes 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.)
- chx 5y agoThanks 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 https://gist.github.com/chx/3a694c2a077451e3d446f85546bb9278
- Sharlin 5y agoIn modern gits you can also `git stash -p` allowing you to use (named if needed) stashes for that purpose.
- aleclm 5y agoThis 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!