Re: Using filter-branch to move repo contents in subdirectory
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jul 29, 2010, 13:08 UTC
- Message-ID
- <201007291508.05242.trast@student.ethz.ch>
- In-Reply-To
- <AANLkTik2dL5jrEjZe0LB6Y4_PEwRt-7t_5CG7gup3pnV@mail.gmail.com>
Adam Mercer wrote:
Show 7 quoted lines
> $ 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' HEADAs 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