7913116a8e
- .claude/agents/fn-analizador/SKILL.md - .claude/agents/fn-constructor/SKILL.md - .claude/agents/fn-executor/SKILL.md - .claude/agents/fn-mejorador/SKILL.md - .claude/agents/fn-orquestador/SKILL.md - .claude/agents/fn-recopilador/SKILL.md - .claude/commands/app.md - .claude/commands/compile.md - .claude/commands/cpp-app.md - .claude/commands/create_functions.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| git_pull_with_stash | function | bash | infra | 1.0.0 | impure | git_pull_with_stash(repo_dir: string) -> stdout: status | Si el repo tiene cambios pendientes, los stashea antes de pullear. Hace fetch origin + pull --ff-only. Si hay divergencia reporta [diverged] y restaura el stash. Si stash pop da conflicto reporta [stash-conflict] sin tocarlo. Exit 0 siempre para que el caller pueda continuar con otros repos. |
|
false | error_go_core |
|
linea de estado por stdout: '[pulled] repo', '[up-to-date] repo', '[diverged] repo' o '[stash-conflict] repo' | false | bash/functions/infra/git_pull_with_stash.sh |
Ejemplo
source bash/functions/infra/git_pull_with_stash.sh
# Pullear repo con auto-stash
status=$(git_pull_with_stash $HOME/fn_registry)
echo "$status"
# [pulled] fn_registry
# o:
# [up-to-date] fn_registry
# o:
# [diverged] fn_registry (pull fallo por divergencia)
# Iterar y coleccionar divergencias
diverged=()
while IFS= read -r repo; do
result=$(git_pull_with_stash "$repo")
echo "$result"
if [[ "$result" == "[diverged]"* || "$result" == "[stash-conflict]"* ]]; then
diverged+=("$result")
fi
done < <(discover_git_repos $HOME/fn_registry)
if [[ ${#diverged[@]} -gt 0 ]]; then
echo "ATENCION: repos que requieren intervencion manual:"
printf ' %s\n' "${diverged[@]}"
fi
Estados de salida
| Linea stdout | Significado |
|---|---|
[pulled] repo |
Se trajo commits nuevos correctamente |
[up-to-date] repo |
Ya estaba al dia (o sin remote) |
[diverged] repo |
Pull --ff-only fallo — requiere rebase/merge manual |
[stash-conflict] repo |
Pull ok pero stash pop tuvo conflictos — requiere resolucion manual |
Notas
Solo hace pull fast-forward — nunca rebase ni merge automatico. El stash incluye untracked (--include-untracked) para no perder archivos nuevos no trackeados. Exit 1 solo si repo_dir no es un repo git. Todos los demas casos (divergencia, conflictos, sin remote) retornan exit 0 con linea descriptiva.