git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is there a scriptable way to update the stat-info in the index without having git open and read those files?
@ 2011-08-22 22:28 Elijah Newren
  2011-08-22 22:49 ` Junio C Hamano
  2011-08-27 15:18 ` Pete Wyckoff
  0 siblings, 2 replies; 3+ messages in thread
From: Elijah Newren @ 2011-08-22 22:28 UTC (permalink / raw)
  To: Git Mailing List

Hi,

I want to do something really close to
  git update-index -q --refresh
However, I want it to assume the files in the working tree are
unmodified from the index (i.e. don't waste time opening and reading
the file) and simply update the stat information in the index to match
the current files on disk.

Yes, I know that would be unsafe if the files don't have the
appropriate contents; I'm promising that they do have the appropriate
contents and don't want to pay the performance penalty for git to
verify.  Is that possible?


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.  Did I miss it?

Thanks,
Elijah

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-27 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 22:28 Is there a scriptable way to update the stat-info in the index without having git open and read those files? Elijah Newren
2011-08-22 22:49 ` Junio C Hamano
2011-08-27 15:18 ` Pete Wyckoff

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).