Commit 4ceb8155ccb971807ae8c7e32ed1357ac23685a2

Tracey Emery 2020-01-15T22:10:30

create full logs page

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
diff --git a/Makefile.inc b/Makefile.inc
index 106ff97..8f9b2cf 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,5 +1,5 @@
 CPPFLAGS += -DGOT_LIBEXECDIR=${LIBEXECDIR} -DGOT_VERSION=${GOT_VERSION}
-#CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
+CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
 #CFLAGS += -DGOT_PACK_NO_MMAP
 #CFLAGS += -DGOT_NO_OBJ_CACHE
 #CFLAGS += -DGOT_OBJ_CACHE_DEBUG
diff --git a/gotweb/TODO b/gotweb/TODO
index c1ca944..a55dfa2 100644
--- a/gotweb/TODO
+++ b/gotweb/TODO
@@ -2,6 +2,15 @@ Complete templates.
 Complete stylesheets.
 Complete gw_funcs
 ----
-Remember items
-	description
-	cloneurl
+
+- Add Prev/Next to shortlogs/logs that have more entries than
+  got_max_commits_display
+
+- Alter gw_get_repo_log full_log int to type more logs output for other options,
+  such as header displays for commit, commit_diff, etc.
+
+- Discuss how much of the gitweb functionality we really need or want. A user
+  can really go down an endless rabbit hole. Is it all worthwhile?
+
+- Redo index header, so columns are removed when content is set to not display
+  in gotweb.conf.
diff --git a/gotweb/files/htdocs/gotweb/gotweb.css b/gotweb/files/htdocs/gotweb/gotweb.css
index 6593c76..3ea4783 100644
--- a/gotweb/files/htdocs/gotweb/gotweb.css
+++ b/gotweb/files/htdocs/gotweb/gotweb.css
@@ -190,12 +190,12 @@ body {
 	padding-bottom: 5px;
 	overflow: auto;
 }
-#shortlog_wrapper {
+#logbriefs_wrapper {
 	clear: left;
 	float: left;
 	width: 100%;
 }
-#shortlog_age {
+#logbriefs_age {
 	padding-left: 10px;
 	padding-top: 5px;
 	padding-bottom: 5px;
@@ -203,7 +203,7 @@ body {
 	width: 7.5em;
 	overflow: auto;
 }
-#shortlog_author {
+#logbriefs_author {
 	float: left;
 	padding-top: 5px;
 	padding-bottom: 5px;
@@ -211,8 +211,9 @@ body {
 	font-style: italic;
 	overflow: auto;
 }
-#shortlog_log {
+#logbriefs_log {
 	float: left;
+	padding-left: 10px;
 	padding-right: 10px;
 	padding-top: 5px;
 	padding-bottom: 5px;
@@ -353,6 +354,66 @@ body {
 	text-decoration: none;
 }
 
+/* logs.tmpl */
+
+#logs_wrapper {
+	clear: left;
+	float: left;
+	width: 100%;
+}
+#logs_title_wrapper {
+	clear: left;
+	float: left;
+	width: 100%;
+	background-color: LightSlateGray;
+	color: #ffffff;
+}
+#logs_title {
+	padding-left: 10px;
+	padding-top: 5px;
+	padding-bottom: 5px;
+}
+#logs_content {
+	clear: left;
+	float: left;
+	width: 100%;
+}
+#logs_row_wrapper {
+	clear: left;
+	float: left;
+	background-color: #f5fcfb;
+	width: 100%;
+}
+#logs_commit {
+	clear: left;
+	float: left;
+	padding-left: 10px;
+	padding-top: 5px;
+	padding-bottom: 2px;
+}
+#logs_author {
+	clear: left;
+	float: left;
+	padding-left: 10px;
+	padding-top: 2px;
+	padding-bottom: 2px;
+}
+#logs_age {
+	clear: left;
+	float: left;
+	padding-left: 10px;
+	padding-top: 2px;
+	padding-bottom: 5px;
+}
+
+#log {
+	clear: left;
+	float: left;
+	padding-left: 20px;
+	padding-top: 2px;
+	padding-bottom: 20px;
+}
+
 /* summary.tmpl */
 
 #summary_wrapper {
@@ -361,19 +422,19 @@ body {
 	width: 100%;
 	background-color: Khaki;
 }
-#summary_shortlog_title_wrapper {
+#summary_logbriefs_title_wrapper {
 	clear: left;
 	float: left;
 	width: 100%;
 	background-color: LightSlateGray;
 	color: #ffffff;
 }
-#summary_shortlog_title {
+#summary_logbriefs_title {
 	padding-left: 10px;
 	padding-top: 5px;
 	padding-bottom: 5px;
 }
-#summary_shortlog_content {
+#summary_logbriefs_content {
 	clear: left;
 	float: left;
 	width: 100%;
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 69b21bc..debc3fa 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -141,8 +141,8 @@ static char			*gw_get_repo_owner(struct trans *,
 static char			*gw_get_time_str(time_t, int);
 static char			*gw_get_repo_age(struct trans *,
 				    char *, char *, int);
-static char			*gw_get_repo_shortlog(struct trans *,
-				    const char *, int);
+static char			*gw_get_repo_log(struct trans *, const char *,
+				    char *, int, int);
 static char			*gw_get_repo_tags(struct trans *);
 static char			*gw_get_repo_heads(struct trans *);
 static char			*gw_get_clone_url(struct trans *, char *);
@@ -174,7 +174,7 @@ static const struct got_error*	 gw_history(struct trans *);
 static const struct got_error*	 gw_index(struct trans *);
 static const struct got_error*	 gw_log(struct trans *);
 static const struct got_error*	 gw_raw(struct trans *);
-static const struct got_error*	 gw_shortlog(struct trans *);
+static const struct got_error*	 gw_logbriefs(struct trans *);
 static const struct got_error*	 gw_snapshot(struct trans *);
 static const struct got_error*	 gw_summary(struct trans *);
 static const struct got_error*	 gw_tree(struct trans *);
@@ -197,7 +197,7 @@ enum gw_query_actions {
 	GW_INDEX,
 	GW_LOG,
 	GW_RAW,
-	GW_SHORTLOG,
+	GW_LOGBRIEFS,
 	GW_SNAPSHOT,
 	GW_SUMMARY,
 	GW_TREE
@@ -214,7 +214,7 @@ static struct gw_query_action gw_query_funcs[] = {
 	{ GW_INDEX,	 "index",	gw_index,	"gw_tmpl/index.tmpl" },
 	{ GW_LOG,	 "log",		gw_log,		"gw_tmpl/index.tmpl" },
 	{ GW_RAW,	 "raw",		gw_raw,		"gw_tmpl/index.tmpl" },
-	{ GW_SHORTLOG,	 "shortlog",	gw_shortlog,	"gw_tmpl/index.tmpl" },
+	{ GW_LOGBRIEFS,	 "logbriefs",	gw_logbriefs,	"gw_tmpl/index.tmpl" },
 	{ GW_SNAPSHOT,	 "snapshot",	gw_snapshot,	"gw_tmpl/index.tmpl" },
 	{ GW_SUMMARY,	 "summary",	gw_summary,	"gw_tmpl/index.tmpl" },
 	{ GW_TREE,	 "tree",	gw_tree,	"gw_tmpl/index.tmpl" },
@@ -393,7 +393,18 @@ static const struct got_error *
 gw_log(struct trans *gw_trans)
 {
 	const struct got_error *error = NULL;
+	char *log, *log_html;
 
+	log = gw_get_repo_log(gw_trans, NULL, NULL,
+	    gw_trans->gw_conf->got_max_commits_display, 1);
+
+	if (log != NULL && strcmp(log, "") != 0) {
+		if ((asprintf(&log_html, logs, log)) == -1)
+			return got_error_from_errno("asprintf");
+		khttp_puts(gw_trans->gw_req, log_html);
+		free(log_html);
+		free(log);
+	}
 	return error;
 }
 
@@ -406,23 +417,22 @@ gw_raw(struct trans *gw_trans)
 }
 
 static const struct got_error *
-gw_shortlog(struct trans *gw_trans)
+gw_logbriefs(struct trans *gw_trans)
 {
 	const struct got_error *error = NULL;
-	char *shortlog, *shortlog_html;
+	char *logbriefs, *logbriefs_html;
 
-	shortlog = gw_get_repo_shortlog(gw_trans, NULL,
-	    gw_trans->gw_conf->got_max_commits_display);
+	logbriefs = gw_get_repo_log(gw_trans, NULL, NULL,
+	    gw_trans->gw_conf->got_max_commits_display, 0);
 
-	if (shortlog != NULL && strcmp(shortlog, "") != 0) {
-		if ((asprintf(&shortlog_html, summary_shortlog,
-		    shortlog)) == -1)
+	if (logbriefs != NULL && strcmp(logbriefs, "") != 0) {
+		if ((asprintf(&logbriefs_html, summary_logbriefs,
+		    logbriefs)) == -1)
 			return got_error_from_errno("asprintf");
-		khttp_puts(gw_trans->gw_req, shortlog_html);
-		free(shortlog_html);
-		free(shortlog);
+		khttp_puts(gw_trans->gw_req, logbriefs_html);
+		free(logbriefs_html);
+		free(logbriefs);
 	}
-
 	return error;
 }
 
@@ -439,7 +449,7 @@ gw_summary(struct trans *gw_trans)
 {
 	const struct got_error *error = NULL;
 	char *description_html, *repo_owner_html, *repo_age_html,
-	     *cloneurl_html, *shortlog, *tags, *heads, *shortlog_html,
+	     *cloneurl_html, *logbriefs, *tags, *heads, *logbriefs_html,
 	     *tags_html, *heads_html, *age;
 
 	error = apply_unveil(gw_trans->gw_dir->path, NULL);
@@ -497,17 +507,17 @@ gw_summary(struct trans *gw_trans)
 	}
 	khttp_puts(gw_trans->gw_req, div_end);
 
-	shortlog = gw_get_repo_shortlog(gw_trans, NULL, D_MAXSLCOMMDISP);
+	logbriefs = gw_get_repo_log(gw_trans, NULL, NULL, D_MAXSLCOMMDISP, 0);
 	tags = gw_get_repo_tags(gw_trans);
 	heads = gw_get_repo_heads(gw_trans);
 
-	if (shortlog != NULL && strcmp(shortlog, "") != 0) {
-		if ((asprintf(&shortlog_html, summary_shortlog,
-		    shortlog)) == -1)
+	if (logbriefs != NULL && strcmp(logbriefs, "") != 0) {
+		if ((asprintf(&logbriefs_html, summary_logbriefs,
+		    logbriefs)) == -1)
 			return got_error_from_errno("asprintf");
-		khttp_puts(gw_trans->gw_req, shortlog_html);
-		free(shortlog_html);
-		free(shortlog);
+		khttp_puts(gw_trans->gw_req, logbriefs_html);
+		free(logbriefs_html);
+		free(logbriefs);
 	}
 
 	if (tags != NULL && strcmp(tags, "") != 0) {
@@ -545,7 +555,7 @@ gw_load_got_path(struct trans *gw_trans, struct gw_dir *gw_dir)
 	const struct got_error *error = NULL;
 	DIR *dt;
 	char *dir_test;
-	bool opened = false;
+	int opened = 0;
 
 	if ((asprintf(&dir_test, "%s/%s/%s",
 	    gw_trans->gw_conf->got_repos_path, gw_dir->name,
@@ -557,7 +567,7 @@ gw_load_got_path(struct trans *gw_trans, struct gw_dir *gw_dir)
 		free(dir_test);
 	} else {
 		gw_dir->path = strdup(dir_test);
-		opened = true;
+		opened = 1;
 		goto done;
 	}
 
@@ -570,7 +580,7 @@ gw_load_got_path(struct trans *gw_trans, struct gw_dir *gw_dir)
 	if (dt == NULL)
 		free(dir_test);
 	else {
-		opened = true;
+		opened = 1;
 		error = got_error(GOT_ERR_NOT_GIT_REPO);
 		goto errored;
 	}
@@ -1111,8 +1121,8 @@ gw_get_clone_url(struct trans *gw_trans, char *dir)
 }
 
 static char *
-gw_get_repo_shortlog(struct trans *gw_trans, const char *search_pattern,
-    int limit)
+gw_get_repo_log(struct trans *gw_trans, const char *search_pattern,
+    char *start_commit, int limit, int full_log)
 {
 	const struct got_error *error;
 	struct got_repository *repo = NULL;
@@ -1121,10 +1131,10 @@ gw_get_repo_shortlog(struct trans *gw_trans, const char *search_pattern,
 	struct got_commit_object *commit = NULL;
 	struct got_object_id *id = NULL;
 	struct got_commit_graph *graph = NULL;
-	char *start_commit = NULL, *shortlog = NULL, *id_str = NULL,
-	     *path = NULL, *in_repo_path = NULL, *commit_row = NULL,
-	     *commit_age = NULL, *commit_author = NULL, *commit_log = NULL,
-	     *commit_log0, *newline, *shortlog_navs_html = NULL;
+	char *logbriefs = NULL, *id_str = NULL, *path = NULL,
+	     *in_repo_path = NULL, *commit_row = NULL, *commit_age = NULL,
+	     *commit_author = NULL, *commit_log = NULL, *commit_log0, *newline,
+	     *logbriefs_navs_html = NULL;
 	regex_t regex;
 	int have_match;
 	size_t newsize;
@@ -1313,39 +1323,65 @@ gw_get_repo_shortlog(struct trans *gw_trans, const char *search_pattern,
 
 		committer_time =
 		    got_object_commit_get_committer_time(commit_disp);
-		asprintf(&commit_age, "%s", gw_get_time_str(committer_time,
-		    TM_DIFF));
-		asprintf(&commit_author, "%s",
-		    got_object_commit_get_author(commit_disp));
-		error = got_object_commit_get_logmsg(&commit_log0, commit_disp);
-		if (error)
-			commit_log = strdup("");
-		else {
-			commit_log = commit_log0;
-			while (*commit_log == '\n')
-				commit_log++;
-			newline = strchr(commit_log, '\n');
-			if (newline)
-				*newline = '\0';
+
+		if (full_log) {
+
+			asprintf(&commit_age, "%s",
+			    gw_get_time_str(committer_time, TM_LONG));
+			asprintf(&commit_author, "%s",
+			    got_object_commit_get_author(commit_disp));
+			error = got_object_commit_get_logmsg(&commit_log0,
+			    commit_disp);
+			if (error)
+				commit_log = strdup("");
+			else
+				commit_log = gw_html_escape(commit_log0);
+			asprintf(&logbriefs_navs_html, logbriefs_navs,
+			    gw_trans->repo_name, id_str, gw_trans->repo_name,
+			    id_str, gw_trans->repo_name, id_str,
+			    gw_trans->repo_name, id_str);
+			asprintf(&commit_row, logs_row, id_str,
+			    gw_html_escape(commit_author), commit_age,
+			    commit_log, logbriefs_navs_html);
+			error = buf_append(&newsize, diffbuf, commit_row,
+			    strlen(commit_row));
+		} else {
+			asprintf(&commit_age, "%s",
+			    gw_get_time_str(committer_time, TM_DIFF));
+			asprintf(&commit_author, "%s",
+			    got_object_commit_get_author(commit_disp));
+			error = got_object_commit_get_logmsg(&commit_log0,
+			    commit_disp);
+			if (error)
+				commit_log = strdup("");
+			else {
+				commit_log = commit_log0;
+				while (*commit_log == '\n')
+					commit_log++;
+				newline = strchr(commit_log, '\n');
+				if (newline)
+					*newline = '\0';
+			}
+			asprintf(&logbriefs_navs_html, logbriefs_navs,
+			    gw_trans->repo_name, id_str, gw_trans->repo_name,
+			    id_str, gw_trans->repo_name, id_str,
+			    gw_trans->repo_name, id_str);
+			asprintf(&commit_row, logbriefs_row, commit_age,
+			    commit_author, commit_log, logbriefs_navs_html);
+			error = buf_append(&newsize, diffbuf, commit_row,
+			    strlen(commit_row));
 		}
-		asprintf(&shortlog_navs_html, shortlog_navs,
-		    gw_trans->repo_name, id_str, gw_trans->repo_name, id_str,
-		    gw_trans->repo_name, id_str, gw_trans->repo_name, id_str);
-		asprintf(&commit_row, shortlog_row, commit_age, commit_author,
-		    commit_log, shortlog_navs_html);
-		error = buf_append(&newsize, diffbuf, commit_row,
-		    strlen(commit_row));
 
 		free(commit_age);
 		free(commit_author);
 		free(commit_log0);
-		free(shortlog_navs_html);
+		free(logbriefs_navs_html);
 		free(commit_row);
 		free(id_str);
 		commit_age = NULL;
 		commit_author = NULL;
 		commit_log = NULL;
-		shortlog_navs_html = NULL;
+		logbriefs_navs_html = NULL;
 		commit_row = NULL;
 		id_str = NULL;
 
@@ -1353,7 +1389,7 @@ gw_get_repo_shortlog(struct trans *gw_trans, const char *search_pattern,
 		if (error || (limit && --limit == 0))
 			break;
 	}
-	shortlog = strdup(diffbuf->cb_buf);
+	logbriefs = strdup(diffbuf->cb_buf);
 	got_object_commit_close(commit);
 
 	free(path);
@@ -1368,7 +1404,7 @@ gw_get_repo_shortlog(struct trans *gw_trans, const char *search_pattern,
 
 	if (search_pattern)
 		regfree(&regex);
-	return shortlog;
+	return logbriefs;
 done:
 	if (repo)
 		got_repo_close(repo);
@@ -1385,7 +1421,8 @@ gw_get_repo_tags(struct trans *gw_trans)
 {
 	char *tags = NULL;
 
-	asprintf(&tags, tags_row, "30 min ago", "1.0.0", "tag 1.0.0", tags_navs);
+	asprintf(&tags, tags_row, "30 min ago", "1.0.0", "tag 1.0.0",
+	    tags_navs);
 	return tags;
 }
 
@@ -1488,7 +1525,7 @@ main()
 	struct trans *gw_trans;
 	struct gw_dir *dir = NULL, *tdir;
 	const char *page = "index";
-	bool gw_malloc = true;
+	int gw_malloc = 1;
 
 	if ((gw_trans = malloc(sizeof(struct trans))) == NULL)
 		errx(1, "malloc");
@@ -1508,7 +1545,7 @@ main()
 
 	if ((gw_trans->gw_conf =
 	    malloc(sizeof(struct gotweb_conf))) == NULL) {
-		gw_malloc = false;
+		gw_malloc = 0;
 		error = got_error_from_errno("malloc");
 		goto err;
 	}
diff --git a/gotweb/gotweb_ui.h b/gotweb/gotweb_ui.h
index 4a71063..2d578f1 100644
--- a/gotweb/gotweb_ui.h
+++ b/gotweb/gotweb_ui.h
@@ -14,31 +14,6 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/*
- * header nav
- *
- * ***index
- * search
- * Projects
- * 	Project|Description|Owner|Last Commit
- * 	DIV (summary|shortlog|log|tree)
- * ***summary
- * repo navs | search
- * repo description
- * 	description
- * 	owner
- * 	last commit
- * 	URL
- * shortlog
- * 	Date|committer|commit description (commit|commitdiff|tree|snapshot)
- * heads
- * 	create date | head (shortlog|log|tree)
- *
- *
- *
- * footer
- */
-
 #ifndef GOTWEB_UI_H
 #define GOTWEB_UI_H
 
@@ -114,11 +89,11 @@ char *cloneurl =
 	"<div id='cloneurl_title'>Clone URL: </div>" \
 	"<div id='cloneurl'>%s</div>";
 
-char *shortlog_row =
-	"<div id='shortlog_wrapper'>" \
-	"<div id='shortlog_age'>%s</div>" \
-	"<div id='shortlog_author'>%s</div>" \
-	"<div id='shortlog_log'>%s</div>" \
+char *logbriefs_row =
+	"<div id='logbriefs_wrapper'>" \
+	"<div id='logbriefs_age'>%s</div>" \
+	"<div id='logbriefs_author'>%s</div>" \
+	"<div id='logbriefs_log'>%s</div>" \
 	"</div>" \
 	"<div id='navs_wrapper'>" \
 	"<div id='navs'>%s</div>" \
@@ -126,7 +101,7 @@ char *shortlog_row =
 	"</div>" \
 	"<div id='dotted_line'></div>";
 
-char *shortlog_navs =
+char *logbriefs_navs =
 	"<a href='?path=%s&action=commit&commit=%s'>commit</a> | " \
 	"<a href='?path=%s&action=commitdiff&commit=%s'>diff</a> | " \
 	"<a href='?path=%s&action=tree&commit=%s'>tree</a> | " \
@@ -147,7 +122,7 @@ char *tags_row =
 char *tags_navs =
 	"<a href='?path=%s&action=tagt&commit=%s'>tag</a> | " \
 	"<a href='?path=%s&action=commit&commit=%s'>commit</a> | " \
-	"<a href='?path=%s&action=shortlog&commit=%s'>shortlog</a> | " \
+	"<a href='?path=%s&action=logbriefs&commit=%s'>Log Briefs</a> | " \
 	"<a href='?path=%s&action=log&commit=%s'>log</a>";
 
 char *heads_row =
@@ -162,10 +137,40 @@ char *heads_row =
 	"<div id='dotted_line'></div>";
 
 char *heads_navs =
-	"<a href='?path=%s&action=shortlog&headref=%s'>shortlog</a> | " \
+	"<a href='?path=%s&action=logbriefs&headref=%s'>Log Briefs</a> | " \
 	"<a href='?path=%s&action=log&headref=%s'>log</a> | " \
 	"<a href='?path=%s&action=tree&headref=%s'>commit</a>";
 
+/* log.tmpl */
+
+char *logs_wrapper =
+	"<div id='logs_wrapper'>";
+
+char *logs =
+	"<div id='logs_title_wrapper'>" \
+	"<div id='logs_title'>Commits</div></div>" \
+	"<div id='logs_content'>%s</div>";
+
+char *logs_row =
+	"<div id='logs_row_wrapper'>" \
+	"<div id='logs_commit'>Commit: %s</div>" \
+	"<div id='logs_author'>From: %s</div>" \
+	"<div id='logs_age'>Date: %s</div>" \
+	"</div>" \
+	"<div id='dotted_line'></div>" \
+	"<div id='log'>%s</div>" \
+	"<div id='navs_wrapper'>" \
+	"<div id='navs'>%s</div>" \
+	"</div>" \
+	"</div>" \
+	"<div id='dotted_line'></div>";
+
+char *logs_navs =
+	"<a href='?path=%s&action=commit&commit=%s'>commit</a> | " \
+	"<a href='?path=%s&action=commitdiff&commit=%s'>diff</a> | " \
+	"<a href='?path=%s&action=tree&commit=%s'>tree</a> | " \
+	"<a href='?path=%s&action=snapshot&commit=%s'>snapshot</a>";
+
 /* index.tmpl */
 
 char *index_projects_header =
@@ -192,7 +197,7 @@ char *index_projects =
 
 char *index_navs =
 	"<a href='?path=%s&action=summary'>summary</a> | " \
-	"<a href='?path=%s&action=shortlog'>shortlog</a> | " \
+	"<a href='?path=%s&action=logbriefs'>log briefs</a> | " \
 	"<a href='?path=%s&action=log'>log</a> | " \
 	"<a href='?path=%s&action=tree'>tree</a>";
 
@@ -201,10 +206,10 @@ char *index_navs =
 char *summary_wrapper =
 	"<div id='summary_wrapper'>";
 
-char *summary_shortlog =
-	"<div id='summary_shortlog_title_wrapper'>" \
-	"<div id='summary_shortlog_title'>Shortlog</div></div>" \
-	"<div id='summary_shortlog_content'>%s</div>";
+char *summary_logbriefs =
+	"<div id='summary_logbriefs_title_wrapper'>" \
+	"<div id='summary_logbriefs_title'>Log Briefs</div></div>" \
+	"<div id='summary_logbriefs_content'>%s</div>";
 
 char *summary_tags =
 	"<div id='summary_tags_title_wrapper'>" \