feat: add bash shell utility functions
12 funciones Bash del dominio shell: utilidades de scripting (bash_log, bash_colors, bash_check_deps, bash_confirm, bash_handle_error, bash_safe_run), manipulacion de texto (convert_text_case), estructura de proyectos (create_project_structure), y operaciones git (git_clean_branches, git_log_visual, git_push_all_remotes, git_repo_status). Cada una con su .sh y .md de frontmatter.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
---
|
||||
name: git_clean_branches
|
||||
kind: function
|
||||
lang: bash
|
||||
domain: shell
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "git_clean_branches([base_branch: string], [--remote], [--force]) -> void"
|
||||
description: "Elimina ramas locales ya mergeadas en la rama base (autodetecta main/master). Con --remote también borra las ramas en todos los remotes. Con --force omite la confirmación interactiva."
|
||||
tags: [bash, git, branches, clean, merge]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
params:
|
||||
- name: base_branch
|
||||
desc: "rama base para detectar merges (opcional; autodetecta main o master)"
|
||||
- name: --remote
|
||||
desc: "flag para también eliminar ramas en todos los remotes"
|
||||
- name: --force
|
||||
desc: "flag para omitir confirmación interactiva"
|
||||
output: "lista de ramas eliminadas a stdout; exit code 1 si no es repo Git o no se detecta la rama base"
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "bash/functions/shell/git_clean_branches.sh"
|
||||
source_repo: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git"
|
||||
source_license: "MIT"
|
||||
source_file: "scripts/linux/git_utils/limpiar_ramas.sh"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```bash
|
||||
source bash/functions/shell/git_clean_branches.sh
|
||||
|
||||
# Limpieza básica con confirmación
|
||||
git_clean_branches
|
||||
|
||||
# Sin confirmación, sobre rama base "develop"
|
||||
git_clean_branches develop --force
|
||||
|
||||
# Eliminar también en remotes
|
||||
git_clean_branches main --remote --force
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Ramas protegidas que nunca se eliminan: `main`, `master`, `develop`, `dev`, `staging`, `release`. Siempre hace prune de referencias remotas obsoletas antes de buscar candidatos.
|
||||
Reference in New Issue
Block a user