{"thread":{"id":"13144","subject":"[PATCH v2] Clarify and fix English in git-rm documentation.","startedAt":"2008-04-16T23:41:27Z","lastAt":"2008-04-16T23:41:27Z","messageCount":1,"participants":["Jon Loeliger"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"74609","messageId":"E1JmHFn-0006WE-UE@jdl.com","threadId":"13144","inReplyTo":null,"subject":"[PATCH v2] Clarify and fix English in git-rm documentation.","fromName":"Jon Loeliger","fromEmail":"jdl@jdl.com","sentAt":"2008-04-16T23:41:27Z","receivedAt":"2008-04-16T23:41:27Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"\nDo some verb-noun agreement changes\nClarify some file globbing cases\nFixed a wrong statement in an example.\n\nSigned-off-by: Jon Loeliger <jdl@jdl.com>\n---\n\nVersion 2 here incorporates suggestions from Junio.\n\n Documentation/git-rm.txt |   52 ++++++++++++++++++++++++++++-----------------\n 1 files changed, 32 insertions(+), 20 deletions(-)\n\ndiff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt\nindex dc36c66..9c81b72 100644\n--- a/Documentation/git-rm.txt\n+++ b/Documentation/git-rm.txt\n@@ -11,28 +11,37 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n-Remove files from the working tree and from the index.  The\n-files have to be identical to the tip of the branch, and no\n-updates to its contents must have been placed in the staging\n-area (aka index).  When --cached is given, the staged content has to\n-match either the tip of the branch *or* the file on disk.\n+Remove files from the index, or from the working tree and the index.\n+`git rm` will not remove a file from just your working directory.\n+(There is no option to remove a file only from the work tree\n+and yet keep it in the index; use `/bin/rm` if you want to do that.)\n+The files being removed have to be identical to the tip of the branch,\n+and no updates to their contents can be staged in the index,\n+though that default behavior can be overridden with the `-f` option.\n+When '--cached' is given, the staged content has to\n+match either the tip of the branch or the file on disk,\n+allowing the file to be removed from just the index.\n \n \n OPTIONS\n -------\n <file>...::\n \tFiles to remove.  Fileglobs (e.g. `*.c`) can be given to\n-\tremove all matching files.  Also a leading directory name\n-\t(e.g. `dir` to add `dir/file1` and `dir/file2`) can be\n-\tgiven to remove all files in the directory, recursively,\n-\tbut this requires `-r` option to be given for safety.\n+\tremove all matching files.  If you want git to expand\n+\tfile glob characters, you may need to shell-escape them.\n+\tA leading directory name\n+\t(e.g. `dir` to remove `dir/file1` and `dir/file2`) can be\n+\tgiven to remove all files in the directory, and recursively\n+\tall sub-directories,\n+\tbut this requires the `-r` option to be explicitly given.\n \n -f::\n \tOverride the up-to-date check.\n \n -n, \\--dry-run::\n-        Don't actually remove the file(s), just show if they exist in\n-        the index.\n+\tDon't actually remove any file(s).  Instead, just show\n+\tif they exist in the index and would otherwise be removed\n+\tby the command.\n \n -r::\n         Allow recursive removal when a leading directory name is\n@@ -44,9 +53,9 @@ OPTIONS\n \tfor command-line options).\n \n \\--cached::\n-\tThis option can be used to tell the command to remove\n-\tthe paths only from the index, leaving working tree\n-\tfiles.\n+\tUse this option to unstage and remove paths only from the index.\n+\tWorking tree files, whether modified or not, will be\n+\tleft alone.\n \n \\--ignore-unmatch::\n \tExit with a zero status even if no files matched.\n@@ -59,11 +68,15 @@ OPTIONS\n DISCUSSION\n ----------\n \n-The list of <file> given to the command can be exact pathnames,\n-file glob patterns, or leading directory name.  The command\n-removes only the paths that is known to git.  Giving the name of\n+The <file> list given to the command can be exact pathnames,\n+file glob patterns, or leading directory names.  The command\n+removes only the paths that are known to git.  Giving the name of\n a file that you have not told git about does not remove that file.\n \n+File globbing matches across directory boundaries.  Thus, given\n+two directories `d` and `d2`, there is a difference between\n+using `git rm \\'d\\*\\'` and `git rm \\'d/\\*\\'`, as the former will\n+also remove all of directory `d2`.\n \n EXAMPLES\n --------\n@@ -72,11 +85,10 @@ git-rm Documentation/\\\\*.txt::\n \t`Documentation` directory and any of its subdirectories.\n +\n Note that the asterisk `\\*` is quoted from the shell in this\n-example; this lets the command include the files from\n-subdirectories of `Documentation/` directory.\n+example; this lets git, and not the shell, expand the pathnames\n+of files and subdirectories under the `Documentation/` directory.\n \n git-rm -f git-*.sh::\n-\tRemove all git-*.sh scripts that are in the index.\n \tBecause this example lets the shell expand the asterisk\n \t(i.e. you are listing the files explicitly), it\n \tdoes not remove `subdir/git-foo.sh`.\n-- \n1.5.5.50.g71060\n"}]}