git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Anish R Athalye <aathalye@mit.edu>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug report: git cat-file -e / rev-list disagree with git fsck on empty tree
Date: Wed, 02 Sep 2020 12:52:38 -0700	[thread overview]
Message-ID: <xmqqblioarcp.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <1006A7F3-8C48-46E3-8F7C-3F82181E3619@mit.edu> (Anish R. Athalye's message of "Wed, 2 Sep 2020 00:27:30 +0000")

Anish R Athalye <aathalye@mit.edu> writes:

> This is related to the change made in f06ab027efd2 (rev-list: allow cached
> objects in existence check).
>
> That patch seemed designed to allow the workflow where the empty tree is
> missing from the object store, so
> `git cat-file -e 4b825dc642cb6eb9a060e54bf8d69288fbee4904` and
> `git rev-list --objects 4b825dc642cb6eb9a060e54bf8d69288fbee4904`
> both return success even when the object is not physically present.

That sounds buggy.  I know git knows about both empty tree and empty
blob, but replacing the empty tree object name with the empty blob
object name in the above in a freshly-created empty repository gives
me errors from both of them, which is what I'd expect.

> However, in the same situation:
>
>     $ git fsck
>     [...]
>     missing tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904

... and if some other tree references to the empty tree (which is
unusual---I do not think we record such a tree, but some third-party
tools might), it is understandable fsck would complain.

> I'm not sure if this is the intended behavior (the tree is indeed missing, so
> in some sense, this is reasonable). But it seems somewhat confusing that it
> disagrees with the interrogation commands.


      reply	other threads:[~2020-09-02 19:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02  0:27 Anish R Athalye
2020-09-02 19:52 ` Junio C Hamano [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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqblioarcp.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=aathalye@mit.edu \
    --cc=git@vger.kernel.org \
    --subject='Re: Bug report: git cat-file -e / rev-list disagree with git fsck on empty tree' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).