Issue #204: git access fails if git_rev_filter has multiple filters (conservancy/kallithea)
M. Murray
issues-reply at bitbucket.org
Tue Apr 5 02:11:49 UTC 2016
New issue 204: git access fails if git_rev_filter has multiple filters
https://bitbucket.org/conservancy/kallithea/issues/204/git-access-fails-if-git_rev_filter-has
M. Murray:
If git_rev_filter is configured according to the comment in the sample config:
```
#!python
## 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
```
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.
This happens because [kallithea/lib/vcs/backends/git/repository.py line 255](https://kallithea-scm.org/repos/kallithea-incoming/files/tip/kallithea/lib/vcs/backends/git/repository.py#L255) includes settings.GIT_REV_FILTER in the options list passed to self.run_git_command
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.
If git_rev_filter is set to --all, there is no error.
One of the error messages I get is:
```
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... ]
limiting output:
--max-count=<n>
```
The solution, I think is to test for this situation in [kallithea/lib/vcs/backends/git/repository.py line 134](https://kallithea-scm.org/repos/kallithea-incoming/files/tip/kallithea/lib/vcs/backends/git/repository.py#L134)
and split the incoming cmd before appending it to the option list passed to subprocessio.
How shall I submit a patch?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20160405/c03e418e/attachment.html>
More information about the kallithea-general
mailing list