get_sha1() shorthands for blob/tree objects
This is a fairly straightforward patch to allow "get_sha1()" to also have
shorthands for tree and blob objects.
The syntax is very simple and intuitive: you can specify a tree or a blob
by simply specifying <revision>:<path>, and get_sha1() will do the SHA1
lookup from the tree for you.
You can currently do it with "git ls-tree <rev> <path>" and parsing the
output, but that's actually pretty awkward.
With this, you can do something like
git cat-file blob v1.2.4:Makefile
to get the contents of "Makefile" at revision v1.2.4.
Now, this isn't necessarily something you really need all that often, but
the concept itself is actually pretty powerful. We could, for example,
allow things like
git diff v0.99.6:git-commit-script..v1.3.0:git-commit.sh
to see the difference between two arbitrary files in two arbitrary
revisions. To do that, the only thing we'd have to do is to make
git-diff-tree accept two blobs to diff, in addition to the two trees it
now expects.
Signed-off-by: Junio C Hamano <junkio@cox.net>