我们正在尝试创建一个包含过去几天对存储库中所有分支的所有更改的捆绑包。该命令似乎是这样做的,但会生成一堆我们不希望在自动化流程中看到的输出:
% 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会失败,在bundle和create之间添加它也会失败。在捆绑包名称之后添加它,将其传递给 rev-parse,然后它不会输出任何引用,因此不会捆绑任何内容。
我可以将 stderr 重定向到一个文件以供以后处理,但如果可能的话,我宁愿抑制它,这样我就不会丢失任何真正的错误。有什么办法可以做到这一点吗?
马克·E·汉密尔顿
跟进:
这个问题又出现了,我搜了一下发现I很久以前就问过这个问题(显然已经忘记了。)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