fast-import: Let importers retrieve the objects being written
As the description of the "progress" option in git-fast-import.1
hints, there is no convenient way to immediately access the objects
written to a new repository through fast-import. Until a checkpoint
has been started and finishes writing the pack index, any new blobs,
trees, and commits will not be accessible using standard git tools.
So introduce another way: a "cat" command introduced in the command
stream requests for fast-import to print an object to the same
report-fd stream used to report commits being written.
The output uses the same format as "git cat-file --batch".
Like cat-file --batch, this does not provide an option to dereference
objects to a type of the requestor's choosing. Tags are presented
as tags, commits as commits, and trees as trees.
Objects can be specified by path within a tree as well, using a
cat TREE "PATH"
syntax. With this syntax, also, the tree can only be specified by
:n marker or 40-digit tree id.
Cc: Shawn O. Pearce <spearce@spearce.org>
Cc: David Barr <david.barr@cordelta.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>