+bin/vi-git-both-modified
[nethome.git] / bin / vi-git-both-modified
diff --git a/bin/vi-git-both-modified b/bin/vi-git-both-modified
new file mode 100755 (executable)
index 0000000..8f47892
--- /dev/null
@@ -0,0 +1,15 @@
+#! /bin/bash
+fis=""
+for fi in $(git status|sed -n 's/^     both modified: *//p');do
+  if ! grep -q '^<<<<<<< ' $fi;then
+    git add $fi
+    continue
+  fi
+  fis="$fis $fi"
+done
+if [ -z "$fis" ];then
+  echo done
+  exit 0
+fi
+set -x
+exec vim $fis