3 ms·
How do you test these intermediate commits, given that they're different from what's on disk?
by ori_b 8y ago
How do you test these intermediate commits, given that they're different from what's on disk?
- war1025 8y agoUsually I test the end result. Or the commits are disjoint enough that I am confident that they don't interfere with each other. If I really care about things being fully correct at each commit, I'll do an interactive rebase and just stop and test on each commit.
- doublerebel 8y agoCI/CD. I push, it tests, I keep staging and working.
- laughinghan 8y agoIn the case of console.log() and debugger breakpoints, that's not a concern. Often they're disjoint enough that I'm confident that if the end result works, the intermediate commit works, as the sibling commenter mentioned. (Even if not, on many teams it all gets squashed anyway, the intermediate commit message just makes the Pull Request easier to review.) I can also often easily comment out the uncommitted stuff. Finally, if I'm really worried about it, after creating the intermediate commit I can just `git stash`, test it, then `git stash pop` and keep working.