upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2026-02-25fix IPv6 connection failures with Happy Eyeballs (RFC 8305)DanConwayDev
Implement a custom WebSocketTransport that races IPv6 and IPv4 connections with a 250ms head start for IPv6, matching browser behavior. This prevents broken IPv6 from blocking all relay connections indefinitely. This is a temporary fix until the upstream async-wsocket PR is merged: https://github.com/shadowylab/async-wsocket/pull/42
2026-02-20improve `ngit repo` output formattingDanConwayDev
- suppress fetch summary (no updates / updates: X) - write blank line to stderr after relay errors for clear separation - show identifier below title only when it differs from name - show earliest unique commit (root_commit) in metadata - restructure infrastructure into grasp servers / additional git servers / additional relays sections - display grasp servers by domain only (strip scheme, npub, repo path) - strip wss:// prefix from relay display - show maintainer names from metadata cache; fall back to short npub - append (you) next to the current user's name wherever it appears - show [name] attribution and the maintainer model note only when there is more than one maintainer
2026-02-20replace nos.lol with relay.ditto.pub as default relayDanConwayDev
nos.lol always prompts for nip42 auth even for reading, making it unsuitable as a default relay.
2026-02-20use trusted maintainer's grasp servers as fallback for co-maintainersDanConwayDev
when a co-maintainer has no grasp servers of their own, fall back to the trusted maintainer's grasp servers rather than jumping straight to system defaults. if the trusted maintainer only uses a single grasp server, the first system default is appended for redundancy. system defaults are only used when neither the user nor the trusted maintainer has any grasp servers configured.
2026-02-20default relay prompt to no selection; add is never pre-selectedDanConwayDev
With no default relays seeded, the multi-select add option was incorrectly pre-selected when the list was empty. Now add/add-another is always unselected by default so enter skips straight through.
2026-02-20drop default relays from announcement eventsDanConwayDev
ngit init and accept_maintainership_with_defaults no longer seed relay lists from the client default set. The relay list in a Kind:30617 announcement now contains only grasp-server-derived relay URLs; no additional public relays are suggested or added automatically.
2026-02-20extract grasp/maintainership helpers to lib and auto-accept on pushDanConwayDev
move apply_grasp_infrastructure, latest_event_repo_ref to lib/repo_ref.rs and wait_for_grasp_servers + grasp_servers_from_user_or_fallback to a new lib/accept_maintainership.rs so both binaries can share them. add accept_maintainership_with_defaults which publishes the co-maintainer's own Kind:30617 announcement with defaults (user grasp servers, shared metadata from existing events) then waits for grasp server provisioning and updates nostr.repo config and origin remote. replace the push error block with a call to accept_maintainership_with_defaults so pushing now silently accepts co-maintainership instead of failing.
2026-02-18fix: remove outdated patch_supports gate and fix fetch parent fallbackDanConwayDev
Remove the patch_supports_commit_ids gates in checkout.rs and list.rs that pre-dated the mbox fallback logic. apply_patch_chain already handles all fallback cases. Also replace the main-branch TODO fallback in make_commits_for_proposal with get_parent_commit_from_patch, which uses timestamp-based best-guess when the parent-commit tag is absent.
2026-02-18fix: thread applied OID through patch chain correctlyDanConwayDev
When applying a chain of patches without parent-commit tags, each patch's parent was resolved independently, meaning patch2 would not parent off the OID patch1 actually produced. Thread next_parent_override through the loop and guard the early-return in create_commit_from_patch so the override is always honoured.
2026-02-18fix: harden apply_patch_chain when optional patch tags absentDanConwayDev
- Replace .unwrap() calls in filter closure with pattern-let guards so a missing/invalid mbox commit id conservatively includes the patch - Use the OID returned by create_commit_from_patch as branch tip instead of the tag commit id, which may differ for GPG-signed commits - Add module-level doc comment to mbox_parser explaining design rationale and known limitations around the mbox envelope SHA1
2026-02-18fix: improve mbox patch parser resilience for optional tag fallbackDanConwayDev
- Use mailparse crate to handle RFC 2047 encoded-words (Q/B encoding) and RFC 2822 header folding in Subject and From headers - Fix email signature separator check: use exact match 'line == "-- "' instead of starts_with to avoid false positives on body lines - Remove dead/incorrect asctime parsing in committer date extraction; simplify to always return None (falls back to author_timestamp)
2026-02-18feat: handle missing optional patch tags for pr/ flowDanConwayDev
- Add mbox_parser module to extract metadata from patch content - Extract author/committer from From: and Date: headers when tags missing - Extract commit message body as fallback for description tag - Implement best-guess parent commit logic using committer timestamps - Update patch_supports_commit_ids to accept mbox-parseable patches - Enable patches without optional tags to appear as pr/ branches
2026-02-18report event kinds in publish progress messagesDanConwayDev
instead of generic 'Publishing to nostr relays...' messages, describe what is being published e.g. 'Publishing 3 patches to nostr relays...' or 'Publishing 1 announcement and 1 state event to nostr relays...'
2026-02-17add --signer-relay option to ngit account loginDanConwayDev
Allow users to specify custom signer relays for nostrconnect login. Relay URLs are auto-prefixed with wss:// if no scheme is provided.
2026-02-17add second default signer relay for resilienceDanConwayDev
Add wss://relay.ditto.pub as a second default signer relay alongside wss://relay.nsec.app for improved reliability during nostrconnect login.
2026-02-16test: fix all tests that use publishDanConwayDev
that expect whitespace then something
2026-02-16test: fix list reporter under test conditionsDanConwayDev
this took a lot of investigation to work out why this was failing
2026-02-16fix: reporter git server non-verboseDanConwayDev
hide details in non-verbose mode
2026-02-16fix: report wording consistancy in publishingDanConwayDev
always report publishing and finish with published
2026-02-16fix: report wording `fetching` ~> `checking`DanConwayDev
to be consistent with the summary version
2026-02-16fix: report wording `maintainers ~> announcementsDanConwayDev
'maintainers' is missleading as the announcement authors may not be in the maitnainer set
2026-02-13feat: add spinner for publish in non-verbose modeDanConwayDev
Apply the same hidden-to-visible MultiProgress pattern used for fetch to send_events. In concise mode (non-verbose, non-test, non-silent), a spinner is shown immediately and the detail progress bars are revealed after a delay, using the deferred bar finish mechanism.
2026-02-13fix: tweak fetch msgDanConwayDev
as its not fetching from git servers just yet
2026-02-13fix: pre-add heading bar so it renders in expanded viewDanConwayDev
The heading bar was being inserted into the MultiProgress after the draw target switch, but by then all relay bars were already finished so indicatif did not re-render the layout. Pre-add the heading bar at creation time (position 0, before relay bars) and only call finish_with_message on it after the draw target switches to stderr.
2026-02-13fix: show heading in expanded view by finishing after draw target switchDanConwayDev
The 'fetching updates...' heading was finished with finish_with_message while the draw target was still hidden, so indicatif never rendered it. Move the draw target switch before the heading insertion so the heading renders immediately when added.
2026-02-13fix: defer bar finish until reveal to show all barsDanConwayDev
indicatif does not re-render bars that called finish_with_message while the draw target was hidden. Instead of trying to force a redraw, defer the finish_with_message call until after the draw target switches to stderr. A BarRevealState coordinates between relay tasks and the timer: bars that complete before the 5s reveal store their finish state in a mutex-protected list, which the timer flushes after switching the draw target. Bars completing after reveal finish immediately as before.
2026-02-13fix: use force_draw to redraw bars after revealDanConwayDev
tick() is a no-op when enable_steady_tick() is active. Use force_draw() on a bar to trigger a full MultiState redraw including bars that finished while the draw target was hidden.
2026-02-13fix: only show heading when expand delay firesDanConwayDev
Use a ProgressBar inside the detail multi for the heading instead of eprintln so it gets cleared with progress_reporter.clear() and never appears when fetch completes before the delay.
2026-02-13refactor: hidden-to-visible MultiProgress patternDanConwayDev
Replace the broken SpinnerState approach (which checked should_expand at task spawn time when all tasks spawn simultaneously) with a two-MultiProgress pattern: a visible spinner shown immediately, and a hidden detail multi that every relay task always adds bars to. A background timer reveals the detail bars after 5s, printing a heading before switching the draw target.
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-13fix: clear progress reporters on successful completionDanConwayDev
Progress reporters were not being cleared after successful operations, leaving progress bars visible in the terminal output. Now they are properly cleared when all operations complete without errors.
2026-02-12fix: handle existing local branch that is behind when checking out PRDanConwayDev
When a PR branch already exists locally, the previous code would silently move the branch pointer without checking for tracking or fast-forward safety. Now: - If branch has tracking: checkout and warn user to git pull - If no tracking and fast-forward: safely move pointer - If no tracking and diverged: show copy-paste commands for reset/rebase - If commit not found locally: suggest fetching Uses console crate for yellow output instead of hardcoded ANSI codes.
2026-02-11feat: use fallback relays for bootstrapping onlyDanConwayDev
- Add --relay flag to 'ngit account create' allowing users to specify relay URLs (repeatable). Defaults to relay-default-set when not provided. - Remove fallback relays from fetch when repo context exists (repo coordinate provided). Only use them for bootstrapping (profile discovery with no repo context). - Remove fallback relays from publish when repo or user relays exist. Only use them when neither is available (e.g. new account signup). - Update --customize help text to reflect new relay-default-set behavior.
2026-02-10remove more_fallback_relays (dead code)DanConwayDev
The more_fallback_relays field is never consumed anywhere in the codebase. Removing it from the Client struct, Params struct, trait definition, and all related initialization code.
2026-02-10remove relay.nostr.band from default relaysDanConwayDev
The relay.nostr.band relay is now offline and should be removed from the default relay set.
2026-02-10feat: update ngit account login for non-interactive modeDanConwayDev
Update login flow to support non-interactive mode with --nsec flag. Refactor login logic to handle both interactive and non-interactive cases. Add better error handling and validation.
2026-02-10feat: add non-interactive mode support to CLI interactorDanConwayDev
Add CliError type for styled error output and cli_error() helper function. Update Interactor to support non-interactive mode with default values. Add prompt methods that respect non-interactive mode and provide better error messages when required values are missing.
2025-11-18chore: fix clippy warningDanConwayDev
use more idomatic function
2025-11-18test: nostr git url with pathDanConwayDev
add additional test to cover this scenario
2025-11-14fix: fetch report showing cached profile event as newDanConwayDev
it was only checking local cache, where profile events are stored only stored in global
2025-11-13fix: don't attempt to fetch annotated tags we haveDanConwayDev
because thats not needed
2025-11-13fix: cli output dim coloringDanConwayDev
so that relay/git servers appear dim when fetch action is complete
2025-11-13feat(list): make list async and include sync report inlineDanConwayDev
copy relay fetching approach to async and reporting
2025-11-13refactor: simplify get_short_git_server_nameDanConwayDev
so it doesnt use the git_repo
2025-11-13fix: out of sync grasp server cli outputDanConwayDev
so it shows a summary rather than a lot of lines of issues
2025-11-13fix: cli output line deletion during fetchDanConwayDev
also reduce the clutter in the cli output for grasp servers.
2025-11-13test: reduce relay timeouts for testsDanConwayDev
some test failed and some test jus took too long
2025-11-10feat: adaptive relay timeout 45s or 7s based on successDanConwayDev
also auto-retry connection after 2s with x1.5 increment until timeout
2025-11-03fix: show nsec when created and can't save globallyDanConwayDev
otherwise we prompt the user to manually add it to global git config but they don't know the value. we did it like this to not expose the nsec but i in this case we should.
2025-10-28fix(pr): push use stderr rather than stdoutDanConwayDev
so we dont return a value to the git during remote helper operations
2025-10-28fix: nip46 signer bunker pubkeyDanConwayDev
the user pubkey was being used in bunker-url rather than the bunker pubkey. fixes nostr:nevent1qvzqqqqx25pzpv3tq6c9rl2jx2tx4y6y5c6dj4krmse60a0vmjkea5gam3qjpfljqqsx5ztpy48muheny4p49hh634l5zs3jqw9x5980dm9xsjsk98jrk8ch2sdsw
2025-10-20fix: reading NIP-22 style Status events during fetchDanConwayDev
also fix the report so that we show nip10 style statuses too
2025-10-20fix: grasp server detectionDanConwayDev
to ensure we dont try and fallback to ssh
2025-10-17chore: cargo updateDanConwayDev
update patches ahead of wider upgrade. clippy required some autofixes
2025-10-17feat!(nostr_url): replace user with ssh_key_fileDanConwayDev
replaces the "user" in the nostr_url format with "ssh_key_file", to support the original intent, which was to allow users to specify different authentication credentials. most git servers always expect the ssh user to be 'git'. the idiumatic way of specifying logging in as a different user is to specify a different ssh key. the idiomatic way of storing non-default ssh keys is in the location `~/.ssh/key_name`. "ssh_key_file" can be specified as `key_name`, for keys in the default location, or as a relative or absolute custom location eg. `/other_keys/.ssh/nym1` or `../.ssh/nym1`. BREAKING CHANGE: in nostr git url nym1@ssh/npub123/identifer, nym1 is now treated as ssh key file location rather than a ssh user. it can be specified as a file within `~/.ssh` eg `~/.ssh/nym1` or a full or relative path.
2025-10-17feat(send): add `merge-base` tag to PR (Update)DanConwayDev
following its inclusion in the NIP-34 spec
2025-09-04feat(remote): use push PR non-interactive fallbackDanConwayDev
move the PR push code in 'ngit send' into lib. reuse the non-interactive fallbacks in git-remote-nostr
2025-09-03fix: nostr:// nip05 without localDanConwayDev
the patch I sent to rust-nostr library got merged
2025-08-19fix: nip05 without local partDanConwayDev
allow users to use just a nip05 domain in nostr:// urls rather than requiring _@ prefix.
2025-08-19feat(list): add PR fetch and checkout supportDanConwayDev
abstracted git remote helper fetch functions added support to `ngit list` to fetch PR data and checkout as proposal branch
2025-08-18fix: only use state and ann from maintainersDanConwayDev
at some point we introduced a bug were we were taking the state and git servers from non authorised maintainers.
2025-08-07Merge branch 'add-prs-to-ngit-send'DanConwayDev
2025-08-07fix(send): refs not confirmed are usually acceptedDanConwayDev
having implemented 3b5c48f5a2a4b9be5d14baa8f5e801fefd5c1166, a ref pushed to refs/nostr/<event-id> on a github repo was accepted but was not confirmed
2025-08-07fix(send): PR cli outputDanConwayDev
to keep the user informed of whats happening / happend
2025-08-07fix(send):server not confirming acceptanceDanConwayDev
don't treat this as accepted
2025-08-07fix(send): push PR refs to non-grasp serversDanConwayDev
attempt to use a range of protocols instead of unath http
2025-08-07refactor: abstract `is_grasp_server_clone_url`DanConwayDev
so we can use it elsehwere
2025-08-07refactor: rename fn `is_grasp_server_in_list`DanConwayDev
to make it's purpose clearer
2025-08-07fix(push): capture more error updating refsDanConwayDev
previously server might respond with errors updating refs but we were not treating this as a failure to push those refs.
2025-08-07feat(send): PR fallback to user / custom graspDanConwayDev
if use is maintainer, push PR to all repo git servers. if user has a fork, push to all git servers it lists, and repo grasp servers. if user hasn't got a fork but has a user grasp list and pushing push to repo grasp servers fails, create a personal-fork automatically at each user grasp server and push there. fallback to prompting user for either grasp servers or git server with write permission. if user provides grasp servers, suggesting adding to user preference list.
2025-08-06feat(send): custom ref for PR clone urlDanConwayDev
allow specifying ref for pushing PR to custom clone url
2025-08-05feat(send): push PR to custom clone urlDanConwayDev
if the repo doesnt list any grasp servers, or pushing to them fails
2025-08-05feat(send): support PR and PR update eventsDanConwayDev
send as a PR if the commit would make patches that are too big for nostr events. send as a PR update if the proposal is PR. send as a PR, revising a patch root, if patches would be too big. in tests `get_pretend_proposal_root_event` has to be a actual proposal with a tip, rather than just a cover letter, so we have replaced it.
2025-08-04refactor: move generate pr event fn into libDanConwayDev
for future use in `ngit send`
2025-08-04refactor: use rust-nostr `verify_subscriptions`DanConwayDev
instead of `match_events` after receiving events
2025-08-04fix: `t` tag `revision-root` ~> `root-revision`DanConwayDev
NIP-34 specifies patch revisions should have a `t` tag of `root-revision` whereas we have been using `revision-root`. this fixes it and and handles events created with the incorrect tag.
2025-08-01fix: use new gitworkshop.dev url formatDanConwayDev
where just the nevent will do
2025-08-01refactor: move patch size evaluation fn to libDanConwayDev
so we can use it in ngit as well as remote helper
2025-07-31fix: mention marker ~> q tag NIP-10 updateDanConwayDev
required for rust-nostr v0.43 update
2025-07-31fix: nip05 breaking changes in rust-nostrDanConwayDev
as its now 'bring your own transport'
2025-07-31chore: bump rust-nostr v0.43DanConwayDev
with trival breaking changes. nip05 changes will be done seperately.
2025-07-25refactor: move push helpers to libDanConwayDev
to enable forthcoming ngit sync cmd
2025-07-25refactor: move `utils` and `list` helpers to libDanConwayDev
to enable forthcoming `ngit sync` cmd
2025-07-25fix(list): improve pr unsupport textDanConwayDev
and show a more helpful message when proposal can be checked out using the remote
2025-07-25refactor: abstract `get_status`DanConwayDev
for use by `ngit list`
2025-07-23fix(remote): patch to pr upgrade use pr kindDanConwayDev
and include e tag, etc per nip
2025-07-23refactor: Rename fallback relays and grasp serversDanConwayDev
Rename `params.fallback_relays` and `client.fallback_relays` to `relay_default_set`. Rename `params.fallback_grasp_servers` to `grasp_default_set`. This includes updating associated getters and usages across the codebase.
2025-07-23refactor: add fallback grasp servers to clientDanConwayDev
so that they can be used as part of push and send
2025-07-23feat(pr): updates and pr as patch revisionDanConwayDev
issue a pull request update if pushing or force pushing a pull request issue a pull request with an e tag for original patch and close status for the original patch when pushing or force pushing against a patch when the new commits are too big to be iussed as patches
2025-07-22feat(pr): generate pr event > oversized patchDanConwayDev
but only for new proposals
2025-07-22fix: remove blossom from grasp server detectionDanConwayDev
a grasp server doesnt need to appear in repo announcement event `blossoms` tag as blossom has been removed from the grasp spec
2025-07-18feat(pr): fetch pr and pr updates from clone urlsDanConwayDev
we try and get them from clone urls of repo and fallback to those specified by contributor
2025-07-18feat(pr): list PR and PR updatesDanConwayDev
remote will list the refs under `pr/*` namespace. `ngit list` will display in the list of open / draft proposals. it won't yet fetch the related oids to enable fetching or checking out the branch.
2025-07-18feat: fetch PR and PRUpdate eventsDanConwayDev
as the first stage of adding support
2025-07-18feat(status): read nip22 style status eventsDanConwayDev
in anticipation of moving to the nip22 style
2025-07-16chore: bump nightly rustfmtDanConwayDev
to latest available and apply fmt fixes
2025-07-16chore: nix flake updateDanConwayDev
required running: `cargo fix --allow-dirty --allow-staged` `cargo clippy --fix --allow-dirty -- -D warnings` to fix problems and then manually fixing some too
2025-07-16chore: cargo updateDanConwayDev
in prep for upgrade rust-nostr
2025-07-15feat(client): skip relays that just timeoutDanConwayDev
Prevent repeated attempts to connect to relays that have previously failed due to connection timeouts within the current session, improving overall performance and reliability. Added a `relays_not_to_retry` map to the `Client` struct to store relays to skip and their reasons. Implemented methods `skip_relay_for_session` and `is_relay_skipped_for_session` to manage this map. Relays are added to the skip list upon connection timeouts. Subsequent attempts to use these skipped relays during the same session will immediately fail with the recorded reason, avoiding unnecessary network calls. Progress bars are updated to reflect skipped relays and their reasons.
2025-07-15feat: add git timeoutDanConwayDev
to improve reliability