Lindenii Project Forge
Login

server

Lindenii Forge’s main backend daemon
Commit info
ID
9839497b5a81156308ba60fee86e5e3042bd805c
Author
Runxi Yu <me@runxiyu.org>
Author date
Sun, 30 Mar 2025 19:57:14 +0800
Committer
Runxi Yu <me@runxiyu.org>
Committer date
Sun, 30 Mar 2025 19:57:14 +0800
Actions
Add hookc.1 man page
.\" SPDX-License-Identifier: AGPL-3.0-only
.\" SPDX-FileContributor: Runxi Yu <https://runxiyu.org>
.Dd March 30, 2025
.Dt HOOKC 1
.Os Lindenii Forge
.Sh NAME
.Nm hookc
.Nd helper binary to delegate Git hook behavior to the forge daemon
.Sh SYNOPSIS
.Nm
.Op Ar argument ...
.Sh DESCRIPTION
.Nm
is a helper binary for Git server-side hooks that relays the hook's context to
a persistent daemon via a UNIX domain socket and communicates back any relevant
responses.
.Pp
It is intended to be invoked by
.Xr git-receive-pack 1
for hooks such as
.Pa pre-receive ,
.Pa update ,
and
.Pa post-receive .
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev LINDENII_FORGE_HOOKS_SOCKET_PATH
Absolute path to the UNIX domain socket on which the daemon is listening.
.It Ev LINDENII_FORGE_HOOKS_COOKIE
64-character authentication cookie used to validate the hook client to the daemon.
.El
.Sh OPERATION
.Nm
collects the following information and sends it to the daemon:
.Bl -bullet
.It
All command-line arguments
.It
All
.Ev GIT_*
environment variables
.It
The raw hook
.Pa stdin
(e.g., old/new ref triplets for
.Pa pre-receive )
.El
.Pp
After sending this data, it waits for a one-byte status code from the daemon,
which becomes
.Nm Ns 's
own exit status.
.Pp
If the daemon sends any output afterward, it is forwarded to standard error
and will appear as
.Dq remote:
output to the user.
.Sh BUGS
.Bl -bullet
.It
The status byte from the daemon currently must be sent before any stderr output.
.It
Currently assumes
.Pa stdin
and
.Pa stderr
are pipes, which is not guaranteed in future versions of Git.
.El
.Sh AUTHORS
.An Runxi Yu Aq Mt https://runxiyu.org
.An Test_User Aq Mt hax@runxiyu.org
.Sh SEE ALSO
.Xr git-receive-pack 1 ,
.Xr forge 1