summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelley Spoon <kelley.spoon@linaro.org>2021-03-04 01:06:04 -0600
committerKelley Spoon <kelley.spoon@linaro.org>2021-03-04 01:06:04 -0600
commit6ee067b60427c941e319eed0487e6e973c4d13f5 (patch)
treee3698b5b95d9cf9125f865fd9fc9678600728c9d
find_danglers: script to find dangling commitsHEADmaster
Script to help find dangling commits by gerrit change id.
-rwxr-xr-xfind_danglers.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/find_danglers.sh b/find_danglers.sh
new file mode 100755
index 0000000..0fc40bb
--- /dev/null
+++ b/find_danglers.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# prints a table of commit sha1:gerrit change id:commit date
+
+for x in $(git fsck --dangling|cut -f3 -d' '); do
+ id=$(git show --format=raw $x|grep Change-Id:|cut -f2 -d:)
+ if [ "x$id" != "x" ];
+ then
+ echo $x:$id:$(git show --format=medium $x|grep Date:| awk '{$1=""; print}')
+ fi
+done