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

Re: Definition of "the Git repository"

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 29, 2021, 02:08 UTC
Message-ID
<60da80a7d0abb_20757208c5@natae.notmuch>
In-Reply-To
<a5579940-237b-2e4d-bf18-bc0a8f2f1ee3@pawsey.org.au>
Kevin Buckley wrote:
Show 15 quoted lines
> On 2021/06/28 13:21, Felipe Contreras wrote:
> > 
> > To try to make it more orthogonal, let's suppose the index file was
> > outside the .git directory. Would you consider then the staging area
> > separate from the repository?
> > 
> > In fact, we don't have to suppose:
> > 
> >    GIT_INDEX_FILE=/tmp/index git checkout @~ -- .
> > 
> > Does that command change the repository in any way?
>   
> I have to admit that I don't know, and that I can't immediately
> see where the "repository" would be, in that example. This is
> obviously a gap in my understanding: happy to defer to yours.
Well, think about it.
Show 6 quoted lines
> I do however feel that the fact that we have moved to using examples
> that override the Git Index file on the command line, in order to
> define what a "repository" is, just so that we might be able to give
> a "more correct" definition of the term, to someone completely new to
> Git, suggests that, as others have already noted in the discussion,
> it's not easy to be "correct"?

No. The repository is what the repository is. The command is merely an aid for *you* to think about it.

If you are trying to define what a swan is, and you think a swan is a white bird, but then I show you a black swan, what do you think you should do with your definition?

What's complicated about this definition?
  A git repository is contained in the .git directory, but it's not the
  same thing. The staging area is usually inside the .git directory too,
  but it's not part of the repository.
Why do you want to make it more complicated than that?
-- 
Felipe Contreras
Previous: Kevin BuckleyNext: Philip Oakley
Message 12 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.