git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nikodemus Siivola" <nikodemus@random-state.net>
To: git@vger.kernel.org
Subject: Re: Restoring files from old commits
Date: Wed, 15 Aug 2007 20:22:19 +0300	[thread overview]
Message-ID: <6bcc356f0708151022v6cb8c348nb19690c81e489c5d@mail.gmail.com> (raw)
In-Reply-To: <20070715084141.GA2568@steel.home>

Tangentially related to my previous question:

Every once and a while I want to examine an older version
of a file in an editor.

(The typical case is first looking for the source of a change
with git-blame, and then wanting to look at the original code
and the diff side by side.)

My current (suboptimal, I hope!) way of doing getting the file
is git-cat-file: first look at the commit, then look at the tree,
... till I find the SHA1 for the file I want.

git-checkout <sha1-of-commit> <path>, but that leaves the old
version in both the index and the tree, which feels icky especially
if I'm giving this treatment to multiple files at the same time.

So what I'd like is something like

 git cat-path <commit> <path-in-the-tree-referenced-by-that-commit>

Does this exist, or is this scripting time?

Cheers,

 -- Nikodemus

  reply	other threads:[~2007-08-15 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14 12:09 Restoring files from old commits Nikodemus Siivola
2007-07-14 12:37 ` martin f krafft
2007-07-14 14:32   ` Alex Riesen
2007-07-14 18:50     ` Junio C Hamano
2007-07-15  8:41       ` Alex Riesen
2007-08-15 17:22         ` Nikodemus Siivola [this message]
2007-08-15 17:28           ` Salikh Zakirov
2007-08-15 18:27           ` Uwe Kleine-König

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=6bcc356f0708151022v6cb8c348nb19690c81e489c5d@mail.gmail.com \
    --to=nikodemus@random-state.net \
    --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).