Re: Problem using git-filter-branch to move tree when repository name contains space

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

 



On Fri, Apr 01, 2011 at 04:30:26PM +0200, Jean-FranÃois Burdet wrote:

> I want to move my repository (wich is contained in a directory whose
> name's containing a space)  root tree to a subdirectory.
> 
> I followed what's documented in
> http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html ,
> using the last example :
> 
> [...]
>
> jfburdet@nagios:~/git test$ git filter-branch --index-filter \
> >         'git ls-files -s | sed "s-\t\"*-&newsubdir/-" |
> >                 GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
> >                         git update-index --index-info &&
> >          mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
> Rewrite 3658e305df3ace21d39bf57dd4e0e5627818dfcc (1/1)mv: target
> `test/.git-rewrite/t/../index' is not a directory

The problem is that GIT_INDEX_FILE is an absolute path that contains the
repo name. So it needs to be quoted in the mv command. This should work:

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

-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]