We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
The community reviewed whether to reopen this question 2 years ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(14)
如果您仅搜索文件名,请使用:
Windows:
否则签出并执行文件系统搜索:
If you're searching only for the filename, use:
Windows:
Otherwise checkout and do filesystem search:
有sourceforge.net/projects/svn-search。
还有一个直接来自 SVN 主页的名为 SvnQuery 的 Windows 应用程序,位于 http://svnquery.tigris.org
There is sourceforge.net/projects/svn-search.
There is also a Windows application directly from the SVN home called SvnQuery available at http://svnquery.tigris.org
2022 年 4 月更新
VisualSVN Server 5.0 支持通过内容进行全文存储库搜索历史。 在 演示服务器上尝试新的全文搜索功能。
2020 年 1 月更新
VisualSVN Server 4.2 支持在 Web 界面中查找文件和文件夹。 在演示服务器的存储库之一上尝试新功能!
请参阅版本 4.2 发行说明,并从 < a href="https://www.visualsvn.com/server/download/" rel="nofollow noreferrer">主下载页面。
旧答案
从Subversion 1.8,您可以将
--search
选项与svn log
命令一起使用。 请注意,该命令不会在存储库内执行全文搜索,它仅考虑以下数据:svn:author
unversioned property)、svn:date
无版本属性)、svn:log
无版本属性)、以下是有关这些新搜索选项的帮助页面:
Update April, 2022
VisualSVN Server 5.0 supports full-text repository search through the contents and history. Try out the new full-text search feature on the demo server.
Update January, 2020
VisualSVN Server 4.2 supports finding files and folders in the web interface. Try out the new feature on one of the demo server’s repositories!
See the version 4.2 Release Notes, and download VisualSVN Server 4.2.0 from the main download page.
Old answer
Beginning with Subversion 1.8, you can use
--search
option withsvn log
command. Note that the command does not perform full-text search inside a repository, it considers the following data only:svn:author
unversioned property),svn:date
unversioned property),svn:log
unversioned property),Here is the help page about these new search options:
我们使用 http://opensolaris.org/os/project/opengrok/
We use http://opensolaris.org/os/project/opengrok/
git log -S'my line of code'
或在gitk
中进行相同的操作优点是您可以在本地进行多次搜索,而无需加载服务器和网络连接。
git-svn
mirror of that repository.git log -S'my line of code'
or the same ingitk
The advantage is that you can do many searches locally, without loading the server and network connection.
此示例将存储库的完整内容通过管道传输到一个文件,然后您可以在编辑器中快速搜索文件名:
如果存储库相对静态并且您希望进行快速搜索而不必重复从 SVN 加载所有内容,则这非常有用服务器。
This example pipes the complete contents of the repository to a file, which you can then quickly search for filenames within an editor:
This is useful if the repository is relatively static and you want to do rapid searches without having to repeatedly load everything from the SVN server.
我确实喜欢 TRAC - 这个插件可能对您的任务有帮助: http://trac-hacks.org/维基/RepoSearchPlugin
I do like TRAC - this plugin might be helpful for your task: http://trac-hacks.org/wiki/RepoSearchPlugin
请注意,FishEye(以及许多其他Atlassian 产品)有 10 美元的入门版,就 FishEye 而言,它为您提供 5 个存储库,并可供最多 10 名提交者访问。
在这种情况下,这笔钱将捐给慈善机构。
Just a note, FishEye (and a lot of other Atlassian products) have a $10 Starter Editions, which in the case of FishEye gives you 5 repositories and access for up to 10 committers.
The money goes to charity in this case.
慢得令人痛苦(而且实现得很粗糙),但是如果您正在搜索单个文件或小型存储库的历史记录,则 svn log 和 svn cat 的组合可以工作:
将输出文件更改的每个修订号和文件。 您始终可以将每个修订版本放入不同的文件中,然后 grep 进行更改。
附言。 对向我展示如何正确执行此操作的任何人都给予大力支持!
Painfully slow (and crudely implemented) but a combination of svn log and svn cat works if you are searching the history of single files or small repositories:
will output each revision number where file changed and the file. You could always cat each revision into a different file and then grep for changes.
PS. Massive upvotes to anyone that shows me how to do this properly!
如果您真的很绝望,请转储存储库(查看“svnadmin dump”),然后通过 grep 进行查找。 它并不漂亮,但您可以查看搜索结果以查找指示文件和修订版本的元数据,然后检查它以获得更好的外观。
当然,这不是一个好的解决方案,但它是免费的:) SVN 不提供搜索过去签入的功能(甚至过去的日志文件,据我所知)。
If you're really desperate, do a dump of the repo (look at "svnadmin dump") and then grep through it. It's not pretty, but you can look around the search results to find the metadata that indicates the file and revision, then check it out for a better look.
Not a good solution, to be sure, but it is free :) SVN provides no feature for searching past checkins (or even past log files, AFAIK).
许多 SVN 存储库都是“简单”的 HTTP 站点,因此您可能会考虑查看一些现成的“网络爬行”搜索应用程序,您可以指向 SVN 根目录,它将为您提供基本功能。 更新它可能会有点技巧,也许一些 SVN 检查黑客可以让索引丢弃或重新索引更改。
只是大声思考。
A lot of SVN repos are "simply" HTTP sites, so you might consider looking at some off the shelf "web crawling" search app that you can point at the SVN root and it will give you basic functionality. Updating it will probably be a bit of a trick, perhaps some SVN check in hackery can tickle the index to discard or reindex changes as you go.
Just thinking out loud.
有krugle和koders,但是都很贵。 两者都有 eclipse 的 ide 插件。
theres krugle and koders but both are expensive. Both have ide plugins for eclipse.
我开始使用这个工具
http://www.supose.org/wiki/supose
它工作正常只是缺乏可视化用户界面,但速度很快并且得到了一定程度的维护
I started using this tool
http://www.supose.org/wiki/supose
It works fine just lacking a visual UI, but is fast and somewhat maintained
// 编辑:工具已在另一个答案中提到,因此将所有功劳归于 Kuryaki。
刚刚发现 SupoSE 这是一个基于 java 的命令行工具,它扫描存储库以创建索引,然后能够回答某些类型的查询。 我们仍在评估该工具,但它看起来很有希望。 值得一提的是,它对所有修订版本进行了完整的索引,包括源代码文件和常见的办公格式。
// Edit: Tool was already mentioned in another answer, so give all credits to Kuryaki.
Just found SupoSE which is a java based command line tool which scans a repository to create an index and afterwards is able to answer certain kinds of queries. We're still evaluating the tool but it looks promising. It's worth to mention that it makes a full index of all revisions including source code files and common office formats.