If I really want to make sure, I do:
1. git stash
2. build + test
3. commit
4. git stash pop
> Some projects might not have a CI at all.
Well, then you have bigger problems. Without CI, how would you even know if your projects compiles on other platforms?
When I really want to do your workflow, here is what I do. Add all the debugging print statements and commit them separately in another branch. When I want to include the debug statements, I just cherry-pick the commit with those things.
This way I remove the overhead of doing a staging before every damn commit and still retain the ability to pull in debugging changes whenever I want them.
>Without CI, how would you even know if your projects compiles on other platforms?
Not everything need to be cross platform! And not everything need CI..