All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Adam Mercer <ramercer@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: Using filter-branch to move repo contents in subdirectory
Date: Thu, 29 Jul 2010 15:08:05 +0200	[thread overview]
Message-ID: <201007291508.05242.trast@student.ethz.ch> (raw)
In-Reply-To: <AANLkTik2dL5jrEjZe0LB6Y4_PEwRt-7t_5CG7gup3pnV@mail.gmail.com>

Adam Mercer wrote:
> $ git filter-branch --index-filter \
>     'git ls-files -s | sed "s-\t\"*-&sftlib/-" |
>         GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
>             git update-index --index-info &&
>     mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
> Rewrite 223651f2ebd5d5d9341bcfc9e7cb6caaa3f4d171 (56/65)Ignoring path
> 00bootsftlib/

What OS is this?  You seem to have a 'sed' version where \t does not
match the horizontal tab character, or a shell that replaces the '\t'
inside a double-quoted string with simply 't'.

As a short-term fix, you can try to replace it with $(printf '\t')
which should always give a tab character.  You need to quote the '
though, so that's

  $ git filter-branch --index-filter \
      'git ls-files -s | sed "s-$(printf '\''\t'\'')\"*-&sftlib/-" |
          GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
              git update-index --index-info &&
      mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD


As for the actual issue: 'man 1p sed' on my system claims

        * The escape sequence '\n' shall match a <newline> embedded in the  pat-
          tern space. A literal <newline> shall not be used in the BRE of a con-
          text address or in the substitute function.

but does not mention \t at all, so I guess either that manpage is
wrong or GNU sed is not POSIX compliant even with --posix (where it
still treats \t as a tab).

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2010-07-29 13:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 12:37 Using filter-branch to move repo contents in subdirectory Adam Mercer
2010-07-29 13:08 ` Thomas Rast [this message]
2010-07-29 13:15   ` Adam Mercer
2010-07-29 13:24     ` [PATCH] filter-branch tests/docs: avoid \t in sed regexes Thomas Rast
2010-07-29 14:47       ` Tomas Carnecky
2010-07-29 14:52         ` Thomas Rast
2010-07-29 15:02           ` Tomas Carnecky
2010-07-29 15:10             ` [PATCH] t7005: fix subdirectory-filter test Thomas Rast
2010-07-29 15:12               ` Thomas Rast
2010-08-09 19:36 ` Using filter-branch to move repo contents in subdirectory Adam Mercer
2010-08-11 15:01   ` Adam Mercer
2010-08-11 19:32     ` Jeff King
2010-08-11 19:59       ` Adam Mercer

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=201007291508.05242.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=ramercer@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.