use `comm` instead of ruby script, since we have exact file names (and now a huge number of them).
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/fa274794 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/fa274794 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/fa274794 Branch: refs/heads/master Commit: fa274794b999529d5834778520bfb0f8f8dcbf58 Parents: f29fd5e Author: Alex Heneveld <[email protected]> Authored: Wed Dec 16 00:59:18 2015 +0000 Committer: Alex Heneveld <[email protected]> Committed: Wed Dec 16 00:59:18 2015 +0000 ---------------------------------------------------------------------- 4-make-new-repos.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/fa274794/4-make-new-repos.sh ---------------------------------------------------------------------- diff --git a/4-make-new-repos.sh b/4-make-new-repos.sh index acaec27..9fb63cb 100755 --- a/4-make-new-repos.sh +++ b/4-make-new-repos.sh @@ -34,13 +34,15 @@ mkdir new-repos for x in $PROJS ; do new_repo brooklyn-$x - ( cd new-repos/${REPO_PREFIX}brooklyn-$x && git filter-branch --index-filter "git ls-files | ${basedir}/filter_whitelist.rb ${basedir}/common-whitelist.txt ${basedir}/$x-whitelist.full.gen.txt | xargs -0 git rm -q -r --cached --ignore-unmatch" --tag-name-filter cat --prune-empty master ${branches} ) + # use -0 and tr so files with spaces are passed as single words + # batch by 1000 to avoid xargs insufficient space error + ( cd new-repos/${REPO_PREFIX}brooklyn-$x && git filter-branch --index-filter "git ls-files | comm -23 - ${basedir}/$x-whitelist.full.gen.txt | tr '\n' '\0' | xargs -0 -n 1000 git rm -q -r --cached --ignore-unmatch" --tag-name-filter cat --prune-empty master ${branches} ) cleanup brooklyn-$x git rm .gitattributes .gitignore README.md NOTICE LICENSE git mv brooklyn-$x/{*,.??*} ./ done new_repo brooklyn -( cd new-repos/${REPO_PREFIX}brooklyn && git filter-branch --index-filter "git ls-files | ${basedir}/filter_whitelist.rb ${basedir}/common-whitelist.txt ${basedir}/brooklyn-uber-repo-whitelist.gen.txt | xargs -0 git rm -q -r --cached --ignore-unmatch" --tag-name-filter cat --prune-empty master ${branches} ) +( cd new-repos/${REPO_PREFIX}brooklyn && git filter-branch --index-filter "git ls-files | comm -23 - ${basedir}/brooklyn-uber-repo-whitelist.gen.txt | tr '\n' '\0' | xargs -0 -n 1000 git rm -q -r --cached --ignore-unmatch" --tag-name-filter cat --prune-empty master ${branches} ) cleanup brooklyn
