SVN存储库搜索

Joh*_*ohn 154 svn search code-search-engine

是否有任何好的软件可以让我通过我的SVN存储库搜索代码片段?我找到了'FishEye',但成本是1,200,远远超出我的预算.

phi*_*l_w 68

如果您只搜索文件名,请使用:

svn list -R file:///subversion/repository | grep filename
Run Code Online (Sandbox Code Playgroud)

视窗:

svn list -R file:///subversion/repository | findstr filename
Run Code Online (Sandbox Code Playgroud)

否则结帐并进行文件系统搜索:

egrep -r _code_ .
Run Code Online (Sandbox Code Playgroud)

  • 它可能不是很明显,但这些命令适用于任何访问svn服务器的方法,而不仅仅是文件:(例如svn:和svn + ssh:也可以) (3认同)
  • //,你介意为每个人提供一个有效的例子吗? (2认同)

Elm*_*ber 37

sourceforge.net/projects/svn-search.

http://svnquery.tigris.org上还有一个名为SvnQuery的SVN主页直接提供的Windows应用程序


bah*_*rep 11

Subversion 1.8--searchsvn log开始,您可以使用命令的选项.请注意,该命令不会在存储库中执行全文搜索,它仅考虑以下数据:

  • 修订版的作者(svn:author无版权财产),
  • 日期(svn:date无版权财产),
  • 日志消息文本(svn:log无版本属性),
  • 已更改路径的列表(即受特定修订影响的路径).

以下是有关这些新搜索选项的帮助页面:

 If the --search option is used, log messages are displayed only if the
 provided search pattern matches any of the author, date, log message
 text (unless --quiet is used), or, if the --verbose option is also
 provided, a changed path.
 The search pattern may include "glob syntax" wildcards:
     ?      matches any single character
     *      matches a sequence of arbitrary characters
     [abc]  matches any of the characters listed inside the brackets
 If multiple --search options are provided, a log message is shown if
 it matches any of the provided search patterns. If the --search-and
 option is used, that option's argument is combined with the pattern
 from the previous --search or --search-and option, and a log message
 is shown only if it matches the combined search pattern.
 If --limit is used in combination with --search, --limit restricts the
 number of log messages searched, rather than restricting the output
 to a particular number of matching log messages.
Run Code Online (Sandbox Code Playgroud)


Ben*_*and 10

我们使用http://opensolaris.org/os/project/opengrok/

  • OpenGrok现已转移到http://opengrok.github.io/OpenGrok/. (3认同)

Vi.*_*Vi. 9

  1. 创建git-svn该存储库的镜像.
  2. 在git中搜索添加或删除的字符串:git log -S'my line of code'或者相同的gitk

优点是您可以在本地执行许多搜索,而无需加载服务器和网络连接.


Con*_*ngo 8

此示例将存储库的完整内容传递到文件,然后您可以在编辑器中快速搜索文件名:

svn list -R svn://svn > filelist.txt
Run Code Online (Sandbox Code Playgroud)

如果存储库是相对静态的并且您希望快速搜索而不必重复加载SVN服务器中的所有内容,则此选项非常有用.

  • 我应该注意,在我的情况下,有必要使用`http`作为协议(`svn list -R http:// repo/svn/etc`). (4认同)

Wil*_*ung 1

许多 SVN 存储库都是“简单”的 HTTP 站点,因此您可能会考虑查看一些现成的“网络爬行”搜索应用程序,您可以指向 SVN 根目录,它将为您提供基本功能。更新它可能会有点技巧,也许一些 SVN 检查黑客可以让索引丢弃或重新索引更改。

只是大声思考。