From 811f34b70b60b4df2997e3ba8cd109e7d06d683b Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Thu, 10 Aug 2023 21:30:57 +1000 Subject: [PATCH] [[B]Commits] Bump Git commit hash length limit to 40 (#1495) When working in large repositories, 9 characters can be ambiguous. Bumping it to 40, which is the length of SHA-1. (The algorithm is not that relevant though. Even when SHA-256 takes over, 40 characters should still be enough for most repositories.) --- autoload/fzf/vim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index d0248b5..171aac9 100755 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -1301,7 +1301,7 @@ function! s:commits_sink(lines) return endif - let pat = '[0-9a-f]\{7,9}' + let pat = '[0-9a-f]\{7,40}' if a:lines[0] == 'ctrl-y' let hashes = join(filter(map(a:lines[1:], 'matchstr(v:val, pat)'), 'len(v:val)'))