git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using filter-branch to move repo contents in subdirectory
@ 2010-07-29 12:37 Adam Mercer
  2010-07-29 13:08 ` Thomas Rast
  2010-08-09 19:36 ` Using filter-branch to move repo contents in subdirectory Adam Mercer
  0 siblings, 2 replies; 13+ messages in thread
From: Adam Mercer @ 2010-07-29 12:37 UTC (permalink / raw)
  To: git

Hi

I'm trying to use git filter-branch to move all contents of a repo
into a subdirectory of the repo root. The git filter-branch man page
has the following example:

       To move the whole tree into a subdirectory, or remove it from there:

           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

So I've been trying to use this, the original structure of the repo is:

$ ls
00boot                 SFTdumpall.c     debian
Makefile.am            SFTdumpheader.c  ligodcc.cls
README                 SFTvalidate.c    pdfdraftcopy.sty
SCCB_2004_09_09        SFTwrite.c       run_validate.sh
SFTReferenceLibrary.c  T040164.tex      sftreferencelibrary-2.2.tar.gz
SFTReferenceLibrary.h  configure.in     sftreferencelibrary-2.3.tar.gz
$

and I want all this in a subdirectory call "sftlib", so using the
example from the manpage I ran:

$ 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/
Rewrite c979ee835ebb89408e2f5f345ddefbb4d8cd75f5 (57/65)Ignoring path
00bootsftlib/
Rewrite 10037389e41fb4b4d04234ca2e302a7a491616d5 (58/65)Ignoring path
00bootsftlib/
Rewrite 21b4c31a02c6b7718145d471ba20e6fa70eb30d0 (59/65)Ignoring path
00bootsftlib/
Rewrite dc5cebbe14050f52f2effaa5eac4eb579dd440c3 (60/65)Ignoring path
00bootsftlib/
Rewrite 3b83fdd19b5d674445f5263df8cb2fc35c3c0092 (61/65)Ignoring path
00bootsftlib/
Rewrite 5246038ceeb2d28fba462076b62f3cf1b2b7e9ab (62/65)Ignoring path
00bootsftlib/
Rewrite 0fd3256ff401b405c677e83db350ad41ee74ef0d (63/65)Ignoring path
00bootsftlib/
Ignoring path debian/compatsftlib/
Ignoring path debian/copyrightsftlib/
Rewrite 9aca227c807658b951e81a6ca4460115b2fe8ccc (64/65)Ignoring path
00bootsftlib/
Ignoring path debian/compatsftlib/
Ignoring path debian/copyrightsftlib/
Rewrite 00274be10e10920d84db145268d85faf1b06539f (65/65)Ignoring path
00bootsftlib/
Ignoring path debian/compatsftlib/
Ignoring path debian/copyrightsftlib/

Ref 'refs/heads/to_merge' was rewritten
$

now the directory structure is:

$ ls
Makefile.am  SCCB_2004_09_09        SFTReferenceLibrary.h
SFTdumpheader.c   SFTwritsftlib    configure.in  ligodcc.cls
run_validatsftlib
README       SFTReferenceLibrary.c  SFTdumpall.c
SFTvalidatsftlib  T040164.tsftlib  debian        pdfdraftsftlib
sftsftlib
$

which is clearly not what I'm wanting. What I am doing wrong here? As
far as I can I'm using the example from the man-page?

Cheers

Adam

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-08-11 19:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 12:37 Using filter-branch to move repo contents in subdirectory Adam Mercer
2010-07-29 13:08 ` Thomas Rast
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).