Improve git stash handling for local changes
We have reports that kdesrc-build is getting confused compared to git about the status of local changes and whether a stash needs to be performed. This causes kdesrc-build to error out at the update stage for the module, and unnecessarily as well since the module is actually up to date.
git rebase --autostash seems reasonable but is too simplistic.
One possible alternative proposed by @ouwerkerk would be to always:
git stash listand note the number of stashes
git stash push -u .(i.e. include untracked files)
git stash listagain to see if the number of stashes changed
- Warn if it has
- Bring local clone up to date with remote
- Possibly make sure to warn again after the build when reporting success/error summary, because the user might have forgotten about this by the end of the
This all makes sense to me, but someone still needs to actually implement this and I won't let the old MR open just to track, so I'm tracking as an issue here instead.