All of lore.kernel.org
 help / color / mirror / Atom feed
* 'git show' with multiple revisions
@ 2015-04-28 10:10 Ed Avis
  2015-04-29  2:04 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Ed Avis @ 2015-04-28 10:10 UTC (permalink / raw)
  To: git

I would like to see the content of a file in multiple revisions.
I can get them with 'git show' as follows:

    % git show REV1:FILE
    % git show REV2:FILE

and so on.  But that launches a new process for each revision.  Now, there is
the option to pass multiple arguments to 'git show':

    % git show REV1:FILE REV2:FILE

This gets both revisions in a single process and so is faster.  But it
concatenates the content so there isn't a way to separate them out again.

Could 'git show' sprout an option to get multiple things programmatically
so that they can be separated out again?  One way would be to quote or escape
the contents somehow so that the result can be parsed:

    % git show --porcelain REV1:FILE REV2:FILE

The question is what format should be used to output many strings to stdout.

An alternative would be to specify an output file:

    % git show --output foo REV1:FILE                        # writes foo
    % git show --output foo REV1:FILE --output bar REV2:FILE # writes foo, bar

Note that here I am only getting the file content, not log messages or any of
the other things which 'git show' can produce.  So perhaps what I really want
is some kind of 'git cat'.  Or is there another more appropriate tool?

Thanks,

-- 
Ed Avis <eda@waniasset.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-29 16:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 10:10 'git show' with multiple revisions Ed Avis
2015-04-29  2:04 ` Jeff King
2015-04-29 15:47   ` Ed Avis
2015-04-29 15:53     ` Jeff King
2015-04-29 15:53     ` Junio C Hamano
2015-04-29 16:01       ` Ed Avis
2015-04-29 16:08         ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.