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

Re: git index containing tree extension for unknown path

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2015, 20:39 UTC
Message-ID
<xmqqr3unx40n.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAENte7gqKpqr=ENOEN_3s3Fz6gc-Kt70OJyZojbgwhR7YVX6Zg@mail.gmail.com>
Christian Halstrick <christian.halstrick@gmail.com> writes:
> Is it allowed that the git index contains a tree extension mentioning
> patch 'x/y/z' while the only entry in the index is a '.gitattributes'
> files in the root?

Depends on the definition of "mention", but it is not unexpected that you see "x", "y", and "z" in the cache-tree extension as invalidated nodes after you do something like this:

	rm -fr test &&
        git init test &&
        cd test
        mkdir -p x/y/z &&
        >x/y/z/1 &&
        git add x &&
        git write-tree && # cache-tree is fully valid
        mv x/y/z x/y/a &&
        git add x # cache-tree invalidated

"z", if appears, should still know that "y" is its parent and "y", if appears, should still know that "x" is its parent. All of the three should say they have been invalidated by showing a negative entry-count and show the "correct" subtree count that appear in the extension (i.e. if "z" is there as an invalidated leaf, it should say "-1 0" to indicate an invalidated entry by a negative entry count, with zero subtrees, and "y" would show "-1 1" to indicate an invalidated entry with one subtree, namely "z", etc.).

Previous: Christian HalstrickNext: Christian Halstrick
Message 2 of 3 in “git index containing tree extension for unknown path”
  1. Christian HalstrickJan 21, 2015
  2. Junio C HamanoJan 21, 2015
  3. Christian HalstrickJan 23, 2015

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.