additional hash simplifications for -s'any'
[git-grep-footer.git] / git-grep-footer
index 8ac3a03b0a9fcf1225b5e33c4f564f1439ec266d..53f6f1cf49d15e0d6f63d062c91e844c7bb24c6d 100755 (executable)
@@ -79,7 +79,8 @@ while (readline) {
                                                s{\b (https?)://\S+ }{[$1]}gmsx;  # url
                                                s{(?: < | \A ) [^@>\s]+ @ [^>]+ (?: > | \Z )}{<...>}igmsx;  # address
                                                s{\b [0-9]+ \b}{[num]}gmsx;  # number
-                                               s{\b I? [0-9a-f]{40} \b}{[sha1]}gmsx;  # hash
+                                               s{\b [Ig]? [0-9a-f]{  40} \b}{[sha1]}gmsx;  # hash
+                                               s{\b [Ig]? [0-9a-f]{6,40} \b}{[hash]}gmsx;  # abbrev
                                        }
                                }
                                when (['all', 'contents']) {