fix: disinto init: fails late if git user.name/user.email not configured (#778) (#780)

Fixes #778

## Changes
Add git identity warning to preflight_check() (warns if user.name/user.email missing) and auto-configure repo-local identity in setup_ops_repo() before the seed commit. This prevents init from failing late when git identity is not configured globally.

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/780
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
This commit is contained in:
johba 2026-03-27 06:59:06 +01:00
parent f918e26cce
commit 4251f9fb0e
2 changed files with 24 additions and 8 deletions

View file

@ -21,14 +21,11 @@ FAILED=0
# Uses awk instead of grep -Eo for busybox/Alpine compatibility (#296).
get_fns() {
local f="$1"
# Use POSIX character classes and bracket-escaped parens for BusyBox awk
# compatibility (BusyBox awk does not expand \t to tab in character classes
# and may handle \( differently in ERE patterns).
awk '/^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]+[[:space:]]*[(][)]/ {
sub(/^[[:space:]]+/, "")
sub(/[[:space:]]*[(][)].*/, "")
print
}' "$f" 2>/dev/null | sort -u || true
# Use grep+sed instead of awk for BusyBox compatibility — BusyBox awk
# unreliably handles [(][)] bracket expressions in some Alpine builds.
grep -E '^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]+[[:space:]]*\(\)' "$f" 2>/dev/null \
| sed 's/^[[:space:]]*//; s/[[:space:]]*().*$//' \
| sort -u || true
}
# Extract call-position identifiers that look like custom function calls: