{"thread":{"id":"18273","subject":"[PATCH] Documentation: filter-branch: show --ignore-unmatch in main index-filter example","startedAt":"2009-03-11T23:00:56Z","lastAt":"2009-03-11T23:00:56Z","messageCount":1,"participants":["Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"107749","messageId":"fc756c64020427c7bff3a9d9a41c4842b1c13acb.1236812339.git.trast@student.ethz.ch","threadId":"18273","inReplyTo":null,"subject":"[PATCH] Documentation: filter-branch: show --ignore-unmatch in main index-filter example","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-03-11T23:00:56Z","receivedAt":"2009-03-11T23:00:56Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Rearrange the example usage of\n\n  git filter-branch --index-filter 'git rm --cached ...'\n\nso that --ignore-unmatch is in the main example block.  People keep\nstumbling over the (lack of this) option to the point where it is a\nFAQ, so we would want to expose the most common usage where it stands\nout.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nThis actually came up once again on IRC about a week ago, but the doc\nchange sank somewhere deep into my todo stack.\n\nArguably the --tree-filter 'rm filename' example should get the same\ntreatment, but I can't find a nice way to do so without harming the\nflow of thought in the example development.\n\n\n Documentation/git-filter-branch.txt |   17 +++++++++--------\n 1 files changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex 7ffe03f..237f85e 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -91,7 +91,9 @@ OPTIONS\n --index-filter <command>::\n \tThis is the filter for rewriting the index.  It is similar to the\n \ttree filter but does not check out the tree, which makes it much\n-\tfaster.  For hairy cases, see linkgit:git-update-index[1].\n+\tfaster.  Frequently used with `git rm \\--cached\n+\t\\--ignore-unmatch ...`, see EXAMPLES below.  For hairy\n+\tcases, see linkgit:git-update-index[1].\n \n --parent-filter <command>::\n \tThis is the filter for rewriting the commit's parent list.\n@@ -204,19 +206,18 @@ However, if the file is absent from the tree of some commit,\n a simple `rm filename` will fail for that tree and commit.\n Thus you may instead want to use `rm -f filename` as the script.\n \n-A significantly faster version:\n+Using `\\--index-filter` with 'git-rm' yields a significantly faster\n+version.  Like with using `rm filename`, `git rm --cached filename`\n+will fail if the file is absent from the tree of a commit.  If you\n+want to \"completely forget\" a file, it does not matter when it entered\n+history, so we also add `\\--ignore-unmatch`:\n \n --------------------------------------------------------------------------\n-git filter-branch --index-filter 'git rm --cached filename' HEAD\n+git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD\n --------------------------------------------------------------------------\n \n Now, you will get the rewritten history saved in HEAD.\n \n-As with using `rm filename`, `git rm --cached filename` will fail\n-if the file is absent from the tree of a commit.  If it is not important\n-whether the file is already absent from the tree, you can use\n-`git rm --cached --ignore-unmatch filename` instead.\n-\n To rewrite the repository to look as if `foodir/` had been its project\n root, and discard all other history:\n \n-- \n1.6.2.489.g51f6b7\n"}]}