From 48f175083ae9ee03aa5ed7cddfbf74edf6d75774 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sat, 16 Jun 2018 13:11:09 +0100 Subject: Makefile: drive asciidoc directly for HTML output This is mostly taken from Git's doc/Makefile, although simplified for our use. The output now uses Asciidoc's default CSS which I think looks a bit nicer than the Docbook formatting; as a result of this we no longer need our custom .css file. A side effect of this change is that temporary files generated from the HTML output no longer conflict with the manpage output format (because any temporary HTML output files use names derived from the output filename which includes .html). Signed-off-by: John Keeping --- Makefile | 9 ++++++++- cgit-doc.css | 3 --- 2 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 cgit-doc.css diff --git a/Makefile b/Makefile index 687069f..70f32a4 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,12 @@ DOC_MAN5 = $(patsubst %.txt,%,$(MAN5_TXT)) DOC_HTML = $(patsubst %.txt,%.html,$(MAN_TXT)) DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT)) +ASCIIDOC = asciidoc +ASCIIDOC_EXTRA = +ASCIIDOC_HTML = xhtml11 +ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) +TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML) + # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # do not support the 'size specifiers' introduced by C99, namely ll, hh, # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). @@ -134,7 +140,8 @@ doc-pdf: $(DOC_PDF) a2x -f manpage $< $(DOC_HTML): %.html : %.txt - a2x -f xhtml --stylesheet=cgit-doc.css --xsltproc-opts="--param generate.consistent.ids 1" $< + $(TXT_TO_HTML) -o $@+ $< && \ + mv $@+ $@ $(DOC_PDF): %.pdf : %.txt a2x -f pdf cgitrc.5.txt diff --git a/cgit-doc.css b/cgit-doc.css deleted file mode 100644 index 5a399b6..0000000 --- a/cgit-doc.css +++ /dev/null @@ -1,3 +0,0 @@ -div.variablelist dt { - margin-top: 1em; -} -- cgit v1.2.3-24-g4f1b From 7708859c4dcebff1e43516c23a8bf80f88fcea35 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 13 Jun 2018 10:02:00 +0800 Subject: ui-tree: free read_sha1_file() buffer after use Free up the buffer allocated in read_sha1_file() Signed-off-by: Andy Green Signed-off-by: John Keeping --- ui-tree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui-tree.c b/ui-tree.c index 67fd1bc..524de0f 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -127,6 +127,8 @@ static void print_object(const unsigned char *sha1, char *path, const char *base print_binary_buffer(buf, size); else print_text_buffer(basename, buf, size); + + free(buf); } struct single_tree_ctx { -- cgit v1.2.3-24-g4f1b From 26610aff34b8dbbfa296bb7a9785c39831cfe7e3 Mon Sep 17 00:00:00 2001 From: Jon DeVree Date: Sun, 10 Jun 2018 18:28:49 -0400 Subject: ui-tag: Fix inconsistent capitalization Way back in 2009 all of these were lower cased except this one occurrence. Signed-off-by: Jon DeVree Signed-off-by: John Keeping --- ui-tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-tag.c b/ui-tag.c index 909cde0..2c216d0 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -107,7 +107,7 @@ void cgit_print_tag(char *revname) htmlf("tag name"); html_txt(revname); html("\n"); - html("Tagged object"); + html("tagged object"); cgit_object_link(obj); html("\n"); if (ctx.repo->snapshots) -- cgit v1.2.3-24-g4f1b From b759189574971eabf98aee73b4e4e4c604e21a94 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 19 Jun 2018 17:02:07 +0800 Subject: ui-blame: free read_sha1_file() buffer after use Signed-off-by: Andy Green Signed-off-by: John Keeping --- ui-blame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui-blame.c b/ui-blame.c index 17e2d60..b118a81 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -154,7 +154,7 @@ static void print_object(const unsigned char *sha1, const char *path, htmlf("
blob size (%ldKB)" " exceeds display size limit (%dKB).
", size / 1024, ctx.cfg.max_blob_size); - return; + goto cleanup; } html("\n\n"); @@ -213,6 +213,9 @@ static void print_object(const unsigned char *sha1, const char *path, html("\n
\n"); cgit_print_layout_end(); + +cleanup: + free(buf); } static int walk_tree(const unsigned char *sha1, struct strbuf *base, -- cgit v1.2.3-24-g4f1b From fb804a353780633b23a5452b3893fcc9f3705431 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 30 May 2018 10:28:12 +0200 Subject: git: update to v2.17.1 Update to git version v2.17.1. Required changes: * The function 'typename' has been renamed to 'type_name' (upstream commit debca9d2fe784193dc2d9f98b5edac605ddfefbb) Signed-off-by: Christian Hesse --- Makefile | 2 +- git | 2 +- ui-shared.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 70f32a4..be2ed4f 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.16.0 +GIT_VER = 2.17.1 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r diff --git a/git b/git index 2512f15..fc54c1a 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 2512f15446149235156528dafbe75930c712b29e +Subproject commit fc54c1af3ec09bab8b8ea09768c2da4069b7f53e diff --git a/ui-shared.c b/ui-shared.c index 9d8f66b..ce806f6 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -545,7 +545,7 @@ void cgit_object_link(struct object *obj) page = "tag"; else page = "blob"; - name = fmt("%s %s...", typename(obj->type), shortrev); + name = fmt("%s %s...", type_name(obj->type), shortrev); reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL); } -- cgit v1.2.3-24-g4f1b From e65ea965a07c7d48d269b2d2278d0101f7ac2b48 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 4 Jun 2018 22:27:46 +0200 Subject: print git version string in footer This helps tracking what git version cgit uses. The security implications are low as anybody can look up the version of our submodule anyway. The paranoid can use a custom footer. :-p On the other hand this brings potential security issues to the administrators eyes... Signed-off-by: Christian Hesse --- ui-shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index ce806f6..0c6ca60 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -10,6 +10,7 @@ #include "ui-shared.h" #include "cmd.h" #include "html.h" +#include "version.h" static const char cgit_doctype[] = "\n"; @@ -785,8 +786,8 @@ void cgit_print_docend(void) if (ctx.cfg.footer) html_include(ctx.cfg.footer); else { - htmlf("