Re: Newbie question: equiv of: cvs co -p <filename> ?
- From
Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
- Date
- Aug 9, 2005, 22:18 UTC
- Message-ID
- <42F92BC2.20406@lsrfire.ath.cx>
- In-Reply-To
- <Pine.LNX.4.63.0508100009210.10311@wgmdd8.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
Show 12 quoted lines
> 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