Skip to content

Commit 03c5257

Browse files
author
Andrew Ruder
committed
Stop assuming abbreviated hash length
Git will always use at least 7 characters, but the size of the abbreviated hash just scales with the repo size. I am working on a repo that abbreviates to 11, rather than up the length one more, let's just go straight to 40. (I see no downsides)
1 parent aecf1e1 commit 03c5257

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/gitv/util/line.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let g:autoloaded_gitv_util_line = 1
77

88
fu! gitv#util#line#sha(lineNumber) "{{{
99
let l = getline(a:lineNumber)
10-
let sha = matchstr(l, "\\[\\zs[0-9a-f]\\{7,10}\\ze\\]$")
10+
let sha = matchstr(l, "\\[\\zs[0-9a-f]\\{7,40}\\ze\\]$")
1111
return sha
1212
endf "}}}
1313

0 commit comments

Comments
 (0)