script: add ctdb-import.* scripts
authorStefan Metzmacher <metze@samba.org>
Wed, 25 Sep 2013 22:00:53 +0000 (00:00 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 13 Nov 2013 13:12:51 +0000 (14:12 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
script/ctdb-import.msg-filter.sh [new file with mode: 0755]
script/ctdb-import.tree-filter.sh [new file with mode: 0755]
script/ctdb-import.txt [new file with mode: 0644]

diff --git a/script/ctdb-import.msg-filter.sh b/script/ctdb-import.msg-filter.sh
new file mode 100755 (executable)
index 0000000..107d736
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+
+set -e
+set -u
+
+cat -
+echo ""
+echo "(This used to be ctdb commit ${GIT_COMMIT})"
+
+exit 0
diff --git a/script/ctdb-import.tree-filter.sh b/script/ctdb-import.tree-filter.sh
new file mode 100755 (executable)
index 0000000..3b4a1e1
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+
+set -e
+set -u
+
+lo=$(find -mindepth 1 -maxdepth 1)
+for o in $lo; do
+       mkdir -p ctdb
+       mv $o ctdb/
+done
+
+exit 0
+
diff --git a/script/ctdb-import.txt b/script/ctdb-import.txt
new file mode 100644 (file)
index 0000000..621b24e
--- /dev/null
@@ -0,0 +1,5 @@
+ctdb-import.git$ git filter-branch \
+               --tree-filter /path/to/ctdb-import.tree-filter.sh \
+               --msg-filter  /path/to/ctdb-import.msg-filter.sh \
+               HEAD
+