如何搜索整个 CVS 存储库(所有分支/历史记录/评论)?
如果我想基本上 grep 存储库中的每一行,有没有办法做到这一点?我知道对于大型项目来说这需要很长时间。
如果不是全部包括在内,至少只是当前分支及其整个源历史记录?
编辑:我应该更明确。 如果我无法直接访问 CVS 存储库所在的服务器怎么办?因此我无法直接 grep 具有 CVS 存储库的文件系统。
If I want to essentially grep every line ever in the repository, is there a way to do it? I know this would take a long time for large projects.
If not all inclusive, at least just the current branch and its entire source history?
Edit: I should have been more explicit. What if I don't have direct access to the server that the CVS repository is on? So I couldn't directly grep the filesystem that has the CVS repository.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果不访问存储库,则无法使用标准 CVS 工具来执行此操作。那里的第三方工具可能会做到这一点(我不知道有一个,尽管 CS-CVS 似乎声明),但要以编程方式执行此操作,您必须对所有相关文件执行 CVS 日志,然后在日志中检索和搜索 cvs 报告的每个版本(cvs log 是一个命令CVS 中的行选项显示任何文件的修订历史记录,但不显示内容)。
There is no way to do this with standard CVS tools without access to the repository. A third party tool out there may do it (I don't know of one, although CS-CVS seems to claim to), but to do it programatically, you would have to do CVS logs on all the relevant files, and then retrieve and search each version reported by cvs in the logs (cvs log is a command line option in CVS that shows you the revision history of any file, but it doesn't show you the contents).
这是我最近在无法访问服务器的情况下使用的。那个时候好像有用了。从工作副本内部调用它,并在 PATH 中使用 cvs。请注意,这不会搜索提交消息,但您可以简单地 grep 'cvs log' 来搜索。
Here's what I recently used, in a case where I didn't have access to the server. It seemed to work that time. Call it from inside a working copy, with cvs in the PATH. Note that this doesn't search commit messages, but you can simply grep 'cvs log' for that.
这取决于您要寻找什么。 CVS 版本文件以纯文本形式包含对该文件进行的所有编辑。因此,如果您只是查找包含特定单词的所有文件,请在存储库上执行递归 grep。
如果您要查找包含这些单词的特定版本,那么您将必须从存储库中提取版本,这是昂贵的。但是,如果您可以通过 grep 存储库来限制文件集,那么情况还不错。
It depends on what you're looking for. CVS version files contain all of the edits that have ever happened to the file, in plaintext. So if you're simply looking for all files that contain a particular word, do a recursive grep on the repository.
If you're looking to find specific versions that contain those words, then you're going to have to extract the versions from the repository, which is expensive. However, if you can limit the set of files by grepping the repository, then it's not so bad.