All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: git-vger@eldondev.com, Aman <amanmatreja@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: About GIT Internals
Date: Thu, 26 May 2022 09:47:37 +0100	[thread overview]
Message-ID: <8adba93c-7671-30d8-5a4c-4ad6e1084a22@iee.email> (raw)
In-Reply-To: <Yo68+kjAeP6tnduW@invalid>

On 26/05/2022 00:34, git-vger@eldondev.com wrote:
> Hi Aman, responses inline below.
>
> On Wed, May 25, 2022 at 09:40:42PM +0530, Aman wrote:
>> Could someone please assist - in sharing some resources - which I
>> could go through, to better understand GIT software internals.
> There is an excellent free book at https://git-scm.com/book/en/v2 .
>
> Chapter 10 is about git internals. It is important to realize that,
> unlike many other version control systems, git works effectively on
> files locally on your computer, without any server or other shared
> resources to manage. Also, one good way to learn may be to form a
> question that you want to answer first. "How do I ...." or "what happens
> when I ....". Since git works locally, it is possible to create a git
> repo, look at the files contained in the .git directory, take action
> with git, and then look at the files again.
>
>
Another Git feature, compared to older version control systems, is that
it flips the 'control' aspect on its head. (who controls what you can
store?)

It does this by using the hash (sha1, or sha256) values as a way of
users _checking_ that they have the right copy of a file or commit,
rather than needing special permissions to access (write/read) some
alleged 'master' copy (in the sense of a unique artefact) of the
particular version. Maintainers now check and authorise particular
versions much more easily.

Hence Git _Distributes Control_ - you no longer need permission to keep
versioned copies of your work. This was, in my mind, a core element of
its success.

There is other stuff about how Git splits the (file) content from it's
meta-data, so if say 10 files contain the same licence text, then it
only hold one copy of that text, with its own unique hash. Then has a
hierarchy (pyramid) of hashes of the meta-data to build up a whole
project's hash (the top level 'tree'), and the same hierarchy technique
is repeated for the project's history of commits.

If you have a copy of the repository with the latest (same) hash then
you have a perfect copy, indistinguishable to the 'original'! Older
versioning systems did not have those guarantees, many were derived from
systems for versioning engineering and architectural drawings such as
those that were used for the RMS Titanic or Empire State Building.

Philip

PS it's worth checking out the distinction between having hash (a magic
id) of some text, and encrypting (a magic translation of) some text.



  reply	other threads:[~2022-05-26  8:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 16:10 About GIT Internals Aman
2022-05-25 16:49 ` Emily Shaffer
2022-05-25 21:14 ` Erik Cervin Edin
2022-05-25 23:34 ` git-vger
2022-05-26  8:47   ` Philip Oakley [this message]
     [not found]     ` <CACMKQb3exv13sYN5uEP_AG-JYu1rmVj4HDxjdw8_Y-+maJPwGg@mail.gmail.com>
2022-05-27 14:40       ` Philip Oakley
     [not found]         ` <C4B1A93D-800F-4C49-93D5-86FE58B1DDCA@hxcore.ol>
2022-05-27 15:14           ` Philip Oakley
2022-05-30  9:49         ` Kerry, Richard
2022-05-30 11:53           ` Konstantin Khomoutov
2022-05-30 13:50             ` Ævar Arnfjörð Bjarmason
2022-06-03 12:18               ` Aman
2022-06-03 15:23                 ` Konstantin Khomoutov
2022-06-04 15:24                   ` Aman
2022-06-06 11:52                     ` Konstantin Khomoutov
2022-06-03 15:25                 ` Emily Shaffer
2022-06-03 17:15                   ` Junio C Hamano
2022-05-26 12:45 ` Konstantin Khomoutov

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=8adba93c-7671-30d8-5a4c-4ad6e1084a22@iee.email \
    --to=philipoakley@iee.email \
    --cc=amanmatreja@gmail.com \
    --cc=git-vger@eldondev.com \
    --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.