> This may be a meaningless pedantic argument, but I noticed that the standard 
> git documentation talks about "The Three Trees", being "HEAD", "Index", and 
> "Working Directory".

> I'm aware of the fact that the internal data structure is a tree, but it 
> seems very strange to refer to "HEAD" and "Index" as a "tree".  The former is 
> clearly just a single link to a node in the overall tree, and the latter is 
> clearly a list of nodes in the tree.

> Is there something I'm missing that makes it reasonable to refer to these as 
> "trees"?

Hi,

I'll presume you are refering to 
https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified and similar 
presentations.

First, Trees are recursive, and it's easy to confuse the specific Git tree 
organisation, with the general computer science descriptions. In this (3-tree) 
case they are refering to three git trees (its view point of them).

A (stored) tree has a single sha1 hash (hence addressing your 'just a single 
link' concern). That hash object then lists further hashes to create the fully 
blossomed tree.

I'm old enough to remember In/Out trays, and Filing clerks for desk work.

HEAD tells you the reference to what is in the filing cabinet (the last fully 
filed commit)

Index tells you what you have currently placed in your Out box (but not called 
the filing clerk yet to stick it into the cabinet as a Commit)

Working Tree is all the stuff that's still on your desk in various stages of 
preparation.


The subtle aspect is that computers now provide perfect replication, so you can 
have perfect copies in the filing cabinet, your Outbox, and on your desk (work) 
area (at the same time). You can swap stuff between the work desk and Out 
(Index) tray until you are ready.

Historically there was a whole palaver about handling and controling the 
alleged 'master' sheet/document (and then which was the Carbon copy == Cc:). 
Git have move us on from control of that one perfect master (all copies were 
inferior) to verification that the copy you have is identical. 

That shift (from control to veracity) rips up all the old rules because the 
issues that required control have gone.

Hope that helps
--
Philip

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to