|
diff --git a/ui-log.c b/ui-log.c index c3757dd..3202848 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -136,65 +136,66 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern |
136 | tip = ctx.qry.head; |
136 | tip = ctx.qry.head; |
137 | |
137 | |
138 | argv[1] = disambiguate_ref(tip); |
138 | argv[1] = disambiguate_ref(tip); |
139 | |
139 | |
140 | if (grep && pattern && (!strcmp(grep, "grep") || |
140 | if (grep && pattern && (!strcmp(grep, "grep") || |
141 | !strcmp(grep, "author") || |
141 | !strcmp(grep, "author") || |
142 | !strcmp(grep, "committer"))) |
142 | !strcmp(grep, "committer"))) |
143 | argv[argc++] = fmt("--%s=%s", grep, pattern); |
143 | argv[argc++] = fmt("--%s=%s", grep, pattern); |
144 | |
144 | |
145 | if (path) { |
145 | if (path) { |
146 | argv[argc++] = "--"; |
146 | argv[argc++] = "--"; |
147 | argv[argc++] = path; |
147 | argv[argc++] = path; |
148 | } |
148 | } |
149 | init_revisions(&rev, NULL); |
149 | init_revisions(&rev, NULL); |
150 | rev.abbrev = DEFAULT_ABBREV; |
150 | rev.abbrev = DEFAULT_ABBREV; |
151 | rev.commit_format = CMIT_FMT_DEFAULT; |
151 | rev.commit_format = CMIT_FMT_DEFAULT; |
152 | rev.verbose_header = 1; |
152 | rev.verbose_header = 1; |
153 | rev.show_root_diff = 0; |
153 | rev.show_root_diff = 0; |
154 | setup_revisions(argc, argv, &rev, NULL); |
154 | setup_revisions(argc, argv, &rev, NULL); |
155 | load_ref_decorations(); |
155 | load_ref_decorations(); |
156 | rev.show_decorations = 1; |
156 | rev.show_decorations = 1; |
157 | rev.grep_filter.regflags |= REG_ICASE; |
157 | rev.grep_filter.regflags |= REG_ICASE; |
158 | compile_grep_patterns(&rev.grep_filter); |
158 | compile_grep_patterns(&rev.grep_filter); |
159 | prepare_revision_walk(&rev); |
159 | prepare_revision_walk(&rev); |
160 | |
160 | |
161 | if (pager) |
161 | if (pager) |
162 | html("<table class='list nowrap'>"); |
162 | html("<table class='list nowrap'>"); |
163 | |
163 | |
164 | html("<tr class='nohover'><th class='left'>Age</th>" |
164 | html("<tr class='nohover'><th class='left'>Age</th>" |
165 | "<th class='left'>Commit message"); |
165 | "<th class='left'>Commit message"); |
166 | if (pager) { |
166 | if (pager) { |
167 | html(" ("); |
167 | html(" ("); |
168 | cgit_log_link("toggle", NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
168 | cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, |
| |
169 | NULL, ctx.qry.head, ctx.qry.sha1, |
169 | ctx.qry.path, ctx.qry.ofs, ctx.qry.grep, |
170 | ctx.qry.path, ctx.qry.ofs, ctx.qry.grep, |
170 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1); |
171 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1); |
171 | html(")"); |
172 | html(")"); |
172 | } |
173 | } |
173 | html("</th><th class='left'>Author</th>"); |
174 | html("</th><th class='left'>Author</th>"); |
174 | if (ctx.repo->enable_log_filecount) { |
175 | if (ctx.repo->enable_log_filecount) { |
175 | html("<th class='left'>Files</th>"); |
176 | html("<th class='left'>Files</th>"); |
176 | columns++; |
177 | columns++; |
177 | if (ctx.repo->enable_log_linecount) { |
178 | if (ctx.repo->enable_log_linecount) { |
178 | html("<th class='left'>Lines</th>"); |
179 | html("<th class='left'>Lines</th>"); |
179 | columns++; |
180 | columns++; |
180 | } |
181 | } |
181 | } |
182 | } |
182 | html("</tr>\n"); |
183 | html("</tr>\n"); |
183 | |
184 | |
184 | if (ofs<0) |
185 | if (ofs<0) |
185 | ofs = 0; |
186 | ofs = 0; |
186 | |
187 | |
187 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
188 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
188 | free(commit->buffer); |
189 | free(commit->buffer); |
189 | commit->buffer = NULL; |
190 | commit->buffer = NULL; |
190 | free_commit_list(commit->parents); |
191 | free_commit_list(commit->parents); |
191 | commit->parents = NULL; |
192 | commit->parents = NULL; |
192 | } |
193 | } |
193 | |
194 | |
194 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
195 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
195 | print_commit(commit); |
196 | print_commit(commit); |
196 | free(commit->buffer); |
197 | free(commit->buffer); |
197 | commit->buffer = NULL; |
198 | commit->buffer = NULL; |
198 | free_commit_list(commit->parents); |
199 | free_commit_list(commit->parents); |
199 | commit->parents = NULL; |
200 | commit->parents = NULL; |
200 | } |
201 | } |
|