git: Fix detection of repos with local changes to stash.

Authored by mpyne on Mar 13 2020, 2:06 AM.


git: Fix detection of repos with local changes to stash.

kdesrc-build can get confused about whether a git repository has local
changes or not. This is a problem because if there are no local changes,
but kdesrc-build thinks there were local changes, kdesrc-build will try
to have git stash those local changes. If there is no such change to
stash, git-stash will still succeed, but the later git-stash command to
reverse the operation will fail (because there's no stash to reverse).
This then causes kdesrc-build to fail the update.

The issue, as found and fixed by Bruno Carvalho, is that the
git-status command kdesrc-build uses to see if there are local changes
can output a header even with the --short option passed, if the
status.branch option is set for the user's git configuration.

The fix is to use an underlying facility in git to generate diffs
directly and have git itself return an exit code to flag whether there
are local changes.

Another potential issue which I hope this will fix is that
git-submodules have also been known to confuse kdesrc-build here,
especially with Qt5's qtwebengine. But we'll see.

Differential Revision:


mpyneMar 13 2020, 2:06 AM
Differential Revision
D27639: Fix ksb/Updater/Git mislabeling dirty git trees
R365:4f2d2024990b: GIT_SILENT made messages (after extraction)