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

Re: which files are "known to git"?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
May 23, 2018, 08:20 UTC
Message-ID
<alpine.LFD.2.21.1805230406050.16917@localhost.localdomain>
In-Reply-To
<20180521175335.GC10623@aiede.svl.corp.google.com>
On Mon, 21 May 2018, Jonathan Nieder wrote:
Show 17 quoted lines
> Robert P. J. Day wrote:
> > On Mon, 21 May 2018, Elijah Newren wrote:
>
> >> Hi Robert,
> >>
> >> I had always assumed prior to your email that 'known to Git'
> >> meant 'tracked' or 'recorded in the index'...
> >
> >   i *know* i've been in this discussion before, but i don't
> > remember where, i *assume* it was on this list, and i recall
> > someone (again, don't remember who) who opined that there are two
> > categories of files that are "known to git":
>
> My understanding was the same as Elijah's.
>
> I would be in favor of a patch that replaces the phrase "known to
> Git" in Git's documentation with something less confusing.
  ironically, the 2nd edition of o'reilly's "version control with git"
uses the phrases "known to Git" and "unknown to Git" on p. 378 (and
nowhere else that i can see):

"Furthermore, for the purposes of this [git clean] command, Git uses a slightly more conservative concept of under version control. Specifically, the manual page uses the phrase “files that are unknown to Git” for a good reason: even files that are mentioned in the .gitignore and .git/info/exclude files are actually known to Git. They represent files that are not version controlled, but Git does know about them. And because those files are called out in the .gitignore files, they must have some known (to you) behavior that shouldn’t be disturbed by Git. So Git won’t clean out the ignored files unless you explicitly request it with the -x option."

  that phrase even occurs in git-produced diagnostic messages such as:
  dir.c: error("pathspec '%s' did not match any file(s) known to git.",

in any event, perhaps the phrase "known to Git" has some value, as long as it's defined very precisely and used consistently, which it obviously isn't right now.

rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Junio C HamanoNext: Elijah Newren
Message 13 of 16 in “which files are "known to git"?”
  1. Robert P. J. DayMay 21, 2018
  2. Randall S. BeckerMay 21, 2018
  3. Elijah NewrenMay 21, 2018
  4. Duy NguyenMay 21, 2018
  5. Robert P. J. DayMay 21, 2018
  6. Robert P. J. DayMay 21, 2018
  7. Junio C HamanoMay 21, 2018
  8. Robert P. J. DayMay 21, 2018
  9. Jonathan NiederMay 21, 2018
  10. Robert P. J. DayMay 21, 2018
  11. Jonathan NiederMay 21, 2018
  12. Junio C HamanoMay 22, 2018
  13. Robert P. J. DayMay 23, 2018
  14. Elijah NewrenMay 21, 2018
  15. Robert P. J. DayMay 21, 2018
  16. Stefan BellerMay 21, 2018

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.