From: Phil Hord Date: Thu, 01 Mar 2012 23:39:07 GMT Subject: filter-branch vs. Message-ID: <4F50089B.1090202@cisco.com> I'm trying to pass some arguments to gilt-filter-branch, but it's not doing what I expect. The manual says that git-filter-branch ends with 'rev-list options'. So I tested git-rev-list with this trivial example and got what I wanted: $ git rev-list --not --remotes --not HEAD^..HEAD 019483b7aedfef711b3c85eca000d812a3b501bd But when I tried it with filter-branch it didn't work: $ git filter-branch --msg-filter cat --not --remotes --not HEAD^..HEAD Usage: git filter-branch [--env-filter ] [--tree-filter ] [--index-filter ] [--parent-filter ] [--msg-filter ] [--commit-filter ] [--tag-name-filter ] [--subdirectory-filter ] [--original ] [-d ] [-f | --force] [...] On the other hand, this works ok: $ git filter-branch --msg-filter catHEAD^..HEAD--not --remotes --not Rewrite 019483b7aedfef711b3c85eca000d812a3b501bd (1/1) WARNING: Ref 'refs/heads/master' is unchanged git-filter-branch seems to be parsing its own switches and not recognizing when they run out and the rest are "rev-list" options. Is there a way to force this break, or should I just expect to have to rewrite the logic so that there's always a non-switch argument at the start of the rev-list section? Or am I just doing this wrong? fwiw - I'm actually wanting to do this in a script: git filter-branch --msg-filter cat --not --remotes --not "$@" I put my "--not --remotes --not" before the user arguments in case the user arguments include an odd number of "--not" switches on its own. Thanks, Phil