You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Couldn't you highlight branch name in git log --decorate and git log --decorate --graph?
In --all mode, highlighting would be strongly expected to find branches easily.
I started the first step with the diff below,
however, by my poor vim-syntax knowledge,
I couldn't avoid the false positive that contains () in commit message...
--- a/syntax/git.vim+++ b/syntax/git.vim@@ -18,8 +18,10 @@ syn region gitHead start=/\%(^commit\%( \x\{4,\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ en
" minimize false positives by verifying contents of buffer
if getline(1) =~# '^\x\{7,\} ' && getline('$') =~# '^\x\{7,\} '
syn match gitHashAbbrev /^\x\{7,\} \@=/ contains=@NoSpell
+ syn match gitHashRef /(.\{-})/ contains=@NoSpell
elseif getline(1) =~# '^[|\/\\_ ]\{-\}\*[|\/\\_ ]\{-\} \x\{7,\} '
syn match gitHashAbbrev /^[|\/\\_ ]\{-\}\*[|\/\\_ ]\{-\} \zs\x\{7,\} \@=/ contains=@NoSpell
+ syn match gitHashRef /(.\{-})/ contains=@NoSpell
endif
" git log --graph
syn region gitGraph start=/\%(^[|\/\\_ ]*\*[|\/\\_ ]\{-\} commit\%( \x\{4,\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^\%([|\/\\_ ]*$\)\@=/ contains=@NoSpell
@@ -74,12 +76,13 @@ syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained
syn match gitDate /\<\d\+ \l\+ ago\>/ contained
syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHashAbbrev skipwhite
syn match gitReference /\S\+\S\@!/ contained
-syn match gitHash /\<\x\{40,\}\>/ contained nextgroup=gitIdentity,gitHash skipwhite contains=@NoSpell+syn match gitHash /\<\x\{40,\}\>/ contained nextgroup=gitIdentity,gitHash,gitHashRef skipwhite contains=@NoSpell
syn match gitReflogOld /^\x\{40,\} \@=/ contained nextgroup=gitReflogNew skipwhite contains=@NoSpell
syn match gitReflogNew /\<\x\{40,\} \@=/ contained nextgroup=gitIdentity skipwhite contains=@NoSpell
-syn match gitHashAbbrev /\<\x\{4,\}\>/ contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell-syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite contains=@NoSpell+syn match gitHashAbbrev /\<\x\{4,\}\>/ contained nextgroup=gitHashAbbrev,gitHashRef skipwhite contains=@NoSpell+syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev,gitHashRef skipwhite contains=@NoSpell
syn match gitHashStage /\<\x\{4,\}\>/ contained nextgroup=gitStage skipwhite contains=@NoSpell
+syn match gitHashRef /(.\{-})/ contained skipwhite contains=@NoSpell
syn match gitStage /\<\d\t\@=/ contained
@@ -98,6 +101,7 @@ hi def link gitDate Number
hi def link gitMode Number
hi def link gitHashStage gitHash
hi def link gitHashAbbrev gitHash
+hi def link gitHashRef gitIdentityKeyword
hi def link gitReflogOld gitHash
hi def link gitReflogNew gitHash
hi def link gitHash Identifier
The text was updated successfully, but these errors were encountered:
The solution to your false positive is nextgroup. But I'm worried about other false positives, commit messages like (Hopefully) fix bug. Since --decorate is not the default, most people will only ever see false positives. That's why I decided it not to bother with this at all. Not saying I will never budge on this, but it's going to be an uphill battle. You might want to start with the more modest goal of fixing the --decorate --pretty=medium case.
Couldn't you highlight branch name in
git log --decorate
andgit log --decorate --graph
?In
--all
mode, highlighting would be strongly expected to find branches easily.I started the first step with the diff below,
however, by my poor vim-syntax knowledge,
I couldn't avoid the false positive that contains
()
in commit message...The text was updated successfully, but these errors were encountered: