From: Junio C Hamano <junkio@cox.net>
To: eschvoca <eschvoca@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How do I clear the directory cache
Date: Thu, 20 Oct 2005 21:09:30 -0700 [thread overview]
Message-ID: <7vmzl34ikl.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 2b05065b0510202023i62ab7c03uea1381d76535dcc7@mail.gmail.com
eschvoca <eschvoca@gmail.com> writes:
> Yes, ... is what I want (how do I do this with pure git?).
How do you do *what* with pure git is something not clear to me,
so let me try to rephrase you and see if I understood what you
want correctly, in pure git terms:
0. Your last commit (.git/HEAD), your index file (.git/index)
and the files in your working tree are in sync to begin
with.
1. Then you do random changes in the working tree (add, modify,
remove) and do git-update-index on them without making a
commit. If your index file is fully in sync with your
working tree, git-diff-files would say nothing after this.
If you did git-update-index on some but not all, then
git-diff-files would report unrecorded changes.
2. But you want to revert these changes to the index file. By
"clearing the directory cache", you mean you want the index
file to have what it had in step 0, but you want to keep
what is on the filesystem intact.
If that is what you want, then:
$ git-read-tree HEAD
$ git-update-index --refresh >/dev/null
would reset the index to the tree recorded in your last commit.
You can see that
$ git diff --name-status --cached HEAD
does not report any difference between HEAD and your index, while
$ git diff --name-status
shows the differences between your index and your working tree.
HOWEVER, the index file does not record "intent to add", so you
would not see files you added in step 1. mentioned in the output
of the last command.
next prev parent reply other threads:[~2005-10-21 4:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-17 14:20 How do I clear the directory cache eschvoca
2005-10-20 8:59 ` Petr Baudis
2005-10-21 3:23 ` eschvoca
2005-10-21 4:09 ` Junio C Hamano [this message]
2005-10-21 20:16 ` eschvoca
2005-10-21 21:00 ` Linus Torvalds
2005-10-21 10:52 ` Petr Baudis
2005-10-21 20:40 ` eschvoca
2005-10-21 21:43 ` Petr Baudis
2005-10-22 19:20 ` eschvoca
2005-10-22 21:09 ` Petr Baudis
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=7vmzl34ikl.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=eschvoca@gmail.com \
--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).