do not call update_alternates if package.importdir != package.srcdir

importdir != srcdir really says that the current package is not the
one being imported, and that the alternates list cannot be generated,
so skip the update.

This fixes a bunch of warnings when using importdir with cache, where
the alternates would basically be modified for each sub-package.
git: fix interaction between detached HEADs and only_local

When using local-only access and detached HEADs, the remote commit
was not properly resolved in #update, which would lead to an invalid
call to merge-base.
importers: streamline subprocess calling

This commit modifies all calls to Subprocess.run to get rid of Dir.chdir
as much as possible (with the longer term target to parallelize import),
as well as using Package#run instead of Subprocess.run directly. It finally
removes most calls to the backtick operator to call the autobuild run facilities
instead, ensuring proper quoting and error reporting
importers: make the retry behaviour a per-exception attribute

We basically only want to retry if the importer has hit the network.
In all other cases, the error is really final.
rework the windows handling code in Subprocess.run

The new code is a lot simpler, and also fixes a missing cleanup on
exception bug: if an exception was raised between the two chdirs, the
process would stay in the package's directory
git: simplify the update logic tremendously, and fix unncessary detached HEAD situations
git: reset --hard must be run with a working copy
display error messages on STDERR
allow passing IO objects directly as input to Subprocess.run
git: be more specific in the rescue clause of #rev_parse
git: define #show
remove 1.8-compatibility code
chomp the lines output by subprocesses in Subprocess.run
git: rename on_target_branch? to on_local_branch?
git: never create a detached HEAD

The current behaviour when commit: or tag: was given was to create
a detached HEAD, which is really really less than ideal.

Since we are going to use those a lot more, this commit tries to find
a better way. Namely, autobuild now resets the local branch to the
commit while trying to preserve uncommitted changes. It will do so
only if the branch contains only commits that are already on the remote
origin.
document Subcommand.run
git: add support to test the git version

While most of the git CLI is fairly stable and backward compatible,
it happens that it breaks. For instance git update-index --cacheinfo
was given arguments delimited by spaces but is now (2.1.0) expecting
them with commas.