From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>,
GIT <git@vger.kernel.org>
Subject: Re: Howto update a 'dirty' entry in the cache from the object database
Date: Wed, 04 May 2005 10:37:40 -0700 [thread overview]
Message-ID: <7vll6uopsr.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0505041014510.2328@ppc970.osdl.org> (Linus Torvalds's message of "Wed, 4 May 2005 10:23:01 -0700 (PDT)")
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> On Wed, 4 May 2005, Thomas Glanzmann wrote:
>>
>> I edited a bunch of files and notice that I want to revert back one of
>> the files to the original one (the one that comes with HEAD). But I
>> already updated the cache. Is there a way to 'patch' the cache with the
>> original file.
LT> Absolutely.
LT> You can do it several ways. The easiest one is
LT> git-read-tree -m HEAD
LT> git-checkout-cache -f filename
LT> but this means that you revert your entire index file to the old HEAD
LT> information, so you'll need to do git-update-cache on the files that you
LT> changed.
I think the easiest one that does not lose the cache for other
files is:
git-diff-cache -z HEAD |
GIT_EXTERNAL_DIFF=git-apply-patch-script \
git-diff-tree-helper -z -R filename
This means: find diff from HEAD to the cache, and apply the diff
in the reverse, only to the filename.
next prev parent reply other threads:[~2005-05-04 17:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-04 14:23 Howto update a 'dirty' entry in the cache from the object database Thomas Glanzmann
2005-05-04 17:23 ` Linus Torvalds
2005-05-04 17:37 ` Junio C Hamano [this message]
2005-05-04 19:20 ` Thomas Glanzmann
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=7vll6uopsr.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=sithglan@stud.uni-erlangen.de \
--cc=torvalds@osdl.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