upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/main.rs
AgeCommit message (Collapse)Author
2026-03-05fix(pr-checkout): require --force on diverged proposal branchDanConwayDev
checkout_patch() previously re-applied the patch chain whenever the local branch tip didn't match the published tip, silently overwriting local amendments and rebased revisions without warning. Now detects the relationship between local and published tips: - up to date: check out as-is - behind (local is ancestor of published): fast-forward, no flag needed - local commits on top (published is ancestor of local): check out as-is - diverged (neither ancestor): bail with guidance, --force to overwrite - published tip not found locally and branch exists: same as diverged Also adds --force flag to `ngit pr checkout` to explicitly opt in to overwriting a diverged branch, covering both local amendments and author force-pushes. Bug discovered during test implementation in tests/ngit_pr_checkout.rs.
2026-03-05fix(issue): add --comments flag to issue list commandDanConwayDev
--comments was supported by 'issue view' but not 'issue list', making 'ngit issue list <id> --comments' fail while the equivalent 'view' command worked fine.
2026-03-05feat(cover-note): add kind-1624 cover notes for PRs, patches, and issuesDanConwayDev
Implements experimental kind-1624 cover note events: - KIND_COVER_NOTE constant and process_cover_note() in git_events.rs; replaceable semantics (latest created_at, hex-id tiebreak), author or maintainer only - kind-1624 events fetched alongside labels in the fetch pipeline; cover_notes count added to FetchReport display - ngit pr/issue view: cover note displayed in place of description with a clear 'Cover Note:' header; maintainer-authored notes identify the author; original description shown only with --comments; cover_note object included in --json output - ngit pr set-cover-note / ngit issue set-cover-note: publish a kind-1624 event; nostr: mentions in --body converted to q/p tags via tags_from_content (same rules as issue --body) - Fix pre-existing clippy::too_many_lines on repo/mod.rs show_info
2026-03-05refactor(subject): standardise on subject over title in CLI and outputDanConwayDev
- JSON output fields renamed from title to subject in pr list/view and issue list/view - Printed view output changed from Title: to Subject: - ngit issue create --subject (alias --title) - ngit send --subject (alias --title) - Error messages and interactive prompts updated to match
2026-03-05feat(subject): add pr/issue set-subject via NIP-32 kind-1985 labelsDanConwayDev
Adds the ability to update the displayed title of a PR or issue after creation using a kind-1985 label event with the #subject namespace. Only the author or a repository maintainer may set the subject. The latest authorised event wins with tiebreak by lexicographically larger event ID (NIP-1 replaceable event semantics). Branch names and commit messages are never affected. - Split get_labels() into process_labels() (additive #t) and process_subject() (replaceable-style #subject), with a shared get_labels_and_subject() entry point that processes both from a single pre-fetched slice of kind-1985 events - All list/view/JSON display paths apply the subject override silently - New ngit pr set-subject <id> --subject <text> command - New ngit issue set-subject <id> --subject <text> command
2026-03-05feat(status): add --reason to all pr and issue status commandsDanConwayDev
All status transitions (pr close/reopen/ready/draft, issue close/reopen/ resolved) now accept an optional --reason flag stored in the event content.
2026-03-05feat(status): add pr draft, issue resolved, and --reason for issue closeDanConwayDev
Add `ngit pr draft <id>` to convert a PR back to draft (kind-1632). Add `ngit issue resolved <id> [--reason <text>]` to mark an issue as fixed (kind-1631 GitStatusApplied), distinct from close which signals wontfix/duplicate/invalid. Add `--reason <text>` to `ngit issue close` — stored in event content. Also fix success/error message wording in pr_status and issue_status to use consistent past-tense action strings.
2026-03-05feat(label): add `ngit issue label` and `ngit pr label` commandsDanConwayDev
Publishes a NIP-32 kind-1985 label event referencing the target issue or PR. Only the event author or a repository maintainer may apply labels. Duplicate labels (already present via t-tags or prior kind-1985 events) are silently skipped. The new event is saved to the local cache before broadcasting so subsequent reads reflect the change immediately. CLI: ngit issue label <id> --label <L> [--label <L>...] ngit pr label <id> --label <L> [--label <L>...]
2026-03-05add `ngit account whoami` commandDanConwayDev
Shows currently logged-in account(s) with name and npub. When both a local (repo-scoped) and global account are configured, displays both with local marked as active. Supports --json (returns local, global, and active objects each with name, npub, nip05, scope) and --offline (reads from cache only, no network). Fixes doc_markdown clippy warning in cli.rs.
2026-03-04add `ngit repo --json` for machine-readable repo detectionDanConwayDev
Outputs {"is_nostr_repo": false} when not in a nostr repository, or full structured JSON (name, identifier, description, nostr_url, coordinate, maintainers, grasp_servers, git_servers, relays, hashtags) when it is. Always exits 0. Also adds --title as an alias for --name on `ngit init`.
2026-03-04standardise on --label; add label filter and display to pr list/viewDanConwayDev
- rename --hashtag (comma-separated) to --label (repeatable) on issue list, matching the --label flag already used on issue create - add --label filter to pr list with the same OR semantics (matching GitHub) - display labels column in pr list table and Labels: line in pr view - include labels array in all JSON outputs (list and view for both issue and pr) - rename internal 'hashtags' -> 'labels' throughout issue_list.rs and list.rs
2026-03-04add --comments flag to issue/pr view; show reply threadingDanConwayDev
- issue view and pr view now show only a comment count by default - pass --comments to include the full thread - JSON output always includes comment_count; comments array only with --comments - each comment in the thread includes reply_to (null for top-level, parent comment id for replies) - human-readable view shows a dim '↳ reply to <short-id>' line on replies
2026-03-04fix NIP-22 compliance and add --reply-to flag for issue/PR commentsDanConwayDev
- Add missing P and p tags (root and parent author pubkeys) - Fix E tag 4th element to be root pubkey (was empty string) - Fix e tag 4th element to be parent pubkey (was "reply", a NIP-10 convention) - Add --reply-to <ID|nevent> flag to both issue and PR comment commands - When --reply-to is set, look up the parent comment from cache and use it as the parent scope (e/k/p); root scope (E/K/P) always stays the issue/PR - When --reply-to is omitted, parent == root (existing top-level behaviour)
2026-03-04restructure CLI around ngit pr/issue subcommand groupsDanConwayDev
Introduce ngit pr subcommand group (list, view, checkout, apply, send, close, reopen, ready, comment, merge) replacing the former top-level ngit list/checkout/apply commands. ngit send is kept at the top level. Expand ngit issue with view, create, close, reopen, comment subcommands. Status changes (close/reopen/ready) are gated to the PR/issue author or a repository maintainer. ngit pr merge is maintainer-only and publishes a GitStatusApplied event immediately after the git merge.
2026-03-04feat: add ngit issue list commandDanConwayDev
Non-interactive listing of NIP-34 issues (kind 1621) with status resolution, hashtag display, and detail view. - get_issues_from_cache: fetch GitIssue events from local cache by repo coordinate, mirroring get_proposals_and_revisions_from_cache - ngit issue list: table output of ID, status, title and hashtags at end of each row; status resolved via existing get_status() logic - --status: comma-separated filter (open,draft,closed,applied; default: open) - --hashtag: comma-separated label filter (case-insensitive, OR match) - --json: machine-readable output including hashtags and description - --offline: skip network fetch, use local cache only - <id>: optional positional argument (hex event-id or nevent) to show full details of a specific issue including body content
2026-02-20improve `ngit repo` output stylingDanConwayDev
- make repo name bold yellow as a title; section headings bold dim - add dim horizontal rules above and below the name/description block - move earliest unique commit to the bottom (after additional relays) - add --offline flag to skip network fetch and use local cache only
2026-02-20add `ngit repo` subcommand groupDanConwayDev
- `ngit repo` (no subcommand): show repository info including maintainer tree, per-maintainer infrastructure attribution, and a note explaining the union-vs-personal field model and recursive maintainer sets - `ngit repo init`: alias for `ngit init` - `ngit repo edit`: same as init but signals intent to update an existing repository announcement - `ngit repo accept`: scoped command for co-maintainers to publish their announcement; errors with clear messages for all other states (trusted maintainer, already accepted, not invited, no repo found)
2026-02-17fix: show help menu when ngit is run without argumentsDanConwayDev
Previously, running ngit without any command would show an error message. Now it displays the help menu, which is more user-friendly and follows standard CLI tool conventions.
2026-02-17feat: add --offline flag to list, checkout, apply commandsDanConwayDev
Skip network fetch when --offline is set, using only local cache
2026-02-13feat: add spinner for git fetch in non-verbose modeDanConwayDev
Shows a progress spinner when fetching from git remotes in non-verbose mode. Suppresses git fetch output and listing messages when not in verbose mode. Uses NGITTEST environment variable for test timeouts.
2026-02-13feat: add --verbose/-v flag for detailed outputDanConwayDev
Adds a global --verbose/-v flag that sets NGIT_VERBOSE environment variable. Also sets NGIT_VERBOSE automatically when NGIT_TEST is set.
2026-02-12feat: make ngit list non-interactive by defaultDanConwayDev
- Add --status flag for filtering (default: open,draft) - Add --json flag for JSON output - Add optional <id> argument for showing proposal details - Rename interactive logic to launch_interactive() - Non-interactive mode outputs table format by default - Use -i flag for interactive mode Phase 3 of non-interactive ngit list implementation.
2026-02-12feat: add ngit apply command for non-interactive patch applicationDanConwayDev
Adds a new 'ngit apply <event-id>' command that applies proposal patches to the current branch. Supports --stdout flag to output patches for piping to git am. Phase 2 of non-interactive ngit list implementation.
2026-02-12feat: add ngit checkout command for non-interactive proposal checkoutDanConwayDev
Adds a new 'ngit checkout <event-id|nevent>' command that creates or updates a proposal branch and checks it out. Supports both PRs and patches with parent-commit references. Phase 1 of non-interactive ngit list implementation.
2026-02-11fix: force interactive mode for list commandDanConwayDev
The list command is inherently interactive - it presents menus for browsing and selecting proposals. Without interactive mode, all choice() calls auto-select default index 0, causing the first proposal to be checked out immediately without user input.
2026-02-10feat: add global CLI flags for non-interactive modeDanConwayDev
Add --defaults, --interactive, and --force flags to support non-interactive operation. Non-interactive mode is now the default behavior, with interactive mode enabled via the -i/--interactive flag. Also add CliError handling in main() to support styled error output from subcommands.
2025-09-11fix: ngit binary enforce git server timeoutDanConwayDev
rather than just in the remote helper.
2025-07-25feat(sync): add cmd to sync git serversDanConwayDev
with nostr state. optionally use 'force' flag
2025-05-21feat: add --customize flag for instructionsDanConwayDev
of how to customise ngit via git config items
2024-11-27feat: remove `pull` `push` and `fetch` ngit cmdsDanConwayDev
to simplify the api and encourage use of the git remote helper
2024-11-27feat(account): move login/out cmds to accountDanConwayDev
move login, logout export-keys commands to sub commands under account
2024-11-27feat(logout): add logout commandDanConwayDev
rather than using `ngit login` which is less intuative
2024-11-27feat(export-keys): to use in other clientsDanConwayDev
as part of the easy on-boaridng flow
2024-11-11Revert "refactor: remove ngit `pull` `push` `fetch`"DanConwayDev
This reverts commit 43b5e9b38bf5dcfbac85637a2d3efc69ddfe77ac.
2024-11-04refactor: remove ngit `pull` `push` `fetch`DanConwayDev
simplify api to encougage use of the git plugin
2024-09-04refactor: fix imports, etc based on restructureDanConwayDev
move some functions out of ngit and into lib/mod and lib/git_events remove MockConnect from binaries so it is only used in the library. this was done: * mainly because automocks were not being imported from lib into each binary * but also because the these functions were being tested with MockConnect
2024-09-04refactor: organise into lib and bin structureDanConwayDev
the make the code more readable this commit just moves the files, the next commit should fix the imports