Junio C Hamano <gitster@xxxxxxxxx> writes: > Greg Troxel <gdt@xxxxxxxxxx> writes: > >> git ls-tree HEAD foo >> git ls-tree HEAD foo | git update-index --index-info > > This --index-info definitely looks wrong, if "foo" is a directory, as the > entries in the index are supposed to be either blobs or commits. In the man page for update-index in the --index-info section, what I'm doing seems to be covered by point 2, which specifically talks about output of ls-tree. I realize the index is a data structure that has pairs of paths to blobs. But I also think of it as a representation of a tree object that would be referenced were one to commit (even if it isn't in that form yet). So I would argue that update-index with a tree should walk that tree and insert all the paths resulting from expansion into the index? > The command could just instead barf, saying the input is wrong, but the > option was so low-level that it was deliberately written to accept and > store anything you throw at it --- even when it is nonsensical for the > version of plumbing, later updates to the data structure might have made > it making sense, which was the way to ease development of the system. If what I'm doing is an abuse of update-index, do you or anyone else have a suggestion to make a directory in the index match a tree object? (I'm trying to use an index filter; it takes 11 hours to run filter-branch (5500 commits, 400K files in index, 800MB .git, ~2+GB working directory, tmpdir on NetBSD tmpfs (all in ram)).) Thanks, Greg
Attachment:
pgpKMY64aAIqL.pgp
Description: PGP signature