git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Definition of "the Git repository"

From
Philip Oakley <philipoakley@iee.email>
Date
Jun 28, 2021, 15:18 UTC
Message-ID
<070e36dc-f126-661a-3af7-b44d47ef7861@iee.email>
In-Reply-To
<12dd4f05-456f-c763-441e-5bb16634306a@pawsey.org.au>
On 28/06/2021 03:24, Kevin Buckley wrote:
Show 14 quoted lines
> On 2021/06/26 04:48, Philip Oakley wrote:
>>
>> ... One can also include in the generic 'repository' the
>> various special .git* files that are [user] added to the main source
>> directory.
>>
>> But it gets worse. In the .git directory there is the 'objects' ...
>
> I don't believe it does get worse, indeed, I am not convinced that it
> is as bad as your observation on the semantics might suggest.
>
> 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.

Part of my view (of the multiplicity of descriptives within Git) regarding what is in a repository is from comparing the git created content from a clone, that of a `git init`, and a users overall project and .git trees after multiple interactions. Each has different features.

Show 38 quoted lines
>
> For me, the 'objects", the 'ref/heads', the "staging area' and the like,
> also lie within the repository.
>
> As for any anciliary files, that control how the git commands actually
> process any data in the "working directory" beyond the defaults, some
> of them, eg the global commands, will typically exist outside of the
> working directory: below one's home directory, and, of course, there
> are the system-wide files, typically below /etc.
>
> Given then, that we can have Git-related files, for any given working
> directory, below /etc, below the user's home directory, and within the
> working directory itself, perhaps it is the whole "computer" which
> should be referred to as "the repository"?
>
> Furthermore, even in the case of anciliary files typically found within
> the working directory, and I'm thinking of .gitignore as the obvious
> example, even the directives in that can be overriden on the command
> line, as well as complemented by files outside of the working directory.
>
>
> I am tempted to say that even if the definition of a "repository" can't
> be agreed on, or rather, easily determined by inspection, then at least
> the corresponding working directory can be, however, the fact that one
> has  access to EnvVars and corresponding command line arguments such as
> --git-dir=<path>, --work-tree=<path>, would suggest that it could be
> harder for the novice to get their head around things, however, as it is
> typicaly clear what the working directory is (the top level directory
> containing the files you are working on, under the control of Git),
> calling that same directory the "repository" seems, to me anyway, to add
> to any confusion, that a Git novice may have.
>
> Given the can of worms that this question has opened up, although I'm
> getting the feeling that it has long since been opened, I still maintain
> that it would be less confusing, at least for a novice, for the working
> directory to be identified and for a previously non-existent directory,
> that gets created by the 'git init', to be referred to as the repository,
> so as to make a distinction.

My main point was that there is this creative tension between the different contexts and that beginners should be aware that it's not all cut and dried in the same way that language definitions tend to be.

--
Philip
Previous: Felipe ContrerasNext: Chris Torek
Message 13 of 15 in “Definition of "the Git repository"”
  1. Kevin BuckleyJun 25, 2021
  2. Ævar Arnfjörð BjarmasonJun 25, 2021
  3. Igor DjordjevicJun 25, 2021
  4. Igor DjordjevicJun 25, 2021
  5. Felipe ContrerasJun 25, 2021
  6. Philip OakleyJun 25, 2021
  7. Kevin BuckleyJun 28, 2021
  8. Felipe ContrerasJun 28, 2021
  9. Kevin BuckleyJun 28, 2021
  10. Felipe ContrerasJun 28, 2021
  11. Kevin BuckleyJun 29, 2021
  12. Felipe ContrerasJun 29, 2021
  13. Philip OakleyJun 28, 2021
  14. Chris TorekJun 28, 2021
  15. Junio C HamanoJun 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.