git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Johannes SchindelinNext: Linus Torvalds
Message 3 of 7 in “Newbie question: equiv of: cvs co -p <filename> ?”
  1. John EllsonAug 9, 2005
  2. Johannes SchindelinAug 9, 2005
  3. Rene ScharfeAug 9, 2005
  4. Linus TorvaldsAug 10, 2005
  5. cg-cat [was: Re: Newbie question: equiv of: cvs co -p <filename> ? ]John Ellson, Aug 10, 2005
  6. Petr BaudisAug 11, 2005
  7. Matthias UrlichsAug 12, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.