* [PATCH 1/2] parsing.c: Remove leading space from committer
@ 2014-01-15 22:18 cgit
2014-01-15 22:18 ` [PATCH 2/2] t0111: Additions and fixes cgit
2014-01-15 23:57 ` [PATCH 1/2] parsing.c: Remove leading space from committer Jason
0 siblings, 2 replies; 4+ messages in thread
From: cgit @ 2014-01-15 22:18 UTC (permalink / raw)
This did not really break anything in the past since spaces are ignored
when rendering HTML. Remove the preceding space anyway to prevent from
potential future problems.
Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
This would get fixed anyway when switching to strip_prefix(). However,
it is better to do this now to avoid any problems. It is also "required"
for the following patch (otherwise, we would have to add a workaround
for this bug to the test case which doesn't seem right and might lead to
confusion when the bug suddenly disappears after the strip_prefix()
migrate and the tests break).
parsing.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parsing.c b/parsing.c
index 0062550..599f61e 100644
--- a/parsing.c
+++ b/parsing.c
@@ -156,7 +156,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
}
if (p && !prefixcmp(p, "committer ")) {
- p = parse_user(p + 9, &ret->committer, &ret->committer_email,
+ p = parse_user(p + 10, &ret->committer, &ret->committer_email,
&ret->committer_date);
}
--
1.8.5.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] t0111: Additions and fixes
2014-01-15 22:18 [PATCH 1/2] parsing.c: Remove leading space from committer cgit
@ 2014-01-15 22:18 ` cgit
2014-01-15 23:57 ` Jason
2014-01-15 23:57 ` [PATCH 1/2] parsing.c: Remove leading space from committer Jason
1 sibling, 1 reply; 4+ messages in thread
From: cgit @ 2014-01-15 22:18 UTC (permalink / raw)
* Rename the capitalize-* filters to dump.* since they also dump the
arguments.
* Add full argument validation to the email filters.
Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
tests/filters/capitalize-buffer.lua | 17 -----------------
tests/filters/capitalize-stdin.sh | 4 ----
tests/filters/dump.lua | 17 +++++++++++++++++
tests/filters/dump.sh | 4 ++++
tests/setup.sh | 16 ++++++++--------
tests/t0111-filter.sh | 4 ++--
6 files changed, 31 insertions(+), 31 deletions(-)
delete mode 100644 tests/filters/capitalize-buffer.lua
delete mode 100755 tests/filters/capitalize-stdin.sh
create mode 100644 tests/filters/dump.lua
create mode 100755 tests/filters/dump.sh
diff --git a/tests/filters/capitalize-buffer.lua b/tests/filters/capitalize-buffer.lua
deleted file mode 100644
index 1f15c93..0000000
--- a/tests/filters/capitalize-buffer.lua
+++ /dev/null
@@ -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
-
-
diff --git a/tests/filters/capitalize-stdin.sh b/tests/filters/capitalize-stdin.sh
deleted file mode 100755
index da6f7a1..0000000
--- a/tests/filters/capitalize-stdin.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-[ "$#" -gt 0 ] && printf "%s " "$*"
-tr '[:lower:]' '[:upper:]'
diff --git a/tests/filters/dump.lua b/tests/filters/dump.lua
new file mode 100644
index 0000000..1f15c93
--- /dev/null
+++ b/tests/filters/dump.lua
@@ -0,0 +1,17 @@
+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
+
+
diff --git a/tests/filters/dump.sh b/tests/filters/dump.sh
new file mode 100755
index 0000000..da6f7a1
--- /dev/null
+++ b/tests/filters/dump.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+[ "$#" -gt 0 ] && printf "%s " "$*"
+tr '[:lower:]' '[:upper:]'
diff --git a/tests/setup.sh b/tests/setup.sh
index 12c97f5..785edd7 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -128,19 +128,19 @@ repo.desc=spaced repo
repo.url=filter-exec
repo.path=$PWD/repos/filter/.git
repo.desc=filtered repo
-repo.about-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
-repo.commit-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
-repo.email-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
-repo.source-filter=exec:$FILTER_DIRECTORY/capitalize-stdin.sh
+repo.about-filter=exec:$FILTER_DIRECTORY/dump.sh
+repo.commit-filter=exec:$FILTER_DIRECTORY/dump.sh
+repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh
+repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh
repo.readme=master:a+b
repo.url=filter-lua
repo.path=$PWD/repos/filter/.git
repo.desc=filtered repo
-repo.about-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
-repo.commit-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
-repo.email-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
-repo.source-filter=lua:$FILTER_DIRECTORY/capitalize-buffer.lua
+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
}
diff --git a/tests/t0111-filter.sh b/tests/t0111-filter.sh
index c89020a..730f1c0 100755
--- a/tests/t0111-filter.sh
+++ b/tests/t0111-filter.sh
@@ -30,11 +30,11 @@ do
'
test_expect_success "check whether the $prefix email filter works for authors" '
- grep "A U THOR <AUTHOR at EXAMPLE.COM>" tmp
+ grep "<author at example.com> commit A U THOR <AUTHOR at EXAMPLE.COM>" tmp
'
test_expect_success "check whether the $prefix email filter works for committers" '
- grep "C O MITTER <COMMITTER at EXAMPLE.COM>" tmp
+ grep "<committer at example.com> commit C O MITTER <COMMITTER at EXAMPLE.COM>" tmp
'
done
--
1.8.5.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] parsing.c: Remove leading space from committer
2014-01-15 22:18 [PATCH 1/2] parsing.c: Remove leading space from committer cgit
2014-01-15 22:18 ` [PATCH 2/2] t0111: Additions and fixes cgit
@ 2014-01-15 23:57 ` Jason
1 sibling, 0 replies; 4+ messages in thread
From: Jason @ 2014-01-15 23:57 UTC (permalink / raw)
Merged, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-15 23:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15 22:18 [PATCH 1/2] parsing.c: Remove leading space from committer cgit
2014-01-15 22:18 ` [PATCH 2/2] t0111: Additions and fixes cgit
2014-01-15 23:57 ` Jason
2014-01-15 23:57 ` [PATCH 1/2] parsing.c: Remove leading space from committer Jason
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).