UseSWIG: Enable NO_SONAME on swig modules (#14815)

Swig modules are plugins and do not need the SONAME field set.
Merge topic 'UseSWIG-NO_SONAME' into next

f26147b8 UseSWIG: Enable NO_SONAME on swig modules (#14815)
ExternalProject: Strip trailing space from git hash
ExternalProject: Improve handling of git remote branches

ExternalProject handles git remote branches by commit hash. Due to
this, the git repository ends in detached states, and local commits
are discarded.

Use "git rebase" for remote branches instead of "git checkout".  If
there are uncommitted changes, use "git stash save/pop" to save changes
and restore them after the rebase.  If any of these operations fails,
try to restore the original status and exit with a fatal error, asking
the user to resolve the conflicts manually.

This also makes the behaviour of ExternalProject using git more similar
to the svn version, and probably more likely to what the user expects
by setting GIT_TAG to a branch.
Merge topic 'ExternalProject_GitUpdate' into next

f2128d4c ExternalProject: Improve handling of git remote branches
ff2451dc ExternalProject: Strip trailing space from git hash