by rbehrends · 1w ago · 0 comments
> Stashing might be "clean" - but "clean" just means primitive in this sense, it's a bad thing - but it destroys local state and I don't want that.
Stashing is the logical inverse of staging, with the stash taking the place of the staging area. It is not more or less primitive than the staging area and it does not destroy local state, as it is entirely and easily reversible and composes with other operations (esp. if unshelving is implemented via a proper merge as it should be). There is nothing sacrosanct about local state; it gets changed or "destroyed" everytime you modify a file. This is normal for a worktree. In addition, it allows you to actually see what the commit looks like before you commit it, to view, compile, or test it as needed, rather than just eyeballing it.
> The problem is in the UI, all those operations can be expressed much more naturally if one used a good UI like Magit.
If that is your argument, then you do not need a staging area for your apparent use case, as you can select the changes you want to commit in the UI (in fact, in JetBrains IDEs that works analogously regardless of whether you use git or another VCS without a staging area). In this case, having the staging area is empty ceremony.
We won't because you're set on having a local-only (or local-first) workflow whereas I want a system where the remote CI/CD service is an essential part. I'm only interested in a development flow that requires Internet connection at all times, especially for enterprise work.
> It is not more or less primitive than the staging area
I should have said "crude". Stashing is simply a poor choice.
> as it is entirely and easily reversible
It's not: often, after stashing you realise you need to make further modifications, after which the stash doesn't apply any more and even a proper merge is not guaranteed to work.
> There is nothing sacrosanct about local state; it gets changed or "destroyed" everytime you modify a file
There's everything sacrosanct about it. I don't want a VCS to do that without my consent.
> In addition, it allows you to actually see what the commit looks like before you commit it, to view,
I don't need to view it that way. I will upload the commit to the online UI and view it there.
> compile, or test it as needed, rather than just eyeballing it.
I don't want to compile or test locally. The CI/CD environment assures repeatability and has access to many orders of magnitude more compute.
> If that is your argument, then you do not need a staging area for your apparent use case, as you can select the changes you want to commit in the UI (in fact, in JetBrains IDEs that works analogously regardless of whether you use git or another VCS without a staging area). In this case, having the staging area is empty ceremony.
The staging area is a necessary primitive. On a VCS that doesn't have it, JetBrains will have to implement it.