https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-02-23T12:42:44ZRedmineRedmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=146082010-02-23T12:42:44ZAntonio García-Domínguez
<ul></ul><p>Oh, and the old DAV HTTP protocol would be OK, but it has performance problems and can corrupt the repository if you have the wrong version of curl :-/.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=146392010-02-23T21:33:07ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> set to <i>SCM</i></li></ul> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=146562010-02-24T16:59:27ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/3250">0001-Redmine.pm-add-Git-smart-HTTP-support-v2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3250/0001-Redmine.pm-add-Git-smart-HTTP-support-v2.patch">0001-Redmine.pm-add-Git-smart-HTTP-support-v2.patch</a> added</li></ul><p>New patch which fixes a few mistakes in the POD.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=146572010-02-24T17:01:25ZAntonio García-Domínguez
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>Oh, and the old DAV HTTP protocol would be OK, but it has performance problems and can corrupt the repository if you have the wrong version of curl :-/.</p>
</blockquote>
<p>Forgot to add that smart HTTP can use hooks as well, and doesn't require a cronjob with "git update-server-info". Smart HTTP requires Git 1.6.6+ on server and client.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=146762010-02-25T09:07:13ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/3254">0001-Redmine.pm-add-Git-smart-HTTP-support.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3254/0001-Redmine.pm-add-Git-smart-HTTP-support.patch">0001-Redmine.pm-add-Git-smart-HTTP-support.patch</a> added</li></ul><p>Third version, this time with a sample Apache configuration and some tips on where to place the repositories and how they should be named.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=149052010-03-04T10:11:18ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/3300">0001-Redmine.pm-add-Git-smart-HTTP-support-v4.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3300/0001-Redmine.pm-add-Git-smart-HTTP-support-v4.patch">0001-Redmine.pm-add-Git-smart-HTTP-support-v4.patch</a> added</li></ul><p>Oops, the last patch was corrupt. Version 4 of the patch fixes this. Sorry!</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=182662010-07-12T21:47:42ZFelix Schäfer
<ul></ul><p>Antonio, your patch looks good, though it expects the paths to your repositories to start with <code>/git/</code>. Could you please rework it so that the path under which the repositories reside is configurable in the apache config, possibly defaulting to <code>/git/</code> as that seems to be the canonical example?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=182932010-07-13T16:31:15ZFelix Schäfer
<ul><li><strong>File</strong> <a href="/attachments/4112">0001-Redmine.pm-add-Git-smart-HTTP-support-r3840.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4112/0001-Redmine.pm-add-Git-smart-HTTP-support-r3840.patch">0001-Redmine.pm-add-Git-smart-HTTP-support-r3840.patch</a> added</li></ul><p>I Updated the patch against <a class="changeset" title="Force the test RAILS_ENV to help prevent purging data when mistyping. #4572" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3840">r3840</a>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184542010-07-19T19:55:08ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/4139">0001-Redmine.pm-add-Git-smart-HTTP-support-redmine0.9.6.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4139/0001-Redmine.pm-add-Git-smart-HTTP-support-redmine0.9.6.patch">0001-Redmine.pm-add-Git-smart-HTTP-support-redmine0.9.6.patch</a> added</li></ul><p>Felix, there seems to be a slight typo in your patch: both lines 416 and 417 add something. I would normally expect the original line to be removed and the new line to be added.</p>
<p>I recently updated my patch for Redmine 0.9.6 (<a class="changeset" title="Tagging 0.9.6" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3839">r3839</a>), so it should be up to date (Redmine.pm's last change is from <a class="changeset" title="Check the browse repository or commit access permissions in Redmine.pm with LDAP. #5797" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3832">r3832</a>). It's running smoothly on my installation.</p>
<p>As for the /git/ prefix: would another Apache directive for customizing it be OK?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184602010-07-19T20:33:32ZFelix Schäfer
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>Felix, there seems to be a slight typo in your patch: both lines 416 and 417 add something. I would normally expect the original line to be removed and the new line to be added.</p>
</blockquote>
<p>Yeah, noticed that too today, was gonna correct that, but it seems you've done that already, thanks :-)</p>
<blockquote>
<p>As for the /git/ prefix: would another Apache directive for customizing it be OK?</p>
</blockquote>
<p>Well, I was thinking about how svn doesn't need that, and in fact there already is a function <code>get_project_identifier</code> which you should be able to get the identifier from, so no need for an additional setting.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184662010-07-19T20:47:35ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/4143">0001-Redmine.pm-add-Git-smart-HTTP-support-simplified.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4143/0001-Redmine.pm-add-Git-smart-HTTP-support-simplified.patch">0001-Redmine.pm-add-Git-smart-HTTP-support-simplified.patch</a> added</li></ul><p>After thinking it over, I didn't like having to specify the URL prefix two times in the Apache config. It would look like this:</p>
<pre>
<Location /git>
RedmineGitSmartHttp yes
RedmineGitURLPrefix /git
</Location>
</pre>
<p>It just breaks DRY :-/. Instead, I have relaxed the regexp that checks whether a request is a write operation, so it will work with any prefix. I went from this:</p>
<pre>
my $is_read_only = $uri !~ /^\/git\/.*\/[^\/]*git\-receive\-pack$/o;
</pre>
<p>to this, which only checks the last path component and the query string:</p>
<pre>
my $is_read_only = $uri !~ /\/[^\/]*git\-receive\-pack$/o;
</pre> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184682010-07-19T20:50:41ZAntonio García-Domínguez
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>Yeah, noticed that too today, was gonna correct that, but it seems you've done that already, thanks :-)</p>
</blockquote>
<p>No problem :-).</p>
<blockquote>
<p>Well, I was thinking about how svn doesn't need that, and in fact there already is a function <code>get_project_identifier</code> which you should be able to get the identifier from, so no need for an additional setting.</p>
</blockquote>
<p>Yeah, I saw it on the authen handler code. But that'd only get me the project ID, and not the path in the <Location> block (/git/ here), which is what I really need. However, I have fixed the patch so it won't need this prefix (see my previous comment).</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184722010-07-19T20:55:47ZFelix Schäfer
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>Felix Schäfer wrote:</p>
<blockquote>
<p>Well, I was thinking about how svn doesn't need that, and in fact there already is a function <code>get_project_identifier</code> which you should be able to get the identifier from, so no need for an additional setting.</p>
</blockquote>
<p>Yeah, I saw it on the authen handler code. But that'd only get me the project ID, and not the path in the <Location> block (/git/ here), which is what I really need. However, I have fixed the patch so it won't need this prefix (see my previous comment).</p>
</blockquote>
<p>Sorry, got that backwards, but I still don't like the regex being that lax. Anyway, from the aforementioned method, I can see you can get the location from the request object <code>$r->location</code>, why not just use that as a prefix to your regex as is done in said method?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184782010-07-19T21:14:48ZAntonio García-Domínguez
<ul></ul><p>Well, duh! :-D</p>
<p>I spent a while on the Apache site trying to find the appropriate method and I just found it after reading your post and checking that function. <a href="http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_location_" class="external">Here</a>.</p>
<p>OK, I'll get on it :-).</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184852010-07-19T21:55:00ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/4144">0001-Redmine.pm-add-Git-smart-HTTP-support-use-location.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4144/0001-Redmine.pm-add-Git-smart-HTTP-support-use-location.patch">0001-Redmine.pm-add-Git-smart-HTTP-support-use-location.patch</a> added</li></ul><p>OK, one more try: this patch uses $location as you suggested instead of a fixed prefix. The only caveat is that the path in the <Location> block cannot have a trailing slash. I have modified the documentation at the beginning of the file to mention this.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184862010-07-19T22:03:56ZFelix Schäfer
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>The only caveat is that the path in the <Location> block cannot have a trailing slash. I have modified the documentation at the beginning of the file to mention this.</p>
</blockquote>
<p>Again referencing the already existing commit, why not just <code>m{^$location/*[^/]+/[^/]*git\-receive\-pack$}o</code>?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184872010-07-19T22:04:29ZFelix Schäfer
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>Again referencing the already existing commit</p>
</blockquote>
<p>And by commit I mean function x_X</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=184972010-07-20T08:03:25ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/4149">0001-Redmine.pm-add-Git-smart-HTTP-support.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4149/0001-Redmine.pm-add-Git-smart-HTTP-support.patch">0001-Redmine.pm-add-Git-smart-HTTP-support.patch</a> added</li></ul><p>Hmm, let's try and get that regexp as tight as possible. We need to watch out for these two URLs:</p>
<ul>
<li>/info/refs?service=git-receive-pack: Git performs a GET on this URL before actually trying to push, and it needs the same authentication as an actual push.</li>
<li>/git-receive-pack: this is the service where Git will POST the changes to.</li>
</ul>
<p>We can't do both with your regexp, I'm afraid. Here's a patch with a revised regexp that accepts these two cases and nothing else, and also allows for trailing slashes in the Location block.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=185352010-07-21T08:23:57ZFelix Schäfer
<ul></ul><p>If <code>http://myserv.er/my/location/project-identifier/info/refs?service=git-receive-pack</code> really is the only path that git needs to read from the repo, this should work :-) I'll try to install it on my redmine later on.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=185752010-07-22T00:11:01ZAntonio García-Domínguez
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>If <code>http://myserv.er/my/location/project-identifier/info/refs?service=git-receive-pack</code> really is the only path that git needs to read from the repo, this should work :-) I'll try to install it on my redmine later on.</p>
</blockquote>
<p>And <code>http://myserv.er/my/location/project-identifer/git-receive-pack</code>, don't forget :-).</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=186112010-07-22T17:19:05ZFelix Schäfer
<ul></ul><p>The patch works great, maybe the messages could be somewhat unified though: not being in a private project yields "fatal: Authentication failed" while being in the project and not having commit access yields "error: Cannot access URL <a class="external" href="https://git.fachschaften.org/sandbox-git/">https://git.fachschaften.org/sandbox-git/</a>, return code 22 fatal: git-http-push failed".</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=186332010-07-23T09:26:08ZAntonio García-Domínguez
<ul></ul><p>I agree with you, but I'm not a Git developer :-/. That's why I placed those instructions in the documentation of Redmine.pm. Perhaps we could add your remarks as a small troubleshooting section?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=186342010-07-23T09:32:51ZFelix Schäfer
<ul></ul><p>No, it's just a minor annoyance, we can dig in back later if this really becomes a problem.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=189712010-08-04T20:03:36ZAntonio García-Domínguez
<ul></ul><p>If the patch is OK, do you think it could be merged to trunk sometime in the near future? If possible, I'd like to stop having to juggle it around every time I update Redmine :-/.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=189742010-08-04T20:59:26ZFelix Schäfer
<ul></ul><p>That's Eric's or JPLang's call :-)</p>
<p>Eric, this patch floats my boat and it looks good to me, there's even some <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration">documentation</a> to it ;-) Anything more you need to include it?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=192362010-08-11T14:38:55ZNicolas Sebrecht
<ul></ul><p>Hi,</p>
<p>I'm stuck by an error when trying to do anything with the last patch. I've followed the related documentation.<br /><pre>
$ git clone http://my.hostname/test
Cloning into test...
fatal: http://my.hostname/test/info/refs not found: did you run git update-server-info on the server?
</pre></p>
<p>Run the command did nothing and the <code>config.ru</code> file looks good (checked).</p>
I have the following version tools in the server side:
<ul>
<li>git 1.7.2.1.44.g721e7</li>
<li>redmine 1.0.0</li>
</ul>
<p>Any idea?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=192392010-08-11T15:43:29ZFelix Schäfer
<ul></ul><p>Nicolas Sebrecht wrote:</p>
<blockquote>
<p>Any idea?</p>
</blockquote>
<p>Please visit the forums (or IRC, I'm thegcat over there) for configuration help. Please also include some more information about your setup, thanks.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=192802010-08-12T08:12:01ZNicolas Sebrecht
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>Please visit the forums (or IRC, I'm thegcat over there) for configuration help. Please also include some more information about your setup, thanks.</p>
</blockquote>
<p>The thread <a class="external" href="http://www.redmine.org/boards/2/topics/15962">http://www.redmine.org/boards/2/topics/15962</a> did help me. I was missing the trailing "/public" for the DocumentRoot field in my apache virtualhost.</p>
<p>Thanks.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=218402010-10-27T10:05:48ZEnrique Garcia
<ul></ul><p>Hi,</p>
<p>I'm interested on this patch. However I'm confused. There 9 patch files.</p>
<p>Which one should I use?</p>
<p>Can anyone please remove the deprecated patches, or mark them somehow?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=220172010-11-01T06:12:53ZAntonio García-Domínguez
<ul></ul><p>Hi Enrique,</p>
<p>I would love to do something about the old patches, but I can't :-(. In any case, you should use the very last one (the 2010-07-20 10:03 one).</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=236692011-01-04T04:52:01ZLee Fay
<ul><li><strong>File</strong> <a href="/attachments/5092">LeeF-Redmine.pm.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/5092/LeeF-Redmine.pm.patch">LeeF-Redmine.pm.patch</a> added</li></ul><p>Hello, I've made a very minor addition to the patch, it allows the repositories to have ".git" at the end, like when served from gitosis. I haven't tested it extensively, but it's worked for everything I've done so far. This patch should also not break compatibility with SVN authentication.</p>
<p>Please let me know if there is something wrong with I have done.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=246502011-01-29T07:35:33Zmichael fox
<ul></ul><p>I finally got this working, but here's the problem:</p>
<p>Redmine allows you to name your git repo anything, but Redmine.pm script assumes that the repo name is the same as the name of the project identifier.</p>
<p>So, I was trying to make it work with a project with identifier "testr" and a repo called "/repo/testrepo.git"</p>
<p>And I kept getting 401, and I couldn't figure out why.</p>
<p>Finally I figured out I needed to create a symlink /repo/testr to /repo/testrepo.git and suddenly it worked.</p>
<p>So, there's you're workaround if you're experiencing this problem.</p>
<p>I don't know if I can do a patch on my own, but here's a start:<br /><pre>
sub get_project_identifier {
my $r = shift;
my $location = $r->location;
$location =~ /http://[^/]*/(.*)/refs/;
my $repo = $1;
#not sure how to do SQL in perl, but something like:
#select project_id from repositories where url='$repo';
return $project_id;
}
</pre></p>
<p>select project_id from repositories where url='/repo/testrepo.git';</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=246512011-01-29T07:54:26ZFelix Schäfer
<ul></ul><p>michael fox wrote:</p>
<blockquote>
<p>[…] Redmine.pm script assumes that the repo name is the same as the name of the project identifier.</p>
</blockquote>
<p>The svn version does, and so does the patch.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=246532011-01-29T11:01:49Zmichael fox
<ul></ul><p>Ok. Maybe you'll like this one better.</p>
<p>I was having a problem where a user that was not authorized to commit was able to commit anyway.</p>
<p>I traced it back to this regular expression:<br /><pre>
my $is_read_only = $uri !~ m{^$location/*[^/]+/(info/refs\?service=)?git\-receive\-pack$}o;
</pre></p>
<p>The problem occurs when there is an extra slash like:<br /><pre>
"GET /repo/testr//info/refs?service=git-receive-pack HTTP/1.1"
</pre></p>
<p>Then, somehow according to the logic of the script, it is okay for that person to commit.</p>
<p>This slight change fixes the problem (+ after the / before info):<br /><pre>
my $is_read_only = $uri !~ m{^$location/*[^/]+/+(info/refs\?service=)?git\-receive\-pack$}o;
</pre></p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=248102011-02-04T00:38:56ZRadek Antoniuk
<ul><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li></ul><p>As this is waiting for input from JP I am assigning it to you to get the attention :-)<br />This patch looks good and I think it should be merged into the current branch. Jean-Philippe, any thoughts on that?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=256132011-02-24T21:26:48ZChristian Gutierrez
<ul></ul><p>Hi, i think that patch works great with simple projects, but it doesn't work with nested projects, if i have a principal project called project1, and create a second project called project2 as a subproject of project1, then, in my directory's repository i use project1/project2 as a git repository but, when i do "git push origin master" from a remote host i get:</p>
<p>error: Cannot access URL <a class="external" href="http://user@server.example.com/git/project1/project2/">http://user@server.example.com/git/project1/project2/</a>, return code 22<br />fatal: git-http-push failed</p>
<p>Maybe i'm doing something wrong?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=256162011-02-25T08:28:07ZFelix Schäfer
<ul></ul><p>Christian Gutierrez wrote:</p>
<blockquote>
<p>Maybe i'm doing something wrong?</p>
</blockquote>
<ol>
<li>you shouldn't checkout a repository into another repository,</li>
<li>the URLs must all be <code>protocol://host/location/identifier</code>, where identifier is the identifier of the project.</li>
</ol>
<p>In your case, I think the authentication bit will only work if you put the repository for <code>project2</code> to <code>http://user@server.example.com/git/project2/</code>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=256302011-02-25T15:06:51ZChristian Gutierrez
<ul></ul><p>Felix, thanks for your reply, it works with symbolic links.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=269842011-03-24T06:29:39ZToshi MARUYAMA
<ul><li><strong>Category</strong> changed from <i>SCM</i> to <i>SCM extra</i></li><li><strong>Assignee</strong> deleted (<del><i>Jean-Philippe Lang</i></del>)</li></ul> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=272122011-03-28T11:22:57ZJulien Mellerin
<ul></ul><p>Hello,</p>
<p>I am trying to apply this patch to the current latest release of Redmine (1.1.2). But the only result I get is the following message :<br /><code>Only garbage was found in the patch input.</code><br />So I guess the patch is incompatible with this release. Is there a way to fix this ?</p>
<p>Thanks,</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=273642011-03-30T12:43:57ZAnonymous
<ul></ul><p>I get the issue that several Hunk (1 through 8) failed</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=274072011-03-31T10:39:34ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/5725">0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/5725/0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix.patch">0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix.patch</a> added</li></ul><p>Dieter, Julien: that's odd, because my latest patch applied cleanly (with "git apply (patch)") on top of the 1.1.2 tag of the Git mirror of the Redmine code repository. LeeF's also worked, except you had to be inside extra and it added trailing whitespace to line 138.</p>
<p>In any case, here's a new patch. This patch applies cleanly with "git apply" on top of the 1.1.2 tag in the Redmine Git clone. The patch is based on LeeF's patch, but removes some trailing whitespace in line 138 and adds Michael Fox's security fix in message <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Passwords are revield in logs (Closed)" href="https://www.redmine.org/issues/34">#34</a>. Please try it out :-).</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=274512011-04-01T12:12:18ZJulien Mellerin
<ul></ul><p>Thanks Antonio. I was using "patch -p1 < the_patch_file". Using "git apply" worked for me.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=274952011-04-02T14:20:02ZFabrice Estiévenart
<ul></ul><p>Hello,</p>
<p>I followed the instructions for smart git http integration and applied 0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix.patch on my redmine 1.0.1. When I try to access git.mydomain.com, I get the following message in my Apache error log:</p>
<p>Use of uninitialized value $identifier in substitution (s///) at /usr/lib/perl5/Apache/Redmine.pm line 486<br />I suppose this variable is not nicely initialized in the preceding instruction...</p>
<p>Could you please help me ? Thank you</p>
<p>Fabrice</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=275262011-04-03T21:56:06ZAntonio García-Domínguez
<ul></ul><p>Are you simply trying to visit <a class="external" href="http://git.mydomain.com">http://git.mydomain.com</a> or <a class="external" href="http://git.mydomain.com/">http://git.mydomain.com/</a>? That won't work: the auth code expects URLs to start with something like <a class="external" href="http://git.mydomain.com/myproject">http://git.mydomain.com/myproject</a>, where myproject is your project's ID. By the way, you can't really browse through the URLs for smart HTTP access for Git with a regular browser, like SVN: you need to use a proper Git client.</p>
<p>According to the patch, the code around line 486 is this:</p>
<pre>
my $location = $r->location;
my ($identifier) = $r->uri =~ m{$location/*([^/]+)};
$identifier =~ s/\.git//;
$identifier;
</pre>
<p>If you get that error in line 486 (<code>$identifier =~ s/\.git//;</code>), that's because $identifier wasn't initialized in the previous line. That can only be if the URI does not match the <code>$location/*([^/]+)</code> regexp, and I can only think of two URLs which do not match that regexp: <a class="external" href="http://git.mydomain.com">http://git.mydomain.com</a> and <a class="external" href="http://git.mydomain.com/">http://git.mydomain.com/</a>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=276712011-04-07T12:20:20ZMarcel Eeken
<ul></ul><p>Hey,</p>
<p>I had this working for a long time. But recently i changed something and don't know exactly what i did wrong, so i tried a clean installation of redmine to test but can't seem to get it to work anymore. I followed this guide <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration">HowTo_configure_Redmine_for_advanced_git_integration</a> and only implemented the basic access so no authentication is required but i keep getting 401 errors.</p>
<p>This is what i get on the client side:<br /><pre>
$ git ls-remote http://git.website.com/duneinterface
error: The requested URL returned error: 401 while accessing http://git.website.com/duneinterface/info/refs
fatal: HTTP request failed
</pre></p>
<p>In this is what i see in the logs<br /><pre>
ip - - [07/Apr/2011:14:17:34 +0200] "GET /duneinterface/info/refs?service=git-upload-pack HTTP/1.1" 401 283 "-" "git/1.7.0.2.msysgit.0.14.g956d7"
ip - - [07/Apr/2011:14:17:35 +0200] "GET /duneinterface/info/refs HTTP/1.1" 401 283 "-" "git/1.7.0.2.msysgit.0.14.g956d7"
</pre></p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=277622011-04-09T15:19:29ZAntonio García-Domínguez
<ul></ul><p>Those URLs are read-only, according to the patch. They should only produce 401 errors if the project is private and you haven't set up the appropriate files with your credentials (see the instructions at the beginning of the patch), or if you don't have read access to the project.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=288592011-05-12T10:19:18ZВе Fio
<ul></ul><p>Love the patch! Would really like to see this be a standard feature!!!</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=288712011-05-12T22:16:54ZВе Fio
<ul><li><strong>File</strong> <a href="/attachments/5989">0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix-redminetrunk.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/5989/0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix-redminetrunk.patch">0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix-redminetrunk.patch</a> added</li></ul><p>Updated the patch for Redmine trunk</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=294322011-06-01T08:12:57ZLoïs PUIG
<ul></ul><p>Hi, love this patch and works perfectly if accessing git repositories from <a class="external" href="http://git.mydomain.com/myrepo.git">http://git.mydomain.com/myrepo.git</a>, but what about if i want my repos to be accessible from a subdir like <a class="external" href="http://git.mydomain.com/git/myrepo.git">http://git.mydomain.com/git/myrepo.git</a> ?<br />Can anyone explain how to modify Redmine.pm to do so please ?<br />Thanks a lot ... :)</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=294332011-06-01T08:17:47ZFelix Schäfer
<ul></ul><p>Loïs PUIG wrote:</p>
<blockquote>
<p>Can anyone explain how to modify Redmine.pm to do so please ?<br />Thanks a lot ... :)</p>
</blockquote>
<p>You don't need to modify Redmine.pm for it, change your apache config to say <code><Location /git/></code> instead of <code><Location /></code>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=294342011-06-01T08:24:46ZLoïs PUIG
<ul></ul><p>Thanks for your help :)</p>
<blockquote>
<p>You don't need to modify Redmine.pm for it, change your apache config to say <code><Location /git/></code> instead of <code><Location /></code>.</p>
</blockquote>
<p>Well i did, and i'm allowed to access my repos with this config</p>
<pre>
SetEnv GIT_PROJECT_ROOT /srv/gitosis/repositories
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/gitosis/repositories/$1
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/gitosis/repositories/$1
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Location /git>
Options All
AllowOverride All
Order allow,deny
Allow from all
</location>
</pre>
<p>but not with this one</p>
<pre>
PerlLoadModule Apache::Redmine
SetEnv GIT_PROJECT_ROOT /srv/gitosis/repositories
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/gitosis/repositories/$1
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/gitosis/repositories/$1
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Location /git>
Options All
AllowOverride All
AuthType Basic
AuthName "Redmine git repositories"
Require valid-user
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
RedmineDSN "DBI:mysql:database=redmine;host=localhost"
RedmineDbUser "redmine"
RedmineDbPass "mypassword"
RedmineGitSmartHttp yes
</location>
</pre>
<p>ig get <pre>
Use of uninitialized value $identifier in substitution (s///) at /usr/lib/perl5/Apache/Redmine.pm line 486.\n
</pre> in the log file</p>
<p>Any ideas ?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=294352011-06-01T08:26:42ZLoïs PUIG
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>the auth code expects URLs to start with something like <a class="external" href="http://git.mydomain.com/myproject">http://git.mydomain.com/myproject</a>, where myproject is your project's ID.</p>
</blockquote> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=294362011-06-01T08:40:25ZFelix Schäfer
<ul></ul><p>Loïs PUIG wrote:</p>
<blockquote>
<p>Any ideas ?</p>
</blockquote>
<p>Redmine.pm expects the path part of the URL to be <code>$LOCATION/$PROJECT_NAME</code>, so your stuff should work if you have a project with the identifier <code>myrepo</code>. If you have and it doesn't work (notice: being admin doesn't give you special rights, you must explicitly be a member of the project and have repo read rights), try <code><Location /git/></code> instead of <code><Location /git></code>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=294382011-06-01T09:20:37ZLoïs PUIG
<ul></ul><blockquote>
<p>try <code><Location /git/></code> instead of <code><Location /git></code>.</p>
</blockquote>
<p>It wasn't that but i finally got it !! I needed to add the following line to the location directive<br /><pre>
Order allow,deny
Allow from all
</pre></p>
<p>and now it works perfectly... Here is the config..</p>
<pre>
PerlLoadModule Apache::Redmine
SetEnv GIT_PROJECT_ROOT /srv/gitosis/repositories
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/gitosis/repositories/$1
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/gitosis/repositories/$1
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Location /git>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthType Basic
AuthName "Redmine git repositories"
Require valid-user
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
RedmineDSN "DBI:mysql:database=redmine;host=localhost"
RedmineDbUser "redmine"
RedmineDbPass "mypassword"
RedmineGitSmartHttp yes
</location>
</pre>
<p>Anyway a big thanks for your bloody quick support, i really appreciated feeling being supported.. Long life to Redmine, a damn nice App!!</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=304192011-07-01T13:01:10ZThimios Dimopulos
<ul></ul><p>Hi,</p>
<p>I am running Redmine version: Redmine 1.1.3.devel.5759 from redmine trunk and git version 1.7.4.1 on ubuntu natty. <br />I am not using gitosis or gitolite, but creating the repositories with reposman and serving them with git-http-backend as described in <a class="external" href="http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration">http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration</a>.</p>
<p>I applied 0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix-redminetrunk.patch on Redmine.pm.</p>
<p>I have the following Virtualhost configuration, inspired by the one posted by Loïs PUIG:<br /><pre>
<VirtualHost *:80>
ServerName git.thimios-host.thimios.com
ErrorLog /var/log/githosting/error.log
CustomLog /var/log/githosting/access.log combined
PerlLoadModule Apache::Redmine
SetEnv GIT_PROJECT_ROOT /home/thimios/Work/repositories/git
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /home/thimios/Work/repositories/git/$1
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /home/thimios/Work/repositories/git/$1
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Location /git>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthType Basic
AuthName "Redmine git repositories"
Require valid-user
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
RedmineDSN "DBI:mysql:database=redmine;host=localhost"
RedmineDbUser "redmine"
RedmineDbPass "r3dm1n3"
RedmineGitSmartHttp yes
</location>
</VirtualHost>
</pre></p>
<p>But, when I try to clone a repository, I get the following error:</p>
<pre>
thimios@thimios-host:/tmp$ git clone http://git.thimios-host.thimios.com/test1
Cloning into test1...
error: The requested URL returned error: 501 while accessing http://git.thimios-host.thimios.com/test1/info/refs
fatal: HTTP request failed
</pre>
<p>There is a warning when restarting apache:</p>
<pre>
[warn] Useless use of AllowOverride in line 17 of /etc/apache2/sites-enabled/githostinghttpbackend
</pre>
<p>There is nothing in the apache logs. It shouldn't be a permissions problem, since www-data user has read-write access to the complete directory tree of the repository. Any ideas about what the problem could be or where to look for more debugging info?</p>
<p>thanks a lot</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=306302011-07-11T00:03:11ZAntonio García-Domínguez
<ul></ul><p>Sorry for the late reply :-(. Have you tried changing the LogLevel to something a bit more verbose, like "info"?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=334102011-10-30T15:56:27ZAntonio García-Domínguez
<ul></ul><p>Just a quick heads up: what are the chances of integrating this patch into trunk in the near future? I've been applying it since Redmine 0.8.x, and it's worked pretty well for me. It also seems to be used by quite a few people, judging from the comments here.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=339942011-11-22T09:33:51ZMarkus Schlichting
<ul></ul><p>Hi,<br />thanks a lot for this, I highly appreciate it :-) <br />Just did an test installation with Redmine on Ubuntu 11.10 Server and this git integration is great :)</p>
<p>Two Questions left:<br />Has someone gone a step further and automated the initialization of the git repository on creation of a new project in redmine? And wiring the repository path to the new project? That would be just perfect :)</p>
<p>I'm planning to use this setup with SSL . I hope it would be just activating HTTPS/SSL in Apache. Would you expect more difficulties?</p>
<p>Would love to see this in the main release :)<br />Thanks a lot for your work!</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=339952011-11-22T13:09:23ZAntonio García-Domínguez
<ul></ul><p>Markus Schlichting wrote:</p>
<blockquote>
<p>thanks a lot for this, I highly appreciate it :-) <br />Just did an test installation with Redmine on Ubuntu 11.10 Server and this git integration is great :)</p>
</blockquote>
<p>I'm glad you like it :-).</p>
<blockquote>
<p>Two Questions left:<br />Has someone gone a step further and automated the initialization of the git repository on creation of a new project in redmine? And wiring the repository path to the new project? That would be just perfect :)</p>
</blockquote>
<p>I think you can automate that, using reposman.rb with the proper options. Look at <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/HowTo_Automate_repository_creation">HowTo Automate repository creation</a> for hints. There are a few undocumented options for reposman.rb that have to do with Git, I think. The only limitation is that you cannot generate both SVN and Git repositories automatically: you have to pick between SVN or Git.</p>
<blockquote>
<p>I'm planning to use this setup with SSL . I hope it would be just activating HTTPS/SSL in Apache. Would you expect more difficulties?</p>
</blockquote>
<p>Not really, but remember to disable weak ciphers and SSL 2.0. For instance, I use this in my Apache virtual host:</p>
<pre>
SSLCipherSuite HIGH:MEDIUM
SSLProtocol all -SSLv2
</pre>
<p>Make sure your <code>~/.netrc</code> is only readable by your own user account and nobody else. Oh, and if you use a self-signed certificate or your CA is not in <code>/etc/ssl/certs</code> (or wherever your OpenSSL CA certificate store is), you'll probably have to tell Git not to verify the chain of trust of the certificate using something like <code>git config --global http.sslVerify no</code>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=339962011-11-22T13:17:13ZFelix Schäfer
<ul></ul><p>Markus Schlichting wrote:</p>
<blockquote>
<p>Two Questions left:<br />Has someone gone a step further and automated the initialization of the git repository on creation of a new project in redmine? And wiring the repository path to the new project? That would be just perfect :)</p>
</blockquote>
<p>As Antonio said, you can use reposman, or the <a href="http://www.redmine.org/plugins/redmine_scm" class="external">redmine_scm plugin</a></p>
<blockquote>
<p>I'm planning to use this setup with SSL . I hope it would be just activating HTTPS/SSL in Apache. Would you expect more difficulties?</p>
</blockquote>
<p>Except the "sslVerify no" part (I wouldn't set this globally…) for self-signed certificates, it should all work well.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=349522011-12-21T15:34:40ZHerve Leroux
<ul></ul><p>Hi,</p>
<p>The last version of the patch : <br />0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix-redminetrunk.patch</p>
<p>doesn't work on the 1.3.0 version of Redmine :</p>
<p><code>patch < ~/0001-merged-LeeF-s-patch-with-Michael-Fox-s-security-fix-redminetrunk.patch<br />patching file Redmine.pm<br />Hunk #2 succeeded at 219 with fuzz 1.<br />Hunk #3 succeeded at 261 (offset 1 line).<br />Hunk #5 succeeded at 313 (offset 1 line).<br />Hunk #6 FAILED at 431.<br />Hunk #7 FAILED at 450.<br />Hunk #8 succeeded at 509 with fuzz 1 (offset 25 lines).<br />2 out of 8 hunks FAILED -- saving rejects to file Redmine.pm.rej</code></p>
<p><strong>expected :</strong><br /><code>- if ($hashed_password eq $salted_password && ((defined $read_only_methods{$method} && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) ) {</code><br /><strong>found :</strong> <br /><code> if ($hashed_password eq $salted_password && (($access_mode eq "R" && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) ) {</code></p>
<p><strong>for information :</strong> line 441<br /><code>my $access_mode = request_is_read_only($r) ? "R" : "W";</code></p>
<p><strong>I would suggest to update this line to :</strong><br /><code>my $access_mode = defined $read_only_methods{$r->method} ? "R" : "W";</code></p>
<p>Could anyone confirm or update the patch ?</p>
<p>Best,</p>
<p>Hervé Leroux</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=349532011-12-21T15:40:49ZHerve Leroux
<ul></ul><p>my mistake, you should have read the following :<br /><strong>for information :</strong> line 441<br />my $access_mode = defined $read_only_methods{$r->method} ? "R" : "W";</p>
<p><strong>I would suggest to update this line to :</strong><br />my $access_mode = $request_is_read_only($r) ? "R" : "W";</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=349902011-12-22T15:14:27ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/6975">0001-Redmine.pm-update-patch-4905-to-Redmine-1.3.0.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6975/0001-Redmine.pm-update-patch-4905-to-Redmine-1.3.0.patch">0001-Redmine.pm-update-patch-4905-to-Redmine-1.3.0.patch</a> added</li></ul><p>Herve Leroux wrote:</p>
<blockquote>
<p>my mistake, you should have read the following :<br /><strong>for information :</strong> line 441<br />my $access_mode = defined $read_only_methods{$r->method} ? "R" : "W";</p>
<p><strong>I would suggest to update this line to :</strong><br />my $access_mode = $request_is_read_only($r) ? "R" : "W";</p>
</blockquote>
<p>Thanks for the information! I have updated the patch according to your instructions. It looks good, but I don't have a Redmine 1.3.0 installation around here to test it on. Could you try it, please?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=350262011-12-23T18:02:39ZMiloš Kozák
<ul><li><strong>File</strong> <a href="/attachments/6980">log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6980/log">log</a> added</li></ul><p>Hello, <br />First of all Thank you for you work. I am running Redmine 1.3 and your recent 1.3 patch but I am getting an error line:</p>
<pre>
[error] [client PUBLIC_IP] Undefined subroutine &Apache::Authn::Redmine::request_is_ready_only called at /usr/lib/perl5/Apache/Redmine.pm line 441.\n
</pre>
<p>Which affects even my SVN repositories.. I have Debian 6.0 and all software is from apt or gem. Anyone has an idea how to fix this situation? If any one wanted more informations drop me a line..</p>
<p>I offer a benefit for getting this bug down.. :)</p>
<p>Miloš</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=350502011-12-28T11:57:56ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/6991">0001-Redmine.pm-update-patch-4905-to-Redmine-1.3.0-fixed.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6991/0001-Redmine.pm-update-patch-4905-to-Redmine-1.3.0-fixed.patch">0001-Redmine.pm-update-patch-4905-to-Redmine-1.3.0-fixed.patch</a> added</li></ul><p>Hi Milos,</p>
<p>Sorry about that! There was a typo in the original patch. Could you try this one?</p>
<p>Antonio</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=350532011-12-28T14:56:22ZMiloš Kozák
<ul></ul><p>Thanks. It works.</p>
<p>Funny things is I went through the code and mislooked this type even though I remember I spot on that!</p>
<p>Miloš</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=350612011-12-29T11:10:36Zder kaan
<ul></ul><p>Hi,</p>
<p>just installed the latest patch and started a few tests with it. Now a registered user has access to all git repositories (just needs to know the repo-name). <br />I played around with Redmine + Git + this patch a few weeks before and if I remember correct, then users needed to be assigned to a project + has to have a least a developer role. <br />Is this correct or did this change?</p>
<p>Cheers, <br />derkaan</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=350642011-12-29T19:24:43ZAntonio García-Domínguez
<ul></ul><p>der kaan wrote:</p>
<blockquote>
<p>just installed the latest patch and started a few tests with it. Now a registered user has access to all git repositories (just needs to know the repo-name). <br />I played around with Redmine + Git + this patch a few weeks before and if I remember correct, then users needed to be assigned to a project + has to have a least a developer role. <br />Is this correct or did this change?</p>
</blockquote>
<p>It depends on whether it's a public project or not. Basically, we're reusing the same logic Redmine uses for SVN repositories, but instead of looking at the HTTP method, we look at the URL to be served by the Git smart-http handler. To sum it up:</p>
<ul>
<li>Public projects: anyone can fetch, but only members with write access can push.</li>
</ul>
<ul>
<li>Private projects: only members with read access can fetch, and only members with write access can push.</li>
</ul>
<p>Do you mean that any registered user can push without having write access, and that any registered user can fetch from a private project without having read access? In that case, it'd be a regression. Could you try the same with SVN repositories?</p>
<p>If it happens with SVN repos as well, that'd be a regression in the original Redmine.pm, and you'd need to report it as a separate bug.</p>
<p>If it only happens with Git repositories, then maybe something changed in the URLs served by Git's smart-http protocol. Could you please indicate which versions of Git are you using at the client and server sides?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=350702011-12-30T07:54:19Zder kaan
<ul></ul><p>Thanks for the perfect info + Setting the project to private solved my issue.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=374842012-04-17T02:06:05ZAnonymous
<ul></ul><p>I don't think the latest patch is working for Redmine v1.4.0 for multiple repos per project. But even the SVN itself is not working. I've asked about it at <a class="external" href="http://www.redmine.org/boards/2/topics/30043">http://www.redmine.org/boards/2/topics/30043</a>.</p>
<p>p/s: The patch is also throwing some error due to the latest changes for Redmine.pm (<a class="external" href="https://github.com/edavis10/redmine/commit/f071b39d268a52aca556782aadadef7856158d31#extra/svn/Redmine.pm">https://github.com/edavis10/redmine/commit/f071b39d268a52aca556782aadadef7856158d31#extra/svn/Redmine.pm</a>)</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=374922012-04-17T08:23:54ZAntonio García-Domínguez
<ul></ul><p>aurorius woot wrote:</p>
<blockquote>
<p>I don't think the latest patch is working for Redmine v1.4.0 for multiple repos per project. But even the SVN itself is not working. I've asked about it at <a class="external" href="http://www.redmine.org/boards/2/topics/30043">http://www.redmine.org/boards/2/topics/30043</a>.</p>
<p>p/s: The patch is also throwing some error due to the latest changes for Redmine.pm (<a class="external" href="https://github.com/edavis10/redmine/commit/f071b39d268a52aca556782aadadef7856158d31#extra/svn/Redmine.pm">https://github.com/edavis10/redmine/commit/f071b39d268a52aca556782aadadef7856158d31#extra/svn/Redmine.pm</a>)</p>
</blockquote>
<p>Have you seen this paragraph on your second link?</p>
<pre>
A projet repository must be named with the projet identifier. In case
of multiple repositories for the same project, use the project identifier
and the repository identifier separated with a dot:
/var/svn/foo
/var/svn/foo.otherrepo
</pre>
<p>Seems like using sample.svn1 and sample.svn2 instead of sample-svn1 and sample-svn2 should work.</p>
<p>I'll try to update the patch in a bit :-).</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=374932012-04-17T08:50:10ZAnonymous
<ul></ul><p>Oh my, I didn't read about it properly, I'm too focus on the changes at the 410th line. It's actually working right now. Thanks a lot for the fast reply.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=374942012-04-17T09:40:04ZAntonio García-Domínguez
<ul><li><strong>File</strong> <a href="/attachments/7479">Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7479/Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch">Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch</a> added</li></ul><p>In any case, here is an updated patch :-). If you could try it out on a fresh Redmine install, it'd be great. I don't have any Redmine 1.4.0 installations over here.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=374952012-04-17T10:10:09ZAnonymous
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>In any case, here is an updated patch :-). If you could try it out on a fresh Redmine install, it'd be great. I don't have any Redmine 1.4.0 installations over here.</p>
</blockquote>
<p>That's fast, lol. BTW, I don't a fresh Redmine installation at the moment, sorry about that. But the good news is that the patch does work for my current Redmine v1.4.0. Things that I've tested:</p>
<ol>
<li>git clone <a class="external" href="http://git.server/myrepo.git">http://git.server/myrepo.git</a></li>
<li>git pull and push are working correctly</li>
<li>git clone <a class="external" href="http://username@git.server/myrepo.git">http://username@git.server/myrepo.git</a> also works</li>
<li>svn checkout and commit is also working</li>
<li>also works for a project with one svn and one git repo under the project</li>
<li>all authentications come from the Redmine itself.</li>
</ol>
<p>This is my httpd-vhosts.conf, maybe it can help someone in the future:</p>
<pre>
<VirtualHost *:80>
ServerName git.myserver
DocumentRoot /opt/git
SetEnv GIT_PROJECT_ROOT /opt/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias / /usr/libexec/git-core/git-http-backend/
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /opt/git/$1
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /opt/git/$1
PerlLoadModule Apache::Redmine
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
/usr/libexec/git-core/git-http-backend/$1
<Directory /usr/libexec/git-core/>
Options +ExecCGI
Allow From All
</Directory>
<Location "/">
AuthType Basic
AuthName "Redmine Git repositories"
Require valid-user
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
RedmineDSN "DBI:mysql:database=redmine;host=localhost"
RedmineDbUser "redmine"
#RedmineDbPass "password"
RedmineGitSmartHttp yes
</Location>
</VirtualHost>
</pre>
<p>I'm planning to write a full tutorial for this implementation (when I have the time). Anyway, thanks a lot for the fast reply (again) XD</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=376882012-04-25T17:26:34ZEdwin Mckain
<ul><li><strong>Assignee</strong> set to <i>Antonio García-Domínguez</i></li></ul><p>Hey everyone!</p>
<p>I'm still a newbie with Redmine, and I want to patch my Redmine.pm file, I'm using Redmine 1.4.1.</p>
<p>I already downloaded the last path (Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch) I put it into my /redmine folder (where the test, extra folders are).</p>
<p>I'm trying to patch it using the following command:</p>
<p>patch -p1 <Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch</p>
<p><em>but it is not working these are the messages that I receive:</em></p>
<p>patching file extra/svn/Redmine.pm<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: permissions if not admin (Closed)" href="https://www.redmine.org/issues/1">#1</a> FAILED at 102.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Listing 5 projects on Welcome page (Closed)" href="https://www.redmine.org/issues/2">#2</a> FAILED at 151.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: ajax pagination of projects (Closed)" href="https://www.redmine.org/issues/3">#3</a> FAILED at 188.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: log problem (Closed)" href="https://www.redmine.org/issues/4">#4</a> FAILED at 204.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Setting an issue status as default status leads to an sql error. (Closed)" href="https://www.redmine.org/issues/5">#5</a> FAILED at 212.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: info.rhtml uninitialized constant (Closed)" href="https://www.redmine.org/issues/6">#6</a> FAILED at 338.<br />6 out of 6 hunks FAILED -- saving rejects to file extra/svn/Redmine.pm.rej</p>
<p>What am I doing wrong?</p>
<p>Thanks in advance!</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=376892012-04-25T17:37:58ZEdwin Mckain
<ul></ul><p>Edwin Mckain wrote:</p>
<blockquote>
<p>Hey everyone!</p>
<p>I'm still a newbie with Redmine, and I want to patch my Redmine.pm file, I'm using Redmine 1.4.1.</p>
<p>I already downloaded the last path (Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch) I put it into my /redmine folder (where the test, extra folders are).</p>
<p>I'm trying to patch it using the following command:</p>
<p>patch -p1 <Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch</p>
<p><em>but it is not working these are the messages that I receive:</em></p>
<p>patching file extra/svn/Redmine.pm<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: permissions if not admin (Closed)" href="https://www.redmine.org/issues/1">#1</a> FAILED at 102.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Listing 5 projects on Welcome page (Closed)" href="https://www.redmine.org/issues/2">#2</a> FAILED at 151.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: ajax pagination of projects (Closed)" href="https://www.redmine.org/issues/3">#3</a> FAILED at 188.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: log problem (Closed)" href="https://www.redmine.org/issues/4">#4</a> FAILED at 204.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Setting an issue status as default status leads to an sql error. (Closed)" href="https://www.redmine.org/issues/5">#5</a> FAILED at 212.<br />Hunk <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: info.rhtml uninitialized constant (Closed)" href="https://www.redmine.org/issues/6">#6</a> FAILED at 338.<br />6 out of 6 hunks FAILED -- saving rejects to file extra/svn/Redmine.pm.rej</p>
<p>What am I doing wrong?</p>
<p>Thanks in advance!</p>
</blockquote>
<p>BTW I'm following this tutorial in order to automated Git with Redmine on CentOS 6.2, here is the link:</p>
<p><a class="external" href="http://www.dreu.info/blog/install-redmine-with-automated-git-on-centos-redhat/">http://www.dreu.info/blog/install-redmine-with-automated-git-on-centos-redhat/</a></p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377412012-04-27T16:27:29ZTakashi Okamoto
<ul><li><strong>File</strong> <a href="/attachments/7547">Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7547/Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm.patch">Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm.patch</a> added</li></ul><p>I added support the multi-repositories.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377462012-04-27T22:30:56ZTakashi Okamoto
<ul><li><strong>File</strong> <a href="/attachments/7549">Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm-2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7549/Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm-2.patch">Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm-2.patch</a> added</li></ul><p>I fixed the bug by a name including underscore.<br />My patch is based on Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377492012-04-28T01:40:47ZToshi MARUYAMA
<ul><li><strong>File</strong> <a href="/attachments/7550">trunk-r9557-strip-dot-git.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7550/trunk-r9557-strip-dot-git.diff">trunk-r9557-strip-dot-git.diff</a> added</li></ul><p>Redmine trunk <a class="changeset" title="Make sure that "today" does not change during tests." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9557">r9557</a> supports multiple scms.<br />I don't know why note-79 patch uses SQL "like".<br />DOT is confused with bare repository ".git".<br />This is a patch to strip ".git".</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377512012-04-28T03:15:36ZTakashi Okamoto
<ul></ul><p>My patch is based on Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch.<br />At least, it doesn't work with git sub repositories.</p>
<p>This issues is discussed long time. I wonder why you don't apply<br />git-http-backend feature. I always confused git-http-backend when<br />every upgrade. Maybe all of the users who use git-http-backend are same.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377572012-04-28T08:16:58ZToshi MARUYAMA
<ul></ul><p>Takashi Okamoto wrote:</p>
<blockquote>
<p>At least, it doesn't work with git sub repositories.</p>
</blockquote>
<p>Did you read note-72 ?</p>
<blockquote>
<p>This issues is discussed long time. I wonder why you don't apply<br />git-http-backend feature. I always confused git-http-backend when<br />every upgrade. Maybe all of the users who use git-http-backend are same.</p>
</blockquote>
<p>Because I don't use git mainly.<br />And there is no test of Redmine.pm.<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/test">source:trunk/test</a></p>
<p>ChiliProject imported this issue patch.<br /><a class="external" href="https://www.chiliproject.org/issues/245">https://www.chiliproject.org/issues/245</a><br />But, there is a few feedback to ChiliProject.</p>
<p>If many uses want to import this patch, it maybe to able to import it.<br />But I don't know that JPL wants it.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377692012-04-28T23:22:26ZAnonymous
<ul></ul><p>How do you define many? Git is gaining significant users over the past few years especially with the pricy Github. I'd really love (maybe others too), to see this patch to be made official without having to reply to this thread everytime a new version is released. But of course, I'm not good enough to develop it, if there's anything a normal dev can do about ths feature, just post it.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377702012-04-29T00:19:55ZToshi MARUYAMA
<ul></ul><p>aurorius woot wrote:</p>
<blockquote>
<p>How do you define many?</p>
</blockquote>
<p><a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: Broken character encoding in pdf export (Closed)" href="https://www.redmine.org/issues/61">#61</a> had many feedback and many watchers.<br />This issue is lesser than <a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: Broken character encoding in pdf export (Closed)" href="https://www.redmine.org/issues/61">#61</a>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377942012-05-01T11:22:12ZAntonio García-Domínguez
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>Redmine trunk <a class="changeset" title="Make sure that "today" does not change during tests." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9557">r9557</a> supports multiple scms.<br />I don't know why note-79 patch uses SQL "like".<br />DOT is confused with bare repository ".git".<br />This is a patch to strip ".git".</p>
</blockquote>
<p>I had assumed that the <a href="http://www.redmine.org/projects/redmine/repository/entry/trunk/extra/svn/Redmine.pm?rev=9256#L411" class="external">regexp in line 411</a> already did that:</p>
<pre><code>my ($identifier) = $r->uri =~ m{$location/*([^/.]+)};</code></pre>
<p>Shouldn't that implicitly strip anything after the first dot? The character class is negated, so /foo.something/bar or /foo.git/bar should be both matched to the "foo" identifier cleanly. That's why I dropped the line that stripped the ".git" suffix.</p>
<p>According to note 75, the patch from note 74 worked as-is (and worked on the 1.4.0 sources at the time).</p>
<p>Takashi Okamoto: why did you switch to using a SQL query? Wouldn't that retrieve the project's name (and not its short ID)? I'm a bit confused.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=377952012-05-01T11:36:37ZAntonio García-Domínguez
<ul></ul><p>Edwin Mckain wrote:</p>
<blockquote>
<p>BTW I'm following this tutorial in order to automated Git with Redmine on CentOS 6.2, here is the link:</p>
<p><a class="external" href="http://www.dreu.info/blog/install-redmine-with-automated-git-on-centos-redhat/">http://www.dreu.info/blog/install-redmine-with-automated-git-on-centos-redhat/</a></p>
</blockquote>
<p>I'm sorry to hear that, but I can't seem to reproduce the issue :-/. I just applied the patch from note 74 cleanly on top of <a href="http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-1.4.1.tar.gz" class="external">Redmine 1.4.1</a>, using</p>
<pre><code>patch -p1 < Redmine.pm-update-patch-4905-to-Redmine-1.4.0.patch</code></pre> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=379672012-05-05T23:27:48ZAnonymous
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>aurorius woot wrote:</p>
<blockquote>
<p>How do you define many?</p>
</blockquote>
<p><a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: Broken character encoding in pdf export (Closed)" href="https://www.redmine.org/issues/61">#61</a> had many feedback and many watchers.<br />This issue is lesser than <a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: Broken character encoding in pdf export (Closed)" href="https://www.redmine.org/issues/61">#61</a>.</p>
</blockquote>
<p>But there are issues such as <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Support for subforums (Closed)" href="https://www.redmine.org/issues/3831">#3831</a> and others with low feedbacks that has been accepted into the trunk. Maybe put this issue as a candidate for the next major release?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=379702012-05-06T09:41:17ZToshi MARUYAMA
<ul></ul><p>aurorius woot wrote:</p>
<blockquote>
<p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>aurorius woot wrote:</p>
<blockquote>
<p>How do you define many?</p>
</blockquote>
<p><a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: Broken character encoding in pdf export (Closed)" href="https://www.redmine.org/issues/61">#61</a> had many feedback and many watchers.<br />This issue is lesser than <a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: Broken character encoding in pdf export (Closed)" href="https://www.redmine.org/issues/61">#61</a>.</p>
</blockquote>
<p>But there are issues such as <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Support for subforums (Closed)" href="https://www.redmine.org/issues/3831">#3831</a> and others with low feedbacks that has been accepted into the trunk. Maybe put this issue as a candidate for the next major release?</p>
</blockquote>
Redmine core feature has test.<br />So, we can maintain if git changes behavior.
<ul>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/1.4.1/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb">source:tags/1.4.1/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb</a></li>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/1.4.1/lib/redmine/scm/adapters/git_adapter.rb#L393">source:tags/1.4.1/lib/redmine/scm/adapters/git_adapter.rb#L393</a></li>
</ul>
<p>PDF plugin is not maintained, but Redmine contains all sources.<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/1.4.1/vendor/plugins/rfpdf">source:tags/1.4.1/vendor/plugins/rfpdf</a><br />And many patches are posted to redmine.org.</p>
<p>If git smart http protocol changes behavior,<br />who can maintain without test?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=384512012-05-25T08:54:35ZAndzinSan Dono
<ul></ul><p>Hi,<br />I follow all this "tutorial". But when I am trying login server is request it again and again. Seems like bad login/pass, but I am sure that login and pass are correct.<br />I have redmine 1.3.3, patch for redmine.pm v1.3.0 - maybe this is error.</p>
<p>Can you help me?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=386522012-06-02T17:09:36ZAntonio García-Domínguez
<ul></ul><p>AndzinSan Dono wrote:</p>
<blockquote>
<p>I follow all this "tutorial". But when I am trying login server is request it again and again. Seems like bad login/pass, but I am sure that login and pass are correct.<br />I have redmine 1.3.3, patch for redmine.pm v1.3.0 - maybe this is error.</p>
<p>Can you help me?</p>
</blockquote>
<p>Sorry for the delay, I was off on a trip. Have you checked that you're a member of the project with the appropriate access level, and that the repository is available at /svn/short_project_id? To avoid leaking unwanted information, the authentication hook will not report any of these problems, but simply reject your authentication attempt.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=386532012-06-02T17:14:33ZAndzinSan Dono
<ul></ul><p>Antonio García-Domínguez wrote:</p>
<blockquote>
<p>Sorry for the delay, I was off on a trip. Have you checked that you're a member of the project with the appropriate access level, and that the repository is available at /svn/short_project_id? To avoid leaking unwanted information, the authentication hook will not report any of these problems, but simply reject your authentication attempt.</p>
</blockquote>
<p>I fix it, but now I dont remember how :D</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=389382012-06-11T15:19:17ZLluís Vilanova
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
Redmine core feature has test.<br />So, we can maintain if git changes behavior.
<ul>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/1.4.1/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb">source:tags/1.4.1/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb</a></li>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/1.4.1/lib/redmine/scm/adapters/git_adapter.rb#L393">source:tags/1.4.1/lib/redmine/scm/adapters/git_adapter.rb#L393</a></li>
</ul>
</blockquote>
<p>[...]</p>
<blockquote>
<p>If git smart http protocol changes behavior,<br />who can maintain without test?</p>
</blockquote>
<p>But does Redmine.pm have tests for other SCMs? (e.g., subversion). For that you would need to actually execute the external SCM client applications to perform queries against a test server properly configured with apache, redmine and Redmine.pm. After a quick look at the project, I couldn't find such tests.</p>
<p>What I mean is that adding git smart-server support into Redmine.pm has the same amount of tests than the current Redmine.pm for subversion (as far as I could see). Of course, I can understand that the main developers of Redmine could feel uncomfortable by accepting a patch for a feature that none of them is using and that has no regression test.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=389612012-06-12T19:45:09ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>I've started writing automated tests for Redmine.pm (<a class="changeset" title="Start implementing tests for Redmine.pm perl module." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9826">r9826</a>). They run against a running Apache+mod_perl+mod_dav_svn. They're not yet part of the CI server but they should be as soon as possible.</p>
<p>Could someone have a look at these tests and provide similar tests for git (at least one that do read operations like <code>#test_read_commands</code> and one that writes like <code>#test_write_commands</code>) so that this patch could finally get merged. No matter if you're not able to actually run them, a draft will be fine.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=389622012-06-12T20:38:13ZLluís Vilanova
<ul><li><strong>File</strong> <a href="/attachments/7748">repository_git_test.rb</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7748/repository_git_test.rb">repository_git_test.rb</a> added</li></ul><p>This should be something to begin with.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=389852012-06-13T18:00:56ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>I guess I have to install the git-http-backend CGI to actually run tests with the smart HTTP protocol?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=389872012-06-13T18:51:07ZLluís Vilanova
<ul></ul><p>This is the snippet for the apache configuration I have for my <em>VirtualHost</em>:</p>
<pre>
SetEnv GIT_PROJECT_ROOT /home/code/git
SetEnv GIT_HTTP_EXPORT_ALL 1
ScriptAliasMatch \
"(?x)^/git/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
/usr/lib/git-core/git-http-backend/$1
ScriptAlias /git/ /usr/lib/cgi-bin/gitweb.cgi/
AliasMatch ^/gitweb/$ /dev/null
<Location /git>
AuthType Basic
AuthName "Project membership authentication"
Require valid-user
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
RedmineDSN "DBI:mysql:database=redmine_default;host=127.0.0.1"
RedmineDbUser "redmine"
RedmineDbPass "..."
RedmineCacheCredsMax 50
RedmineGitSmartHttp yes
</Location>
</pre>
<p>The <code>ScriptAlias</code> line is just to divert all non-git operations to the gitweb CGI, and the previous <code>ScriptAliasMatch</code> diverts relevant operations to the smart server (which comes with the <code>git</code> package itself in Debian). I'm not sure if this setup is exactly the same as shown in the current Redmine docs.</p>
<p>I also have the configs for Bazaar and Mercurial (and Subversion) if you want to try.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=390022012-06-14T08:15:05ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> changed from <i>Antonio García-Domínguez</i> to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> set to <i>2.1.0</i></li></ul><p>Committed in <a class="changeset" title="Adds support for Git's smart HTTP protocol to Redmine.pm (#4905)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9829">r9829</a>, thanks.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=393792012-06-29T07:03:05ZVasily Bezruchkin
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li><li><strong>Assignee</strong> deleted (<del><i>Jean-Philippe Lang</i></del>)</li></ul><p>Greetings,</p>
<p>Do you have any ideas how to patch redmine 2.0.3 version? I tried to apply patch but it looks it didn't go well.</p>
<p>Any advice?</p>
<p>Thanks in advance.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=393802012-06-29T07:56:53ZToshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Do not reopen with unrelated matters.</p>
<p>You need to cherry-pick all related revisions from trunk to 2.0-stable.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=397592012-07-16T19:53:11ZSebastien B
<ul></ul><p>I also have Redmine 2.0.3 and I tried many patches for Git's smart HTTP protocol but none works.</p>
<p>I noticed that my Redmine.pm file is empty!</p>
<p>I have the following errors:</p>
<p>patching file Redmine.pm<br />Hunk # 1 FAILED at 93.<br />Hunk # 2 FAILED at 142.<br />Hunk # 3 FAILED at 179.<br />Hunk # 4 FAILED at 195.<br />Hunk # 5 FAILED at 203.<br />Hunk # 6 FAILED at 329.<br />Hunk # 7 FAILED at 400.<br />7 out of 7 hunks FAILED - saving rejects to file Redmine.pm.rej</p>
<p>What does it mean "You need to cherry-pick all related revisions from trunk to 2.0-stable."?</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=397652012-07-16T22:45:46ZToshi MARUYAMA
<ul><li><strong>File</strong> <a href="/attachments/7954">2.0-stable.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7954/2.0-stable.diff">2.0-stable.diff</a> added</li></ul><p>Sebastien B wrote:</p>
<blockquote>
<p>What does it mean "You need to cherry-pick all related revisions from trunk to 2.0-stable."?</p>
</blockquote>
<pre>
$ hg clone -U https://bitbucket.org/redmine/redmine
$ cd redmine
$ hg update 2.0-stable
$ hg pare
changeset: 8800:1d5a579f92e1
branch: 2.0-stable
user: jplang
date: Sun Jul 15 15:56:23 2012 +0000
summary: Merged r9984 from trunk.
$ hg log -r 660939a6e6fd
changeset: 8548:660939a6e6fd
user: jplang
date: Thu Jun 14 08:13:53 2012 +0000
summary: Adds support for Git's smart HTTP protocol to Redmine.pm (#4905).
$ hg trans 660939a6e6fd
applying 660939a6e6fd
660939a6e6fd transplanted to 0f66bfa74dcf
$ hg export -r tip > ~/Desktop/2.0-stable.diff
</pre> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=398272012-07-18T17:29:55ZWojtek …
<ul></ul><p>which patch file is suitable for version 1.4.4? I've tried Redmine.pm-update-patch-4905-to-Redmine-1.4.1-support-multiscm-2.patch but this one doesn't seems to work (constant authentication failed)</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=408922012-09-14T06:23:42ZVincent Metalhead
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>I'm running 1.4.4 too and I've got the exact same problem.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=408942012-09-14T07:03:05ZEtienne Massip
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>This feature will be part of <a class="version" href="https://www.redmine.org/versions/47">2.1.0</a>.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=408952012-09-14T07:44:41ZVincent Metalhead
<ul><li><strong>File</strong> <a href="/attachments/8203">Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/8203/Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2.patch">Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2.patch</a> added</li></ul><p>OK, looking forward to 2.1.0</p>
<p>But in the meantime allow me to add my four chars to the patch for those who are using 1.4.4 <em>now</em>. :-)</p>
<pre>
- $sth->execute('%/'.$identifier);
+ $sth->execute('%/'.$identifier.'%');
</pre>
<p>One of the SQL queries didn't take bare repositories into account.</p>
<p>---<br />/edit: The correct <code>RedmineDbWhereClause</code> is something along the lines of</p>
<pre>
RedmineDbWhereClause "AND roles.id IN (1,4)"
</pre>
<p>This is a really thoughtful and mighty feature. :-)</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=409102012-09-14T11:04:15ZVincent Metalhead
<ul><li><strong>File</strong> <a href="/attachments/8206">Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/8206/Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved.patch">Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved.patch</a> added</li></ul><p>After further testing I found some limitations of my version of the patch.</p>
<p>This improved version of the patch can handle similarly named repository identifiers.<br />(i.e. <code>project</code> and <code>project-subproject</code>)</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=409132012-09-14T12:23:19ZVincent Metalhead
<ul><li><strong>File</strong> <a href="/attachments/8207">Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/8207/Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved2.patch">Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved2.patch</a> added</li></ul><p>Found a bug. (Is it really a bug?)</p>
<p>In Line 530 the project <em>name</em> is used instead of the project <em>identifier</em>. (<code>SELECT name FROM projects ...</code>)<br />Which means that a project's name must match the (main) repositories identifier.</p>
<p>This (hopefully last) patch corrects that. Sorry for the noise.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=409962012-09-18T15:18:27ZAles Zabala Alava
<ul></ul><p>I have tested Redmine.pm-1.4.4-based-on-1.4.1-multiscm-2--improved2.patch and seems to be broken sometimes with multiple repositories per project.</p>
<p>The apache logs show this:<br /><pre>
DBD::Pg::st execute failed: ERROR: more than one row returned by a subquery used as an expression at /usr/lib/perl5/Apache2/Redmine.pm line 533.
DBD::Pg::st fetchrow_array failed: no statement executing at /usr/lib/perl5/Apache2/Redmine.pm line 537.
</pre></p>
<p>The repositories actually in my project are those:</p>
<pre>
SCM Identifier Main repository Repository
Mercurial eraikin * /var/local/hg/eraikin
Git eraikingit /var/local/git/eraikin
</pre>
<p>It works fine for projects with only one repository :-)</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=409982012-09-18T16:22:33ZVincent Metalhead
<ul></ul><p>Works for my configuration:<br /><pre>
Git wizzan /var/lib/gitolite/repositories/wizzan.git/
Git wizzan-external-code /var/lib/gitolite/repositories/wizzan-external-code.git/
</pre></p>
<p>But you can try the following: Change line 530 of your Redmine.pm from <br /><pre>
SELECT identifier FROM projects WHERE id = (SELECT project_id FROM repositories WHERE url LIKE ? OR url LIKE ? OR url LIKE ? OR url LIKE ?);
</pre></p>
<p>to</p>
<pre>
SELECT identifier FROM projects WHERE id IN (SELECT project_id FROM repositories WHERE url LIKE ? OR url LIKE ? OR url LIKE ? OR url LIKE ?);
</pre>
<p>Turn the <strong><code>=</code></strong> into an <strong><code>IN</code></strong>.</p>
<p>If that fixes your problem. I'll update the patch.</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=411182012-09-23T02:33:08ZAles Zabala Alava
<ul></ul><p>I have tested again and works.</p>
<p>It seems the patch was fine from the start, I just misunderstood and tried to access the repositories using the identifier, not the url :-/</p>
<p>Thanks for the fast response!</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=491352013-05-06T12:42:53ZPeter Panther
<ul></ul><p>After updating redmine from 1.4.7 to 2.3.1 i can't access (clone) my git repos.<br /><pre>
error: The requested URL returned error: 500 while accessing https://<user>@<server>/git/<projectid>/info/refs
fatal: HTTP request failed
</pre><br />Subversion checkout with the same user works without any problem.</p>
<p>The Apache log shows<br /><pre>
[Mon May 06 14:26:27 2013] [error] [client <ip>] No Authn provider configured
[Mon May 06 14:26:27 2013] [error] [client <ip>] No Authn provider configured
</pre></p>
<p>The apache/git config meets the requirements described in the header of Redmine.pm.</p>
<p>Is anybody out there running a working Redmine.pm(from V2.3) with Git?<br />Any ideas/recommendation?</p>
<p>Thanks a lot</p> Redmine - Patch #4905: Redmine.pm: add support for Git's smart HTTP protocolhttps://www.redmine.org/issues/4905?journal_id=491402013-05-06T13:50:54ZPeter Panther
<ul></ul><p>Replacing DECLINED with AUTH_REQUIRED seems to solve the problem</p>
<p><a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Redmine.pm: Allow fallback to other Apache auth providers (Closed)" href="https://www.redmine.org/issues/11475">#11475</a> gave me the hint ....</p>