Subject: Re: Filter-branch's "move tree to subdirectory" example fails with BSD sed?

From: Johannes Sixt <[email-masked]>
Date: Sat, 14 Apr 2012 21:25:05 +0200

Am 14.04.2012 18:00, schrieb Christopher Tiwald:
> The "Move tree to subdirectory" example in the 'git filter-branch'
> manpage fails on Mac OSX 10.7.3, but succeeds on Ubuntu 10.04.

> git init "test"
> cd "test"
> mkdir -p subdirA/subdirB
> echo content > subdirA/subdirB/file
> git add .
> git commit -m "initial commit"
> git ls-files -s | sed "s-\t\"*-&newsubdir/-"
> 
> On Mac 10.7.3 the final command outputs:
> 100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	subdirA/subdirB/file
> 
> On Ubuntu 10.04:
> 100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	newsubdir/subdirA/subdirB/file

Perhaps a literal TAB instead of \t makes the example work?

It would be difficult, though, to write this down in the manual in an
unambiguous way.

-- Hannes