From 9b18632b7ed0e7301d80638528758aa2f2c3467e Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 9 Nov 2007 13:47:58 +0100 Subject: [PATCH 01/16] Makefile install: include cgit.png, do not empty cache The cache-cleaning is potentially dangerous, so lets move it away from the install target. A special emptycache target can be used to run the rm -rf. Signed-off-by: Lars Hjemli --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6abd82a..026bae4 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ ui-snapshot.o ui-blob.o ui-tag.o ui-refs.o -.PHONY: all git install clean distclean force-version get-git +.PHONY: all git install clean distclean emptycache force-version get-git all: cgit git @@ -53,12 +53,12 @@ install: all mkdir -p $(DESTDIR)$(CGIT_SCRIPT_PATH) install cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) install cgit.css $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.css - rm -rf $(DESTDIR)$(CACHE_ROOT)/* + install cgit.png $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.png uninstall: rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) rm -f $(CGIT_SCRIPT_PATH)/cgit.css - rm -rf $(CACHE_ROOT) + rm -f $(CGIT_SCRIPT_PATH)/cgit.png clean: rm -f cgit VERSION *.o @@ -68,5 +68,8 @@ distclean: clean git clean -d -x cd git && git clean -d -x +emptycache: + rm -rf $(DESTDIR)$(CACHE_ROOT)/* + get-git: curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git -- 2.50.1 From 2919b91d20c80f92bf63bf19daace44ff2d2e9c9 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 9 Nov 2007 13:51:00 +0100 Subject: [PATCH 02/16] CGIT 0.7.1 Signed-off-by: Lars Hjemli --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 026bae4..27e966d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CGIT_VERSION = v0.7 +CGIT_VERSION = v0.7.1 CGIT_SCRIPT_NAME = cgit.cgi CGIT_SCRIPT_PATH = /var/www/htdocs/cgit CGIT_CONFIG = /etc/cgitrc -- 2.50.1 From b4649fc90597910c89c3f37a6aec9af54d9f416b Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sun, 11 Nov 2007 00:40:58 +0100 Subject: [PATCH 03/16] Create initial testsuite This creates a simple testsuite, heavily inspired by the testsuite in git. Signed-off-by: Lars Hjemli --- Makefile | 5 +- tests/.gitignore | 2 + tests/Makefile | 13 +++++ tests/setup.sh | 108 +++++++++++++++++++++++++++++++++++ tests/t0010-validate-html.sh | 31 ++++++++++ tests/t0101-index.sh | 13 +++++ tests/t0102-summary.sh | 20 +++++++ tests/t0103-log.sh | 15 +++++ tests/t0104-tree.sh | 15 +++++ tests/t0105-commit.sh | 22 +++++++ tests/t0106-diff.sh | 20 +++++++ tests/t0107-snapshot.sh | 36 ++++++++++++ 12 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 tests/.gitignore create mode 100644 tests/Makefile create mode 100755 tests/setup.sh create mode 100755 tests/t0010-validate-html.sh create mode 100755 tests/t0101-index.sh create mode 100755 tests/t0102-summary.sh create mode 100755 tests/t0103-log.sh create mode 100755 tests/t0104-tree.sh create mode 100755 tests/t0105-commit.sh create mode 100755 tests/t0106-diff.sh create mode 100755 tests/t0107-snapshot.sh diff --git a/Makefile b/Makefile index 685e662..72c189c 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ ifdef NEEDS_LIBICONV endif -.PHONY: all git install clean distclean emptycache force-version get-git +.PHONY: all git test install clean distclean emptycache force-version get-git all: cgit git @@ -54,6 +54,9 @@ git: cd git && $(MAKE) xdiff/lib.a cd git && $(MAKE) libgit.a +test: all + $(MAKE) -C tests + install: all mkdir -p $(DESTDIR)$(CGIT_SCRIPT_PATH) install cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..c1c1c0b --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,2 @@ +trash +test-output.log diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..697e5a1 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,13 @@ + + +T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh) + +all: $(T) + +$(T): + @$@ + +clean: + $(RM) -rf trash + +.PHONY: $(T) clean diff --git a/tests/setup.sh b/tests/setup.sh new file mode 100755 index 0000000..51d5a75 --- /dev/null +++ b/tests/setup.sh @@ -0,0 +1,108 @@ +# This file should be sourced by all test-scripts +# +# Main functions: +# prepare_tests(description) - setup for testing, i.e. create repos+config +# run_test(description, script) - run one test, i.e. eval script +# +# Helper functions +# cgit_query(querystring) - call cgit with the specified querystring +# cgit_url(url) - call cgit with the specified virtual url +# +# Example script: +# +# . setup.sh +# prepare_tests "html validation" +# run_test 'repo index' 'cgit_url "/" | tidy -e' +# run_test 'repo summary' 'cgit_url "/foo" | tidy -e' + + +mkrepo() { + name=$1 + count=$2 + dir=$PWD + test -d $name && return + printf "Creating testrepo %s\n" $name + mkdir -p $name + cd $name + git init + for ((n=1; n<=count; n++)) + do + echo $n >file-$n + git add file-$n + git commit -m "commit $n" + done + cd $dir +} + +setup_repos() +{ + rm -rf trash/cache + mkdir -p trash/cache + mkrepo trash/repos/foo 5 >/dev/null + mkrepo trash/repos/bar 50 >/dev/null + cat >trash/cgitrc <test-output.log + res=$? + if test $res = 0 + then + printf " %s: ok - %s\n" $test_count "$desc" + else + ((test_failed++)) + printf " %s: fail - %s\n" $test_count "$desc" + fi +} + +cgit_query() +{ + CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="$1" "$PWD/../cgit" +} + +cgit_url() +{ + CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="url=$1" "$PWD/../cgit" +} + diff --git a/tests/t0010-validate-html.sh b/tests/t0010-validate-html.sh new file mode 100755 index 0000000..907a415 --- /dev/null +++ b/tests/t0010-validate-html.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +. ./setup.sh + + +test_url() +{ + tidy_opt="-eq" + test -z "$NO_TIDY_WARNINGS" || tidy_opt+=" --show-warnings no" + cgit_url "$1" | sed -e "1,4d" >trash/tidy-$test_count + tidy $tidy_opt trash/tidy-$test_count + rc=$? + if test $rc = 2 + then + false + else + : + fi +} + +prepare_tests 'Validate html with tidy' + +run_test 'index page' 'test_url ""' +run_test 'foo' 'test_url "foo"' +run_test 'foo/log' 'test_url "foo/log"' +run_test 'foo/tree' 'test_url "foo/tree"' +run_test 'foo/tree/file-1' 'test_url "foo/tree/file-1"' +run_test 'foo/commit' 'test_url "foo/commit"' +run_test 'foo/diff' 'test_url "foo/diff"' + +tests_done diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh new file mode 100755 index 0000000..12ed00c --- /dev/null +++ b/tests/t0101-index.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Check content on index page" + +run_test 'generate index page' 'cgit_url "" >trash/tmp' +run_test 'find foo repo' 'grep -e "foo" trash/tmp' +run_test 'find bar repo' 'grep -e "bar" trash/tmp' +run_test 'no tree-link' 'grep -ve "foo/tree" trash/tmp' +run_test 'no log-link' 'grep -ve "foo/log" trash/tmp' + +tests_done diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh new file mode 100755 index 0000000..7edd675 --- /dev/null +++ b/tests/t0102-summary.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Check content on summary page" + +run_test 'generate foo summary' 'cgit_url "foo" >trash/tmp' +run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' +run_test 'find commit 5' 'grep -e "commit 5" trash/tmp' +run_test 'find branch master' 'grep -e "master" trash/tmp' +run_test 'no tags' 'grep -ve "tags" trash/tmp' + +run_test 'generate bar summary' 'cgit_url "bar" >trash/tmp' +run_test 'no commit 45' 'grep -ve "commit 45" trash/tmp' +run_test 'find commit 46' 'grep -e "commit 46" trash/tmp' +run_test 'find commit 50' 'grep -e "commit 50" trash/tmp' +run_test 'find branch master' 'grep -e "master" trash/tmp' +run_test 'no tags' 'grep -ve "tags" trash/tmp' + +tests_done diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh new file mode 100755 index 0000000..b08cd29 --- /dev/null +++ b/tests/t0103-log.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Check content on log page" + +run_test 'generate foo/log' 'cgit_url "foo/log" >trash/tmp' +run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' +run_test 'find commit 5' 'grep -e "commit 5" trash/tmp' + +run_test 'generate bar/log' 'cgit_url "bar/log" >trash/tmp' +run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' +run_test 'find commit 50' 'grep -e "commit 50" trash/tmp' + +tests_done diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh new file mode 100755 index 0000000..9c362ca --- /dev/null +++ b/tests/t0104-tree.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Check content on tree page" + +run_test 'generate bar/tree' 'cgit_url "bar/tree" >trash/tmp' +run_test 'find file-1' 'grep -e "file-1" trash/tmp' +run_test 'find file-50' 'grep -e "file-50" trash/tmp' + +run_test 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >trash/tmp' +run_test 'find line 1' 'grep -e "1" trash/tmp' +run_test 'no line 2' 'grep -ve "2" trash/tmp' + +tests_done diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh new file mode 100755 index 0000000..7137751 --- /dev/null +++ b/tests/t0105-commit.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Check content on commit page" + +run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp' +run_test 'find tree link' 'grep -e "" trash/tmp' +run_test 'find parent link' 'grep -E "" trash/tmp' + +run_test 'find commit subject' ' + grep -e "
commit 5
" trash/tmp +' + +run_test 'find commit msg' 'grep -e "
" trash/tmp' +run_test 'find diffstat' 'grep -e "" trash/tmp' + +run_test 'find diff summary' ' + grep -e "1 files changed, 1 insertions, 0 deletions" trash/tmp +' + +tests_done diff --git a/tests/t0106-diff.sh b/tests/t0106-diff.sh new file mode 100755 index 0000000..e140bcc --- /dev/null +++ b/tests/t0106-diff.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Check content on diff page" + +run_test 'generate foo/diff' 'cgit_url "foo/diff" >trash/tmp' +run_test 'find diff header' 'grep -e "a/file-5 b/file-5" trash/tmp' +run_test 'find blob link' 'grep -e "@@ -0,0 +1 @@" trash/tmp +' + +run_test 'find added line' ' + grep -e "
+5
" trash/tmp +' + +tests_done diff --git a/tests/t0107-snapshot.sh b/tests/t0107-snapshot.sh new file mode 100755 index 0000000..8e90e10 --- /dev/null +++ b/tests/t0107-snapshot.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +. ./setup.sh + +prepare_tests "Verify snapshot" + +run_test 'get foo/snapshot/test.tar.gz' ' + cgit_url "foo/snapshot/test.tar.gz" >trash/tmp +' + +run_test 'check html headers' ' + head -n 1 trash/tmp | + grep -e "Content-Type: application/x-tar" && + + head -n 2 trash/tmp | + grep -e "Content-Disposition: inline; filename=.test.tar.gz." +' + +run_test 'strip off the header lines' ' + tail -n +6 trash/tmp > trash/test.tar.gz +' + +run_test 'verify gzip format' 'gunzip --test trash/test.tar.gz' +run_test 'untar' 'tar -xf trash/test.tar.gz -C trash' + +run_test 'count files' ' + c=$(ls -1 trash/foo/ | wc -l) && + test $c = 5 +' + +run_test 'verify untarred file-5' ' + grep -e "^5$" trash/foo/file-5 && + test $(cat trash/foo/file-5 | wc -l) = 1 +' + +tests_done -- 2.50.1 From 2915483ef6c9c29ac1493e6945688bb62f7825b4 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sun, 11 Nov 2007 13:04:28 +0100 Subject: [PATCH 04/16] Fix html error detected by test-suite Signed-off-by: Lars Hjemli --- cgit.css | 6 +++++- html.c | 2 +- tests/t0104-tree.sh | 10 ++++++++-- tests/t0105-commit.sh | 2 +- ui-commit.c | 6 +++--- ui-diff.c | 2 +- ui-log.c | 2 +- ui-repolist.c | 2 +- ui-shared.c | 24 ++++++++++++------------ ui-summary.c | 2 +- ui-tree.c | 6 +++--- 11 files changed, 37 insertions(+), 27 deletions(-) diff --git a/cgit.css b/cgit.css index f1003b4..565427f 100644 --- a/cgit.css +++ b/cgit.css @@ -111,7 +111,11 @@ div#sidebar div.infobox { div#sidebar div.infobox h1 { font-size: 10pt; font-weight: bold; - margin: 0px; + margin: 8px 0px 0px 0px; +} + +div#sidebar div.infobox h1.first { + margin-top: 0px; } div#sidebar div.infobox a.menu { diff --git a/html.c b/html.c index 6c9cc8b..eb163d9 100644 --- a/html.c +++ b/html.c @@ -132,7 +132,7 @@ void html_option(char *value, char *text, char *selected_value) html_attr(value); html("'"); if (selected_value && !strcmp(selected_value, value)) - html(" selected"); + html(" selected='selected'"); html(">"); html_txt(text); html("\n"); diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 9c362ca..2516c72 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -9,7 +9,13 @@ run_test 'find file-1' 'grep -e "file-1" trash/tmp' run_test 'find file-50' 'grep -e "file-50" trash/tmp' run_test 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >trash/tmp' -run_test 'find line 1' 'grep -e "
1" trash/tmp' -run_test 'no line 2' 'grep -ve "2" trash/tmp' + +run_test 'find line 1' ' + grep -e "1" trash/tmp +' + +run_test 'no line 2' ' + grep -e "2" trash/tmp +' tests_done diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh index 7137751..aa2bf33 100755 --- a/tests/t0105-commit.sh +++ b/tests/t0105-commit.sh @@ -13,7 +13,7 @@ run_test 'find commit subject' ' ' run_test 'find commit msg' 'grep -e "
" trash/tmp' -run_test 'find diffstat' 'grep -e "
" trash/tmp' +run_test 'find diffstat' 'grep -e "
" trash/tmp' run_test 'find diff summary' ' grep -e "1 files changed, 1 insertions, 0 deletions" trash/tmp diff --git a/ui-commit.c b/ui-commit.c index 4ac8955..bd55a33 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -84,7 +84,7 @@ void print_fileinfo(struct fileinfo *info) html("
"); htmlf("%d", info->added + info->removed); html(""); - htmlf("", (max_changes > 100 ? 100 : max_changes)); + htmlf("
", (max_changes > 100 ? 100 : max_changes)); htmlf("
", info->added * 100.0 / max_changes); htmlf("", @@ -157,7 +157,7 @@ void cgit_print_commit(char *hex) } info = cgit_parse_commit(commit); - html("\n"); + html("
\n"); html("
author"); html_txt(info->author); html(" "); @@ -209,7 +209,7 @@ void cgit_print_commit(char *hex) html(""); if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { html("
Diffstat
"); - html(""); + html("
"); max_changes = 0; cgit_diff_commit(commit, inspect_filepair); for(i = 0; i"); + html("
"); html(""); diff --git a/ui-log.c b/ui-log.c index e5f3c57..a41d2b2 100644 --- a/ui-log.c +++ b/ui-log.c @@ -90,7 +90,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern } prepare_revision_walk(&rev); - html("
"); cgit_diff_tree(old_rev_sha1, new_rev_sha1, filepair_cb, prefix); html("
"); + html("
"); html("" ""); diff --git a/ui-repolist.c b/ui-repolist.c index 9aa5c1e..3e97ca9 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -53,7 +53,7 @@ void cgit_print_repolist(struct cacheitem *item) cgit_print_docstart(cgit_root_title, item); cgit_print_pageheader(cgit_root_title, 0); - html("
AgeMessage
"); + html("
"); if (cgit_index_header) { htmlf("\n"); - html("\n
", columns); diff --git a/ui-shared.c b/ui-shared.c index 7c69f60..9ec646b 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -358,7 +358,7 @@ void cgit_print_docstart(char *title, struct cacheitem *item) ttl_seconds(item->ttl))); html("\n"); html(cgit_doctype); - html("\n"); + html("\n"); html("\n"); html(""); html_txt(title); @@ -373,7 +373,7 @@ void cgit_print_docstart(char *title, struct cacheitem *item) void cgit_print_docend() { - html("</td>\n</tr>\n<table>\n</body>\n</html>\n"); + html("</td>\n</tr>\n</table>\n</body>\n</html>\n"); } int print_branch_option(const char *refname, const unsigned char *sha1, @@ -456,21 +456,21 @@ void cgit_print_pageheader(char *title, int show_search) int header = 0; html("<div id='sidebar'>\n"); - html("<a href='"); + html("<div id='logo'><a href='"); html_attr(cgit_rooturl()); - htmlf("'><div id='logo'><img src='%s' alt='cgit'/></div></a>\n", + htmlf("'><img src='%s' alt='cgit'/></a></div>\n", cgit_logo); html("<div class='infobox'>"); if (cgit_query_repo) { - html("<h1>"); + html("<h1 class='first'>"); html_txt(strrpart(cgit_repo->name, 20)); html("</h1>\n"); html_txt(cgit_repo->desc); if (cgit_repo->owner) { - html("<p>\n<h1>owner</h1>\n"); + html("<h1>owner</h1>\n"); html_txt(cgit_repo->owner); } - html("<p>\n<h1>navigate</h1>\n"); + html("<h1>navigate</h1>\n"); reporevlink(NULL, "summary", NULL, "menu", cgit_query_head, NULL, NULL); cgit_log_link("log", NULL, "menu", cgit_query_head, NULL, NULL, @@ -484,19 +484,19 @@ void cgit_print_pageheader(char *title, int show_search) for_each_ref(print_archive_ref, &header); - html("<p>\n<h1>branch</h1>\n"); + html("<h1>branch</h1>\n"); html("<form method='get' action=''>\n"); add_hidden_formfields(0, 1, cgit_query_page); - html("<table class='grid'><tr><td id='branch-dropdown-cell'>"); + html("<table summary='branch selector' class='grid'><tr><td id='branch-dropdown-cell'>"); html("<select name='h' onchange='this.form.submit();'>\n"); for_each_branch_ref(print_branch_option, cgit_query_head); html("</select>\n"); html("</td><td>"); - html("<noscript><input type='submit' id='switch-btn' value='..'></noscript>\n"); + html("<noscript><input type='submit' id='switch-btn' value='..'/></noscript>\n"); html("</td></tr></table>"); html("</form>\n"); - html("<p>\n<h1>search</h1>\n"); + html("<h1>search</h1>\n"); html("<form method='get' action='"); if (cgit_virtual_root) html_attr(cgit_fileurl(cgit_query_repo, "log", @@ -519,7 +519,7 @@ void cgit_print_pageheader(char *title, int show_search) html("</div>\n"); - html("</div>\n<table class='grid'><tr><td id='content'>\n"); + html("</div>\n<table summary='page content' class='grid'><tr><td id='content'>\n"); } diff --git a/ui-summary.c b/ui-summary.c index c856793..b96414e 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -190,7 +190,7 @@ void cgit_print_summary() if (cgit_summary_log > 0) cgit_print_log(cgit_query_head, 0, cgit_summary_log, NULL, NULL, NULL, 0); - html("<table class='list nowrap'>"); + html("<table summary='repository info' class='list nowrap'>"); if (cgit_summary_log > 0) html("<tr class='nohover'><td colspan='4'> </td></tr>"); cgit_print_branches(cgit_summary_branches); diff --git a/ui-tree.c b/ui-tree.c index c22e30b..c138877 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -17,7 +17,7 @@ static void print_object(const unsigned char *sha1, char *path) enum object_type type; char *buf; unsigned long size, lineno, start, idx; - const char *linefmt = "<tr><td class='no'><a name='%1$d'>%1$d</a></td><td class='txt'>"; + const char *linefmt = "<tr><td class='no'><a id='n%1$d' name='n%1$d' href='#n%1$d'>%1$d</a></td><td class='txt'>"; type = sha1_object_info(sha1, &size); if (type == OBJ_BAD) { @@ -37,7 +37,7 @@ static void print_object(const unsigned char *sha1, char *path) html_attr(cgit_pageurl(cgit_query_repo, "blob", fmt("id=%s", sha1_to_hex(sha1)))); htmlf("'>%s</a>",sha1_to_hex(sha1)); - html("<table class='blob'>\n"); + html("<table summary='blob content' class='blob'>\n"); idx = 0; start = 0; lineno = 0; @@ -108,7 +108,7 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, static void ls_head() { - html("<table class='list'>\n"); + html("<table summary='tree listing' class='list'>\n"); html("<tr class='nohover'>"); html("<th class='left'>Mode</th>"); html("<th class='left'>Name</th>"); -- 2.50.1 From 2ff33a8a0405b420cd75e0e207c7efeecd6f130b Mon Sep 17 00:00:00 2001 From: Lars Hjemli <hjemli@gmail.com> Date: Sun, 11 Nov 2007 13:14:15 +0100 Subject: [PATCH 05/16] Set commit date on snapshot contents The testsuite revealed that cgit snapshots don't set any useful timestamp on the files contained in the snapshot. Signed-off-by: Lars Hjemli <hjemli@gmail.com> --- ui-snapshot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui-snapshot.c b/ui-snapshot.c index bd34a28..4d1aa88 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -99,6 +99,7 @@ void cgit_print_snapshot(struct cacheitem *item, const char *head, memset(&args,0,sizeof(args)); args.base = fmt("%s/", prefix); args.tree = commit->tree; + args.time = commit->date; cgit_print_snapshot_start(sat->mimetype, filename, item); (*sat->write_func)(&args); return; -- 2.50.1 From 5b75064a81f9fe8f8a446a4be050fe3dfcf52b89 Mon Sep 17 00:00:00 2001 From: Lars Hjemli <hjemli@gmail.com> Date: Sun, 11 Nov 2007 13:14:15 +0100 Subject: [PATCH 06/16] Set commit date on snapshot contents The testsuite revealed that cgit snapshots don't set any useful timestamp on the files contained in the snapshot. Cherry-picked-from: 2ff33a8a0405b420cd75e0e207c7efeecd6f130b Signed-off-by: Lars Hjemli <hjemli@gmail.com> --- ui-snapshot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui-snapshot.c b/ui-snapshot.c index bd34a28..4d1aa88 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -99,6 +99,7 @@ void cgit_print_snapshot(struct cacheitem *item, const char *head, memset(&args,0,sizeof(args)); args.base = fmt("%s/", prefix); args.tree = commit->tree; + args.time = commit->date; cgit_print_snapshot_start(sat->mimetype, filename, item); (*sat->write_func)(&args); return; -- 2.50.1 From 1b7c5b2e0b918e9452694aace7c19194683989a8 Mon Sep 17 00:00:00 2001 From: Lars Hjemli <hjemli@gmail.com> Date: Sun, 11 Nov 2007 13:44:39 +0100 Subject: [PATCH 07/16] Generate valid html for "downloads" menu header Noticed-by: http://validator.w3.org Signed-off-by: Lars Hjemli <hjemli@gmail.com> --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 9ec646b..5192800 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -411,7 +411,7 @@ int print_archive_ref(const char *refname, const unsigned char *sha1, hashcpy(fileid, sha1); } if (!*header) { - html("<p><h1>download</h1>"); + html("<h1>download</h1>\n"); *header = 1; } url = cgit_pageurl(cgit_query_repo, "blob", -- 2.50.1 From d267d88c9cb1fb4a45120b86e410ab604626c6bb Mon Sep 17 00:00:00 2001 From: Lars Hjemli <hjemli@gmail.com> Date: Sun, 11 Nov 2007 21:57:21 +0100 Subject: [PATCH 08/16] Add support for "robots" meta-tag With this change, cgit will start to generate the "robots" meta-tag, using a default value of "index, nofollow". The default value can be modified with a new cgitrc variable, "robots". Signed-off-by: Lars Hjemli <hjemli@gmail.com> --- cgit.h | 1 + cgitrc | 5 +++++ shared.c | 3 +++ ui-shared.c | 2 ++ 4 files changed, 11 insertions(+) diff --git a/cgit.h b/cgit.h index 6291c58..ab0efeb 100644 --- a/cgit.h +++ b/cgit.h @@ -139,6 +139,7 @@ extern char *cgit_virtual_root; extern char *cgit_script_name; extern char *cgit_cache_root; extern char *cgit_repo_group; +extern char *cgit_robots; extern int cgit_nocache; extern int cgit_snapshots; diff --git a/cgitrc b/cgitrc index 6363c9c..8c616e0 100644 --- a/cgitrc +++ b/cgitrc @@ -8,6 +8,11 @@ #nocache=0 +## This variable can be used to override the default value for "robots" +## meta-tag. If unset, the meta-tag isn't generated. +#robots=index, nofollow + + ## Set allowed snapshot types by default. Can be overridden per repo # can be any combination of zip/tar.gz/tar.bz2/tar #snapshots=0 diff --git a/shared.c b/shared.c index 8cb4808..fd8b1e3 100644 --- a/shared.c +++ b/shared.c @@ -26,6 +26,7 @@ char *cgit_virtual_root = NULL; char *cgit_script_name = CGIT_SCRIPT_NAME; char *cgit_cache_root = CGIT_CACHE_ROOT; char *cgit_repo_group = NULL; +char *cgit_robots = "index, nofollow"; int cgit_nocache = 0; int cgit_snapshots = 0; @@ -197,6 +198,8 @@ void cgit_global_config_cb(const char *name, const char *value) cgit_agefile = xstrdup(value); else if (!strcmp(name, "renamelimit")) cgit_renamelimit = atoi(value); + else if (!strcmp(name, "robots")) + cgit_robots = xstrdup(value); else if (!strcmp(name, "repo.group")) cgit_repo_group = xstrdup(value); else if (!strcmp(name, "repo.url")) diff --git a/ui-shared.c b/ui-shared.c index 5192800..2f771da 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -364,6 +364,8 @@ void cgit_print_docstart(char *title, struct cacheitem *item) html_txt(title); html("\n"); htmlf("\n", cgit_version); + if (cgit_robots && *cgit_robots) + htmlf("\n", cgit_robots); html("\n"); -- 2.50.1 From fd90d2826a979f3844312718ad130880cf19d52c Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 16 Nov 2007 09:51:35 +0100 Subject: [PATCH 09/16] Gimp my logo Signed-off-by: Lars Hjemli --- cgit.png | Bin 3790 -> 5406 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/cgit.png b/cgit.png index ee48197a8d55abf3345d913a87c17734c1af040e..22f7e954354eca7d22057aa53fef49cc568932b6 100644 GIT binary patch literal 5406 zcmeAS@N?(olHy`uVBq!ia0y~yU|7Jwz>vVf#=yWZOTBU?0|NtFlDE4H!+#K5uy^@n z1_lPs0*}aI1_o|n5N2eUHAjMhfq}im)7O>#IybMliq0IKaBl_%k=33qjv*Dd-o|DI zi#-2syVw7`Px<)+1_~TWHzXb;h&azaFfp8-x^&4u7ZaQTHgQuP%ED(q0}YyOxdpd*zs?ND&!`qIEuIy$godK zJ!rtAHI*yo`q5jrq)KAjQzH{3+L|V(MxNNj;~F^OWXgn-DGUsW5=tCQJJxX@FBD*L zWIDs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f*%6Aa+XBXG+}kb&uP2pE3`rahRnOY4|91I{&4$rq=zO@0Tr1 zw3>O;;>WBl6@LEGu@@^WSvS9Q)`+$K;5=x1^KiHW~rMVxjPTugv|6fJ< zc8jiiJN)@=h2+C5^e?{LLY9h6a@3=Ets_8eLYYgO3-f_i4>BqbW-M6Q6>|4n7)VR$lW{u#K zd=(b{NGTrwvmBomHu6T)iX1U->veeSbwf?_{|EuMu2v;QQ0P)y)^IUI{+?Q1)Z$oNF=W^UrGV-nyZ%(`(-3 zWq*IXTM{NaX>Q5&?myE*qt`uCSi4xhB|4uy3?{?tJvq}6PR&KJskQsW5^HIx{6C6L1S{R~s zeV@-KS$FS!5VNUQPizb~qs#d#yDj~7oqFH51k0-(SSzKd8pn7zfA^n&eDjA5xn8gT zIPpA=_`_&ia`Em2uJ%8S(i;xE{K)0c>hYK-Eug1Cm&-v!J;Cl}!(@-xJKU0|)LGtS z1*)CYKe_0c->oKR-juX!&gJhL)@>8lvJ+JZa%kJ-ZB-r->pfRu16S0m4pX^?4u*(! zOYY#rhW7^L+?fX*Pq1&`EsnTo@Wa8bfm!s~r^S^EIF%W%IeQ!Adbu$kIuIx?ut6xw zsVUF;x|zsNvkeXhN;~I2m@5}u6MBDZ$KScZYTs9QDKGoErz-SC;!kb!w(oyRK0M=* z`BhLB|Mcp+lRr1x?2xy7S5@&TUCc!JxZZK+b?R?3pGoY}eD)zx`I`$@Jj3Me_a@0Q zv6(Kspz!NrPXCU6#T;GX+6kMvO4NR8oVk{|h+lYaYh0tC)FGWD`-|+i9#ksns4_e- z?(pCHCUjwo(xsp~8XOjt0WL}Bk3DT!so7S*s4kKsXkFlR(`$>R$fO55ZrykB*c{8D z=ri+yn#k8jZjv+HK5J%qCfP1d__cXNA1s-h Date: Fri, 16 Nov 2007 09:52:03 +0100 Subject: [PATCH 10/16] Use tables for page layout It feels like the Right Thing, and it fixes some rendering problems in a much used webbrowser. Signed-off-by: Lars Hjemli --- cgit.css | 49 +++++++++++++++++++++++++++++-------------------- ui-shared.c | 22 ++++++++++++---------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/cgit.css b/cgit.css index 565427f..17c2712 100644 --- a/cgit.css +++ b/cgit.css @@ -8,7 +8,7 @@ body { font-size: 10pt; color: #333; background: white; - padding-left: 4px; + padding: 4px; } table { @@ -78,29 +78,39 @@ img { border: none; } -div#sidebar { +table#layout { + border-collapse: collapse; + border: none; + margin: 0px; +} + +td#sidebar { vertical-align: top; width: 162px; padding: 0px 0px 0px 0px; - margin: 4px; - float: left; + margin: 0px; } -div#logo { +td#sidebar table { + border-collapse: separate; + border-spacing: 0px; margin: 0px; - padding: 4px 0px 4px 0px; - text-align: center; + padding: 0px; background-color: #ccc; +} + +td#sidebar table.sidebar td.sidebar { + padding: 4px; border-top: solid 1px #eee; border-left: solid 1px #eee; border-right: solid 1px #aaa; border-bottom: solid 1px #aaa; } -div#sidebar div.infobox { - margin: 0px 0px 0px 0px; - padding: 0.5em; - text-align: left; +div#logo { + margin: 0px; + padding: 4px 0px 4px 0px; + text-align: center; background-color: #ccc; border-top: solid 1px #eee; border-left: solid 1px #eee; @@ -108,43 +118,42 @@ div#sidebar div.infobox { border-bottom: solid 1px #aaa; } -div#sidebar div.infobox h1 { +td#sidebar h1 { font-size: 10pt; font-weight: bold; margin: 8px 0px 0px 0px; } -div#sidebar div.infobox h1.first { +td#sidebar h1.first { margin-top: 0px; } -div#sidebar div.infobox a.menu { +td#sidebar a.menu { display: block; background-color: #ccc; padding: 0.1em 0.5em; text-decoration: none; } -div#sidebar div.infobox a.menu:hover { +td#sidebar a.menu:hover { background-color: #bbb; text-decoration: none; } -div#sidebar div.infobox select { +td#sidebar select { width: 100%; margin: 2px 0px 0px 0px; } -td#branch-dropdown-cell { - width: 99%; +td#sidebar form { + text-align: right; } input#switch-btn { - width: 20px; margin: 2px 0px 0px 0px; } -div#sidebar div.infobox input.txt { +td#sidebar input.txt { width: 100%; margin: 2px 0px 0px 0px; } diff --git a/ui-shared.c b/ui-shared.c index 2f771da..4c0613a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -457,12 +457,14 @@ void cgit_print_pageheader(char *title, int show_search) static const char *default_info = "This is cgit, a fast webinterface for git repositories"; int header = 0; - html("
\n"); + html("\n"); } -- 2.50.1 From e8e6721817c983770fc0fdfbb26a17900e3c34ce Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 16 Nov 2007 10:28:29 +0100 Subject: [PATCH 11/16] Add cell-spacing in html There are some browsers which don't support the border-spacing property Signed-off-by: Lars Hjemli --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 4c0613a..be2c75d 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -459,7 +459,7 @@ void cgit_print_pageheader(char *title, int show_search) html("\n"); html("