From: Phil Hord <hordp@cisco.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: filter-branch vs. <rev-list options>
Date: Thu, 01 Mar 2012 18:39:07 -0500 [thread overview]
Message-ID: <4F50089B.1090202@cisco.com> (raw)
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 <command>] [--tree-filter
<command>]
[--index-filter <command>] [--parent-filter <command>]
[--msg-filter <command>] [--commit-filter <command>]
[--tag-name-filter <command>] [--subdirectory-filter
<directory>]
[--original <namespace>] [-d <directory>] [-f | --force]
[<rev-list options>...]
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
next reply other threads:[~2012-03-01 23:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 23:39 Phil Hord [this message]
2012-03-02 1:00 ` filter-branch vs. <rev-list options> Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F50089B.1090202@cisco.com \
--to=hordp@cisco.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).