Summary
Most modules reserve exit code 2 for usage/validation errors and 1 for operational failures, but git/gh don't follow that convention.
Details
lib/bash/git/lib_git.sh (e.g. :14-17, :24-27, :55-58, :132-134) and lib/bash/gh/lib_gh.sh (e.g. :17-19, :269-272, :292-293) return 1 uniformly for both bad-usage errors and genuine operational failures (e.g. base_git_detect_default_branch returns 1 both for wrong arg count and for "couldn't detect a branch", lib_git.sh:51).
- Contrast
lib/bash/list/lib_list.sh:25-29, lib/bash/arg/lib_arg.sh:152-155, and lib/bash/cli/lib_cli.sh (__base_bash_libs_cli_declaration_usage__ etc.), which consistently return 2 for usage/validation errors.
Impact
A consumer can't reliably branch on exit status to distinguish "I called this wrong" from "the operation failed" when mixing git/gh helpers with list/str/arg/cli helpers.
Suggested fix
Adopt one convention repo-wide (2 = usage error, 1 = operational failure, matching most modules) and update git/gh accordingly, or explicitly document the deviation.
Summary
Most modules reserve exit code 2 for usage/validation errors and 1 for operational failures, but
git/ghdon't follow that convention.Details
lib/bash/git/lib_git.sh(e.g.:14-17,:24-27,:55-58,:132-134) andlib/bash/gh/lib_gh.sh(e.g.:17-19,:269-272,:292-293) return1uniformly for both bad-usage errors and genuine operational failures (e.g.base_git_detect_default_branchreturns1both for wrong arg count and for "couldn't detect a branch",lib_git.sh:51).lib/bash/list/lib_list.sh:25-29,lib/bash/arg/lib_arg.sh:152-155, andlib/bash/cli/lib_cli.sh(__base_bash_libs_cli_declaration_usage__etc.), which consistently return2for usage/validation errors.Impact
A consumer can't reliably branch on exit status to distinguish "I called this wrong" from "the operation failed" when mixing git/gh helpers with list/str/arg/cli helpers.
Suggested fix
Adopt one convention repo-wide (2 = usage error, 1 = operational failure, matching most modules) and update
git/ghaccordingly, or explicitly document the deviation.