git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Geoff Nixon <geoff@geoff.codes>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug: `git-filter-branch −−subdirectory−filter` fails on Darwin, others?
Date: Wed, 11 May 2016 10:08:02 -0400	[thread overview]
Message-ID: <20160511140802.GA20134@sigill.intra.peff.net> (raw)
In-Reply-To: <154a01265c2.c271895e226206.8641058706319152212@geoff.codes>

On Wed, May 11, 2016 at 06:47:20AM -0700, Geoff Nixon wrote:

> I believe I have found a bug in git. On Mac OS X (at least 10.9
> through 10.11), and versions of git from the current HEAD down through
> at least 1.8.x, `git filter-branch −−subdirectory−filter ...` fails.
> Using, e.g., the following example (from the docs for
> git-filter-branch), `git filter-branch --subdirectory-filter foodir --
> --all`, and using the git repository as the example repository, `git
> filter-branch --subdirectory-filter Documentation -- --all`, the
> "error message" one receives is "fatal: bad revision
> '−−subdirectory−filter'".

I just double-checked, and it works fine for me in a simple test:

  git init
  mkdir subdir
  for i in 1 2 3 4 5; do
    echo $i >base-$i
    echo $i >subdir/sub-$i
    git add .
    git commit -m $i
  done
  git filter-branch --subdirectory-filter subdir -- --all

That's on:

  $ sw_vers
  ProductName:    Mac OS X
  ProductVersion: 10.9.5
  BuildVersion:   13F34

However, I notice the error message you show has non-ascii dashes when
it prints "--subdirectory-filter". That matches what you said below:

>     - Exporting PS4 to 'WTF: $LINENO ' and setting `-x` is practically
>     of no use, except that the last line before it fails appears to be
>     `git rev-parse --no-flags --revs-only --symbolic-full-name
>     --default HEAD $'�\210\222�\210\222subdirectory�\210\222filter`
>     (including the octal sequences and bad-unicode character, those
>     are not email artifacts)

Are you sure that you are invoking filter-branch with regular ascii
dashes, and not Unicode "minus-sign" (U+2212)?

I seem to recall this coming up once before related to OS X, but I can't
seem to find it in the archive. And I don't recall if it was related to
the terminal, a keyboard setting, or something else.

-Peff

  reply	other threads:[~2016-05-11 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 13:47 Bug: `git-filter-branch −−subdirectory−filter` fails on Darwin, others? Geoff Nixon
2016-05-11 14:08 ` Jeff King [this message]
2016-05-11 14:47   ` Geoff Nixon

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=20160511140802.GA20134@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=geoff@geoff.codes \
    --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).