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

Re: update-index --index-info producing spurious submodule commits

From
GTGreg Troxel <gdt@ir.bbn.com>
Date
Aug 19, 2011, 00:27 UTC
Message-ID
<rmiliuq2qlg.fsf@fnord.ir.bbn.com>
In-Reply-To
<7vd3g272tk.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> Greg Troxel <gdt@ir.bbn.com> 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?

Show 5 quoted lines
> 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

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 7 in “update-index --index-info producing spurious submodule commits”
  1. Greg TroxelAug 18, 2011
  2. Junio C HamanoAug 18, 2011
  3. Greg TroxelAug 19, 2011
  4. Junio C HamanoAug 19, 2011
  5. Greg TroxelAug 19, 2011
  6. Jonathan NiederAug 20, 2011
  7. Junio C HamanoAug 19, 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.