Hacker News new | past | comments | ask | show | jobs | submit login

I think there’s some Stockholm Syndrome [1] thing going on with the staging area. It confuses noobies and it’s easy to make mistakes.

I think we’ll be okay with this stack workflow [2] taken from Mercurial’s Evolve command [3].

[1]: https://en.wikipedia.org/wiki/Stockholm_syndrome

[2]: https://sapling-scm.com/docs/overview/stacks

[3]: https://www.mercurial-scm.org/doc/evolution/tutorials/topic-...




> I think there’s some Stockholm Syndrome

I lived through the alternative and the staging area is superior. If it wasn't, I might not be using Git, or at least begrudge when I have to; neither is the case.


Isn't the staging area just a stack of changes where stack height == 1?


Sure. And a branch is also just a stack of changes…

The whole point is that this things are treated differently.


But 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.


I 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.


Which part of the stack features would replace the staging area? I see nothing in this regard. Was the right documentation site linked?

I also don't see anything that couldn't be trivially added to Git. A few lines of shell script would likely suffice. What do I miss here?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: