Re: [PATCH v12 3/7] receive-pack: add new proc-receive hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> 于2020年4月16日周四 上午2:34写道:
>
> Jiang Xin <worldhello.net@xxxxxxxxx> writes:
>
> > Will correct it.
> >
> > What I am working on for reroll v13:
> >
> > * Add new commit "receive-pack: feed extended_status to post-receive“
> >
> >    When commands are fed to the "post-receive" hook, `extended_status` will
> >    be parsed and the real old-oid, new-oid, reference name will feed to
> >    the "post-receive" hook.
> >
> > * Add test cases for "git push --porcelain".
> >
> >    I found some changes not covered by test.  So I decide add some
> >    test cases for "git push --porcelain".  I will split the test cases into
> >    multiple files inside "t5411/" like:
> >
> >        t5411/test-0000-normal-push.sh
> >        t5411/test-0001-normal-push--porcelain.sh
> >
> > * Other minor fixes.
>
> Thanks for a heads-up, but given that nobody seems to be reading
> your patches and commenting on them, you might want to slow down a
> bit.

For over a week, I have not received more comments on reroll v13 on
this topic ("jx/proc-receive-hook"). Therefore, I invite Peff and
Couder to review because I think it would be very interesting to add a
centralized workflow to Github and Gitlab.

 * [PATCH v13 3/8]:
https://public-inbox.org/git/20200418160334.15631-4-worldhello.net@xxxxxxxxx/

This patch introduces a new hook "proc-receive" on the server side. It
won't break anything except GitHub's "spokes" architecture (I guess).
Because in Alibaba, we have such issue when we implement our own
"spokes" architecture.  In order to make this special push operation
(on a special ref such as "refs/for/master/topic") idempotently on
multiple replicas, we extended the protocol of "receive-pack" and let
"spokes" to send a request with a flag, which specifies one replica as
master replica to execute the "proc-receive" hook.

* [PATCH v13 4/8]:
https://public-inbox.org/git/20200418160334.15631-5-worldhello.net@xxxxxxxxx/
* [PATCH v13 5/8]:
https://public-inbox.org/git/20200418160334.15631-6-worldhello.net@xxxxxxxxx/

Patch 4/8 and patch 5/8 extends status report for both server and
client sides. The extension is backward compatible. When user push
like this:

    git push origin HEAD:refs/for/master/topic

Old version of git may report like:

    To <URL/of/upstream.git>
     * [new reference] HEAD -> refs/for/master/topic

But new version of git may report like:

    To <URL/of/upstream.git>
     + <OID-B>...<OID-A> HEAD -> refs/pull/123/head (forced update)


As for how to use this "proc-receive" hook to implement a centralized
git workflow, please refer to my blog as a reference:

* https://git-repo.info/en/2020/03/agit-flow-and-git-repo/

--
Jiang Xin




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux