File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ if [ -f .env ]; then
3838 if [ -n " ${SSH_PUBLIC_KEY:- } " ]; then
3939 git config --global gpg.format ssh
4040 git config --global user.signingkey " key::${SSH_PUBLIC_KEY} "
41- git config --global commit.gpgsign true
41+ if ssh_signing_available; then
42+ git config --global commit.gpgsign true
43+ else
44+ git config --global commit.gpgsign false
45+ fi
4246 fi
4347 if [ -n " ${GITHUB_TOKEN:- } " ] && command -v gh & > /dev/null; then
4448 gh auth setup-git 2> /dev/null || true
5963fi
6064
6165# --- SSH commit signing ---
62- SIGNING=$( git config --global commit.gpgsign 2> /dev/null || echo " " )
63- if [ " $SIGNING " = " true" ]; then
64- log_success " SSH commit signing enabled."
66+ SIGNING_KEY=$( git config --global user.signingkey 2> /dev/null || echo " " )
67+ if [ -n " $SIGNING_KEY " ]; then
68+ if ssh_signing_available; then
69+ log_success " SSH commit signing enabled (1Password / SSH agent detected)."
70+ else
71+ log_info " SSH signing key configured but agent not available — signing disabled."
72+ fi
6573else
6674 log_info " SSH commit signing not configured (optional)."
6775fi
Original file line number Diff line number Diff line change 9696if [ -n " $SSH_PUBLIC_KEY " ]; then
9797 git config --global gpg.format ssh
9898 git config --global user.signingkey " key::${SSH_PUBLIC_KEY} "
99- git config --global commit.gpgsign true
99+ if ssh_signing_available; then
100+ git config --global commit.gpgsign true
101+ log_success " SSH commit signing enabled (agent available)."
102+ else
103+ git config --global commit.gpgsign false
104+ log_warn " SSH key saved but agent not available — signing disabled. Commits will proceed unsigned."
105+ fi
100106fi
101107
102108if [ -n " $GEMINI_API_KEY " ]; then
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ read_env() {
8282 fi
8383}
8484
85+ # Check if the SSH agent is available for commit signing.
86+ # Returns 0 if SSH_AUTH_SOCK is set and the agent responds.
87+ ssh_signing_available () {
88+ [ -n " ${SSH_AUTH_SOCK:- } " ] && [ -S " ${SSH_AUTH_SOCK} " ] && ssh-add -L & > /dev/null
89+ }
90+
8591# Ensure we are at the repository root
8692ensure_root () {
8793 local script_dir
Original file line number Diff line number Diff line change @@ -104,18 +104,18 @@ make setup
104104
105105Start developing! Use the universal ` Makefile ` targets:
106106
107- | Command | Purpose |
108- | ----------------- | -------------------------------- |
109- | ` make help ` | Show all available targets |
110- | ` make setup ` | Install deps & configure hooks |
111- | ` make doctor ` | Check environment health |
112- | ` make new-adr ` | Scaffold a new architecture record|
113- | ` make ai-context ` | Bundle project context for AI |
114- | ` make dev ` | Start the development server |
115- | ` make test ` | Run the test suite |
116- | ` make build ` | Create a production build |
117- | ` make lint ` | Run code formatting & linting |
118- | ` make clean ` | Remove build artifacts |
107+ | Command | Purpose |
108+ | ----------------- | ---------------------------------- |
109+ | ` make help ` | Show all available targets |
110+ | ` make setup ` | Install deps & configure hooks |
111+ | ` make doctor ` | Check environment health |
112+ | ` make new-adr ` | Scaffold a new architecture record |
113+ | ` make ai-context ` | Bundle project context for AI |
114+ | ` make dev ` | Start the development server |
115+ | ` make test ` | Run the test suite |
116+ | ` make build ` | Create a production build |
117+ | ` make lint ` | Run code formatting & linting |
118+ | ` make clean ` | Remove build artifacts |
119119
120120---
121121
Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ if [ -f .env ]; then
3838 if [ -n " ${SSH_PUBLIC_KEY:- } " ]; then
3939 git config --global gpg.format ssh
4040 git config --global user.signingkey " key::${SSH_PUBLIC_KEY} "
41- git config --global commit.gpgsign true
41+ if ssh_signing_available; then
42+ git config --global commit.gpgsign true
43+ else
44+ git config --global commit.gpgsign false
45+ fi
4246 fi
4347 if [ -n " ${GITHUB_TOKEN:- } " ] && command -v gh & > /dev/null; then
4448 gh auth setup-git 2> /dev/null || true
5963fi
6064
6165# --- SSH commit signing ---
62- SIGNING=$( git config --global commit.gpgsign 2> /dev/null || echo " " )
63- if [ " $SIGNING " = " true" ]; then
64- log_success " SSH commit signing enabled."
66+ SIGNING_KEY=$( git config --global user.signingkey 2> /dev/null || echo " " )
67+ if [ -n " $SIGNING_KEY " ]; then
68+ if ssh_signing_available; then
69+ log_success " SSH commit signing enabled (1Password / SSH agent detected)."
70+ else
71+ log_info " SSH signing key configured but agent not available — signing disabled."
72+ fi
6573else
6674 log_info " SSH commit signing not configured (optional)."
6775fi
Original file line number Diff line number Diff line change 9898if [ -n " $SSH_PUBLIC_KEY " ]; then
9999 git config --global gpg.format ssh
100100 git config --global user.signingkey " key::${SSH_PUBLIC_KEY} "
101- git config --global commit.gpgsign true
101+ if ssh_signing_available; then
102+ git config --global commit.gpgsign true
103+ log_success " SSH commit signing enabled (agent available)."
104+ else
105+ git config --global commit.gpgsign false
106+ log_warn " SSH key saved but agent not available — signing disabled. Commits will proceed unsigned."
107+ fi
102108fi
103109
104110if [ -n " $GEMINI_API_KEY " ]; then
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ read_env() {
8282 fi
8383}
8484
85+ # Check if the SSH agent is available for commit signing.
86+ # Returns 0 if SSH_AUTH_SOCK is set and the agent responds.
87+ ssh_signing_available () {
88+ [ -n " ${SSH_AUTH_SOCK:- } " ] && [ -S " ${SSH_AUTH_SOCK} " ] && ssh-add -L & > /dev/null
89+ }
90+
8591# Ensure we are at the repository root
8692ensure_root () {
8793 local script_dir
You can’t perform that action at this time.
0 commit comments