git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* index rebuild for cloned repo
@ 2010-10-31 17:44 Pete Wyckoff
  2010-10-31 18:07 ` Jonathan Nieder
  2010-10-31 19:59 ` [PATCH] cherry-pick/revert: transparently refresh index Jonathan Nieder
  0 siblings, 2 replies; 16+ messages in thread
From: Pete Wyckoff @ 2010-10-31 17:44 UTC (permalink / raw)
  To: git

I'm trying to share pre-built working trees using NFS-server-side
volume cloning (not "git clone").  This makes a new volume that
shares all the data with the source volume, including build
products that would otherwise take hours to regenerate.  While
the data is identical, much of the inode information changes:
uid, gid, ino, dev, mtime, ctime.

What is the best way to rewrite .git/index in the clone?  Options
that work but are slow:

    git reset --hard HEAD
	write all files, breaking data sharing, 2 min 45 sec

    git update-index --refresh
	stat and read all files, 5 min 55 sec

I hacked out the file data comparison in ce_modified_check_fs()
to measure:

    HACKED git update-index --refresh
	Just the stat, 13 sec

The lstat() is required to look up the new inode number.

The rest of the clone operation takes around 3 min, so
I'd like to avoid this additional 5+ min of read()s if
possible.  Is there a way to do so using existing commands?
Should I add a new option to update-index, or maybe write
a stand-alone tool to manipulate the index file directly?

Thanks,

		-- Pete


P.S.  The user-observable problem that occurs if I do not
rebuild the index is, e.g.:

    $ git cherry-pick build/top
    error: Your local changes to 'file.h' would be overwritten by merge.  Aborting.
    Please, commit your changes or stash them before you can merge.

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

end of thread, other threads:[~2010-11-14 17:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-31 17:44 index rebuild for cloned repo Pete Wyckoff
2010-10-31 18:07 ` Jonathan Nieder
2010-10-31 19:59 ` [PATCH] cherry-pick/revert: transparently refresh index Jonathan Nieder
2010-10-31 20:26   ` Andreas Schwab
2010-10-31 20:32     ` Jonathan Nieder
2010-10-31 22:26   ` Pete Wyckoff
2010-10-31 22:28     ` [PATCH] teach update-index --refresh about --data-unchanged Pete Wyckoff
2010-11-03 17:37       ` Junio C Hamano
2010-11-03 18:36         ` Jonathan Nieder
2010-11-03 22:02           ` Pete Wyckoff
2010-11-14 16:58             ` Pete Wyckoff
2010-11-14 17:34               ` Jonathan Nieder
2010-11-01  8:09   ` [PATCH] cherry-pick/revert: transparently refresh index Johannes Sixt
2010-11-03 17:30     ` Junio C Hamano
2010-11-03 20:33       ` Johannes Sixt
2010-11-01  8:44   ` Nguyen Thai Ngoc Duy

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