Commit graph

2 commits

Author SHA1 Message Date
Stephen Way fbf1354367
fix: pager via libc::dup2, harden pre-push hook stdin handling
* New `output::pager` module spawns `$FJ_PAGER` / `$PAGER` / `less -FRX`
  when stdout is a TTY and dup2's our stdout onto its stdin. The
  `PagerGuard` restores the original stdout and waits on the child on
  drop so all output flushes before exit.
* Wired into the top-level dispatch: list/view/diff/api/search/status
  output is now paged automatically. Short output passes through via
  `less -F`. Global `--no-pager` flag and `FJ_NO_PAGER` env opt out.
* libc 0.2 added as a small dep (needed for dup/dup2/close).
* Pre-push hook now drains and closes stdin at the top, then runs every
  step with `</dev/null`. Previously a test or build could in principle
  inherit git push's stdin (the list of refs being pushed) and block
  if it ever tried to read it. Adds CARGO_TERM_PROGRESS_WHEN=never so
  the progress bar doesn't muddle non-TTY runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:53:13 -07:00
Stephen Way 191d941c78
expand: repo auto-detect, --web, editor, PR diff/checks/ready/review/status, repo lifecycle, api headers/paginate
* CI: pre-push hook (fmt, clippy -D warnings, test, release build) plus
  opt-in FJ_E2E=1 smoke. Install via scripts/install-hooks.sh.
* Repo auto-detection from git remote: -R/--repo becomes optional on all
  repo-scoped subcommands. Detection prefers `upstream` then `origin`,
  honors --host, and parses https/ssh/scp-style URLs.
* `--web` flag wired to every list/view command (open in default browser).
* `$EDITOR` integration for issue/pr create + comment + edit (omit
  `--body` to launch your editor; `-` keeps stdin).
* PR: new `diff`, `commits`, `files`, `checks`, `ready`, `review`,
  `edit`, `status`, `reopen` subcommands. `view --comments` now shows
  reviews too.
* Issue: `edit` and `develop` (creates a branch for the issue).
* Repo: `fork`, `sync`, `edit`, `rename`, `archive`, `unarchive`,
  `delete` (with slug-confirmation), `branches`, `topics`.
* `fj api` gains `-H` headers, `--paginate` (follows Link rel=next),
  `--include` (response headers), `--silent`. The jq-ish projector now
  supports `[N]`/`[-N]` brackets and `|` pipes.
* MSRV bumped to 1.82 (uses `is_none_or`).
* 46 unit tests covering pure logic: hosts CRUD, remote URL parsing,
  link header parser, jq projection, branch label fallback, slugify.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 08:22:40 -07:00