]> git.ipfire.org Git - thirdparty/git.git/commit
receive-pack: new config receive.procReceiveRefs
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Thu, 27 Aug 2020 15:45:48 +0000 (11:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Aug 2020 19:47:47 +0000 (12:47 -0700)
commit31e8595a1132187f99792a4b889c2128cd9253ef
tree5445ada784d963f703667505945f01a8558928d9
parentb913075cb8bd55a6c2ecac4aa7af0de6fb98d5b6
receive-pack: new config receive.procReceiveRefs

Add a new multi-valued config variable "receive.procReceiveRefs"
for `receive-pack` command, like the follows:

    git config --system --add receive.procReceiveRefs refs/for
    git config --system --add receive.procReceiveRefs refs/drafts

If the specific prefix strings given by the config variables match the
reference names of the commands which are sent from git client to
`receive-pack`, these commands will be executed by an external hook
(named "proc-receive"), instead of the internal `execute_commands`
function.

For example, if it is set to "refs/for", pushing to a reference such as
"refs/for/master" will not create or update reference "refs/for/master",
but may create or update a pull request directly by running the hook
"proc-receive".

Optional modifiers can be provided in the beginning of the value to
filter commands for specific actions: create (a), modify (m),
delete (d). A `!` can be included in the modifiers to negate the
reference prefix entry. E.g.:

    git config --system --add receive.procReceiveRefs ad:refs/heads
    git config --system --add receive.procReceiveRefs !:refs/heads

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/receive.txt
builtin/receive-pack.c
t/t5411/once-0010-report-status-v1.sh
t/t5411/test-0010-proc-receive-settings.sh [new file with mode: 0644]
t/t5411/test-0040-process-all-refs.sh [new file with mode: 0644]
t/t5411/test-0041-process-all-refs--porcelain.sh [new file with mode: 0644]
t/t5411/test-0050-proc-receive-refs-with-modifiers.sh [new file with mode: 0644]