kubitron / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
78 stars 15 forks source link

Clone failed using JGit over http #63

Open leelyle opened 12 years ago

leelyle commented 12 years ago

Hi,

There is an error when I try to using JGit (Java Git, Eclipse plugin) to clone the repo the error message is : invalid advertisement of 001e# service=git-upload-pack

and i run curl --include http://xxxx/redmine/xxxx.git/info/refs?service=git-upload-pack

the server returns: HTTP/1.1 200 OK Date: Mon, 03 Sep 2012 09:28:21 GMT Server: Apache/2.2.22 (Ubuntu) ETag: "8b5a1c9b0510a4d5eabe02d3cfa43ab5" Cache-Control: no-cache, max-age=0, must-revalidate Pragma: no-cache Expires: Fri, 01 Jan 1980 00:00:00 GMT X-Runtime: 64 Content-Length: 264 Content-Type: application/x-git-upload-pack-advertisement; charset=utf-8

and i found out that clone will failed if Content-Type has "charset=xxx"

the discussion is here https://bugs.eclipse.org/bugs/show_bug.cgi?id=358043

kubitron commented 12 years ago

I'm not sure if you are saying that this is a bug with the plugin. It seems to be a bug with JGit, right?

leelyle commented 12 years ago

i think it's a specification bug JGit shouldn't check this, Server shouldn't add "charset=xxx" in Content type according to smart http protocol. I tested JGit clone on github over http, it's working fine. Anyway, Is there any ways around this?

kubitron commented 12 years ago

Sorry for the long silence.

Well, the server code places those charset specs explicitly into the headers. I didn't write this code, so didn't want to mess with essentially functioning code. I could possibly look into this more.

crocket commented 12 years ago

If the git version of the server was distant from that of the client, smart HTTP transfer would fail.

kubitron commented 12 years ago

No -- this is explicitly in the plugin code. I suppose I could remove it, but not sure why it was added in the first case.