{"thread":{"id":"14604","subject":"[PATCH] Documentation/git-filter-branch: Remove Useless Use of Plumbing","startedAt":"2008-07-22T22:24:35Z","lastAt":"2008-07-23T22:02:30Z","messageCount":3,"participants":["Petr Baudis","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84389","messageId":"20080722222418.15372.62190.stgit@localhost","threadId":"14604","inReplyTo":null,"subject":"[PATCH] Documentation/git-filter-branch: Remove Useless Use of Plumbing","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-22T22:24:35Z","receivedAt":"2008-07-22T22:24:35Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"The example to remove file using index-filter uses git update-index\n --remove where git rm --cached works as well.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/git-filter-branch.txt |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex a3edc00..7ba9dab 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -191,7 +191,7 @@ Thus you may instead want to use `rm -f filename` as the script.\n A significantly faster version:\n \n --------------------------------------------------------------------------\n-git filter-branch --index-filter 'git update-index --remove filename' HEAD\n+git filter-branch --index-filter 'git rm --cached filename' HEAD\n --------------------------------------------------------------------------\n \n Now, you will get the rewritten history saved in HEAD.\n"},{"id":"84407","messageId":"7vd4l5jwi4.fsf@gitster.siamese.dyndns.org","threadId":"14604","inReplyTo":"20080722222418.15372.62190.stgit@localhost","subject":"Re: [PATCH] Documentation/git-filter-branch: Remove Useless Use of Plumbing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-23T00:05:07Z","receivedAt":"2008-07-23T00:05:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> The example to remove file using index-filter uses git update-index\n>  --remove where git rm --cached works as well.\n\nI am not sure \"works as well\" is a good enough justification to choose a\nPorcelain command over a plumbing command in this particular context.\nAfter all, filter-branch is a scripting enviornment, isn't it?\n\nThere also is another subtle difference.  \"git rm\" takes pathspecs while\n\"update-index\" takes paths.\n\nSo after running one of these commands:\n\n\t$ git rm --cached 'Makefil?'\n\t$ git update-index --force-remove 'Makefil?'\n\noutput from:\n\n\t$ git diff --cached --stat\n\nwould be different.\n"},{"id":"84625","messageId":"20080723220230.GP32184@machine.or.cz","threadId":"14604","inReplyTo":"7vd4l5jwi4.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Documentation/git-filter-branch: Remove Useless Use of Plumbing","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-23T22:02:30Z","receivedAt":"2008-07-23T22:02:30Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Tue, Jul 22, 2008 at 05:05:07PM -0700, Junio C Hamano wrote:\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > The example to remove file using index-filter uses git update-index\n> >  --remove where git rm --cached works as well.\n> \n> I am not sure \"works as well\" is a good enough justification to choose a\n> Porcelain command over a plumbing command in this particular context.\n> After all, filter-branch is a scripting enviornment, isn't it?\n\nBut one of the few that are regularly used even by \"mere users\", who\nwould be probably put off unnecessarily by using this mysterious command.\n(We might also say that I'm testing Dscho's suggestions, though this\npatch was of course provoked by a \"huh\" of a user I was helping.)\n\n> There also is another subtle difference.  \"git rm\" takes pathspecs while\n> \"update-index\" takes paths.\n> \n> So after running one of these commands:\n> \n> \t$ git rm --cached 'Makefil?'\n> \t$ git update-index --force-remove 'Makefil?'\n> \n> output from:\n> \n> \t$ git diff --cached --stat\n> \n> would be different.\n\nI don't think this is relevant for the example in question. Users are as\nlikely to be bit by or take advantage of this as by regular git rm\nusage.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"}]}