]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/amlook: --squash trims the amlog notes tree
authorJunio C Hamano <gitster@pobox.com>
Tue, 6 Oct 2020 20:13:56 +0000 (13:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Oct 2020 20:13:56 +0000 (13:13 -0700)
amlook

diff --git a/amlook b/amlook
index dcae1f040700a2249cbec44e2098995e4266a854..e750129bc6ce88b8d02c078159316aec86cdef1f 100755 (executable)
--- a/amlook
+++ b/amlook
@@ -121,6 +121,12 @@ elif test "$1" = "--gc"
 then
        shift
        garbage_collect "$@"
+elif test "$1" == "--squash"
+then
+       L=notes/amlog &&
+       git notes --ref=$L prune &&
+       C=$(echo amlog | git commit-tree refs/$L^{tree}) &&
+       git update-ref refs/$L $C
 else
        for msg
        do