From 5a9f0eea45bf68a692c530f7a3ac3e70a58ed92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Spo=CC=88nemann?= Date: Fri, 10 Jun 2016 14:01:43 +0200 Subject: [PATCH] Create branches before doing filter-branch and a added a task that combines all filter-branch tasks --- splitting/build.gradle | 8 +++++++- splitting/git-filter-branch.sh | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/splitting/build.gradle b/splitting/build.gradle index c380b2c77..bf9028d41 100644 --- a/splitting/build.gradle +++ b/splitting/build.gradle @@ -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") } +} diff --git a/splitting/git-filter-branch.sh b/splitting/git-filter-branch.sh index e7bd12306..a8ff18c30 100755 --- a/splitting/git-filter-branch.sh +++ b/splitting/git-filter-branch.sh @@ -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" \