bunch of new stuff, a few fixes
[distro-setup] / auto-commit-changes
diff --git a/auto-commit-changes b/auto-commit-changes
new file mode 100755 (executable)
index 0000000..d46dd55
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+commit() {
+  if ! git diff --quiet || ! git diff --cached --quiet; then
+    # even with -q, it emits a newline into stderr
+    git commit -qam autocommit 2>/dev/null
+  fi
+}
+
+
+
+if [[ $1 ]]; then
+  for dir; do
+    cd $dir
+    commit
+  done
+else
+  commit
+fi