git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: John Ellson <ellson@research.att.com>, git@vger.kernel.org
Subject: Re: Newbie question:  equiv of:  cvs co -p <filename>  ?
Date: Wed, 10 Aug 2005 00:18:42 +0200	[thread overview]
Message-ID: <42F92BC2.20406@lsrfire.ath.cx> (raw)
In-Reply-To: <Pine.LNX.4.63.0508100009210.10311@wgmdd8.biozentrum.uni-wuerzburg.de>

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

  reply	other threads:[~2005-08-09 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 21:59 Newbie question: equiv of: cvs co -p <filename> ? John Ellson
2005-08-09 22:10 ` Johannes Schindelin
2005-08-09 22:18   ` Rene Scharfe [this message]
2005-08-10  0:36 ` Linus Torvalds
2005-08-10 14:38   ` [PATCH] cg-cat [was: Re: Newbie question: equiv of: cvs co -p <filename> ? ] John Ellson
2005-08-11 23:03     ` Petr Baudis
2005-08-12  7:53       ` Matthias Urlichs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42F92BC2.20406@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ellson@research.att.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).