| Age | Commit message (Collapse) | Author |
|
Git worktrees don't have a .git directory with a parent, so we need to
look for the git dir via git2's Repository::discover() and then look for
the cache database there. This allows the client to work correctly when
run from a worktree, and also allows the cache database to be shared
between the main repo and its worktrees (since they share the same git
dir and thus the same cache path).
|
|
When applying a patch, if the reconstructed commit OID doesn't match
the tagged commit id (after the existing amend attempt), accept the
reconstructed OID rather than erroring. The diff is applied correctly
regardless of the mismatch; apply_patch_chain already threads the
actual OID forward via next_parent_override so the chain remains
consistent.
Mismatches can occur for several reasons: GPG-signed commits where
libgit2's commit_create_buffer produces subtly different bytes than
the original git commit, patches produced with non-standard tooling,
or edge cases like the diff.noprefix issue fixed in 7a36aed.
|
|
When applying a patch with a pgp signature, commit_create_buffer +
commit_signed reconstructs the signed commit object. The resulting OID
matches the original only if commit_create_buffer produces the exact
same bytes that git originally signed — which isn't guaranteed across
different git implementations or versions.
The existing amend workaround (which re-applies author/committer to
recover the correct OID) is preserved for unsigned commits. For
pgp-signed commits the amend still runs but the mismatch bail is
skipped, since the tree, author, committer, message and signature are
all correct regardless of the OID difference.
|
|
libgit2 respects the user's `diff.noprefix` git config when generating
patches via `git_email_create_from_commit`, producing diffs without the
standard `a/`/`b/` path prefixes. `git2::Diff::from_buffer` always
expects the standard prefix format and fails with "header filename does
not contain 1 path components" when it is absent.
Two fixes:
- In `make_patch_from_commit`: explicitly set `old_prefix("a/")` and
`new_prefix("b/")` on the diff options so ngit always generates
interoperable patches regardless of the submitter's git config.
- In `create_commit_from_patch`: normalize no-prefix diffs before
passing to `git2::Diff::from_buffer`, as a defensive measure for
patches already published by affected ngit versions or other tools.
Adds unit tests for the normalization function covering: no-op on
already-prefixed diffs, single and multi-file patches, new/deleted
files (/dev/null preservation), and end-to-end libgit2 parse
verification.
|
|
Add GitSystem to SignerInfoSource so credentials stored in the system
git config (/etc/gitconfig) are included in the priority fallback chain
(local > global > system) and shown as a separate level in whoami output.
|
|
The Nix environment provides libgit2 1.9.2 via nixpkgs, which
libgit2-sys picks up at build time instead of using its bundled version.
This caused test assertions that hardcode the libgit2 version string
(appended by libgit2 to patch output) to fail after commit 319bb7f
added new Cargo dependencies, though the exact mechanism by which those
dependencies triggered the switch from the bundled 1.9.1 to the system
1.9.2 remains unclear.
Also bump git2 from 0.20.2 to 0.20.4 in both Cargo.toml files so the
bundled libgit2-sys version (0.18.3+1.9.2) properly aligns with the
1.9.2 version in use.
|
|
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.
|
|
- 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
|
|
- 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
|
|
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.
|
|
add additional test to cover this scenario
|
|
update patches ahead of wider upgrade. clippy required some autofixes
|
|
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.
|
|
following its inclusion in the NIP-34 spec
|
|
so we can use it in ngit as well as remote helper
|
|
as its now 'bring your own transport'
|
|
with trival breaking changes. nip05 changes will
be done seperately.
|
|
and show a more helpful message when proposal can be checked out
using the remote
|
|
to latest available and apply fmt fixes
|
|
required running:
`cargo fix --allow-dirty --allow-staged`
`cargo clippy --fix --allow-dirty -- -D warnings`
to fix problems
and then manually fixing some too
|
|
in prep for upgrade rust-nostr
|
|
to improve reliability
|
|
we have had some bugs related to git2 so moving to the latest version
|
|
only use custom port on specified protocol (ie. http, https or ssh)
ignore custom port on when trying other protocols
specify `ssh://` prefix when using custom port as otherwise it can
be ignored
|
|
update nix dependancies to latest version using default update options
run `cargo clippy --fix` and `cargo fmt` to fix new clippy errors
|
|
and fix all of the breaking changes
|
|
simplify to allow the removal of warning:
`#[allow(clippy::too_many_arguments)]`
|
|
If the user has NIP-05 set up in profile, and it resolves at the time
of running `ngit init`, NIP-05 will be used in the nostr remote url.
|
|
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`
|
|
improve the error message when fetching nip05 profile fails
|
|
prevent a panic when tags are of an unexpect length
|
|
property `user`, which refers to the ssh user to be used when
connecting to git remotes, was being parsed as the local section of
the nip05 address
|
|
so the user understands the cause of any delay if the domain takes
a while to respond
|
|
prioritise using nip05 nostr url format when the nip05, public key
mapping is stored in the (usually local) git config.
|
|
store all nip05s in a single git config item called "nostr.nip05"
using the `<nip05>:<hex-public-key>` format with multiple values
comma seperated.
git config is suposed to be human readable so it consideration was
given to storing the npub instead of hex but nip05 generally uses hex
and its rarely, if at all, going to be read directly by humans.
in the future it might be better to use git syntax for storing
multiple items but library git2 doesn't support this. it would be
trivial to do though. multiple nip05 items is an edge case so this
format is ok for now.
|
|
update tests to use the async `parse_and_resolve` instead of removed
`from_str` method
|
|
replace `NostrUrlDecoded::from_str` with
`NostrUrlDecoded::parse_and_resolve`
store nip05 pubkey mapping in git cache
|
|
previously fetch supported fetching multiple trusted coordinates at
once. The additional complexity trade off isn't worth it.
It will still fetch events related to the coordinates of maintainers
that the trusted maintainer lists.
A scenario where there might be multiple trusted coordinates is
where a large repo is split into multiple nostr repos to manage
pull requests and issues in seperate sub-units. I might therefore
have different remotes that target different identifiers.
There also might be different set of maintainers groups that are
have different views on the latest state of the same codebase and
they haven't split off into using different identifiers.
Its simplier ngit to fetch these different nostr repos independantly
when requested. git-remote-nostr will do this automatically as it
works through remotes but for ngit cmds a further change is required
so `get_repo_coordinates` and `try_and_get_repo_coordinates` prompts
to select the desired one.
|
|
check whether remote `origin` is nostr url and if not attempt
to set it.
|
|
use RelayUrl in repo_ref which I had resisted as it mutates relay
urls when printed to append a slash
|
|
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
|
|
* 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
|
|
bump all rust-nostr packages
refactoring code based on breaking changes
upgrading to patched version to address signer issue:
nostr:nevent1qvzqqqqqqypzq6xcz9jerqgqkldy8lpg7lglcyj4g3nwzy2cs6u70wejdaj7csnjqy88wumn8ghj7mn0wvhxcmmv9uqzpsw5ph8le2n2kh6uchftawt74hddazk9tp7wjmz967y2l0uva5rc7hsstq
|
|
bump all rust-nostr packages
|
|
as it would fail to save to local git config
|
|
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.
|
|
so they match v1.8.2 used in updated git2
|
|
if another protocol was tried first and failed
|
|
push needs to use push_transfer_progress rather than transfer_progress
|
|
to make it more like native git
|
|
which potentially were only identified when a dependancy was updated
|
|
so that it the filesystem url is shown
|
|
used in fetch and tweak the error reporting
|
|
abstract the protocols and order to try under different scenarios
add some additional scenarios eg hardcoded http
tweak error reporting
|
|
as they are easier to read
|
|
enable override from nostr url
clone url is local use local
otherwise try https unathenticated, ssh, then https authenticated
|
|
to enable remote to interact with git servers over a range of
specified protocols
|
|
as it should have been used in the first place
|
|
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
|
|
the make the code more readable
this commit just moves the files, the next commit should fix the imports
|