4 ms·
Not a fan of the staging area, because it won't be tested. I would rather stash some changes to postpone them, then test and commit the workspace.
by erik_seaberg 3y ago
Not a fan of the staging area, because it won't be tested. I would rather stash some changes to postpone them, then test and commit the workspace.
- thiht 3y agoWhat does the staging area has to do with tests?
- erik_seaberg 3y agoWhen the workspace and the staging area aren’t in sync, the differences cannot be tested because the compiler doesn’t know how to deserialize the .git/index blob. The workspace is stored as normal source files, and committing those would be better.
- bshacklett 3y agoThat would remove a huge amount of flexibility from the commit process, though. git add -p (and its siblings) are a huge part of my workflow. I often work on multiple changes at once, but break them out into their own atomic commits with the ‘-p’ flag. What would be great is a simple way to have build/lint/etc. tools look at the staging area instead of the workspace.
- erik_seaberg 3y agoFor what it’s worth, I didn’t have much trouble switching from “git add -p” for changes I want now to “git stash -p” for changes I want later.
- bshacklett 3y agoI’ll definitely give that a try