Add git config defaults for auto-yes and wait options
This commit is contained in:
10
README.md
10
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:
|
||||
|
||||
12
gp
12
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)
|
||||
|
||||
Reference in New Issue
Block a user