<html><body>
<p>New issue 204: git access fails if git_rev_filter has multiple filters <a href="https://bitbucket.org/conservancy/kallithea/issues/204/git-access-fails-if-git_rev_filter-has">https://bitbucket.org/conservancy/kallithea/issues/204/git-access-fails-if-git_rev_filter-has</a></p>
<p>M. Murray:</p>
<p>If git_rev_filter is configured according to the comment in the sample config:</p>
<p>``` #!python</p>
<p>## git rev filter option, --all is the default filter, if you need to ## hide all refs in changelog switch this to --branches --tags git_rev_filter = --branches --tags</p>
<p>```</p>
<p>pre-existing git-based repositories fail to show and rescan gives error when processing them. I didn't test what happens with a new git repo.</p>
<p>This happens because [kallithea/lib/vcs/backends/git/repository.py line 255](<a href="https://kallithea-scm.org/repos/kallithea-incoming/files/tip/kallithea/lib/vcs/backends/git/repository.py#L255">https://kallithea-scm.org/repos/kallithea-incoming/files/tip/kallithea/lib/vcs/backends/git/repository.py#L255</a>) includes settings.GIT_REV_FILTER in the options list passed to self.run_git_command</p>
<p>Consequently, because the two options are a single item in the list, they get passed to the git command together as a single string option.</p>
<p>If git_rev_filter is set to --all, there is no error.</p>
<p>One of the error messages I get is:</p>
<p>``` 2016-04-04 17:03:40.910 ERROR [kallithea.lib.vcs.backends.git.repository] Couldn't run git command ( ['/usr/bin/git', ‘-c’, ‘core.quotepath=false’, ‘rev-list’, ‘--branches --tags’, ‘--reverse’, '--date -order']). Original error was:Subprocess exited due to an error: usage: git rev-list [OPTION] <commit-id>… [ — paths… ]</p>
<pre>limiting output:
--max-count=<n></pre>
<p>```</p>
<p>The solution, I think is to test for this situation in [kallithea/lib/vcs/backends/git/repository.py line 134](<a href="https://kallithea-scm.org/repos/kallithea-incoming/files/tip/kallithea/lib/vcs/backends/git/repository.py#L134">https://kallithea-scm.org/repos/kallithea-incoming/files/tip/kallithea/lib/vcs/backends/git/repository.py#L134</a>) and split the incoming cmd before appending it to the option list passed to subprocessio.</p>
<p>How shall I submit a patch?</p>
<img src="http://link.bitbucket.org/wf/open?upn=7V-2FmRl-2BatdmBwUBFXbsB13NVJlEXqBigXyxfn0HY8gb734ofWR-2Fbbq5jwybzy1EMNaNmZz9I8s08tGV-2F9UeORc9C0ldf8uF3w-2BBXI7EeYlXrOLvyciwL235VJ3IWmnn0fMJXFzptDVVgzCGoJi9sOS672szSSyLd59T00bQIhmbFVX50vXkaH2LJQVaBNyhmnxBY8NswOtJ0fGjd5-2F-2FfssQ-2BGhFRHqhHnL22TbusOuw1-2FzCqnri6L9w72NhMSaMj" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>