Re: [PATCH v14 0/7] New proc-receive hook for centralized workflow
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- May 7, 2020, 11:18 UTC
- Message-ID
- <CANYiYbHi90euK_O8KwPjikuSimWzScV7jT5yoxvT6pFHPJhRdw@mail.gmail.com>
- In-Reply-To
- <CANYiYbGf-szLeBP_JVpCYaWczeg1rNavDCXtEuwXUqiLNoUFtQ@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> 于2020年5月7日周四 上午9:37写道:
Show 29 quoted lines
>
> Junio C Hamano <gitster@pobox.com> 于2020年5月7日周四 上午7:14写道:
> >
> > Jiang Xin <worldhello.net@gmail.com> writes:
> >
> > > From: Jiang Xin <zhiyou.jx@alibaba-inc.com>
> > >
> > > This topic introduces a new hook named "proc-receive" for
> > > "receive-pack". We can use this hook to implement a Gerrit-like
> > > centralized workflow.
> >
> > https://github.com/git/git/runs/651179641 shows us that osx-clang
> > job ends like so:
> >
> > Thanks.
> >
> >
> > Test Summary Report
> > -------------------
> > t5411-proc-receive-hook.sh (Wstat: 256 Tests: 273 Failed: 0)
> > Non-zero exit status: 1
> > Parse errors: Tests out of sequence. Found (27) but expected (26)
> > Tests out of sequence. Found (28) but expected (27)
> > Tests out of sequence. Found (29) but expected (28)
> > Tests out of sequence. Found (30) but expected (29)
> > Tests out of sequence. Found (31) but expected (30)
>
> It seems that the status report for git-push ("ok <refname>") confuses
> the test. Will fix it in next reroll.This morning I cannot find the specific error from the build log, but now I find the error output inside the job tagged as "Run ci/print-test-failures.sh":
++++ diff -u expect actual
--- expect 2020-05-06 22:47:02.000000000 +0000
+++ actual 2020-05-06 22:47:02.000000000 +0000
@@ -2,5 +2,6 @@
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
remote: # proc-receive hook
remote: fatal: protocol error: expected "old new ref", got
"<ZERO-OID> <COMMIT-A> refs/for/master/topic"
-To <URL/of/upstream.git>
- ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive
failed to report status)
+fatal: unable to write flush packet: Broken pipe
+fatal: the remote end hung up unexpectedly
+fatal: the remote end hung up unexpectedlyIn order to increase the code coverage (thanks Stolee for sending a nice code coverage report), I add an option "--die-readline" for test-helper (t/helper/test-proc-receive):
if (parse_oid_hex(reader->line, &old_oid, &p) ||
*p++ != ' ' ||
parse_oid_hex(p, &new_oid, &p) ||
*p++ != ' ' ||
die_readline)
die("protocol error: expected 'old new ref', got '%s'",
reader->line);Hook "proc-receive" hook will die early with the "--die_readline" option, and "receive-pack" should continue running because "receive-pack" ignores the SIG_PIPE signal, but I don't know why the behaviors of "receive-pack" are quite different on different platforms.
I will rewrite the test case using "grep" instead of "test_cmp", and may send another reroll tonight.
-- Jiang Xin