文章摘要
ripgrep 15.0.0版本发布,这是一个代码搜索工具的重要更新,主要包含性能优化和功能改进。
文章总结
ripgrep 15.0.0 版本发布
ripgrep 15.0.0 是 ripgrep 的一个主要版本更新,主要包含错误修复、性能改进和一些新功能。ripgrep 是一个面向行的搜索工具,可以递归地在当前目录中搜索正则表达式模式。默认情况下,ripgrep 会遵循 gitignore 规则,并自动跳过隐藏文件/目录和二进制文件。
主要更新内容:
- 错误修复
- 修复了与 gitignore 匹配相关的多个错误,包括父目录 gitignore 规则应用的问题
- 修复了处理大型 gitignore 文件时的内存使用问题
- 修复了
rg -vf file(当文件为空时)的匹配行为 - 修复了多行搜索和替换相关的多个问题
- 修复了统计信息和 JSON 输出相关的多个问题
- 性能改进
- 在 Windows 上优化了辅助二进制文件的解析
- 改进了 Windows 上超链接生成的性能
- 改进了大文件上下文显示的性能
- 二进制文件现在使用完全 LTO 编译,可能带来小幅性能提升和文件大小减小
- 新功能
-r/--replace标志现在可以与--json一起使用- 支持 Jujutsu (jj) 仓库的 gitignore 规则
- 支持嵌套花括号的 glob 模式
- 新增
highlight颜色类型,用于设置匹配行中非匹配文本的样式
- 平台支持
- 新增 Windows 的 aarch64 架构发布文件
- 移除了 powerpc64 架构的发布文件(由于 CI 问题)
- 其他改进
- 更新了默认文件类型过滤器集合
- 改进了 shell 自动补全功能
- 文档更新和改进
该版本由 GitHub Actions 于 2025 年 10 月 16 日发布,包含 4 个新提交。发布包提供了多种平台和架构的预编译二进制文件,包括 macOS、Windows 和 Linux 的各种架构版本。
(注:原文中的日期"2025年"可能是笔误,实际应为2023年)
评论总结
总结评论内容如下:
- 对软件质量的普遍赞誉
- "That's what I call quality software." (IlikeMadison)
- "the ripgrep codebase is ultimate 'pour a drink, settle into your coziest chair, and read some high quality software' codebase" (2bitencryption)
- 用户体验提升
- "Great tool, and incredibly easy to use...Probably the singular reason why I finally use regex as the first search option" (davoneus)
- "Just like fd, I actually enjoy using rg and like these new set of command line tools." (Fethbita)
- 学习与使用体验
- "rg is a first for me in that it's a CLI tool that an LLM taught me about" (vessenes)
- "I'm trying to retrain the fingers these days, rg is super cool." (vessenes)
- 性能与功能疑问
- "Has it caught up to ugrep in terms of backward compatibility and speed yet?" (boltzmann64)
- 版本更新说明
- "ripgrep 15 is a new major version release...mostly has bug fixes, some minor performance improvements and minor new features" (jodedwards)
注:所有评论均未显示评分信息。