summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2020-02-19 22:57:02 +0500
committerAnton Bobov <abobov@gmail.com>2020-02-19 22:57:02 +0500
commitd34161bbda6781a617705ee429776e53768c7b51 (patch)
tree0336b1562c4e8791b5e9b7cadabdb5d3035dce65
parentd5c22685624a4c4e4ac039a5c23782245f95385b (diff)
Updates.
-rwxr-xr-xfio-cdm5
-rwxr-xr-xgit-split14
2 files changed, 19 insertions, 0 deletions
diff --git a/fio-cdm b/fio-cdm
index 75ea28f..43603c2 100755
--- a/fio-cdm
+++ b/fio-cdm
@@ -58,6 +58,11 @@ fio2cdm() {
trap "rm -f ${TARGET}/.fio-diskmark" 0 1 2 3 9 15
+if [ -z "$TARGET" ] ; then
+ echo "First argument should be target directory."
+ exit 1
+fi
+
# see. http://www.winkey.jp/article.php/20110310142828679
cat <<_EOL_ | fio --output-format=terse - | fio2cdm
[global]
diff --git a/git-split b/git-split
new file mode 100755
index 0000000..6c3398f
--- /dev/null
+++ b/git-split
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# https://stackoverflow.com/questions/40698651/how-to-split-every-commit-by-file
+# Split HEAD commit into multiples with single file in it.
+
+set -e
+
+SHA=$(git rev-parse --short HEAD)
+
+git reset HEAD^
+
+git diff-tree --no-commit-id --name-only -r $SHA | while read -r f; do
+ git add "$f"
+ GIT_EDITOR="echo '0a\n$SHA $f\n\n.\nw' | ed -s" git commit -c $SHA
+done