git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Elijah Newren <newren@gmail.com>, git@vger.kernel.org, peff@peff.net
Subject: Re: [RFC PATCH 3/3] fsck: Check HEAD of other worktrees as well
Date: Sat, 10 Feb 2018 12:11:19 -0800	[thread overview]
Message-ID: <xmqqmv0gtxjs.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180210095952.GA9035@ash> (Duy Nguyen's message of "Sat, 10 Feb 2018 16:59:52 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> On Fri, Feb 09, 2018 at 03:13:30PM -0800, Elijah Newren wrote:
>> This takes advantage of the fact that "worktrees/$WORKTREE/HEAD" will
>> currently resolve as a ref, which may not be true in the future with
>> different ref backends.  I don't think it locks us in to supporting
>> resolving other worktree HEADs with this syntax, as I view the
>> user-visible error message as more of a pointer to a pathname that the
>> user will need to fix.  If the underlying ref storage changes, naturally
>> both this code and the hint may need to change to match.
>
> I'm leaning more about something like this patch below (which does not
> even build, just to demonstrate). A couple points:
>
> - Instead of doing the hacky refs worktrees/foo/HEAD, we get the
>   correct ref store for each worktree
> - We have an API for getting all (non-broken) worktrees. I realize for
>   fsck, we may even want to examine semi-broken worktrees as well, but
>   get_worktrees() can take a flag to accomplish that if needed.

Very sensible.  

When I saw that "fsck" thing, the first thing I wondered was "wait,
how are we doing prune and repack while making sure objects
reachable only from HEAD in other worktrees are not lost?  we must
already have an API that gives us where the refs of them are stored
in".

Thanks for a quick response for course correction.

      parent reply	other threads:[~2018-02-10 20:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 23:13 [RFC PATCH 0/3] Make fsck check other worktree HEADs Elijah Newren
2018-02-09 23:13 ` [RFC PATCH 1/3] fsck: Move fsck_head_link() to get_default_heads() to avoid some globals Elijah Newren
2018-02-09 23:13 ` [RFC PATCH 2/3] t1450-fsck: Add tests for HEAD of other worktrees Elijah Newren
2018-02-09 23:13 ` [RFC PATCH 3/3] fsck: Check HEAD of other worktrees as well Elijah Newren
2018-02-10  9:59   ` Duy Nguyen
2018-02-10 12:34     ` Jeff King
2018-02-10 20:11     ` 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=xmqqmv0gtxjs.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=pclouds@gmail.com \
    --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.
Code repositories for project(s) associated with this public 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).