]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/CB: help culling stale topic branches
authorJunio C Hamano <gitster@pobox.com>
Wed, 20 Apr 2016 21:43:53 +0000 (14:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Apr 2016 21:43:53 +0000 (14:43 -0700)
CB [new file with mode: 0755]

diff --git a/CB b/CB
new file mode 100755 (executable)
index 0000000..685d96b
--- /dev/null
+++ b/CB
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Cull topic branches
+
+git for-each-ref --merged maint 'refs/heads/*/*' |
+while read commit type name
+do
+       git for-each-ref --count=1 --sort=version:refname \
+               --contains "$name" \
+               --format="%(taggerdate:iso) #%(refname:strip=2) $name" \
+               refs/tags/
+done |
+sort |
+sed -e 's/[^#]*#//'