From: Jeff King Date: Thu, 10 Sep 2026 04:02:14 GMT Subject: Re: [PATCH v9 0/4] hook: introduce the receive-report hook Message-ID: <20260910040214.GA240960@coredump.intra.peff.net> In-Reply-To: On Wed, Sep 09, 2026 at 10:20:54AM -0700, Junio C Hamano wrote: > Patrick Steinhardt writes: > > > On Wed, Sep 09, 2026 at 04:51:35PM +0200, Karthik Nayak wrote: > >> Changes in v9: > >> - Fix a bug where we were causing a BUG() when no report was requested. > >> It is perfectly valid for clients to skip the report and we shouldn't > >> fail when they do so. Thanks Junio! > > > > It's curious that nothing has failed because of this. Are we lacking > > tests here? > > The "send-pack" client we have will ask for report if the server > side advertises report-status or report-status-v2 capabilities, and > there is no way to disable it nor there is no practical need to give > a way to do so, so unless we are willing to write a custom client, > or a configuration to disable server capability advertisement, such > a test is a bit impractical to write. You can do it with a t/interop test, but we don't have any that push. This triggers the BUG() when HEAD is master plus the v8 patches: diff --git a/t/interop/i5800-push.sh b/t/interop/i5800-push.sh new file mode 100755 index 0000000000..b3035b555a --- /dev/null +++ b/t/interop/i5800-push.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +VERSION_A=. +VERSION_B=v1.0.0 +MAKE_OPTS_B="NO_OPENSSL=TooOld" + +test_description='push to/from older client' +. ./interop-lib.sh + +test_expect_success "create repo to be served by $VERSION_A" ' + git.a init --bare dst.git +' + +test_expect_success 'create commit in client' ' + git.b init-db && + echo content >file && + git.b add file && + git.b commit -m foo +' + +test_expect_success "push with $VERSION_B" ' + git.b push --exec="git.a receive-pack" \ + dst.git HEAD:refs/heads/foo && + echo foo >expect && + git.a -C dst.git log -1 --format=%s foo >actual && + test_cmp expect actual +' + +test_done Ironically the test succeeds despite the BUG(), because the client isn't expecting a status report, so it happily returns while the server side dies. I think the interop suite is probably more trouble than its worth, though. Nobody really runs it, and there are all kinds of hidden gotchas in trying to build old versions of Git. So this is more of a fun answer than a serious suggestion to add to the series. -Peff