fix: remove dead .gitconfig, use GIT_INIT_DEFAULT_BRANCH env var #17

Merged
m3tam3re merged 1 commits from fix/gitconfig-cleanup into master 2026-05-11 19:06:35 +02:00
Collaborator

Problem

The tmpfiles rule created a .gitconfig at /home/hermes/.gitconfig, but the hermes-agent service sets HOME=/var/lib/hermes, so git never reads it. The file also contained only the literal Nix store path instead of the actual config content (wrong tmpfiles type f instead of L+).

Changes

  • Remove the dead .gitconfig tmpfiles rule (was at /home/hermes/, never read)
  • Add GIT_INIT_DEFAULT_BRANCH = "master" to the environment section
  • Add comment explaining the single-source-of-truth approach

Why env vars > .gitconfig

All git identity is now set via a single mechanism:

  • GIT_AUTHOR_NAME/EMAIL — author identity
  • GIT_COMMITTER_NAME/EMAIL — committer identity
  • GIT_INIT_DEFAULT_BRANCH — default branch (Git 2.28+)

These are injected by the hermes gateway into .env and take precedence over any gitconfig file. No duplication, no tmpfiles rules for git.

## Problem The tmpfiles rule created a .gitconfig at `/home/hermes/.gitconfig`, but the hermes-agent service sets `HOME=/var/lib/hermes`, so git never reads it. The file also contained only the literal Nix store path instead of the actual config content (wrong tmpfiles type `f` instead of `L+`). ## Changes - **Remove** the dead `.gitconfig` tmpfiles rule (was at `/home/hermes/`, never read) - **Add** `GIT_INIT_DEFAULT_BRANCH = "master"` to the `environment` section - **Add** comment explaining the single-source-of-truth approach ## Why env vars > .gitconfig All git identity is now set via a single mechanism: - `GIT_AUTHOR_NAME/EMAIL` — author identity - `GIT_COMMITTER_NAME/EMAIL` — committer identity - `GIT_INIT_DEFAULT_BRANCH` — default branch (Git 2.28+) These are injected by the hermes gateway into `.env` and take precedence over any gitconfig file. No duplication, no tmpfiles rules for git.
m3ta-chiron added 1 commit 2026-05-11 19:05:48 +02:00
The .gitconfig at /home/hermes/.gitconfig was never read because the
hermes-agent service sets HOME=/var/lib/hermes. Git identity was already
fully covered by GIT_AUTHOR_* and GIT_COMMITTER_* env vars via .env.

Replace the dead .gitconfig's init.defaultBranch with the env var
GIT_INIT_DEFAULT_BRANCH (supported since Git 2.28).
m3tam3re merged commit f5ad78c6c2 into master 2026-05-11 19:06:35 +02:00
m3tam3re deleted branch fix/gitconfig-cleanup 2026-05-11 19:06:35 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m3tam3re/nixos-config#17