Re: [PATCH] upload-pack: add tracing for fetches
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 11, 2023, 21:26 UTC
- Message-ID
- <ZScTGyI/XVveu4M7@nand.local>
- In-Reply-To
- <pull.1598.git.1697040242703.gitgitgadget@gmail.com>
On Wed, Oct 11, 2023 at 04:04:02PM +0000, Robert Coup via GitGitGadget wrote:
Show 15 quoted lines
> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh > index d18f2823d86..bb15ac34f77 100755 > --- a/t/t5500-fetch-pack.sh > +++ b/t/t5500-fetch-pack.sh > @@ -132,13 +132,18 @@ test_expect_success 'single branch object count' ' > ' > > test_expect_success 'single given branch clone' ' > - git clone --single-branch --branch A "file://$(pwd)/." branch-a && > - test_must_fail git --git-dir=branch-a/.git rev-parse origin/B > + GIT_TRACE2_EVENT="$(pwd)/branch-a/trace2_event" \ > + git clone --single-branch --branch A "file://$(pwd)/." branch-a && > + test_must_fail git --git-dir=branch-a/.git rev-parse origin/B && > + grep \"fetch-info\".*\"haves\":0 branch-a/trace2_event && > + grep \"fetch-info\".*\"wants\":1 branch-a/trace2_event
Not at all related to your patch here, but I feel like we have a bunch of these greps sprinkled throughout the test suite which serve to inspect some key(s) of a JSON object printed to the trace2 event stream.
It might be nice to have a more robust test-tool that could do this heavy lifting for us instead of having to write these grep expressions ourselves.
But definitely outside the scope of this patch ;-).
Thanks, Taylor