git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kevin Buckley <Kevin.Buckley@pawsey.org.au>
To: git@vger.kernel.org
Subject: Re: Definition of "the Git repository"
Date: Mon, 28 Jun 2021 12:00:15 +0800	[thread overview]
Message-ID: <ec31434f-0c99-ffb7-6eb0-6ecb1f6e761c@pawsey.org.au> (raw)
In-Reply-To: <60d9410bb07a1_aac5d20888@natae.notmuch>

On 2021/06/28 11:24, Felipe Contreras wrote:
> Kevin Buckley wrote:
> 
>> Everything within the .git directory "belongs", in my way of thinking,
>> to the "repository", that is, the directory that gets created when git
>> is (init)ialised.
>> 
>> For me, the 'objects", the 'ref/heads', the "staging area' and the like,
>> also lie within the repository.
> 
> Does it?
> 
> Suppose you have three directories, each with exactly the same contents
> in their corresponding .git directory, the only difference is the
> .git/index file:
> 
>   a) No .git/index file at all
>   b) The .git/index file doesn't have anything staged
>   c) The .git/index file contains some staged changes
> 
> Do you really consider them three different repositories?
> 
> In my mind the staging area is where you put stuff in preparation for
> the commit. The commit is part of the repository, the staging area
> isn't.
> 

I think I do consider them as different, yes, but in the sense that,
because the contents of any working directory can change in isolation
to the others, they have become different instances (perhaps clones?)
of the same repository.

Let's say I make two commits, that resulted in the same state of the
files in the working directory, but I make them in different order
in two of the working directories.

Clearly I need to sync the two different repositories in order to gain
a consistency across them, and that suggets, to me, that they should
be thought of as different.

Let's say I'd rsync-d one working directory, in which I'd made changes
on its branch, with an unchanged one on a different branch (not that
I'd recommend doing this without the utmost caution), then although the
sync will not have affected the original branch in the unchanged directory,
the git internals, stored in the .git repository, would have changed to
reflect the new state.

As to the staging area,

again, for me, Git has an understanding of a "staging area" based on its
inspection of the state of the working directory and a comparison of that
state with what it knows has been committed.

Given that one can stash uncommited changes fron the "staging area", I
think of both the "staging area" and various stashes as parts of the
repository, in that you can't have a "staging area", unless there's a
.git repository there to help instantiate the staging area".


Very much my perception of it all though: as others have pointed out,
there does seem to be some wriggle room in how it is percieved.

Kevin

  reply	other threads:[~2021-06-28  4:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  1:44 Definition of "the Git repository" Kevin Buckley
2021-06-25  5:56 ` Ævar Arnfjörð Bjarmason
2021-06-25  8:56 ` Igor Djordjevic
2021-06-25  9:14 ` Igor Djordjevic
2021-06-25 19:39 ` Felipe Contreras
2021-06-25 20:48 ` Philip Oakley
2021-06-28  2:24   ` Kevin Buckley
2021-06-28  3:24     ` Felipe Contreras
2021-06-28  4:00       ` Kevin Buckley [this message]
2021-06-28  5:21         ` Felipe Contreras
2021-06-29  1:57           ` Kevin Buckley
2021-06-29  2:08             ` Felipe Contreras
2021-06-28 15:18     ` Philip Oakley
2021-06-28 15:34       ` Chris Torek
2021-06-29  6:59 ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec31434f-0c99-ffb7-6eb0-6ecb1f6e761c@pawsey.org.au \
    --to=kevin.buckley@pawsey.org.au \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).