git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Non-ASCII paths and git-cvsserver

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Nov 10, 2006, 18:59 UTC
Message-ID
<46a038f90611101059h1844bae8o9cc9d986eaaddd7b@mail.gmail.com>
In-Reply-To
<45530CEE.6030008@b-i-t.de>
On 11/9/06, sf <sf@b-i-t.de> wrote:
> I want to access a git repository via git-cvsserver. The problem is that
> the repository contains paths with umlauts. These paths come out quoted
> and escaped when checked out with cvs.

Thanks for the detailed report! I am travelling right now, so with "high latency" and on a machine that's missing sqlite libs :-/

But I'll give it a go anyway.

Does this mini-patch help? You'll need Perl 5.8.x and probably a recent SQLite for this.

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 8817f8b..c534de5 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -22,6 +22,9 @@ use Fcntl;
 use File::Temp qw/tempdir tempfile/;
 use File::Basename;

+binmode(STDIN,  ':utf8');
+binmode(STDOUT, ':utf8');
+
 my $log = GITCVS::log->new();
 my $cfg;

@@ -2104,6 +2107,11 @@ sub new
         $self->{tables}{$table} = 1;
     }

+    # this will set the encoding for new DBs
+    # or return false for existing DBs that are not
+    # utf-8
+    $self->{dbh}->do('PRAGMA encoding = "UTF-8"');
+
     # Construct the revision table if required
     unless ( $self->{tables}{revision} )
Previous: sfNext: Junio C Hamano
Message 2 of 11 in “Non-ASCII paths and git-cvsserver”
  1. sfNov 9, 2006
  2. Martin LanghoffNov 10, 2006
  3. Junio C HamanoNov 10, 2006
  4. sfNov 13, 2006
  5. Jakub NarebskiNov 13, 2006
  6. Robin RosenbergNov 13, 2006
  7. Jakub NarebskiNov 13, 2006
  8. Robin RosenbergNov 13, 2006
  9. Junio C HamanoNov 13, 2006
  10. Martin LanghoffNov 13, 2006
  11. sfNov 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.