4 ms·
I’ve been toying with various ways to do this. Some alternatives I’ve thought of: - a “draft commit”, where you can amend a bunch of changes into a commit befo
by wolfgang42 4y ago
I’ve been toying with various ways to do this. Some alternatives I’ve thought of:
- a “draft commit”, where you can amend a bunch of changes into a commit before finalizing it.
- default to “git commit --all”, and allow the user to “git commit --patch” where needed
- as 'anthomtb says, `git stash push --patch` (I also find myself wishing for `git stash pop --patch` so you can shove bits in and out of a stash as needed.)
- OkayPhysicist 4y agoIsn't a "draft commit" the same thing as the staging area?
- wolfgang42 4y agoThe main differences I’m imagining are: a) terminology: it’s one less concept to have to wrap your head around; and b) a draft commit would also have a draft commit message, and (though I’m admittedly not sure about how well this part would work), draft parents (probably supporting refs rather than just commits as parents) so you can have multiple of them and shuffle them around conveniently. (This also sort of subsumes the stash as well.) I made a preliminary stab at this a while back, though it has some awkwardness and I haven’t had a chance to revisit it recently: https://github.com/wolfgang42/git-draft/ https://github.com/wolfgang42/git-draft/