{"thread":{"id":"29806","subject":"filter-branch vs. <rev-list options>","startedAt":"2012-03-01T23:39:07Z","lastAt":"2012-03-02T01:00:19Z","messageCount":2,"participants":["Phil Hord","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"185869","messageId":"4F50089B.1090202@cisco.com","threadId":"29806","inReplyTo":null,"subject":"filter-branch vs. <rev-list options>","fromName":"Phil Hord","fromEmail":"hordp@cisco.com","sentAt":"2012-03-01T23:39:07Z","receivedAt":"2012-03-01T23:39:07Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"I'm trying to pass some arguments to gilt-filter-branch, but it's not\ndoing what I expect.  The manual says that git-filter-branch ends with\n'rev-list options'.  So I tested git-rev-list with this trivial example\nand got what I wanted:\n    $ git rev-list --not --remotes --not HEAD^..HEAD\n    019483b7aedfef711b3c85eca000d812a3b501bd\n\nBut when I tried it with filter-branch it didn't work:\n    $ git filter-branch --msg-filter cat --not --remotes --not HEAD^..HEAD\n     Usage: git filter-branch [--env-filter <command>] [--tree-filter\n<command>]\n            [--index-filter <command>] [--parent-filter <command>]\n            [--msg-filter <command>] [--commit-filter <command>]\n            [--tag-name-filter <command>] [--subdirectory-filter\n<directory>]\n            [--original <namespace>] [-d <directory>] [-f | --force]\n            [<rev-list options>...]\n\nOn the other hand, this works ok:\n    $ git filter-branch --msg-filter catHEAD^..HEAD--not --remotes --not\n    Rewrite 019483b7aedfef711b3c85eca000d812a3b501bd (1/1)\n    WARNING: Ref 'refs/heads/master' is unchanged\n\ngit-filter-branch seems to be parsing its own switches and not\nrecognizing when they run out and the rest are \"rev-list\" options. \n\nIs there a way to force this break, or should I just expect to have to\nrewrite the logic so that there's always a non-switch argument at the\nstart of the rev-list section?  Or am I just doing this wrong?\n\nfwiw - I'm actually wanting to do this in a script:\n    git filter-branch --msg-filter cat --not --remotes --not \"$@\"\n\nI put my \"--not --remotes --not\" before the user arguments in case the\nuser arguments include an odd number of \"--not\" switches on its own.\n\nThanks,\nPhil\n"},{"id":"185873","messageId":"20120302010019.GD21835@sigill.intra.peff.net","threadId":"29806","inReplyTo":"4F50089B.1090202@cisco.com","subject":"Re: filter-branch vs. <rev-list options>","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-02T01:00:19Z","receivedAt":"2012-03-02T01:00:19Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 01, 2012 at 06:39:07PM -0500, Phil Hord wrote:\n\n> git-filter-branch seems to be parsing its own switches and not\n> recognizing when they run out and the rest are \"rev-list\" options. \n> \n> Is there a way to force this break, or should I just expect to have to\n> rewrite the logic so that there's always a non-switch argument at the\n> start of the rev-list section?  Or am I just doing this wrong?\n> \n> fwiw - I'm actually wanting to do this in a script:\n>     git filter-branch --msg-filter cat --not --remotes --not \"$@\"\n\nDid you try \"--\":\n\n  git filter-branch --msg-filter cat -- --not --remotes --not \"$@\"\n\n?\n"}]}