git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Sun Chao via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Sun Chao <16657101987@163.com>
Subject: Re: [PATCH v2 3/3] doc: add documentation for the hide-refs hook
Date: Mon, 15 Aug 2022 00:12:51 -0400	[thread overview]
Message-ID: <CAPig+cQ4isWWEkfasdENzZWgUZzmBF9vXMTpM2XcxYaPgQbzSQ@mail.gmail.com> (raw)
In-Reply-To: <e737997eb31088a0ebe58c1db0e393a45170eabb.1660524865.git.gitgitgadget@gmail.com>

On Sun, Aug 14, 2022 at 8:56 PM Sun Chao via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> "git upload-pack" or "git recevie-pack" can use "hide-refs"

s/recevie/receive/

> hook to filter the references during reference discovery phase.
>
> Signed-off-by: Sun Chao <sunchao9@huawei.com>
> ---
> diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
> @@ -249,6 +249,54 @@ If this hook exits with a non-zero status, `git push` will abort without
> +This hook would be invoked by 'git-receive-pack' and 'git-upload-pack'
> +during the reference discovery phase, each reference and will be filtered

s/and//

> +by this hook. The hook executes once with no arguments for each
> +'git-upload-pack' and 'git-receive-pack' process. Once the hook is invoked,
> +a version number and server process name ('uploadpack' or 'receive') will
> +send to it in pkt-line format, followed by a flush-pkt. The hook should
> +response with its version number.

s/response/respond/

> +During reference discovery phase, each reference will be filtered by this
> +hook. In the following example, the letter 'G' stands for 'git-receive-pack'
> +or 'git-upload-pack' and the letter 'H' stands for this hook. The hook
> +decides if the reference will be hidden or not, it sends result back in
> +pkt-line format protocol, a response "hide" the references will hide
> +to the client and can not fetch it even in protocol V2.
> +
> +       # Version negotiation
> +       G: PKT-LINE(version=1\0uploadpack)
> +       G: flush-pkt
> +       H: PKT-LINE(version=1)
> +       H: flush-pkt
> +
> +       # Send reference filter request to hook
> +       G: PKT-LINE(ref <refname>:<refnamefull>)
> +       G: flush-pkt
> +
> +       # Receive result from the hook.
> +       # Case 1: this reference is hidden
> +       H: PKT-LINE(hide)
> +       H: flush-pkt
> +
> +       # Case 2: this reference can be advertised
> +       H: flush-pkt
> +
> +To enable the `hide-refs` hook, we should config hiderefs with `force:`
> +option, eg:
> +
> +       git config --add transfer.hiderefs force:refs/prefix1/
> +       git config --add uploadpack.hiderefs force:!refs/prefix2/
> +
> +the `hide-refs` will be called during reference discovery phase and
> +check each matched reference, a 'hide' reponse means the reference will

s/reponse/response/

> +be hidden for its private data and even the `allowTipSHA1InWant` and

s/and even the/even if/

> +`allowReachableSHA1InWant` is set to true.

s/is/are/

  reply	other threads:[~2022-08-15  4:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 16:17 [PATCH 0/3] refs-advertise: add hook to filter advertised refs Sun Chao via GitGitGadget
2022-08-03 16:17 ` [PATCH 1/3] " Sun Chao via GitGitGadget
2022-08-03 16:17 ` [PATCH 2/3] t1419: add test cases for refs-advertise hook Sun Chao via GitGitGadget
2022-08-03 16:17 ` [PATCH 3/3] doc: add documentation for the " Sun Chao via GitGitGadget
2022-08-03 20:27 ` [PATCH 0/3] refs-advertise: add hook to filter advertised refs Junio C Hamano
2022-08-04  8:27   ` 孙超
2022-08-10  1:06 ` Jiang Xin
2022-08-10 13:09   ` 孙超
2022-08-15  0:54 ` [PATCH v2 0/3] hide-refs: add hook to force hide refs Sun Chao via GitGitGadget
2022-08-15  0:54   ` [PATCH v2 1/3] " Sun Chao via GitGitGadget
2022-08-15  0:54   ` [PATCH v2 2/3] t1419: add test cases for hide-refs hook Sun Chao via GitGitGadget
2022-08-15  0:54   ` [PATCH v2 3/3] doc: add documentation for the " Sun Chao via GitGitGadget
2022-08-15  4:12     ` Eric Sunshine [this message]
2022-08-15 14:49       ` 孙超
2022-08-15 16:02         ` Junio C Hamano
2022-08-15 14:56   ` [PATCH v3 0/3] hide-refs: add hook to force hide refs Sun Chao via GitGitGadget
2022-08-15 14:56     ` [PATCH v3 1/3] " Sun Chao via GitGitGadget
2022-08-15 14:56     ` [PATCH v3 2/3] t1419: add test cases for hide-refs hook Sun Chao via GitGitGadget
2022-08-15 14:56     ` [PATCH v3 3/3] doc: add documentation for the " Sun Chao via GitGitGadget
2022-08-15 15:01     ` [PATCH v4 0/3] hide-refs: add hook to force hide refs Sun Chao via GitGitGadget
2022-08-15 15:01       ` [PATCH v4 1/3] " Sun Chao via GitGitGadget
2022-08-15 18:18         ` Junio C Hamano
2022-08-16 11:22           ` 孙超
2022-08-18 18:51         ` Calvin Wan
2022-08-19 15:30           ` 孙超
2022-08-15 15:01       ` [PATCH v4 2/3] t1419: add test cases for hide-refs hook Sun Chao via GitGitGadget
2022-08-15 15:01       ` [PATCH v4 3/3] doc: add documentation for the " Sun Chao via GitGitGadget
2022-09-09 15:06       ` [PATCH v5 0/5] hiderefs: add hide-refs hook to hide refs dynamically Sun Chao via GitGitGadget
2022-09-09 15:06         ` [PATCH v5 1/5] " Sun Chao via GitGitGadget
2022-09-13 17:01           ` Junio C Hamano
2022-09-16 17:52             ` Junio C Hamano
2022-09-17  8:14               ` 孙超
2022-09-09 15:06         ` [PATCH v5 2/5] hiderefs: use new flag to mark force hidden refs Sun Chao via GitGitGadget
2022-09-09 15:06         ` [PATCH v5 3/5] hiderefs: hornor hide flags in wire protocol V2 Sun Chao via GitGitGadget
2022-09-09 15:06         ` [PATCH v5 4/5] test: add test cases for hide-refs hook Sun Chao via GitGitGadget
2022-09-09 15:06         ` [PATCH v5 5/5] doc: add documentation for the " Sun Chao via GitGitGadget
2022-09-20  8:22         ` [PATCH v6 0/5] hiderefs: add hide-refs hook to hide refs dynamically Sun Chao via GitGitGadget
2022-09-20  8:22           ` [PATCH v6 1/5] " Sun Chao via GitGitGadget
2022-09-20  8:22           ` [PATCH v6 2/5] hiderefs: use a new flag to mark force hidden refs Sun Chao via GitGitGadget
2022-09-20  8:22           ` [PATCH v6 3/5] hiderefs: hornor hide flags in wire protocol V2 Sun Chao via GitGitGadget
2022-09-20  8:22           ` [PATCH v6 4/5] test: add test cases for hide-refs hook Sun Chao via GitGitGadget
2022-09-20  8:22           ` [PATCH v6 5/5] doc: add documentation for the " Sun Chao via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPig+cQ4isWWEkfasdENzZWgUZzmBF9vXMTpM2XcxYaPgQbzSQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=16657101987@163.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).