subtree(3p/cgit): merge cgit-pink into depot cgit

cgit-pink is a maintained fork of cgit that follows upstream git more
closely and already contains a lot of patches we already had applied.
Consequently, it seems sensible it becomes our future upstream, we may
even be able to upstream some of our custom, less invasive patches.

Change-Id: Ia081e4508866f32298986c7160f4890c8a7c8922
This commit is contained in:
sterni 2022-05-19 10:27:26 +02:00
commit 40803d9c6d
39 changed files with 185 additions and 1616 deletions

View file

@ -1,17 +0,0 @@
function filter_open(...)
buffer = ""
for i = 1, select("#", ...) do
buffer = buffer .. select(i, ...) .. " "
end
end
function filter_close()
html(buffer)
return 0
end
function filter_write(str)
buffer = buffer .. string.upper(str)
end

View file

@ -60,12 +60,6 @@ fi
FILTER_DIRECTORY=$(cd ../filters && pwd)
if cgit --version | grep -F -q "[+] Lua scripting"; then
export CGIT_HAS_LUA=1
else
export CGIT_HAS_LUA=0
fi
mkrepo() {
name=$1
count=$2
@ -144,19 +138,6 @@ repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh
repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh
repo.readme=master:a+b
EOF
if [ $CGIT_HAS_LUA -eq 1 ]; then
cat >>cgitrc <<EOF
repo.url=filter-lua
repo.path=$PWD/repos/filter/.git
repo.desc=filtered repo
repo.about-filter=lua:$FILTER_DIRECTORY/dump.lua
repo.commit-filter=lua:$FILTER_DIRECTORY/dump.lua
repo.email-filter=lua:$FILTER_DIRECTORY/dump.lua
repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua
repo.readme=master:a+b
EOF
fi
}
cgit_query()

View file

@ -11,7 +11,7 @@ test_expect_success 'find commit subject' '
grep "<div class=.commit-subject.>commit 5<" tmp
'
test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp'
test_expect_success 'find commit msg' 'grep "<pre class=.commit-msg.></pre>" tmp'
test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp'
test_expect_success 'find diff summary' '
@ -29,8 +29,8 @@ test_expect_success 'root commit contains diffstat' '
'
test_expect_success 'root commit contains diff' '
grep ">diff --git a/file-1 b/file-1<" tmp &&
grep "<div class=.add.>+1</div>" tmp
grep ">diff --git a/file-1 b/file-1" tmp &&
grep "<span class=.add.>+1</span>" tmp
'
test_done

View file

@ -9,11 +9,11 @@ test_expect_success 'find blob link' 'grep "<a href=./foo/tree/file-5?id=" tmp'
test_expect_success 'find added file' 'grep "new file mode 100644" tmp'
test_expect_success 'find hunk header' '
grep "<div class=.hunk.>@@ -0,0 +1 @@</div>" tmp
grep "<span class=.hunk.>@@ -0,0 +1 @@</span>" tmp
'
test_expect_success 'find added line' '
grep "<div class=.add.>+5</div>" tmp
grep "<span class=.add.>+5</span>" tmp
'
test_done

View file

@ -4,9 +4,6 @@ test_description='Check filtered content'
. ./setup.sh
prefixes="exec"
if [ $CGIT_HAS_LUA -eq 1 ]; then
prefixes="$prefixes lua"
fi
for prefix in $prefixes
do