When using a versioning system, one is often tempted producing 'clean' commits, ie commits that actually make sense, and are compilable (and nice to read for other developers).
As a natural effect of this, commits are usually done pretty late ('when it works').
It mitigates one of the benefits of version control : being able to revert to a state where 'it used to work' and where you wouldn't have rage-deleted a huge chunk of code which wasn't yet committed.
Eclipse has a built-in function for this (local history), but it is IDE dependent.
Is there any similar mechanism with one of the popular VCS (git, mercurial..), potentially as an extension/plugin?
Ideally, it wouldn't interfere with the main commit history, but maintain a parallel 'history of uncommitted changes'.
If such a thing doesn't exist, I might be tempted to write one.
Clarification : I'm well aware of the local branch + rebase or histedit, but I'm asking for an automated and easy to setup solution. If I have to commit frequently I may has well forget/get lazy about doing it, especially if it implies manual clean up (the rebase part) later, for each real commit. The main goal is to provide a safety net for the developer, and people usually realise they need that net just when they are already falling...