From: Erik de Castro Lopo <mle+tools@mega-nerd.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Re: Retrieving a file at a before a specified commit
Date: Thu, 30 May 2013 10:49:32 +1000 [thread overview]
Message-ID: <20130530104932.d7ba4bfb426044ab9653057e@mega-nerd.com> (raw)
In-Reply-To: <20130529075811.GA7204@sigill.intra.peff.net>
Jeff King wrote:
> Yes, that should work as long as the file is modified and not added. You
> can also say "4d77a3cee^:A/B/C" if you do not want to look up the parent
> id yourself.
Thanks, that's useful to know.
> Note that for a merge commit with multiple parents, the question is more
> complex, as there are two previous states that are merged.
This is not the case in the one I am currently looking at. There is a single
parent commit.
> You say that it doesn't work in one particular case. What is that case?
> What happens?
Here is an example. Grab this repository:
git clone git://github.com/qca/open-plc-utils.git
cd open-plc-utils/
Look at this commit:
git log --name-status f51ac745a6d4087cc4d77a3cee01db0412955c79
and notice that one of the files modified is "pib/chkpib2.7", so lets
look at the parent version of that file:
git show f51ac745a6d4087cc4d77a3cee01db0412955c79^:pib/chkpib2.7
which produces no output and exits with 0 status.
However looking at the diff for commit f51ac745a suggests that while
the file pib/chkpib2.7 may have existed before that commit, it must
have been empty (ie zero length).
Does this explanation make sense?
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
next prev parent reply other threads:[~2013-05-30 0:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 6:47 Retrieving a file at a before a specified commit Erik de Castro Lopo
2013-05-29 7:58 ` Jeff King
2013-05-30 0:49 ` Erik de Castro Lopo [this message]
2013-05-30 0:59 ` Erik de Castro Lopo
2013-05-30 2:27 ` Junio C Hamano
2013-05-30 3:18 ` Erik de Castro Lopo
2013-05-30 2:34 ` Jeff King
2013-05-30 3:19 ` Erik de Castro Lopo
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=20130530104932.d7ba4bfb426044ab9653057e@mega-nerd.com \
--to=mle+tools@mega-nerd.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).