3 ms·
This actually... makes a ton of sense. Just as one example, automatically stashing and unstashing when switching branches is so obviously convenient, in hindsi
by crazygringo 6y ago
This actually... makes a ton of sense.
Just as one example, automatically stashing and unstashing when switching branches is so obviously convenient, in hindsight I'm puzzled as to why git doesn't just do this automatically.
So whatever happened to this project?
In the same way SourceTree adopted git-flow with a few special menu commands, I'd love to also see it be able to adopt a "gitless" mode.
Because the great thing about this model is that it can still remain the more complicated git underneath. It just makes using it more straightforward.
- deathanatos 6y ago> Just as one example, automatically stashing and unstashing when switching branches is so obviously convenient, in hindsight I'm puzzled as to why git doesn't just do this automatically. Yeah, I too have wished for this. Do note that that can fail, if there are conflicts, so you'd have to decide whether to fail the command (like today) or to drop the user into conflict resolution.
- hvdijk 6y agoThat's the exception, though. If the changes are automatically stashed when you switch away from a branch, restored when you switch back, and operations that act on branches require you to first switch to that branch, the stash and branch won't get out of sync, the stash will be right on top of the branch. Conflicts shouldn't happen unless you do weird things like reset a branch (git checkout -B) or update it directly without checking it out (git update-ref), in which case you might not even need conflict resolution, such operations might just be specified to immediately drop the stash.
- jmchuster 6y agoI've used Tower for a couple of years, and that's exactly what it does. Auto-stash, re-apply stash when switching branches, and then you have to resolve the merge conflict in the UI if it doesn't re-apply cleanly. Or you just stash if you didn't actually want to re-apply those changes after all, but I've found the default to re-apply to be what I wanted the majority of the time.
- hvdijk 6y agoGit could not do this (automatically stashing and unstashing) in a backwards-compatible fashion, but it could be opt-in with a new config key and does seem like a very useful feature. It also seems like one that should be relatively easy to implement as all the main logic to actually stash and unstash is already part of Git, it would merely need to be saved to a different ref than refs/stash, so all it needs is someone with enough interest to actually implement it.