# Written by the git wrapper for its commit service (monochromatic-git-policy-cli-unit); the wrapper rewrites this file when it changes.
# One instance per worktree: the instance name is a hash of the worktree's own Git directory (service_instance.rs).
[Unit]
Description=Commit service of one worktree for the git wrapper
Requires=monochromatic-git-policy-cli@%i.socket
After=monochromatic-git-policy-cli@%i.socket
[Service]
# The wrapper replaces the program and Git words below, each written between two at-signs, with absolute paths. The program
# is the wrapper's own executable, started in its service mode by the first three words after it (service_main.rs); the
# manager starts it, never the wrapper. The socket comes from the socket unit, so the service is started again by the first
# connection after an exit or a crash. The instance refuses every message about another worktree.
ExecStart=@SERVICE_BINARY@ monochromatic-git-policy-cli service run --journal %S/monochromatic-git-policy-cli/service/%i --git @GIT@ --instance %i
# The journal keeps the identifier it has always shown for this service, also for the lines the manager captures from
# standard error, which would otherwise carry the name of the executable.
SyslogIdentifier=monochromatic-git-policy-cli-service
StateDirectory=monochromatic-git-policy-cli/service/%i
Restart=on-failure
# No resource limits of the wrapper's own: the service and the Git processes it starts get systemd's defaults, the same
# resources plain Git gets. The memory, CPU, task and disk-weight limits this unit once set had no measurement behind
# them, and a memory cap is charged with the page cache those Git processes read the repository's packs and index
# through, so it made them read the same pages from disk again.