git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>,
	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 18:19:34 +0200	[thread overview]
Message-ID: <552D3E16.7090504@drmicha.warpmail.net> (raw)
In-Reply-To: <xmqq1tjn3vzs.fsf@gitster.dls.corp.google.com>

Junio C Hamano venit, vidit, dixit 14.04.2015 11:22:
> Sebastian Schuberth <sschuberth@gmail.com> writes:
> 
>> On Tue, Apr 14, 2015 at 10:50 AM, Michael J Gruber
>> <git@drmicha.warpmail.net> wrote:
>>
>>> "to dangle" means "to hang loosely".
>>>
>>> So, in the description above, "A^ dangles from A loosely" because it
>>> hangs from A (you can reach it from A) but loosely, because it would
>>> "drop" if A gets dropped and A is "likely" to be dropped (because it is
>>> unreachable by refs). But A^ is not dangling in our terminology.
>>>
>>> If you *reverse the arrows*, i.e. consider A^ pointing to A, it becomes
>>> more apparent that A is dangling: it is an unreferenced leaf node.
>>
>> That's exactly what confused me. In the very literal sense, something
>> can only "hang loosely", i.e. dangle, if it's only tied at *one* end,
>> and that's the case for A (which is only connected to A^) but not for
>> A^ (which is connected to its parent, and A). Especially when talking
>> about A as a "leaf" node, like in the leaf of a natural tree, I would
>> think that A is dangling.
> 
> I am not sure if I follow, but probably it is just me who is not
> strong at math, or whose eyesight is not keen enough to notice the
> arrow heads on links between the commits.

"git log --graph" does not show arrow heads, obviously. Many
illustrations about Git do.

The relation between commits is clearly directed: A being a parent
commit of B is different from B being a parent commit of A (and both
cannot be true simultaneously due to the "A" in "DAG")

 > I just visualize commits to be ping-pong balls with strings between
> them, and then grab the root of the graph and lift the whole thing
> up, while tips of the branches and tags are anchored.  Commit A will
> be dangling in the wind if you shake the whole thing.

If you don't have a concept of direction it is difficult to distinguish
roots from tips...

Our commit relationship is certainly a directed one. You can define it
using either "is parent of" or "is child of". They are opposite, and
lead to opposite notions of "root" (a node without predecessors) and
"tip" (a node without successors).

> But that visualization breaks down once you start thinking about
> what will happen to A^{tree} and its blobs; they are attached to A
> with thin strings and they will have to float above A (i.e. sit
> somewhere closer to the root of the tree) just like A^ will go
> closer to the root, to make A appear the "dangling" one, as the
> direction of the arrow is from A to A^{tree} just like we have an
> arrow from A to A^; just like A^ is not dangling because of A,
> A^{tree} is not dangling.
> 

  parent reply	other threads:[~2015-04-14 16:19 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
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 [this message]
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=552D3E16.7090504@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).