git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How do I clear the directory cache

From
Eeschvoca <eschvoca@gmail.com>
Date
Oct 21, 2005, 03:23 UTC
Message-ID
<2b05065b0510202023i62ab7c03uea1381d76535dcc7@mail.gmail.com>
In-Reply-To
<20051020085931.GW30889@pasky.or.cz>

Yes, "cg-reset --adds-removals" is what I want (how do I do this with pure git?).

I would like to clear/reset the index because I've screwed it all up. I don't think I can do as you suggested because of the way I got into this mess.

I'm using git/cogito to version control my hard drive and I've been gradually adding more entries into the .gitignore file because some files change too frequently or I don't want them backed up. The OS modified a bunch of files, I cg-rm'd 1/4 of them, then I changed my mind and added them back, also did some genuine cg-adds, etc. and now I'm all confused (it's a whole hard drive). If other people are interested in doing this I can pass on the lessons I learned.

What I found it git is amazingly fast! cg-status only takes a few seconds. I think there are some problems if you try to do:

cd / cg-add -r usr cg-commit -m "take a long break"

It seems that cg-add-ing and cg-commit-ing smaller chunks is faster than one big chunk.

I think commands for the following should be added to cogito:
cg-status -<status_flag>  # list files with given status flag (without
status flag in column 1)
  git-ls-files [--others|--deleted|etc] --exclude-per-directory=/.gitignore
cg-add [-r] -<status_flag> # add files with a given status flag
  git-ls-files [--others|--deleted|etc]
--exclude-per-directory=/.gitignore | while read i; do cg-add "$i;
done
cg-rm [-r] -<status_flag> # you get the idea.
cg-addremove  # recursively add new files, remove deleted files
I use "while read i" so it will work with spaces in filenames.
Previous: Petr BaudisNext: Junio C Hamano
Message 3 of 11 in “How do I clear the directory cache”
  1. eschvocaOct 17, 2005
  2. Petr BaudisOct 20, 2005
  3. eschvocaOct 21, 2005
  4. Junio C HamanoOct 21, 2005
  5. eschvocaOct 21, 2005
  6. Linus TorvaldsOct 21, 2005
  7. Petr BaudisOct 21, 2005
  8. eschvocaOct 21, 2005
  9. Petr BaudisOct 21, 2005
  10. eschvocaOct 22, 2005
  11. Petr BaudisOct 22, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.