我们正在尝试创建过去几天对存储库中所有分支的所有更改的捆绑包。这个命令似乎这样做了,但生成了一堆我们不希望在自动化流程中看到的输出:
% git bundle create /tmp/some_bundle --branches --since=2.days.ago
warning: ref '4.28' is excluded by the rev-list options
warning: ref '4.30' is excluded by the rev-list options
warning: ref '4.36' is excluded by the rev-list options
warning: ref 'run_lcov_refactor' is excluded by the rev-list options
Counting objects: 4745, done.
Delta compression using up to 48 threads.
Compressing objects: 100% (1296/1296), done.
Writing objects: 100% (3536/3536), 1.00 MiB, done.
Total 3536 (delta 3019), reused 2655 (delta 2224)
我认为警告告诉我的是,命名的分支在过去两天没有变化,这是我所期望的。
bundle 命令似乎没有任何选项来静音或抑制此输出。在捆绑包失败之前添加 --quiet,在捆绑包和创建之间添加它也是如此。在捆绑包名称将其传递给 rev-parse 之后添加它,然后它不会输出任何引用,因此不会捆绑任何内容。
我可以将 stderr 重定向到文件以供以后处理,但如果可能的话,我宁愿只抑制它,这样我就不会丢失任何真正的错误。有什么办法可以做到这一点吗?
马克·汉密尔顿
<小时 />随访:
这个问题又出现了,当我搜索时,我发现我很久以前就问过它(显然忘记了它(。IAE,自从我们终于将 git 升级到 2.32 以来(我们已经在 RHEL7 上停留了一段时间(,我想我会再次检查它。
我可能误解了一些东西,但如果 VonC 提到的修复程序应该解决我提到的问题,它似乎没有这样做。
% git bundle create test.bundle --all --since=2.days.ago --quiet
warning: ref 'refs/heads/5.4' is excluded by the rev-list options
warning: ref 'refs/heads/install_sierra_scn_tarfile' is excluded by the rev-list options
% git bundle create --quiet test.bundle --all --since=2.days.ago
warning: ref 'refs/heads/5.4' is excluded by the rev-list options
warning: ref 'refs/heads/install_sierra_scn_tarfile' is excluded by the rev-list options
这个命令似乎这样做了,但生成了一堆我们不希望在自动化流程中看到的输出
从 Git 2.25(2020 年第 1 季度(开始,您将不会.
"git bundle
"已被教导使用解析选项API。
"
git bundle verify
学习"--quiet
"和"git bundle create
"学习控制进度输出的选项。
请参阅提交 e0eba64、提交 79862b6、提交 73c3253 (2019 年 11 月 10 日(,作者:Robin H. Johnson ( robbat2
(.
(由Junio C Hamano -- gitster
-- 在提交ca5c8aa中合并,2019年12月1日(
bundle-verify
: 添加--quiet
按照邮件列表中的建议添加
--quiet
以git bundle
验证。
git bundle
似乎没有任何选择。一种可能的解决方案是使用 grep
过滤掉要忽略的行。grep
的-v
选项将反转匹配感。