git捆绑警告:参考在rev-list选项中被排除

5
我们正试图创建一个我们代码库中最近几天所有分支的更改捆绑包。 这个命令看起来可以实现这个目标,但它会产生一堆不想在自动化流程中看到的输出:
% 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命令似乎没有任何选项可以静音或抑制输出。在bundle之前添加--quiet会失败,将其添加到bundle和create之间也会失败。在bundle名称之后添加它会将其传递给rev-parse,然后不会输出任何引用,因此没有东西被捆绑。
我可以将stderr重定向到文件以供稍后处理,但如果可能的话,我宁愿将其抑制,以便不会丢失任何真正的错误。有什么方法可以做到这一点吗?
马克·E·汉密尔顿
跟进:
这个问题又出现了,当我搜索时,我发现我很久以前曾经问过这个问题(显然忘记了)。无论如何,由于我们最终将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

我们决定只将输出重定向到文件中。这样,如果需要,我们就可以使用它,但在正常输出中不会看到它。 - Mark E. Hamilton
“--quiet”是针对“git bundle verify”,而不是“git bundle create”。 - VonC
2个回答

1
这个命令似乎可以实现,但会产生一堆我们不想在自动化过程中看到的输出。
从Git 2.25(2020年第一季度)开始,你就不必看到那些输出了。"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

git bundle verify中添加--quiet,如邮件列表上所建议的


太棒了!谢谢你让我知道。 - Mark E. Hamilton

0

git bundle似乎没有任何选项。一个潜在的解决方案是使用grep来过滤掉你想要忽略的行。对于grep-v选项将反转匹配的意义。


谢谢。我想我们会选择将输出重定向到文件中。这样,如果需要的话,我们就有了它,但在正常输出中不会看到它。 - Mark E. Hamilton

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接