Thread (15 messages) flat view 15 messages, 7 authors, 2018-05-23

Re: which files are "known to git"?

From: Robert P. J. Day <hidden>
Date: 2018-05-21 15:55:31

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'.  However, a quick `git grep -i
known.to.git` shows that we're actually not consistent by what we
mean with this phrase.  A little test setup:

  $ echo ignoreme >>.gitignore
  $ git add .gitignore
  $ git commit -m ignoreme
  $ touch ignoreme
  $ git ls-files -o
  ignoreme
  $ git ls-files -o --exclude-standard
  $
quoted
From Documentation/git-clean.txt:
    Normally, only files unknown to Git are removed, but if the `-x`
    option is specified, ignored files are also removed.

  This implies that ignored files are not 'unknown to Git', or fixing the
  double negative, that ignored files are 'known to Git':
  $ git clean -n
  $ git clean -nx
  Would remove ignoreme
  $
  uh oh ... i'm just now remembering a discussion once upon a time
where this wasn't simply a double negative. IIRC (and someone else
help me out here), "known to git" also meant known *not* to be tracked
or something like that (as in, ignored files).

  anyone remember that conversation?

rday
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help