Add support for "restore --sparse"

Thanks to Patrick Rouleau <prouleau72@gmail.com> for spotting a
serious potential short-write problem in an earlier revision of this
work, and suggesting other improvements.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test-cat-file.sh: handle hashsplit bupm files

A bit back we started allowing .bupm files to be hashsplit:

  ee777400cf624b4f7a24b15614c2b6c745560dcb

So add t/git-cat-tree and use it in test-cat-file.sh to prevent the
test from crashing whenever the bupm is a tree.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test-meta.sh: finish renaming variables

Apparently the changes started here weren't completely finished;
finish them:

  b836113e503ab3f8e3c30c3283eb59f936fb0023

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test-meta.sh: escape user/group expressions

Escape external user/group strings before passing them to 'grep -E',
otherwise calls like this will fail when the string includes regular
expression metacharacters:

Thanks to Pierre-Emmanuel Novac <piernov@gmail.com> for reporting the
problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Change incorrect unknown-owners references

The test program is actually called unknown-owner (t/unknown-owner).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test-meta.sh: add missing "$() || exit $?" tests

Their omission was masking bugs fixed in several of the previous
commits.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Allow per-instance specification of the repo_dir for CatPipe

This allows the creation of CatPipes that refer to repositories other
than the default, which in turn allows copying between repositories,
etc.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Allow the specification of a repo_dir to some VFS and git operations

Previously, these VFS and git operations would only operate on the
default repository (git.repo()).

Have vfs.cp() handle more than one repository (via an internal cache).

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
git.py: allow the specification of a repo_dir to update_ref()

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
git.py: generalize update_ref() to support tags in addition to heads

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Makefile: Rewrote so that 'make bup' can be up-to-date
bup cat-file: Added --ref option to specify branch or commit hash.

This option uses git's "git rev-parse" functionality, which resolves
ref's such as branches, tags, or commit hashes. If mybranch is the
name of a branch, "bup cat-file --ref=mybranch path/to/myfile" uses
rev-parse to resolve the commit hash of the commit mybranch points to.
This also enables us to use notation like mybranch^ which refers to
the commit preceding the commit pointed to by mybranch (if mybranch
has exactly one parent). Furthermore, if the commit hash is known, it
can be given directly as --ref=myhash.
Added command "bup log"

"bup log" can be used to inspect the backup history.
It is a wrapper for "git log" and "git diff-tree" and uses them in a
way that is convenient for the bup use case. Furthermore, "bup log"
knows about name mangling and will hide the name mangling from the
user, a feature that "git log" cannot provide directly.
The man-page contains detailed information and examples.
Added command "bup pick-saves"

This low-level command generates a new branch.