All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/6] t6014: test prune with detached HEADs in separate worktrees
Date: Fri, 26 Feb 2016 10:03:39 -0800	[thread overview]
Message-ID: <xmqqwpprjqmc.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <47fd12af598614ca10fa28cb36fb98ca9ab6d7bb.1456504190.git.git@drmicha.warpmail.net> (Michael J. Gruber's message of "Fri, 26 Feb 2016 17:39:42 +0100")

Michael J Gruber <git@drmicha.warpmail.net> writes:

> "git prune" relies on "git rev-list --all" to list all reachable,
> non-prunable commits. In the presence of per-worktree refs such as HEAD
> this becomes more complicated.

Not "all", perhaps "majority of".  The index is another anchor point
and rev-list is not involved in it at all.

For those that are anchored by refs and ref-like things, I think the
right thing to do is not to change the semantics of "--all" like
[3/6] does, but to invent a new option to "for-each-ref" that shows
only the refs and ref-like things that are private to the worktree.
That set may include HEAD and refs/bisect/*, perhaps.

With that, the scripted equivalent of "git repack", "git prune" and
"git fsck" can ask "git worktree list" the list of worktrees to
consult, and in each of them run "git for-each-ref --private" and
"git ls-files -s" to grab the objects to be used as the starting
point of reachability traversal.

  reply	other threads:[~2016-02-26 18:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 16:39 [PATCH/WIP 0/6] Detached HEADs in new worktrees considered harmful Michael J Gruber
2016-02-26 16:39 ` [PATCH 1/6] Documentation/git-worktree: spell --detach correctly Michael J Gruber
2016-02-26 17:52   ` Junio C Hamano
2016-02-26 16:39 ` [PATCH 2/6] t6014: test prune with detached HEADs in separate worktrees Michael J Gruber
2016-02-26 18:03   ` Junio C Hamano [this message]
2016-02-26 16:39 ` [PATCH/RFD 3/6] rev-list: list all heads with --all Michael J Gruber
2016-02-27  2:15   ` Duy Nguyen
2016-02-26 16:39 ` [PATCH 4/6] WIP: mess only with mark_reachable Michael J Gruber
2016-02-26 16:39 ` [PATCH 5/6] WIP: fix unborn branch case Michael J Gruber
2016-02-26 16:39 ` [PATCH 6/6] revisions: list all worktree HEADs with --all Michael J Gruber
2016-02-26 17:37 ` [PATCH/WIP 0/6] Detached HEADs in new worktrees considered harmful Junio C Hamano

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=xmqqwpprjqmc.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /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.