git bundle 警告引用被 rev-list 选项排除在外

Mar*_*ton 5 git

在过去的几天里,我们正在尝试为我们存储库中的所有分支创建一个包含所有更改的包。这个命令似乎这样做,但会生成一堆我们不想在我们的自动化流程中看到的输出:

% 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)
Run Code Online (Sandbox Code Playgroud)

我认为警告告诉我的是,最近两天命名的分支没有变化,这正是我所期望的。

bundle 命令似乎没有任何选项可以安静或抑制此输出。在 bundle 失败之前添加 --quiet,就像在 bundle 和 create 之间添加它一样。在包名称将它传递给 rev-parse 之后添加它,然后它不输出任何引用,所以没有任何东西被捆绑。

我可以将 stderr 重定向到一个文件以供以后处理,但如果可能的话,我宁愿只是抑制它,这样我就不会丢失任何真正的错误。有没有办法做到这一点?

马克·E·汉密尔顿

Cod*_*ice 0

git bundle似乎没有任何选择。一种可能的解决方案是使用grep来过滤掉您希望忽略的行。-v的选项将grep反转匹配的意义。