From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Git Mailing list <git@vger.kernel.org>
Subject: more pedantry ... what means a file "known to Git"?
Date: Sun, 12 Nov 2017 04:48:40 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.2.21.1711120430580.30032@localhost.localdomain> (raw)
apologies for more excruciating nitpickery, but i ask since it seems
that phrase means slightly different things depending on where you
read it.
first, i assume that there are only two categories:
1) files known to Git
2) files unknown to Git
and that there is no fuzzy, grey area middle ground, yes?
now, in "man git-clean", one reads (near the top):
Cleans the working tree by recursively removing files that are
not under version control, starting from the current directory.
Normally, only files unknown to Git are removed, but if the -x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
option is specified, ignored files are also removed.
the way that's worded suggests that ignored files are "known" to Git,
yes? that is, if, by default, "git clean" removes only files "unknown"
to Git, and "-x" extends that to ignored files, the conclusion is that
ignored files are *known* to Git.
if, however, you check out "man git-rm", you read:
The <file> list given to the command can be exact pathnames,
file glob patterns, or leading directory names. The command
removes only the paths that are known to Git. Giving the name
^^^^^^^^^^^^
of a file that you have not told Git about does not remove that file.
so "git rm" removes only files "known to Git", but from the above
regarding how "git clean" sees this, that should include ignored
files, which of course it doesn't.
given that this phrase occurs in a number of places:
$ grep -ir "known to git" *
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."
$
it might be useful to define precisely what it means. or is it assumed
to be context dependent?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next reply other threads:[~2017-11-12 9:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 9:48 Robert P. J. Day [this message]
2017-11-13 15:34 ` more pedantry ... what means a file "known to Git"? Philip Oakley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.21.1711120430580.30032@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).