git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git fsck: unreachable vs. dangling
Date: Tue, 14 Apr 2015 01:05:10 -0700	[thread overview]
Message-ID: <CAPc5daXRpfSrvcae0W+YU-51prCoFGxz_hkhtp7FZ-K9_eeeBQ@mail.gmail.com> (raw)
In-Reply-To: <CAHGBnuOYLpkeUop9vNH3+WSKqrM3NCSqvu-NZnPnk3gEkAr6eg@mail.gmail.com>

On Tue, Apr 14, 2015 at 12:16 AM, Sebastian Schuberth
<sschuberth@gmail.com> wrote:
> Hi,
>
> reading through the fsck docs [1] I'm having a hard time understanding
> what the difference between "unreachable" and "dangling" objects are.
>
> By example, suppose I have a commit A that is the tip of exactly one
> branch (and no tag or other ref points to A). If I delete that branch,
> is A now dangling, or unreachable, or both?

Suppose that branch consists of two commits, A and A^.
When you lose that branch (git branch -D that-branch),
both A and A^ become unreachable. So are trees and
blobs that appear only in A and A^ and nowhere else;
they are also unreachable.

A dangling object is an unreachable object that cannot be
made reachable by any way other than pointing at it
directly with a ref. A^ is not dangling, because you can
make it reachable by pointing A (the tip of the original
branch you just lost) with a ref. A on the other hand is
dangling (if you had a tag object that points at A that
you lost, then A is merely unreachable but not dangling,
because you can point at that tag with a ref and make A
reachable).

  reply	other threads:[~2015-04-14  8:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  7:16 git fsck: unreachable vs. dangling Sebastian Schuberth
2015-04-14  8:05 ` Junio C Hamano [this message]
2015-04-14  8:50   ` Michael J Gruber
2015-04-14  8:58     ` Sebastian Schuberth
2015-04-14  9:22       ` Junio C Hamano
2015-04-14  9:28         ` Sebastian Schuberth
2015-04-14 16:19         ` Michael J Gruber
2015-04-14  8:52   ` Sebastian Schuberth
2015-04-14 14:20     ` Sebastian Schuberth

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=CAPc5daXRpfSrvcae0W+YU-51prCoFGxz_hkhtp7FZ-K9_eeeBQ@mail.gmail.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sschuberth@gmail.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 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 NNTP newsgroup(s).