Add config.def.h and make summary length configurable
This commit is contained in:
parent
f33bca44bd
commit
c3014aaaba
6
Makefile
6
Makefile
|
@ -33,7 +33,11 @@ dist: $(BIN)
|
||||||
(cd release/${VERSION}; \
|
(cd release/${VERSION}; \
|
||||||
tar -czf ../../urmoms-${VERSION}.tar.gz .)
|
tar -czf ../../urmoms-${VERSION}.tar.gz .)
|
||||||
|
|
||||||
${OBJ}: config.mk ${HDR}
|
${OBJ}: config.h config.mk ${HDR}
|
||||||
|
|
||||||
|
config.h:
|
||||||
|
@echo creating $@ from config.def.h
|
||||||
|
@cp config.def.h $@
|
||||||
|
|
||||||
urmoms: urmoms.o
|
urmoms: urmoms.o
|
||||||
${CC} -o $@ urmoms.o ${LDFLAGS}
|
${CC} -o $@ urmoms.o ${LDFLAGS}
|
||||||
|
|
2
config.def.h
Normal file
2
config.def.h
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
static const unsigned summarylen = 70; /* summary length in the log */
|
7
urmoms.c
7
urmoms.c
|
@ -10,6 +10,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "git2.h"
|
#include "git2.h"
|
||||||
|
|
||||||
struct commitinfo {
|
struct commitinfo {
|
||||||
|
@ -428,9 +429,9 @@ writelog(FILE *fp)
|
||||||
fputs("</td><td>", fp);
|
fputs("</td><td>", fp);
|
||||||
if (ci->summary) {
|
if (ci->summary) {
|
||||||
fprintf(fp, "<a href=\"%scommit/%s.html\">", relpath, ci->oid);
|
fprintf(fp, "<a href=\"%scommit/%s.html\">", relpath, ci->oid);
|
||||||
if ((len = strlen(ci->summary)) > 79) {
|
if ((len = strlen(ci->summary)) > summarylen) {
|
||||||
xmlencode(fp, ci->summary, 76);
|
xmlencode(fp, ci->summary, summarylen - 1);
|
||||||
fputs("...", fp);
|
fputs("…", fp);
|
||||||
} else {
|
} else {
|
||||||
xmlencode(fp, ci->summary, len);
|
xmlencode(fp, ci->summary, len);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue