From d3c867c55649f9864c8e0045b89f3f814ea95aeb Mon Sep 17 00:00:00 2001 From: j Date: Mon, 9 Mar 2026 07:17:37 +1300 Subject: [PATCH] Add git config defaults for auto-yes and wait options --- README.md | 10 ++++++++++ gp | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 31b1509..9e91612 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,16 @@ After pushing to a Gitea remote, `gp` automatically monitors the CI workflow pro - Automatically skipped for GitHub/GitLab remotes or when no token is available - Use `--no-wait` to disable +## Config Defaults + +Set per-repo or global defaults via git config: + +```bash +git config gp.auto-yes true # Skip confirmations (like -y) +git config gp.wait false # Don't wait for CI (like --no-wait) +git config --global gp.auto-yes true # Apply globally +``` + ## Commit Message Generation Uses Claude AI (`claude --print`) if available, otherwise falls back to heuristic analysis: diff --git a/gp b/gp index 3454f5c..fb04685 100755 --- a/gp +++ b/gp @@ -47,6 +47,10 @@ EXAMPLES: gp -y # Auto-answer yes to all prompts gp -b develop # Push to develop branch instead of current +GIT CONFIG DEFAULTS: + git config gp.auto-yes true # Always skip confirmations + git config gp.wait false # Don't wait for CI after push + EOF } @@ -765,6 +769,14 @@ TARGET_BRANCH="" PUSH_ONLY=false WAIT_FOR_CI=true +# Load defaults from git config +if git config --get gp.auto-yes &>/dev/null; then + AUTO_YES=true +fi +if [ "$(git config --get gp.wait 2>/dev/null)" = "false" ]; then + WAIT_FOR_CI=false +fi + # Handle special commands first case "${1:-}" in autocomplete)