upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/list.rs
AgeCommit message (Collapse)Author
2026-05-01fix: filter run_list state candidates by current remote's maintainersDanConwayDev
when a repo has multiple nostr:// remotes sharing the same identifier, relays can return state events authored by maintainers of the other remote. without filtering, the newest event wins regardless of author, pointing refs at the wrong commits. state event candidates in run_list are now filtered to maintainers of the current remote's repo announcement.
2026-04-22fix: prevent fatal clone/fetch errors when PR git data unavailableDanConwayDev
Only advertise `refs/heads/pr/*` branches once their tip OIDs are confirmed present locally; prevents `fatal: bad object` / `remote did not send all necessary objects` errors during clone/fetch when a PR tip lives on a different git server than the one that won the bulk prefetch race. After the bulk prefetch, collect remaining missing PR tip OIDs and do one batch fetch per repo git server using only the OIDs that server has advertised; break early once all are satisfied and skip servers that carry none. Avoids batch-poisoning (a server rejects the whole request if any single OID is absent) and redundant connections. Restrict mop-up fetches and run_fetch to the repo's declared git servers; do not fetch from clone-tag URLs in PR events - they are submitter-supplied and could let a malicious or slow server stall every clone/fetch operation. Also apply rustfmt and fix clippy warnings.
2026-02-26fix: advertise only state events with resolvable git objectsDanConwayDev
git-remote-nostr now walks the per-relay state events captured in FetchReport::state_per_relay (newest first) and advertises the first one whose every OID is either present on at least one git server (confirmed via list_refs) or already available locally. If no such state event exists it falls back to the raw git server state. Previously the latest nostr state event was always used regardless of whether its OIDs had been pushed to any server, causing catastrophic missing-object errors during clone or fetch when a state event was published ahead of the corresponding git push.
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.
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-10-17fix(fetch): surpress some warnings for some usersDanConwayDev
only the maintainers and author of a poorly formatted proposal need to know it was submitted but cant be created as a PR branch
2025-09-03fix(remote): `refs/pr-by-id/*` ~> `refs/pr/*/head`DanConwayDev
to align more closely with githubs `refs/pull/*/head` we can pretend that pr means both Patch Request and Pull Request
2025-09-01fix: list shows `/pr` PRs when git data is localDanConwayDev
even if it is not on repository remotes, as it may have been pushed to a user's git server instead
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-15feat(remote): list proposals as `refs/pr-by-id/*`DanConwayDev
This branch name cannot be attacked by brute forcing a shorthand event id like refs/pr/<branch-name(<shorthand-event-id) can.
2025-08-15feat(remote): list all proposals as `refs/pr/*`DanConwayDev
here we can list Pull Requests whose data aren't on the repo relays without causing `git clone nostr://` to fail. we can also list proposals of all statuses so that can review closed proposals.
2025-08-15fix: inaccessable PR commits breaks `git clone`DanConwayDev
we cannot list PRs under refs/heads/pr/* unless we are sure the oids are accessable on a git server as it will cause `git clone` to fail. we now only list PRs that are on accessable repo git servers under refs/heads/pr/*. we should be able to list them under under refs/pr/* as the clone command only fetches refs in refs/heads so we will do this seperately.
2025-07-25refactor: move `utils` and `list` helpers to libDanConwayDev
to enable forthcoming `ngit sync` cmd
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-06-19refactor: rename ngit_relay to graspDanConwayDev
in function, params and variable names
2025-06-02fix: ignore dereferenced tags in stateDanConwayDev
as they are just noise
2025-05-23feat(push): avoid out of sync issues for ngit relayDanConwayDev
we need to be careful with git servers with their own permissions so a ngit user doesn't inadvertantly push changes on top of a another user who pushed directly to the git server without using the force flag. We dont have this problem with ngit-relay so we can always force push, even if the user didnt as nostr is the authority of state.
2025-05-23feat: only try http(s) for ngit-relaysDanConwayDev
otherwise it tries all the protocols and reprots on each
2025-05-09fix: always try git servers over other protocolsDanConwayDev
remove the code that guessed whether it was an authentication failure and gave up is it wasn't. this prevents it from trying http for push when ssh is not supported eg. ngit-relay
2025-05-05chore: nix flake updateDanConwayDev
update nix dependancies to latest version using default update options run `cargo clippy --fix` and `cargo fmt` to fix new clippy errors
2024-12-20feat(remote): include draft PRsDanConwayDev
show draft as well as open PRs as remote branches
2024-12-20refactor: branch_name handlingDanConwayDev
improve clarity by renaming variables and methods defend against `branch-name` tag with an unsafe name
2024-12-20refactor: use nostr url from repo_refDanConwayDev
simplify to allow the removal of warning: `#[allow(clippy::too_many_arguments)]`
2024-12-16chore: bump nix flake rust nightly `fmt` overlayDanConwayDev
update the rust nightly `fmt` overlay which needs to be pinned to a specific version (this case by date) update formatting in main files via `cargo fmt`
2024-11-26refactor: err msgs 'cannot' > 'failed to'DanConwayDev
in nearly all cases 'cannot' was used when an action was tried and failed. 'failed to' is strictly better because: * just because the action didn't work that time doesnt mean it cannot work * it is better at drawing the users attention to a problem
2024-11-21feat(login): overhaul login experienceDanConwayDev
* simplify login menu, making it more accessable to newcomers and easier to select remote signer options * enable `ngit login` to work from anywhere (not just a git repo) * assume fresh login details saved to global git config but fallback to local repository * maintain local repository login via `ngit login --local` * maintain login via CLI arguments eg `ngit send --nsec nsec123` * nudge users to remember nsec when pasting in ncryptsec for a better UX, whilst maintaining the option to be prompted for password everytime * create placeholder menu items for help menu and create account
2024-09-25fix(remote): in list use `pr/`for authored prsDanConwayDev
currently the prefix is missed when listing refs after pushing a pr
2024-09-25chore: bump rust-nostr v0.35DanConwayDev
bump all rust-nostr packages
2024-09-23fix(remote): add resilience to `prs`DanConwayDev
make poorly formatted patches fail silently. we stop trusting that the `commit` tag in the latest patch can be produced by apply the patches. to achieve this we must recreate the commit during the list command, which require fetching the parent oids. support patches without optional `commit` and `parent-commit` tags.
2024-09-17feat(remote): store successful protocol in configDanConwayDev
if another protocol was tried first and failed
2024-09-13fix(remote): clear `fetching ref list`DanConwayDev
so it doesn't remain in the TUI
2024-09-12fix(remote): improve fetch & list status updatesDanConwayDev
to bring them more into line to the native git client
2024-09-12fix(remote): update copyDanConwayDev
to make it more like native git
2024-09-09feat(remote): push protocol selection / fallbackDanConwayDev
enable override from nostr url clone url is filesystem use filesystem otherwise try ssh, then https authenticated unless clone url is http, then try ssh then http as we assume, we are on a local trusted network.
2024-09-06fix(remote): `fetch` and `list` status copyDanConwayDev
so that it the filesystem url is shown
2024-09-06feat(remote): just use ssh if auth succeedsDanConwayDev
and don't proceed to https or http
2024-09-06fix(remote): `list` apply protocols selectionDanConwayDev
used in fetch and tweak the error reporting
2024-09-04refactor(remote): split into modulesDanConwayDev
to make it easier to read
2024-09-04refactor: use FromStr trait for NostrUrlDecodedDanConwayDev
as it should have been used in the first place