The sha1 commit ids displayed by git may range in size and are not strictly 7 digits or 40 digits. In practice, the old default was something like 7, and that was enough to uniquely distinguish the commit. However, some repositories (Upstream Linux kernel) now use 12 as the default.
When we support intervals, use them to specify the full range to make the hint grab all available characters.
This patch fixes the regular expression that parses `fingers-pattern-N`
settings, allowing the `N` number to contain either one or more digits.
Before this patch:
$ (echo '@fingers-pattern-0 "git rebase --(abort|continue)"'; echo '@fingers-pattern-1 "yolo"'; echo '@fingers-pattern-50 "whatever"') | grep '^@fingers-pattern' | sed 's/^@fingers-pattern-[0-9] "\(.*\)"$/(\1)/'
(git rebase --(abort|continue))
(yolo)
@fingers-pattern-50 "whatever"
After this patch:
$ (echo '@fingers-pattern-0 "git rebase --(abort|continue)"'; echo '@fingers-pattern-1 "yolo"'; echo '@fingers-pattern-50 "whatever"') | sed -n 's/^@fingers-pattern-[0-9]\{1,\} "\(.*\)"$/(\1)/p'
(git rebase --(abort|continue))
(yolo)
(whatever)