aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--cgit.c3
-rw-r--r--cgit.css5
-rw-r--r--cgit.h1
-rw-r--r--cgitrc.5.txt4
-rwxr-xr-xfilters/syntax-highlighting.sh29
-rw-r--r--ui-tree.c6
6 files changed, 17 insertions, 31 deletions
diff --git a/cgit.c b/cgit.c
index 08cb5d2..bfde9f9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -165,8 +165,6 @@ void config_cb(const char *name, const char *value)
ctx.cfg.max_msg_len = atoi(value);
else if (!strcmp(name, "max-repodesc-length"))
ctx.cfg.max_repodesc_len = atoi(value);
- else if (!strcmp(name, "max-blob-size"))
- ctx.cfg.max_blob_size = atoi(value);
else if (!strcmp(name, "max-repo-count"))
ctx.cfg.max_repo_count = atoi(value);
else if (!strcmp(name, "max-commit-count"))
@@ -272,7 +270,6 @@ static void prepare_context(struct cgit_context *ctx)
ctx->cfg.max_lock_attempts = 5;
ctx->cfg.max_msg_len = 80;
ctx->cfg.max_repodesc_len = 80;
- ctx->cfg.max_blob_size = 0;
ctx->cfg.max_stats = 0;
ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
ctx->cfg.renamelimit = -1;
diff --git a/cgit.css b/cgit.css
index ef7d3c1..c47ebc9 100644
--- a/cgit.css
+++ b/cgit.css
@@ -162,11 +162,6 @@ table.list td a {
color: black;
}
-table.list td a.ls-dir {
- font-weight: bold;
- color: #00f;
-}
-
table.list td a:hover {
color: #00f;
}
diff --git a/cgit.h b/cgit.h
index 39853df..6c6c460 100644
--- a/cgit.h
+++ b/cgit.h
@@ -185,7 +185,6 @@ struct cgit_config {
int max_lock_attempts;
int max_msg_len;
int max_repodesc_len;
- int max_blob_size;
int max_stats;
int nocache;
int noplainemail;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index e69140b..0c13485 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -177,10 +177,6 @@ max-repodesc-length::
Specifies the maximum number of repo description characters to display
on the repository index page. Default value: "80".
-max-blob-size::
- Specifies the maximum size of a blob to display HTML for in KBytes.
- Default value: "0" (limit disabled).
-
max-stats::
Set the default maximum statistics period. Valid values are "week",
"month", "quarter" and "year". If unspecified, statistics are
diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 6b1c576..999ad0c 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -3,10 +3,6 @@
# tree-view by refering to this file with the source-filter or repo.source-
# filter options in cgitrc.
#
-# This script requires a shell supporting the ${var##pattern} syntax.
-# It is supported by at least dash and bash, however busybox environments
-# might have to use an external call to sed instead.
-#
# Note: the highlight command (http://www.andre-simon.de/) uses css for syntax
# highlighting, so you'll probably want something like the following included
# in your css file (generated by highlight 2.4.8 and adapted for cgit):
@@ -24,11 +20,20 @@
# table.blob .kwc { color:#000000; font-weight:bold; }
# table.blob .kwd { color:#010181; }
-# store filename and extension in local vars
-BASENAME="$1"
-EXTENSION="${BASENAME##*.}"
-
-# map Makefile and Makefile.* to .mk
-[ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk
-
-exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null
+case "$1" in
+ *.c)
+ highlight -f -I -X -S c
+ ;;
+ *.h)
+ highlight -f -I -X -S c
+ ;;
+ *.sh)
+ highlight -f -I -X -S sh
+ ;;
+ *.css)
+ highlight -f -I -X -S css
+ ;;
+ *)
+ highlight -f -I -X -S txt
+ ;;
+esac
diff --git a/ui-tree.c b/ui-tree.c
index f281937..f53ab64 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -107,12 +107,6 @@ static void print_object(const unsigned char *sha1, char *path, const char *base
curr_rev, path);
htmlf(")<br/>blob: %s\n", sha1_to_hex(sha1));
- if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
- htmlf("<div class='error'>blob size (%dKB) exceeds display size limit (%dKB).</div>",
- size / 1024, ctx.cfg.max_blob_size);
- return;
- }
-
if (buffer_is_binary(buf, size))
print_binary_buffer(buf, size);
else