3 ms·
Isn't the staging area just a stack of changes where stack height == 1?
by guytv 4y ago
Isn't the staging area just a stack of changes where stack height == 1?
- still_grokking 4y agoSure. And a branch is also just a stack of changes… The whole point is that this things are treated differently.
- tome 4y agoBut a branch is a commit but the staging area is an index, which is something different. Why two different concepts when one would do? That's my problem with the staging area.
- still_grokking 4y agoI don't care how this is implemented. You may be right that the implementation could be more streamlined. But I care only about the functionality. The whole point is to have some form of "draft commit". The staging area lets me "stash" WIP changes in a transparent way. Having a "draft commit" feature avoids the need to rewrite "bad commits" after the fact. The staging area is really useful to build up commits gradually. When thinking about it I've just realized that the staging area should not only be kept as a feature but could be even extended. You could add a "change-set management system"—which would be essentially multiple staging areas (maybe coupled to improved stash functionality to be able to quickly move / copy changes between change-sets). Yes, such a thing would very likely need to be built on top of the mechanics behind branches / commits. But this should be transparent and not interfere with the said features, imho.