This one is what I call a “double-disclaimer”; a post so iffy that I need to stick not one but two disclaimers in front of it.
First of all, I’m glad people are making FOSS version control for the non-technical audience. Thank you for that. And if that, through your usability studies and such means that for that crowd, the “staging area” a.k.a. the “index” is just not worth its weight in confusion for them, that’s fine. Get rid of it.
Staging is a client side UI affordance, not something that really needs too be part of the wire format or the remote repo format. If I’m collaborating with Alice and Bob on the other side of the world and one of them is not using staging at all and the other is carefully staging everything, I wouldn’t be able to tell the difference. It’s one of those things that doesn’t hurt anyone else. Even though I sometimes think vim users should be required to wear bells to warn others of their presence, when all is said and done, they can receive & read text files and they can write & send text files, so they’re only hurting themselves. Or, if these UI studies are right, it’s us who are using staging who are only hurting ourselves.
Second disclaimer: I know that some of the non-staging tools like
jujutsu and gitless do have ways to do some of the cool things that
staging can do, like the jj split
command in jujutsu, and got even
has an optional index; if you run got stage you can stage things,
otherwise commits commit the entire thing.
So awesome is Magit and its staging area that I sometimes put a text file under git that I normally would never use VC for, just so I can revert hunks from commits and revert hunks from the staging area, too.
It sometimes feels like this wonderful time machine; I still use the weird default Emacs “undo chain” but that hardly matters with all the glorious powers of Magic available!
Jujutsu describes git’s staging area this way:
The index is very similar to an intermediate commit between HEAD and the working copy
That’s right, and that’s why jujutsu doesn’t need it, and that’s awesome. For them. But Magit leverages this feature of being almost-a-commit wonderfully because then I can revert hunks without ever having to have committed them! I can put all kinds of junk in my files and only commit the good things.
Now, in the grim darkness of the far future someone might come up with an Emacs interface for Pijul or for Jujutsu that is as awesome as Magit is, and when that happens, this essay is gonna look pretty wack. But it hasn’t happened yet.