I find the power of the stash in "stash pop", which applies, and drops if there were no conflicts:
git stash push
git checkout -b newbranch upstream/right
git stash pop
and yeah, if your keep your branches long-term stash is not a good solution for this.The advantage of stash is that it's quicker and easier than creating and cleaning up branches. If you're naming stashes and keeping them longterm, then you're basically using them like branches and should consider what benefit you're getting from adding a separate workflow.
Sometimes those botched mergeds have been due to my own incompetence, sometimes due to P4Merge literally corrupting my file and saving out something totally different than what I'd resolved, and sometimes due to unexpected refactoring between branches causing enough of a mess that reapplying the work by hand is easier than "resolving" the conflict.
I like making all my commits “canonical at all times,” but that’s just something I can see it’s time for me to evolve beyond.
But what I'm not doing is saying "you should always use stash". I'm providing use cases, for me personally, where stash is the correct approach.
"Ah", but you might be inclined to argue, "such and such a reason". Yes, but also no.
Right tool for the right job is also an argument for competency and context. Sometimes a hammer is useful for more than just hammering, but very rarely.
The point is there is usually more than just 1 approach, and niche/edge cases can be real nasty if approached with the attitude that everything is a nail
Stashes are just another form of DAG node with their own special syntax and commands and quirks. I've already learned one set of commands for all that, why learn a second, less general set of commands?
I have started using stashes in one very specific case:
1. I realize I'm on the wrong branch 2. I've made no commits 3. The right branch has changes to files I've modified
Careful and safe, but not actually much faster than my old workflow, and I haven't the foggiest idea how to fix things up with stash if I've made several commits, if that's even a thing. Depending on if you count the optional commands, that's one more or one less command. "Those aren't optional!" you might say - but yes, they are. I'll often merely amend my WIP commit into a real one instead of resetting. I'll often keep dead branches long term - perhaps some of my work relied on things that haven't landed on upstream/right yet, and can't be brought over sanely until upstream/wrong lands on upstream/right, or just for peace of mind that I might've forgotten something. Good dead branch names makes this less painful than... numbered stashes? Eww, gross.