{"thread":{"id":"17754","subject":"git filter-branch examples on man page are outdated","startedAt":"2009-02-12T16:33:34Z","lastAt":"2009-02-12T23:06:11Z","messageCount":4,"participants":["Jeffrey Chupp","Jacob Helwig","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"104396","messageId":"AB13D1C5-4464-49B5-8314-FCB1E249BF22@semanticart.com","threadId":"17754","inReplyTo":null,"subject":"git filter-branch examples on man page are outdated","fromName":"Jeffrey Chupp","fromEmail":"jeff@semanticart.com","sentAt":"2009-02-12T16:33:34Z","receivedAt":"2009-02-12T16:33:34Z","isPatch":false,"sender":{"key":"jeff@semanticart.com","avatar":null},"body":"http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html\nmb:repo jeff$ ls db/data/us_cities.data.insert.sql\ndb/data/us_cities.data.insert.sql\nmb:repo jeff$ git filter-branch --index-filter 'git rm -f --cached db/ \ndata/us_cities.data.insert.sql' HEAD\nRewrite d54d3041d7d5739b3093f802fc1ef45f3c8e5e16 (1/2713)fatal:  \npathspec 'db/data/us_cities.data.insert.sql' did not match any files\nindex filter failed: git rm -f --cached db/data/ \nus_cities.data.insert.sql\n\nekidd speculated that since the file wasn't in the first version of  \nthe repo, it was borking.  He was right.  Next he told me to try\n\ngit filter-branch --index-filter 'git rm -f --cached db/data/ \nus_cities.data.insert.sql || true'\n\nwhich worked.  He also asked me to point this out on this list:\n\nekidd:semanticart: Commit 8c1ce0f46b85d40f215084eed7313896300082df  \nchanged the behavior without updating the example in the man page. If  \nyou're feeling inspired, you may want to post this to git@vger.\n\nThanks and apologies for any etiquette breaches, I don't know what I'm  \ndoing :)\n\n-jeff\n"},{"id":"104403","messageId":"1234461670-25657-1-git-send-email-jacob.helwig@gmail.com","threadId":"17754","inReplyTo":"AB13D1C5-4464-49B5-8314-FCB1E249BF22@semanticart.com","subject":"[PATCH] Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter","fromName":"Jacob Helwig","fromEmail":"jacob.helwig@gmail.com","sentAt":"2009-02-12T18:01:10Z","receivedAt":"2009-02-12T18:01:10Z","isPatch":true,"sender":{"key":"jacob.helwig@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14557?v=4"},"body":"Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>\n---\n Documentation/git-filter-branch.txt |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex 451950b..1fbbbb4 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -212,6 +212,11 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD\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.1.1\n"},{"id":"104442","messageId":"7v4oyzjmqv.fsf@gitster.siamese.dyndns.org","threadId":"17754","inReplyTo":"1234461670-25657-1-git-send-email-jacob.helwig@gmail.com","subject":"Re: [PATCH] Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-12T22:47:52Z","receivedAt":"2009-02-12T22:47:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Helwig <jacob.helwig@gmail.com> writes:\n\n> Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>\n> ---\n>  Documentation/git-filter-branch.txt |    5 +++++\n>  1 files changed, 5 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\n> index 451950b..1fbbbb4 100644\n> --- a/Documentation/git-filter-branch.txt\n> +++ b/Documentation/git-filter-branch.txt\n> @@ -212,6 +212,11 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD\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\nLooks sane to me.  Objections?\n"},{"id":"104445","messageId":"alpine.DEB.1.00.0902130005580.10279@pacific.mpi-cbg.de","threadId":"17754","inReplyTo":"7v4oyzjmqv.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add 'rm -f' equivalent to 'git rm' example of filter-branch --index-filter","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-12T23:06:11Z","receivedAt":"2009-02-12T23:06:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 12 Feb 2009, Junio C Hamano wrote:\n\n> Jacob Helwig <jacob.helwig@gmail.com> writes:\n> \n> > Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>\n> > ---\n> >  Documentation/git-filter-branch.txt |    5 +++++\n> >  1 files changed, 5 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\n> > index 451950b..1fbbbb4 100644\n> > --- a/Documentation/git-filter-branch.txt\n> > +++ b/Documentation/git-filter-branch.txt\n> > @@ -212,6 +212,11 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD\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> \n> Looks sane to me.  Objections?\n\nDefinitely no objections from me.\n\nCiao,\nDscho\n"}]}