Skip to content
Browse files

Append timestamp to log format

  • Loading branch information...
1 parent 1545ac5 commit eeb3fbe6e558045e0f7a97c744b70f7115e6254c @kmnk committed May 14, 2013
Showing with 11 additions and 10 deletions.
  1. +4 −3 autoload/giti/log.vim
  2. +7 −7 test/autoload/giti/test_log.vim
View
7 autoload/giti/log.vim
@@ -10,7 +10,7 @@ set cpo&vim
if !exists('g:giti_log_default_line_count')
let g:giti_log_default_line_count = 50
endif
-let s:pretty_format = ":::%H:::%P:::%an<%ae>[%ad]:::%cn<%ce>[%cd]:::%s"
+let s:pretty_format = ":::%H:::%P:::%an<%ae>[%ad(%at)]:::%cn<%ce>[%cd(%at)]:::%s"
" }}}
function! giti#log#run(...)"{{{
@@ -73,11 +73,12 @@ endfunction"}}}
function! s:build_user_data(line)"{{{
let matches
-\ = matchlist(a:line, '^\(.\+\)<\(.\+\)>\[\(.\+\)\]$')
+\ = matchlist(a:line, '^\(.\+\)<\(.\+\)>\[\(.\+\)(\(.\+\))]$')
return {
\ 'name' : matches[1],
\ 'mail' : matches[2],
-\ 'date' : matches[3]
+\ 'date' : matches[3],
+\ 'time' : matches[4]
\ }
endfunction"}}}
View
14 test/autoload/giti/test_log.vim
@@ -33,7 +33,7 @@ endfunction"}}}
function! s:tc.setup_list()"{{{
function! giti#system(command)"{{{
let b:system_called_with = a:command
- return '* | | :::aaaa:::bbbb:::cccc<cc@cc.cc>[cc/cc/cc cc:cc:cc]:::dddd<dd@dd.dd>[dd/dd/dd dd:dd:dd]:::eeee'
+ return '* | | :::aaaa:::bbbb:::cccc<cc@cc.cc>[cc/cc/cc cc:cc:cc(12345)]:::dddd<dd@dd.dd>[dd/dd/dd dd:dd:dd(12345)]:::eeee'
endfunction"}}}
endfunction
function! s:tc.teardown_list()"{{{
@@ -47,8 +47,8 @@ function! s:tc.test_list()"{{{
\ 'graph' : '* | | ',
\ 'hash' : 'aaaa',
\ 'parent_hash' : 'bbbb',
-\ 'author' : {'name' : 'cccc', 'mail' : 'cc@cc.cc', 'date' : 'cc/cc/cc cc:cc:cc'},
-\ 'committer' : {'name' : 'dddd', 'mail' : 'dd@dd.dd', 'date' : 'dd/dd/dd dd:dd:dd'},
+\ 'author' : {'name' : 'cccc', 'mail' : 'cc@cc.cc', 'date' : 'cc/cc/cc cc:cc:cc', 'time' : '12345'},
+\ 'committer' : {'name' : 'dddd', 'mail' : 'dd@dd.dd', 'date' : 'dd/dd/dd dd:dd:dd', 'time' : '12345'},
\ 'subject' : 'eeee',
\ }])
call self.assert_match(
@@ -59,8 +59,8 @@ function! s:tc.test_list()"{{{
\ 'graph' : '* | | ',
\ 'hash' : 'aaaa',
\ 'parent_hash' : 'bbbb',
-\ 'author' : {'name' : 'cccc', 'mail' : 'cc@cc.cc', 'date' : 'cc/cc/cc cc:cc:cc'},
-\ 'committer' : {'name' : 'dddd', 'mail' : 'dd@dd.dd', 'date' : 'dd/dd/dd dd:dd:dd'},
+\ 'author' : {'name' : 'cccc', 'mail' : 'cc@cc.cc', 'date' : 'cc/cc/cc cc:cc:cc', 'time' : '12345'},
+\ 'committer' : {'name' : 'dddd', 'mail' : 'dd@dd.dd', 'date' : 'dd/dd/dd dd:dd:dd', 'time' : '12345'},
\ 'subject' : 'eeee',
\ }])
call self.assert_match(
@@ -71,8 +71,8 @@ function! s:tc.test_list()"{{{
\ 'graph' : '* | | ',
\ 'hash' : 'aaaa',
\ 'parent_hash' : 'bbbb',
-\ 'author' : {'name' : 'cccc', 'mail' : 'cc@cc.cc', 'date' : 'cc/cc/cc cc:cc:cc'},
-\ 'committer' : {'name' : 'dddd', 'mail' : 'dd@dd.dd', 'date' : 'dd/dd/dd dd:dd:dd'},
+\ 'author' : {'name' : 'cccc', 'mail' : 'cc@cc.cc', 'date' : 'cc/cc/cc cc:cc:cc', 'time' : '12345'},
+\ 'committer' : {'name' : 'dddd', 'mail' : 'dd@dd.dd', 'date' : 'dd/dd/dd dd:dd:dd', 'time' : '12345'},
\ 'subject' : 'eeee',
\ }])
call self.assert_match(

0 comments on commit eeb3fbe

Please sign in to comment.
Something went wrong with that request. Please try again.