Part of
src/cmds/— see also docs/contributing/TECHNICAL.md
- git.rs uses
trailing_var_arg = true+allow_hyphen_values = trueso native git flags (--oneline,--cached, etc.) pass through correctly - Auto-detects
--mergesflag to avoid conflicting with--no-mergesinjection - Global git options (
-C,--git-dir,--work-tree,--no-pager) are prepended before the subcommand - Exit code propagation is critical for CI/CD pipelines
- glab_cmd.rs declares
-R/--repoand-g/--groupat the clap level; they are appended to the glab args (not prepended) so subcommand dispatch stays intact has_output_flag()short-circuits to passthrough when the user explicitly requests-F/--output/--json(avoids double JSON injection)should_passthrough_view()redirectsmr/issue viewto passthrough when--webor--commentsis set- JSON handlers use the local
run_glab_json<F>()helper wrappingrunner::run_filtered+RunOptions::stdout_only().early_exit_on_failure().no_trailing_newline(); on JSON parse error, falls back to the raw stdout (glab sometimes emits plain text for empty results) ci statususes text-keyword parsing (glab doesn't support-F jsonfor this subcommand); when no English status keyword is recognized (non-English locale), returns raw verbatimci traceuses ANSI-stripping + GitLab section-marker filtering + runner/git/artifact boilerplate removal; kept as text-only filter, not JSONrelease listfalls back to raw output when the glab 1.82+ format doesn't match the legacy tab-delimited parser- Pipeline / merge-status indicators use text tags (
[ok],[fail],[cancel],[run],[pend],[skip],[conflict]) to matchgh_cmd.rsand avoid multi-byte rendering quirks
gh_cmd.rsimportscompact_diff()fromgit.rsfor diff formatting; markdown helpers (filter_markdown_body,filter_markdown_segment) are defined ingh_cmd.rsitselfglab_cmd.rsalso usescompact_diff()fromgit.rsformr diff; itsfilter_markdown_bodyis currently duplicated fromgh_cmd.rs(shared-module refactor deferred)diff_cmd.rsis a standalone ultra-condensed diff (separate fromgit diff)
| Aspect | gh | glab |
|---|---|---|
| Notation | #42 |
!42 |
| States | OPEN/MERGED/CLOSED |
opened/merged/closed |
| Author | author.login |
author.username |
| URL field | url |
web_url |
| Body field | body |
description |
| Merge check | mergeable |
merge_status (can_be_merged / cannot_be_merged) |
| CI status | statusCheckRollup |
head_pipeline.status |
| Labels | labels (array of objects) |
labels (array of strings) |
| Reviewers | reviewRequests/reviews |
reviewers (array of objects with username) |