We're trying to create a bundle of all the changes to all branches in our repository for the last few days. This command seems to do so, but generates a bunch of output we don't want see in our automated processes:
% 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)
I think what the warnings are telling me is that the named branches have no changes in the last two days, which is what I expect.
The bundle command doesn't seem to have any options to quiet or suppress this output. Adding --quiet before bundle fails, as does adding it between bundle and create. Adding it after the bundle name passes it to rev-parse which then doesn't output any refs, so nothing gets bundled.
I can redirect stderr to a file for later handling, but I'd rather just suppress it if possible, so that I don't lose any real errors. Is there any way to do this?
Mark E. Hamilton
Followup:
This issue came up again, and when I searched I found that I had asked about it a long time ago (and clearly forgotten about it.) IAE, since we finally got git upgraded to 2.32 (we've been stuck on RHEL7 for a while) I though I'd check it again.
I might be misunderstanding something, but if the fix VonC referred to was supposed to fix the issue I mentioned it does not seem to have done so.
% 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
This command seems to do so, but generates a bunch of output we don't want see in our automated processes
And starting with Git 2.25 (Q1 2020), you won't.
"git bundle
" has been taught to use the parse options API.
"
git bundle
verify" learned "--quiet" and "git bundle
create" learned options to control the progress output.
See commit e0eba64, commit 79862b6, commit 73c3253 (10 Nov 2019) by Robin H. Johnson (robbat2
).
(Merged by Junio C Hamano -- gitster
-- in commit ca5c8aa, 01 Dec 2019)
bundle-verify
: add--quiet
Add
--quiet
togit bundle
verify as proposed on the mailing list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With