From: Rene Scharfe Date: Tue, 09 Aug 2005 22:18:42 GMT Subject: Re: Newbie question: equiv of: cvs co -p ? Message-ID: <42F92BC2.20406@lsrfire.ath.cx> In-Reply-To: Johannes Schindelin wrote: > On Tue, 9 Aug 2005, John Ellson wrote: >>How can we cat the latest committed state of a file to stdout? >> >>I hacked this: >> >> #!/bin/bash >> ID=`git-ls-files -s | grep $1 | cut -d ' ' -f 2` > > > and now: > > git-cat-file blob $ID Still not pretty. How about this? #!/bin/sh git-ls-tree HEAD "$@" | while read mode type hash filename; do [ "$type" = "blob" ] && git-cat-file blob "$hash" done Rene