Create branches before doing filter-branch and a added a task that combines all filter-branch tasks

This commit is contained in:
Miro Spönemann 2016-06-10 14:01:43 +02:00
parent 54605ebea2
commit 5a9f0eea45
2 changed files with 10 additions and 1 deletions

View file

@ -61,6 +61,12 @@ repositories.each { targetRepo ->
dependsOn(generateRemovals)
inputs.file removalsFile
workingDir '..'
commandLine 'splitting/git-filter-branch.sh', removalsFile.path, file('.').canonicalPath
commandLine 'splitting/git-filter-branch.sh', removalsFile.path, file('.').canonicalPath, targetRepo
}
}
task(allFilterBranch) {
group 'Git History Manipulation'
description 'Runs the filter-branch tasks for all target repositories.'
repositories.each { dependsOn("${it}FilterBranch") }
}

View file

@ -1,5 +1,8 @@
#!/bin/bash
# TODO change source branch to 'master'
git checkout -B split-$3 msp/separateBuilds
REMOVALS=`cat $1 | tr '\n' ' '`
git filter-branch -f --prune-empty \
--index-filter "git rm -qrf --cached --ignore-unmatch $REMOVALS" \