3 # Cat file(s) by filename from given tree or revision
4 # Copyright (c) John Ellson, 2005
6 # Cat a file of a given filename in a given revision (or in the current
11 # -r TREE_ID:: Look for file in the given revision or tree
12 # ID of the revision or tree where to look for the file, instead of
18 # Initiated from a request from: erg@research.att.com
19 # for an equivalent to "cvs co -p <filename>"
20 # Question posted with really bad initial solution: ellson@research.att.com
21 # Suggestions offered by: Johannes.Schindelin@gmx.de
22 # rene.scharfe@lsrfire.ath.cx
23 # This solution based on posting from: torvalds@osdl.org
24 # Polish and test by: ellson@research.att.com
26 USAGE
="cg-admin-cat [-r TREE_ID] FILE..."
29 .
"${COGITO_LIB}"cg-Xlib ||
exit 1
40 [ ${#ARGS[*]} -ge 1 ] || usage
42 id
=$
(cg-object-id
-t "$rev") ||
exit 1
44 git-ls-tree
"$id" "${ARGS[@]}" |
45 while read -r mode
type sha name
49 git-cat-file blob
"$sha"