List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 0/5] Miscellaneous fixes
@ 2013-09-11 18:10 
  2013-09-11 18:10 ` [PATCH 1/5] Fix some spelling errors 
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From:  @ 2013-09-11 18:10 UTC (permalink / raw)


Hi there. This patchset of tiny, mutually independent changes is meant
to solve a few problems that I've experienced while configuring cgit on
my Ubuntu machine.

P?emysl Janouch (5):
  Fix some spelling errors
  Fix about-formatting.sh
  Fix UTF-8 with syntax-highlighting.py
  Fix the example configuration
  Add a suggestion to the manpage

 cgitrc.5.txt                   |   17 +++++++++--------
 filters/about-formatting.sh    |    2 +-
 filters/syntax-highlighting.py |    1 +
 3 files changed, 11 insertions(+), 9 deletions(-)

-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] Fix some spelling errors
  2013-09-11 18:10 [PATCH 0/5] Miscellaneous fixes 
@ 2013-09-11 18:10 ` 
  2014-01-08 15:46   ` Jason
  2013-09-11 18:10 ` [PATCH 2/5] Fix about-formatting.sh 
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From:  @ 2013-09-11 18:10 UTC (permalink / raw)


Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
---
 cgitrc.5.txt |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 633cb00..07584ff 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -176,7 +176,7 @@ enable-git-config::
 	"scan-path", and must be defined prior, to augment repo-specific
 	settings. The keys gitweb.owner, gitweb.category, and gitweb.description
 	will map to the cgit keys repo.owner, repo.section, and repo.desc,
-	respectivly. All git config keys that begin with "cgit." will be mapped
+	respectively. All git config keys that begin with "cgit." will be mapped
 	to the corresponding "repo." key in cgit. Default value: "0". See also:
 	scan-path, section-from-path.
 
@@ -592,8 +592,8 @@ environment variable will be unset.
 
 MACRO EXPANSION
 ---------------
-The following cgitrc options supports a simple macro expansion feature,
-where tokens prefixed with "$" are replaced with the value of a similary
+The following cgitrc options support a simple macro expansion feature,
+where tokens prefixed with "$" are replaced with the value of a similarly
 named environment variable:
 
 - cache-root
@@ -620,7 +620,7 @@ EXAMPLE CGITRC FILE
 -------------------
 
 ....
-# Enable caching of up to 1000 output entriess
+# Enable caching of up to 1000 output entries
 cache-size=1000
 
 
@@ -700,7 +700,7 @@ mimetype.png=image/png
 mimetype.svg=image/svg+xml
 
 
-# Highlight source code with python pygments-based highligher
+# Highlight source code with python pygments-based highlighter
 source-filter=/var/www/cgit/filters/syntax-highlighting.py
 
 # Format markdown, restructuredtext, manpages, text files, and html files
-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/5] Fix about-formatting.sh
  2013-09-11 18:10 [PATCH 0/5] Miscellaneous fixes 
  2013-09-11 18:10 ` [PATCH 1/5] Fix some spelling errors 
@ 2013-09-11 18:10 ` 
  2014-01-08 15:47   ` Jason
  2013-09-11 18:10 ` [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py 
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From:  @ 2013-09-11 18:10 UTC (permalink / raw)


dash failed to parse the script.

Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
---
 filters/about-formatting.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/filters/about-formatting.sh b/filters/about-formatting.sh
index 313a4e6..892fbeb 100755
--- a/filters/about-formatting.sh
+++ b/filters/about-formatting.sh
@@ -18,7 +18,7 @@
 # CGIT_REPO_CLONE_URL  ( = repo.clone-url setting )
 
 cd "$(dirname $0)/html-converters/"
-case "$(tr '[:upper:]' '[:lower:]' <<<"$1")" in
+case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in
 	*.md|*.mkd) exec ./md2html; ;;
 	*.rst) exec ./rst2html; ;;
 	*.[1-9]) exec ./man2html; ;;
-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py
  2013-09-11 18:10 [PATCH 0/5] Miscellaneous fixes 
  2013-09-11 18:10 ` [PATCH 1/5] Fix some spelling errors 
  2013-09-11 18:10 ` [PATCH 2/5] Fix about-formatting.sh 
@ 2013-09-11 18:10 ` 
  2013-09-13  6:14   ` 
  2013-09-11 18:10 ` [PATCH 4/5] Fix the example configuration 
  2013-09-11 18:10 ` [PATCH 5/5] Add a suggestion to the manpage 
  4 siblings, 1 reply; 13+ messages in thread
From:  @ 2013-09-11 18:10 UTC (permalink / raw)


Previously the script tried to encode output from Pygments with
the ASCII codec, which failed.

Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
---
 filters/syntax-highlighting.py |    1 +
 1 file changed, 1 insertion(+)

diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py
index dcdba03..75c144a 100755
--- a/filters/syntax-highlighting.py
+++ b/filters/syntax-highlighting.py
@@ -25,6 +25,7 @@ from pygments import highlight
 from pygments.formatters import HtmlFormatter
 
 sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
+sys.stdout = codecs.getreader("utf-8")(sys.stdout.detach())
 doc = sys.stdin.read()
 try:
 	lexer = get_lexer_for_filename(sys.argv[1])
-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/5] Fix the example configuration
  2013-09-11 18:10 [PATCH 0/5] Miscellaneous fixes 
                   ` (2 preceding siblings ...)
  2013-09-11 18:10 ` [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py 
@ 2013-09-11 18:10 ` 
  2014-01-08 15:47   ` Jason
  2013-09-11 18:10 ` [PATCH 5/5] Add a suggestion to the manpage 
  4 siblings, 1 reply; 13+ messages in thread
From:  @ 2013-09-11 18:10 UTC (permalink / raw)


"enable-git-clone" doesn't exist, replaced with "enable-http-clone".

Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
---
 cgitrc.5.txt |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 07584ff..2c48081 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -636,7 +636,7 @@ enable-index-owner=1
 
 
 # Allow http transport git clone
-enable-git-clone=1
+enable-http-clone=1
 
 
 # Show extra links for each repository on the index page
-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 5/5] Add a suggestion to the manpage
  2013-09-11 18:10 [PATCH 0/5] Miscellaneous fixes 
                   ` (3 preceding siblings ...)
  2013-09-11 18:10 ` [PATCH 4/5] Fix the example configuration 
@ 2013-09-11 18:10 ` 
  2014-01-08 15:48   ` Jason
  4 siblings, 1 reply; 13+ messages in thread
From:  @ 2013-09-11 18:10 UTC (permalink / raw)


So that people wishing to use "enable-http-clone" don't have to find
out the correct settings on their own.

Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
---
 cgitrc.5.txt |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 2c48081..52caed0 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -133,8 +133,9 @@ enable-filter-overrides::
 
 enable-http-clone::
 	If set to "1", cgit will act as an dumb HTTP endpoint for git clones.
-	If you use an alternate way of serving git repositories, you may wish
-	to disable this. Default value: "1".
+	You can add "http://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL" to clone-url
+	to expose this feature. If you use an alternate way of serving git
+	repositories, you may wish to disable this. Default value: "1".
 
 enable-index-links::
 	Flag which, when set to "1", will make cgit generate extra links for
-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py
  2013-09-11 18:10 ` [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py 
@ 2013-09-13  6:14   ` 
  2014-01-08 15:49     ` Jason
  0 siblings, 1 reply; 13+ messages in thread
From:  @ 2013-09-13  6:14 UTC (permalink / raw)


On 11/09/13 20:10, P?emysl Janouch wrote:
> Previously the script tried to encode output from Pygments with
> the ASCII codec, which failed.
> 
> Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
> ---
>  filters/syntax-highlighting.py |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py
> index dcdba03..75c144a 100755
> --- a/filters/syntax-highlighting.py
> +++ b/filters/syntax-highlighting.py
> @@ -25,6 +25,7 @@ from pygments import highlight
>  from pygments.formatters import HtmlFormatter
>  
>  sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
> +sys.stdout = codecs.getreader("utf-8")(sys.stdout.detach())
>  doc = sys.stdin.read()
>  try:
>  	lexer = get_lexer_for_filename(sys.argv[1])
> 

Excuse me, of course it should be a writer, not a reader:
-sys.stdout = codecs.getreader("utf-8")(sys.stdout.detach())
+sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())

Regards,
P?emysl Janouch


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20130913/8533cf36/attachment.asc>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] Fix some spelling errors
  2013-09-11 18:10 ` [PATCH 1/5] Fix some spelling errors 
@ 2014-01-08 15:46   ` Jason
  0 siblings, 0 replies; 13+ messages in thread
From: Jason @ 2014-01-08 15:46 UTC (permalink / raw)


Merged, thanks.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/5] Fix about-formatting.sh
  2013-09-11 18:10 ` [PATCH 2/5] Fix about-formatting.sh 
@ 2014-01-08 15:47   ` Jason
  0 siblings, 0 replies; 13+ messages in thread
From: Jason @ 2014-01-08 15:47 UTC (permalink / raw)


Merged. Good catch.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/5] Fix the example configuration
  2013-09-11 18:10 ` [PATCH 4/5] Fix the example configuration 
@ 2014-01-08 15:47   ` Jason
  0 siblings, 0 replies; 13+ messages in thread
From: Jason @ 2014-01-08 15:47 UTC (permalink / raw)


Merged.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 5/5] Add a suggestion to the manpage
  2013-09-11 18:10 ` [PATCH 5/5] Add a suggestion to the manpage 
@ 2014-01-08 15:48   ` Jason
  0 siblings, 0 replies; 13+ messages in thread
From: Jason @ 2014-01-08 15:48 UTC (permalink / raw)


Merged.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py
  2013-09-13  6:14   ` 
@ 2014-01-08 15:49     ` Jason
  0 siblings, 0 replies; 13+ messages in thread
From: Jason @ 2014-01-08 15:49 UTC (permalink / raw)


Merged with your change, thanks.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/5] Fix about-formatting.sh
@ 2013-10-08 14:06 martinerikwerner
  0 siblings, 0 replies; 13+ messages in thread
From: martinerikwerner @ 2013-10-08 14:06 UTC (permalink / raw)


> dash failed to parse the script.
>
> Signed-off-by: P?emysl Janouch <p.janouch at gmail.com>
> ---
>  filters/about-formatting.sh |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/filters/about-formatting.sh b/filters/about-formatting.sh
> index 313a4e6..892fbeb 100755
> --- a/filters/about-formatting.sh
> +++ b/filters/about-formatting.sh
> @@ -18,7 +18,7 @@
>  # CGIT_REPO_CLONE_URL  ( = repo.clone-url setting )
>  
>  cd "$(dirname $0)/html-converters/"
> -case "$(tr '[:upper:]' '[:lower:]' <<<"$1")" in
> +case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in
>  	*.md|*.mkd) exec ./md2html; ;;
>  	*.rst) exec ./rst2html; ;;
>  	*.[1-9]) exec ./man2html; ;;
> -- 
> 1.7.10.4

I'd like to second this patch, I was somewhat pulling my hair trying to figure
out why it was treating html as txt until I noticed that it was simply down to
a bashism in an sh script.

--
Martin Erik Werner <martinerikwerner at gmail.com>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-01-08 15:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 18:10 [PATCH 0/5] Miscellaneous fixes 
2013-09-11 18:10 ` [PATCH 1/5] Fix some spelling errors 
2014-01-08 15:46   ` Jason
2013-09-11 18:10 ` [PATCH 2/5] Fix about-formatting.sh 
2014-01-08 15:47   ` Jason
2013-09-11 18:10 ` [PATCH 3/5] Fix UTF-8 with syntax-highlighting.py 
2013-09-13  6:14   ` 
2014-01-08 15:49     ` Jason
2013-09-11 18:10 ` [PATCH 4/5] Fix the example configuration 
2014-01-08 15:47   ` Jason
2013-09-11 18:10 ` [PATCH 5/5] Add a suggestion to the manpage 
2014-01-08 15:48   ` Jason
2013-10-08 14:06 [PATCH 2/5] Fix about-formatting.sh martinerikwerner

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).