| > Second, it's not even so much about the validating a commit (which, for intermediate steps, it might not do), but so that each commit hangs together and a change as a logical unit doesn't exist partly in one and partly in another commit [1]. That's what review is for. > Conceptually, the whole staging process flies in the face of the idea that a commit should represent an atomic repo change No it doesn't. The staging area is precisely what allows you to carefully build a commit. Before git, we had to do the same by backing up the modified files somewhere else and creating a commit, then bringing them back. I used to use CVS, then Subversion, then a mix of Darcs and Arch, before git finally solved it. > One is that if you need additional tooling to work around a problem in an existing tool You're assuming there's a problem. There isn't. > Mind you, there's the problem that commits are really used for two different things, one is to capture conceptual steps and one is to to do quick save of the repo state Using commits to save state is bad and I've forbidden it in my team. Jujutsu makes it more convenient so that uncommitted state is itself a special commit that gets pushed to the server, but the real solution is what Google's SrcFS does: workstations checkout code on top of a FUSE filesystems that really gets saved on the server side, so state can never get lost on a single machine. |
This would mean that you're changing already pushed commits, leading to mutable shared state, which is also not a desirable situation. (Aside from the fact that fixing up commits can be a somewhat painful business in Git.)
Also, this seems to be an inconsistency in your position. If it is okay to have poorly built commits because you can fix them after code review, why is building them carefully in the first place important?
> No it doesn't. The staging area is precisely what allows you to carefully build a commit. Before git, we had to do the same by backing up the modified files somewhere else and creating a commit, then bringing them back. I used to use CVS, then Subversion, then a mix of Darcs and Arch, before git finally solved it.
This is interesting, because Arch already had the concept of a stash (via the oddly named `tla undo/redo`, even if like much of Arch, it was a bit primitive). In any event, stashing/shelving as a concept already does what you want a staging area to accomplish, as I had pointed out above, without the problems introduced by the staging area. In general, the "backing up the modified files somewhere" was made unnecessary in most version control systems a long time ago.
> Using commits to save state is bad and I've forbidden it in my team. Jujutsu makes it more convenient so that uncommitted state is itself a special commit that gets pushed to the server, but the real solution is what Google's SrcFS does: workstations checkout code on top of a FUSE filesystems that really gets saved on the server side, so state can never get lost on a single machine.
You seem to have misread my statement, as I pointed out that this is a problem; we are not disagreeing here. That git does not really have a good way to support the functionality of saving repo state is the actual issue, but a shortcoming that is shared by almost all VCSes.
Doing this at the file system level is also not really adequate. It does not replicate the functionality of temporary snapshots and if it did (like the local history in JetBrains IDEs), it would be cumbersome.