Add workaround for git pretty.format settings that break the log view
[tig.git] / test / log / pretty-format-test
blob79f43410a4a32c03dcfde386204fffdacb9d0a30
1 #!/bin/sh
3 . libtest.sh
4 . libgit.sh
6 export LINES=20
8 tigrc <<EOF
9 # Check compatibility with pretty format override
10 set log-options = --date=short
11 EOF
13 gitconfig <<EOF
14 [format]
15 pretty = format:'%C(bold blue)%H%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
16 EOF
18 steps '
19 :view-log
20 :save-display log-pretty-format-override.screen
22 :toggle log-options --pretty=raw
23 :save-display log-pretty-raw.screen
25 :toggle log-options --pretty=full
26 :save-display log-pretty-full.screen
28 :toggle cmdline-args --pretty=fuller
29 :toggle log-options
30 :save-display log-pretty-fuller.screen
33 git_clone 'repo-one'
35 test_tig
37 assert_equals 'log-pretty-format-override.screen' <<EOF
38 commit 5cb3412a5e06e506840495b91acc885037a48b72
39 Refs: [master], {origin/master}, {origin/HEAD}
40 Author: Max Power <power123@example.org>
41 Date: 2010-04-07
43 Commit 10 E
45 commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4
46 Author: Jørgen Thygesen Brahe <brache@example.dk>
47 Date: 2010-03-29
49 Commit 10 D
51 commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4
52 Author: 作者 <zuozhea@example.ch>
53 Date: 2010-03-21
55 Commit 10 C
56 [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 301 5%
57 EOF
59 assert_equals 'log-pretty-raw.screen' <<EOF
60 commit 5cb3412a5e06e506840495b91acc885037a48b72
61 Refs: [master], {origin/master}, {origin/HEAD}
62 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
63 parent 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4
64 author Max Power <power123@example.org> 1270618660 +0000
65 committer Committer <c.ommitter@example.net> 1270618660 +0000
67 Commit 10 E
69 commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4
70 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
71 parent 8d53d6a41f8540749c0db5d0b53e48d2f178dce4
72 author Jørgen Thygesen Brahe <brache@example.dk> 1269882930 +0000
73 committer Committer <c.ommitter@example.net> 1269882930 +0000
75 Commit 10 D
77 commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4
78 [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 400 4%
79 EOF
81 assert_equals 'log-pretty-full.screen' <<EOF
82 commit 5cb3412a5e06e506840495b91acc885037a48b72
83 Refs: [master], {origin/master}, {origin/HEAD}
84 Author: Max Power <power123@example.org>
85 Commit: Committer <c.ommitter@example.net>
87 Commit 10 E
89 commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4
90 Author: Jørgen Thygesen Brahe <brache@example.dk>
91 Commit: Committer <c.ommitter@example.net>
93 Commit 10 D
95 commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4
96 Author: 作者 <zuozhea@example.ch>
97 Commit: Committer <c.ommitter@example.net>
99 Commit 10 C
100 [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 301 5%
103 assert_equals 'log-pretty-fuller.screen' <<EOF
104 commit 5cb3412a5e06e506840495b91acc885037a48b72
105 Refs: [master], {origin/master}, {origin/HEAD}
106 Author: Max Power <power123@example.org>
107 AuthorDate: Wed Apr 7 05:37:40 2010 +0000
108 Commit: Committer <c.ommitter@example.net>
109 CommitDate: Wed Apr 7 05:37:40 2010 +0000
111 Commit 10 E
113 commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4
114 Author: Jørgen Thygesen Brahe <brache@example.dk>
115 AuthorDate: Mon Mar 29 17:15:30 2010 +0000
116 Commit: Committer <c.ommitter@example.net>
117 CommitDate: Mon Mar 29 17:15:30 2010 +0000
119 Commit 10 D
121 commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4
122 [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 401 4%