You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each command for the "proc-receive" hook may point to a pseudo-reference
and always has a zero-old as its old-oid. But the "proc-receive" hook
may update an alternate reference and the reference may exist already
(has a non-zero old-oid). And we may want certain commands to bypass
the "proc-receive" hook and let "receive-pack" handle them.
In order to report proper reference name, old-oid, and let certain
commands fall through, an extensible reporting method for "proc-receive"
and "receive-pack" is introduced.
The "proc-receive" hook can report its results in the following format:
# OK, run this command successfully.
PKT-LINE(<old-oid> <new-oid> <ref> ok)
# NO, I reject it.
PKT-LINE(<old-oid> <new-oid> <ref> ng <reason>)
# Fall through, let "receive-pack" to execute it.
PKT-LINE(<old-oid> <new-oid> <ref> ft)
# OK, but has an alternate reference. The alternate reference name
# and other status are given in key=value pairs after the null
# character.
PKT-LINE(<old-oid> <new-oid> <ref> ok\0ref=refs/pull/123/head
forced-update)
The reporting function for "receive-pack" is also extended using a
backward compatible way by adding key-value pairs after an null
character, like:
# OK, run this command successfully with optional extended-status.
ok <reference>\0ref=refs/pull/123/head old-oid=...
# NO, I reject it.
ng <reference> <error message>
This commit only includes changes on the server side, so we can make
a compatible test on old version of a Git client.
Suggested-by: Junio C Hamano <[email protected]>
Signed-off-by: Jiang Xin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
0 commit comments