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

Re: which files are "known to git"?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 21, 2018, 18:15 UTC
Message-ID
<20180521181511.GD10623@aiede.svl.corp.google.com>
In-Reply-To
<alpine.LFD.2.21.1805211405410.21888@localhost.localdomain>
Hi,
Robert P. J. Day wrote:
Show 21 quoted lines
>   i did a quick search for that phrase in the current code base and
> came up with:
>
> builtin/difftool.c:		/* The symlink is unknown to Git so read from the filesystem */
> dir.c:		error("pathspec '%s' did not match any file(s) known to git.",
> Documentation/git-rm.txt:removes only the paths that are known to Git.  Giving the name of
> Documentation/git-commit.txt:   be known to Git);
> Documentation/user-manual.txt:error: pathspec '261dfac35cb99d380eb966e102c1197139f7fa24' did not match any file(s) known to git.
> Documentation/gitattributes.txt:	Notice all types of potential whitespace errors known to Git.
> Documentation/git-clean.txt:Normally, only files unknown to Git are removed, but if the `-x`
> Documentation/RelNotes/1.8.2.1.txt: * The code to keep track of what directory names are known to Git on
> Documentation/RelNotes/1.8.1.6.txt: * The code to keep track of what directory names are known to Git on
> Documentation/RelNotes/2.9.0.txt:   known to Git.  They have been taught to do the normalization.
> Documentation/RelNotes/2.8.4.txt:   known to Git.  They have been taught to do the normalization.
> Documentation/RelNotes/1.8.3.txt: * The code to keep track of what directory names are known to Git on
> t/t3005-ls-files-relative.sh:			echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
> t/t3005-ls-files-relative.sh:			echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
>
> so it's not like there's a *ton* of that, but still enough to want to
> get it right. should there be a precise definition for the phrase
> "known to git", or should that phrase simply be banned/replaced?
In my opinion: the latter.

It's not like the phrase represents some concept that we don't have any other name for. They're also known as "tracked files" and that name is more intuitive.

Thanks, Jonathan

Previous: Robert P. J. DayNext: Junio C Hamano
Message 11 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.