git-cvsimport-3: don't execute subcommands with the shell

Creating command strings to execute subcommands via the shell means that
care needs to be taken to quote any user-supplied values, but Python
provides a better way by passing a list of arguments when creating
subprocesses.

Make this change, changing pipelines that currently use the shell to use
pipelined subprocesses.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: actually invoke git-branch

The command called if a branch is renamed is "branch -m".  This should
clearly by "git branch -m".

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: fix moving tags

The command "git tag -f $tag $changed" moves $tag to point at commit
$changed but $changed is the new name for the tag.  Fix this by
reordering the arguments to "git tag".

Also add a call to "git update-ref -d" to remove the old tag.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: use for-each-ref not "branch -l"

git-branch is a porcelain command, switch to the plumbing command
git-for-each-ref so that we're not relying on the output format of
git-branch.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: use for-each-ref not "tag -l"

git-tag is a porcelain command, switch to the plumbing command
git-for-each-ref so that we're not relying on the output format of
git-tag.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: use git-update-ref to modify refs

Instead of the porcelain command "git-tag" use "git-update-ref" when
tags need to be renamed.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
Is there a way to move a branch's reflog using plumbing commands?
git-cvsimport-3: checkout the new tree correctly

Once the import has finished, the branch pointed at by HEAD may have
moved.  "git checkout -q" isn't sufficient to change the working tree -
use "git checkout -f" as git-cvsimport-2.perl does.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
Should we be asserting that the working tree is not dirty before
starting the import, in the same way the git-rebase does?
git-cvsimport-3: don't allow more than one module

Raise an error if more than one module is specified on the command line.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: read configuration from git config

git-cvsimport-2 supports reading options from the Git repository into
which it was importing.  Make git-cvsimport-3 do the same.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: change subprocess helpers to passthrough args

This allows us to use the do_or_die() and capture_or_die() helpers for
all invocations of subprocesses, even when we need to specify custom
stdin or stdout.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: add a version check for new features

Instead of failing with an obscure cvsps error if a feature that is
required is not supported, add a way to check for a given version before
invoking cvsps.

Signed-off-by: John Keeping <john@keeping.me.uk>
git-cvsimport-3: pass "-i" to cvsps for incremental imports

This flag is required for cvsps to output the correct incremental
fast-import stream, so git-cvsimport-3 will fail if the available cvsps
does not support it.

Signed-off-by: John Keeping <john@keeping.me.uk>