Re: How do I get the file contents from an arbitrary revision to stdout?

2 messages, 2 authors, 2021-10-08 · open the first message on its own page

Re: How do I get the file contents from an arbitrary revision to stdout?

From: Junio C Hamano <hidden>
Date: 2021-10-08 21:54:55

Jeff King [off-list ref] writes:
  git cat-file -p bar-branch:foo.c

(the "-p" is "pretty-print based on the object's type", so the two are
equivalent).
IIRC, "cat-file -p" doesn't do textconv, but "show" would, and
depending on the use case the difference may matter.

Re: How do I get the file contents from an arbitrary revision to stdout?

From: Jeff King <hidden>
Date: 2021-10-08 23:01:10

On Fri, Oct 08, 2021 at 02:54:51PM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
  git cat-file -p bar-branch:foo.c

(the "-p" is "pretty-print based on the object's type", so the two are
equivalent).
IIRC, "cat-file -p" doesn't do textconv, but "show" would, and
depending on the use case the difference may matter.
Sorry, I should have been more clear. I meant that the two cat-file
invocations are equivalent (using "blob" versus "-p").

I agree that for human consumption, "show" is preferable.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help