Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 0/3] fsck index files from all worktrees
Date: Sun, 26 Feb 2023 22:49:57 +0100	[thread overview]
Message-ID: <ed3b6f63-5693-62e4-72a9-715e6c90a681@kdbg.org> (raw)
In-Reply-To: <Y/hv0MXAyBY3HEo9@coredump.intra.peff.net>

Am 24.02.23 um 09:05 schrieb Jeff King:
> On Sat, Feb 18, 2023 at 10:38:33AM +0100, Johannes Sixt wrote:
> 
>> I see three problems here:
>>
>> - git fsck should detect the problem (if it really is one) in the
>> worktree index. It seems that it is just an index extension that is
>> affected. Perhaps it should be just a warning, not an error.
> 
> We do fsck the resolve-undo extension, but I think fsck just doesn't
> know anything about worktrees. That should be easy enough to fix.
> Patches below.
> 
>> - If the objects mentioned in the index extension are precious, they
>> should not have been garbage-collected in earlier rounds of git gc
>> (which I certainly did at some point).
> 
> Correct, but the gc error you're getting indicates that we _are_ trying
> to treat them as included. I wonder if you ran git-gc long ago with an
> older version of Git, and this breakage was waiting to surface. AFAICT
> this was all fixed by 8a044c7f1d (Merge branch 'nd/prune-in-worktree',
> 2017-09-19).

I don't know how I got into the situation. The worktree is a lot younger
than that and was made with a Git version young enough to include this
commit. I'll see if it happens again.

>> - I can't git gc the repository now, which is particularly annoying when
>> auto-gc is attempted after almost every git command. Of course, I know
>> how to get out of the situation, but it took some time to identify the
>> worktree index as the culprit. Not something that a beginner would be
>> able to do easily.
> 
> I think in general that "oops, there's something corrupt" can be hard to
> get out of, just because there are so many possibilities. But if we can
> at least report the nature of the problem and the offending filename via
> git-fsck, that would help with pointing people in the right direction.

Agreed. Thanks a lot for the patches, they are certainly helpful.

-- Hannes


      parent reply	other threads:[~2023-02-26 21:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18  9:38 Bug: fsck and repack don't agree when a worktree index extension is "broken" Johannes Sixt
2023-02-24  8:05 ` [PATCH 0/3] fsck index files from all worktrees Jeff King
2023-02-24  8:07   ` [PATCH 1/3] fsck: factor out index fsck Jeff King
2023-02-24  8:09   ` [PATCH 2/3] fsck: check index files in all worktrees Jeff King
2023-02-24  8:45     ` Jeff King
2023-02-24  8:12   ` [PATCH 3/3] fsck: mention file path for index errors Jeff King
2023-05-11  6:39     ` Eric Sunshine
2023-05-11 16:17       ` Jeff King
2023-05-11 16:28         ` Eric Sunshine
2023-05-11 17:01           ` Jeff King
2023-06-29 18:21             ` Eric Sunshine
2023-06-29 19:37               ` Junio C Hamano
2023-06-01 12:15     ` Andreas Schwab
2023-06-01 14:04       ` Jeff King
2023-02-24 17:30   ` [PATCH 0/3] fsck index files from all worktrees Junio C Hamano
2023-02-26 22:29     ` [PATCH 4/3] fsck: check even zero-entry index files Jeff King
2023-02-27 12:09       ` Derrick Stolee
2023-02-27 15:58       ` Junio C Hamano
2023-02-26 21:49   ` Johannes Sixt [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=ed3b6f63-5693-62e4-72a9-715e6c90a681@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 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).