Re: Using filter-branch to move repo contents in subdirectory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 11, 2010 at 10:01:15AM -0500, Adam Mercer wrote:

> On Mon, Aug 9, 2010 at 14:36, Adam Mercer <ramercer@xxxxxxxxx> wrote:
> 
> > I'm trying to do this with another repo now and am getting a different
> > error message:
> >
> > $ git filter-branch --index-filter \
> >    'git ls-files -s | gsed "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 b3100fb24a7eb2f349801f3b87cf995dc3d14bba (1/44)mv:
> > /Users/ram/git/eah2/.git-rewrite/t/../index.new: No such file or
> > directory
> > index filter failed: git ls-files -s | gsed "s-\t\"*-&sftlib/-" |
> > GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && mv
> > $GIT_INDEX_FILE.new $GIT_INDEX_FILE
> > $
> >
> > Any ideas?
> >
> > This is on Mac OS X 10.6.4, with git-1.7.2.1, and GNU sed 4.2.1
> 
> Anyone?

It looks like git-update-index will not create $GIT_INDEX_FILE at all if
you have no actual input lines to --index-info. So perhaps you have some
commit in your repo that has no actual content in it. Either that or
for some reason your "ls-files -s | gsed" invocation is producing no
output.

Try adding a "touch $GIT_INDEX_FILE.new" at the beginning of your index
filter and see if that helps. Then the file will always exist to be
moved, even if we write nothing to it. If it works, then problem solved.
If you get a repo full of empty commits, then something is wrong with
your gsed pipeline.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]