Set to avoid switching git-branch if we had to stash changes, at least as a default.
From IRC:
[13:07] <CarlSchwan[m]> Is there a way for kdesrc-build to not try to switch branches and breaking stuff when stashing/poping?
[13:16] <mpyne> You can use --no-src to skip source updates completely. If it's doing an update it's normally going to try to match the branch setup in the config file. There's not currently a separate option to just avoid switching branches but otherwise do an update (aside from the unwieldy --set-module-option-value to temporarly set the 'branch' option for the module bugging you)
[13:24] <ahmadsamir> {could/is} there {be} an option "if it's not on master or there are uncommitted changes, bail out" ?
[13:30] <CarlSchwan[m]> yeah, I usually do --no-src to just build, but this time it was as a part of a normal kdesrc-build to update all my packages
[13:30] <CarlSchwan[m]> it stashed my change from a branch, switched to master and then pop the stashed change. That broke a few things :/
[13:31] <CarlSchwan[m]> I didn't had that much unstaged changes so I could figure out a way to fix things
[13:34] <mpyne> Hmm, I can set it so that it doesn't switch branch unless there's nothing to stash. With a warning, of course.
Switch branches makes sense, and stashing local changes makes sense, but it probably doesn't make sense to switch branches and stash (and reapply) local changes.
If there are local changes and the branch is wrong, we should instead either:
- Do nothing at all for the update (and complain to the user), or
- Do the stashing drill but run the update for the existing branch rather than the configured one.
2 is probably better but might start with 1 as it is easier.