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

Re: Is there a scriptable way to update the stat-info in the index without having git open and read those files?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2011, 22:49 UTC
Message-ID
<7vwre5t621.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CABPp-BEiN7ffNmvLCvEfz056M_F36j+gV9t6J9-x_=H9q0rZFw@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 13 quoted lines
> A little more detail, for the curious: I have a script that is, among
> other things, renaming large numbers of files.  Calling 'git mv <old>
> <new>' on each pair took forever.  So I switched to manually renaming
> the files in the working copy myself, and using git update-index
> --index-info to do the renames in the index.  The result was _much_
> faster, but of course that method blows away all the stat information
> for the relevant files and causes any subsequent git operation (after
> my script is done) to be slow.  I inserted a 'git update-index -q
> --refresh' at the end of my script to fix that, but that is much
> slower than I want since it has to re-read all the affected files to
> ensure they haven't been modified (however, it isn't as slow as
> forking many git-mv processes).  I've tried to look for a way to speed
> up this update, but haven't found one.

Sounds like a one-off thing to me, and I personally do not think it is worth the effort to add something even riskier than assume-unchanged to solve.

Previous: Elijah NewrenNext: Pete Wyckoff
Message 2 of 3 in “Is there a scriptable way to update the stat-info in the index without having git open and read those files?”
  1. Elijah NewrenAug 22, 2011
  2. Junio C HamanoAug 22, 2011
  3. Pete WyckoffAug 27, 2011

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.