All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Halstrick <christian.halstrick@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: git index containing tree extension for unknown path
Date: Fri, 23 Jan 2015 07:23:45 +0100	[thread overview]
Message-ID: <CAENte7jr6mjz_xCuWpYKW7VzNcYhqEi5Nf_8JdDtyM46pVnfDg@mail.gmail.com> (raw)
In-Reply-To: <xmqqr3unx40n.fsf@gitster.dls.corp.google.com>

Thanks for the explanation. In my case it seems we have an invalid
index. I modified the gin script [1] to inspect the index and found
valid cached trees in the index for pathes for which the index has no
entries. Will try to find out who/how the index was corrupted.

[1] https://raw.githubusercontent.com/chalstrick/gin/master/gin

Output of the script

> gin.py
[header]
  signature = DIRC
  version = 2
  entries = 1

[entry]
  entry = 1
  ctime = 1421834321.9923096
  mtime = 1420815554.0
  dev = 2049
  ino = 658461
  mode = 100644
  uid = 1000
  gid = 1000
  size = 42
  sha1 = 6c6909e2b92e763e890a9a42695680762802a50a
  flags = 14
  assume-valid = False
  extended = False
  stage = (False, False)
  name = .gitattributes

[extension]
  extension = 1
  signature = TREE
  size = 103

[cachedTree]
  name =
  entryCnt = 2
  subtreeCnt = 1
  id = f59374e16868ce8385b4ee602c737f917da4af1b

[cachedTree]
  name = a
  entryCnt = 1
  subtreeCnt = 1
  id = 4b5e60c30485a91ee60bd869ecc3b4d2b892fc3f

[cachedTree]
  name = b
  entryCnt = 1
  subtreeCnt = 1
  id = 50bd519cc418878d4b0ffc27348afd710c188d6d

[cachedTree]
  name = c
  entryCnt = 1
  subtreeCnt = 0
  id = 2b230fa0f3d19b497d3dd24e835691e3a921657f

[checksum]
  checksum = True
  sha1 = 124680d4dec4758ee1ae28f546659d282952ebff
Ciao
  Chris
Ciao
  Chris


On Wed, Jan 21, 2015 at 9:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
> 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.).
>
>

      reply	other threads:[~2015-01-23  6:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 16:14 git index containing tree extension for unknown path Christian Halstrick
2015-01-21 20:39 ` Junio C Hamano
2015-01-23  6:23   ` Christian Halstrick [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAENte7jr6mjz_xCuWpYKW7VzNcYhqEi5Nf_8JdDtyM46pVnfDg@mail.gmail.com \
    --to=christian.halstrick@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.