fast-import: Let importers retrieve the objects being written
commit8b173069f84026d63ba5317e4d663c1ffe4ea193
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 5 Sep 2010 03:41:17 +0000 (4 22:41 -0500)
committerDavid Barr <david.barr@cordelta.com>
Fri, 10 Sep 2010 04:26:22 +0000 (10 14:26 +1000)
tree07480eb5b384f49a46f5bbdbe503584475b5fd17
parente491caff0cbbaa0289087afe3c032c6a44054dea
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>
Documentation/git-fast-import.txt
fast-import.c
t/t9300-fast-import.sh