>Michael Witten <mfwitten@xxxxxxxxx> writes: > ..., I think you essentially want to implement > "git checkout" with something like the following (this hack is **not** > meant as a solution; it is only meant to illustrate what I think is > Markus Elfring's desire): Your "checkout" needs a bit better error checking. For example, you don't want to "reset --hard" when stash failed for whatever reason. For performance and cleanliness reasons, it should first try a branch switch, and only after seeing it fail due to local changes, perform your stash-unstash magic. You would probably want to use the usual "stash save", as you will be consuming the stashed change yourself as its first user, and "pop" will clear it if things resolve cleanly, or the stash will be left as the first element to make it easy to re-attempt the conflict resolution. No need for stash-id nor special casing of detached HEAD situation. And it should do all that only under "-m" option, i.e. when the user indicated that s/he is willilng to face conflict resolution while switching. That would be a genuine improvement compared to the current system (and I suspect it would be easier to implement). "checkout -m" so far has been as bad as "CVS/SVN update" in that it can get you into an unresolvable mess without a chance to go back and retry. autostash will remedy that. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html