5

I am trying to split an ikiwiki into two wikis.

Suppose I have an ikiwiki called myiki (compare this question from ikiwiki.info), which contains the pages

pageA1,pageA2,...,pageB1,pageB2,...

now I want to have two wikis called myikiA and myikiB, such that:

  • myikiA contains pageA1,pageA2,...
    The history of myikiA should contain the whole history of those pages, but no history of pageB1,pageB2,...

and:

  • myikiB contains pageB1,pageB2,...
    The history of myikiB should contain the whole history of those pages but no history of pageA1,pageA2,...

In a first step I made a copy of my scrdir and tried to remove a page named foo like this (note that in the scrdir there are files called foo.mdwn and directories foo as well).
To do so, I did this command:

sudo git filter-branch --tree-filter 'find . -name foo* -exec rm -r -f  {} \;' --prune-empty -f HEAD

Rewrite 3cbc4646145e31cf7ce23d5e8397baaebab64c60 (179/1439)find: `./index/testdir/foo': No such file or directory
tree filter failed: find . -name foo* -exec rm -r -f  {} \;

Any Idea what's wrong with it?

Is there a way to give a list of pages and split the wiki as described above?

Helgi
  • 5,428
  • 1
  • 31
  • 48
student
  • 1,636
  • 3
  • 29
  • 53
  • Would http://stackoverflow.com/questions/5677766/filter-branch-to-remove-extra-directory help or apply in your case? – VonC Dec 09 '11 at 10:03
  • Hm. Thanks, however I don't see, how to apply it to this situation (I am a git newbie). git-ls-files seems not to work recusively!? – student Dec 09 '11 at 10:16
  • Yes, I was just wandering if the '`git update-index --index-info`' bit might improve the situation. – VonC Dec 09 '11 at 10:22
  • @VonC Could you post the complete command I should try instead of that in my post? – student Dec 10 '11 at 10:04
  • It's really important for me to solve this issue, any idea is welcome... – student Dec 10 '11 at 10:19
  • Sorry, but my initial idea don't apply to your `git filter-branch` command. That would have been `sudo git filter-branch --tree-filter 'git update-index --index-info && find . -name foo* -exec rm -r -f {} \;' --prune-empty -f HEAD` – VonC Dec 10 '11 at 13:17
  • @VonC Yes, gives the same error. – student Dec 10 '11 at 14:31
  • Since there are no answers up to now in spite of the bounty, it might be a good idea to move this question to another stackexchange site. What do you thin, which site is appropriate for this question? – student Dec 18 '11 at 10:12

1 Answers1

1

When find finds foo/, it calls rm -rf on it and then tries to enter it to find more files. You can cause find to remove the directory and then ignore it using -prune.

find . -name foo* -exec rm -r -f {} \; -prune

Ryan Patterson
  • 499
  • 3
  • 13
  • Thanks, now I get: `Rewrite 9ed693bf5ed887beac89b482ba8dcf971429838a (97/1492)find: `./index/foo.mdwn': No such file or directory tree filter failed: git update-index --index-info && find . -name foo\* -exec rm -r -f {} \; -prune` – student Dec 27 '11 at 15:38
  • Hmm, you might get away with `find . -name foo.mdwn -delete -o -name foo -type d -exec rm -rf {} \; -prune`? Something along these lines. It's also worth pointing out that the 'foo*' you are using may get expanded by the shell, so you might need to toss it in quotes. – Ryan Patterson Jan 06 '12 at 19:16