Commit Graph

130 Commits

Author SHA1 Message Date
Kiril Videlov
6e8e6b7b9b
remote unneccesary borrow 2024-07-02 15:11:28 +02:00
Sebastian Thiel
de00e4f049
support global secrets (without namespace for build types) and provide commands in tauri crate
That way globals secrets can be used from the UI directly.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
7e7555567b
automatically delete empty passwords from the key store
The frontend uses this to invalidate the GitHub token, even though
it can also deal with `null`. Let's keep the keystore clean and
only keep entries that contain an actual password.

Note that the consumers, i.e. the frontend, handle an empty password
for the short time it's in memory.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
9da051b089
improve naming of tokens stored in the keychain: do not 'abuse' user field
Currently, the user is used as handle name, but instead, just name it
`GitButler`.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
fbfeba0637
auto-delete a user if its access token can't be found 2024-07-02 10:02:46 +02:00
Sebastian Thiel
ee5ff95649
Assure Sensitive fields can't be serialized
This does not only mean that they cannot be written to disk, but also
that extra work has to be done to serialize them over the wire.

This is very much by design, as they can be in structs that are
seemingly serializable and contain sensitive data, but they must
never actually be serialized.

For use in the UI, an extra type must be used that marks the secret
differently, for instance by field name.
2024-07-02 10:02:45 +02:00
Sebastian Thiel
929eb52224
auto-migrate secrets from user.json to their location in the keyring
This will also remove them from their plain-text location.

Further, when the secrets are required they will be obtained
specifically, instead of always having them at hand.

The frontend doesn't ever show these, but needs them, and
it now asks for them when it needs them.
2024-07-02 10:02:43 +02:00
Sebastian Thiel
f3e6c7ba94
Add the capability to store and retrieve secrets
This is a global facility without any state, and provides a simplified
interface to the `keyring` crate.
2024-07-02 10:01:44 +02:00
Caleb Owens
82c3987d45
Unapply to real branches (#4025)
* Don't return optional

* Rename get_integration_commiter

* Add a header to wip commit

* Stuff

* Unapply all branches

* Reorder code

* Fix one test

* Name resolution

* Fix two tests

* Fix another!

* wip

* Fix so many tests

* Fix unapply.rs tests

* Fix selected for changes tests

* Move unapplying logic to delete_branch method

* Remove unused and kinda borked cherry_commit code

* Fix the tests!!!!!

* Make apply_branch private

* Change handling of headers

* Improve order integrity

* Updated types and comments to convey more meaning
2024-07-01 14:13:52 +00:00
Kiril Videlov
b72f9c2199
move error marker out of virtual_branches mod
It's useful outside of it
2024-06-28 11:35:44 +02:00
Kiril Videlov
d17534d291
adds the ability to update the allow_rebasing flag on branches and fix tests 2024-06-26 10:23:31 +02:00
Kiril Videlov
03214dcaa1
introduce a new flag for branches determining if rebasing is allowed 2024-06-25 20:10:27 +02:00
Mattias Granlund
e499b8fdfd Remove timestamp_ms from Hunk
We are not using it, let's re-introduce if needed in the future.
2024-06-25 14:23:45 +03:00
Mattias Granlund
0ae5ded3ec Add test covering issue #4148 2024-06-25 13:09:21 +03:00
Mattias Granlund
e91634bcdb Move a couple of test utils to test_project.rs 2024-06-25 13:09:21 +03:00
Kiril Videlov
c15125833d
performance: creating an oplog entry does not save a workdir tree
We are already storing the virtual branch trees separately, and merging them together can be a slow operation if the index is large.
2024-06-11 13:21:51 +02:00
Sebastian Thiel
788958ee08
hide sensitive information from ever being debug-logged 2024-06-09 08:58:17 +02:00
Kiril Videlov
c0710a05e7
captrure update branch errors in snapshot 2024-06-08 22:31:23 +02:00
Kiril Videlov
9c56a5f040 remove proxy core::git::Oid 2024-06-05 22:56:03 +02:00
Kiril Videlov
4a54f74aa2 remove field access 2024-06-05 01:19:23 +02:00
Kiril Videlov
e63081c69d remove core::git::Repository shell type 2024-06-05 01:11:10 +02:00
Mattias Granlund
d0993b8acd Update updated_at timestamp after mutations
- also drops unnecessary `.context()` from most `vb_state.set_branch(...)` calls
2024-06-04 13:52:58 +02:00
Kiril Videlov
bc16fadcc5 move commit signing to git2 extension trait 2024-06-03 01:04:14 +02:00
Kiril Videlov
4ae1847a28 remove core::git::Reference type 2024-06-02 19:03:03 +02:00
Kiril Videlov
879a07da64 remove core::git::Index 2024-06-02 17:57:18 +02:00
Kiril Videlov
e18684fcdb remove the auto detect git flow
It was complex, buggy and slow
2024-06-02 15:48:15 +02:00
Kiril Videlov
5927ca4ac5 remove shell core::git::Config type 2024-06-02 14:26:09 +02:00
Kiril Videlov
1206a504c9 remote git::Remote shell type 2024-06-01 23:30:25 +02:00
Sebastian Thiel
567a077582
simplify core::errors and remove all the cruft 2024-06-01 14:37:41 +02:00
Sebastian Thiel
a10b19ed2c
reomve all thiserror based errors from controllers 2024-06-01 14:36:08 +02:00
Sebastian Thiel
f82d25741e
use Marker in place of Code::ProjectInvalid
That way, the frontend doesn't see internals.
2024-06-01 14:34:16 +02:00
Sebastian Thiel
e7c1d6033a
Remove all errors that don't trigger a custom code or context 2024-06-01 14:34:16 +02:00
Sebastian Thiel
c0fc0cfde5
Remove BranchNotFound struct 2024-06-01 14:34:16 +02:00
Sebastian Thiel
61a53c6346
Another pass at removing ProjectConflict
As this causes quite a lot of changes, there is this commit to capture them.
2024-06-01 14:34:13 +02:00
Sebastian Thiel
1dc52a44c0
restore detection of project conflicts
Previously that variant was removed even though we need it now to
easily detect this case.
2024-06-01 14:32:27 +02:00
Sebastian Thiel
20d84247e9
Prune Code to only what's used by the UI
Also adjust the `Code` documentation to clarify this - otherwise
we will have more and more variants and nobody actually cares.

The frontend code is adjusted as well, as its `Code` counterpart
contained unsused variants which are now removed.
2024-06-01 14:32:27 +02:00
Mattias Granlund
eeb99090ad Fix incorrect workspace_head during merge conflicts
- without this we get an incorrect diff
2024-05-30 12:09:27 +02:00
Kiril Videlov
62a3d02303 remove git::signature shell type 2024-05-29 23:51:26 +02:00
Sebastian Thiel
96dc9d2887
fix oplog-worktree merging 2024-05-29 17:58:54 +02:00
Kiril Videlov
45979b4c85 remove usage of git::Commit 2024-05-29 17:33:57 +02:00
Sebastian Thiel
1abb464845
Merge pull request #3885 from gitbutlerapp/rust-remote-tweaks-for-byron
Tweaks to remotes code
2024-05-29 15:13:02 +02:00
Kiril Videlov
be149a5569 remove git::Tree in favor of just git2::Tree 2024-05-29 14:30:59 +02:00
Kiril Videlov
9e4bbdedec remove unused reader functions 2024-05-29 14:04:51 +02:00
Caleb Owens
faa476875d Replace &BranchId to BranchId 2024-05-29 11:07:36 +02:00
Caleb Owens
0db12b5115 Don't pass references to project_id 2024-05-29 10:47:11 +02:00
Caleb Owens
6d1ed8474c rename fetch_from_target to fetch_from_remotes 2024-05-28 10:14:35 +02:00
Sebastian Thiel
b0e73e5c89
oplog review 2024-05-28 17:22:02 +02:00
Sebastian Thiel
590d713f91
use git2::Oid instead of String; various small refactors 2024-05-28 13:25:46 +02:00
Sebastian Thiel
e3156ba75c
remove single-use traits while leaving the structure as is 2024-05-28 13:25:46 +02:00
Sebastian Thiel
346c96869e
small refactors (see body for details)
- instrument snapshot creation to assure we see errors (which are ignored in code)
- move tests for public `entry` types into integration tests
- rename `OperationType` to `OperationKind` as it's more commmon in Rust
- Use `Copy` where possible
- streamline implementation: remove clones and allocations, without going zero-copy
- Prefer direct calls to traits to avoid `write!("{}")` just to invoke a trait fmt implementation
- avoid `pub` when `pub(crate)` will do
- strong type for created_at
2024-05-28 13:25:46 +02:00