Commit Graph

543 Commits

Author SHA1 Message Date
Kiril Videlov
6e8e6b7b9b
remote unneccesary borrow 2024-07-02 15:11:28 +02:00
Kiril Videlov
23503afd25
merge stuff 2024-07-02 15:05:56 +02:00
Kiril Videlov
25aceb2520
rm unnecessary borrows 2024-07-02 11:22:08 +03: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
b08a9e8cb1
Prevent MacOS popups each startup on MacOS
MacOS is the only known platform that exhibits this behaviour - if an app
is recompiled, the hash of the binary is used to identify it towards the keychain.
As this changes each time, the keychain will ask for permission, which is fair.

However, it's also an impediment which leads to the implementation of
a keystore that uses git credentials as backend. For this to work,
the latest version of `gitoxide` is required for now.
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
bc8f3b74c7
tauri specializes the secret-store depending on application type
That way, there is no overlap in the technically global store, just
like before when secrets were stored in plain text.
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
Sebastian Thiel
cedb893ad6
put 'core::serde' into its own module file
It started small, but now is large enough to warrant that.
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
b623952fdd
Merge pull request #4198 from gitbutlerapp/remove-print-tree-function
refactor: Remove unused _print_tree function.
2024-06-28 11:21:26 +02:00
Kiril Videlov
8ed324580c
refactor: Remove unused _print_tree function. 2024-06-28 11:10:27 +02:00
Kiril Videlov
251d56677d
refactor: move rebase functions out of virtual_branches module
This opens the doors for further simplifying the core
2024-06-28 11:04:15 +02:00
Sebastian Thiel
adc50a7e7f
more robust login handling by deleting corrupt user.json file
If a user.json file cannot be loaded, delete it automatically
to avoid users to get stuck in 'something went wrong' during layout.

Older versions of GB wouldn't find the access-token in the user.json file
anymore, which would be completely removed via #4165
2024-06-27 15:10:48 +02:00
Kiril Videlov
b886ff84f1
refactor: Remove rusqlite dependency and related code. 2024-06-26 16:21:24 +02:00
Kiril Videlov
3fb7f3b8bb
add the ability to toggle the allow rebasing flag for lanes in the UI 2024-06-26 13:53:13 +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
d4267b81d5
use per-branch flag to check if rebasing is allowed 2024-06-25 21:36:43 +02:00
Kiril Videlov
03214dcaa1
introduce a new flag for branches determining if rebasing is allowed 2024-06-25 20:10:27 +02:00
Kiril Videlov
d4ab41cef9
remove unused code 2024-06-25 14:50:17 +02:00
Kiril Videlov
e707bdd812
Merge pull request #4174 from gitbutlerapp/cool-with-submodules
cool with submodules
2024-06-25 13:35:05 +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
Kiril Videlov
70dc0b54f3
remove a restriction on adding repos with submodules 2024-06-25 13:23:08 +02:00
Kiril Videlov
e4897c467a
ignore submodules on oplog list submodules 2024-06-25 13:21:51 +02: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
Mattias Granlund
d12698abb5 Fix bug in hunk -> branch assignment
- return early on lock only if hunk matches or intersects
2024-06-24 23:11:39 +03:00
Kiril Videlov
64729a9a17
improve performance of workidir diff 2024-06-16 01:54:23 +02:00
Kiril Videlov
41c2ab5908
Merge pull request #4086 from gitbutlerapp/add-mempack-backend-reset-oops
feat: Add in-memory method to open temporary repository for comparing or getting diffs.
2024-06-15 21:49:15 +02:00
Kiril Videlov
be975b7038
refactor: Remove commented-out code for conflict handling in virtual branches. 2024-06-15 21:36:56 +02:00
Kiril Videlov
b01f35bf26
feat: Add in-memory method to open temporary repository for comparing or getting diffs. 2024-06-15 21:21:11 +02:00
Mattias Granlund
650a463a16 Fix empty commit marked as integrated
- we can't say an empty commit is integrated based on tree ids
2024-06-11 23:38:51 +02:00
Kiril Videlov
a5f3649654
remove repeat tree creation when history is being listed 2024-06-11 20:05:13 +02:00
Kiril Videlov
119107c12b
getting the snapshot diff uses workdir from applied vbranches 2024-06-11 19:51:36 +02:00
Kiril Videlov
8e8a0ffce7
list snapshots uses workdir tree from applied vbranches 2024-06-11 19:09:45 +02:00
Kiril Videlov
f36be87f8a
add the ability to get workdir tree from merging all applied virtual branches from a snapshot 2024-06-11 17:07:04 +02: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
Caleb Owens
a4f548e411
Diff the correct way round 2024-06-10 15:20:28 +02:00
Kiril Videlov
88e13bd89e
apply hunks in one go for submodules too 2024-06-10 11:23:36 +02:00
Kiril Videlov
ad48640347
set timeout of 2 sec when caching assets 2024-06-09 21:38:20 +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
Luke Carrier
c3242a5a5a fix: subs{ i => e }quently 2024-06-07 22:39:53 +01:00
Kiril Videlov
1e253b8a59 feat(project): enable new locking by default 2024-06-06 18:08:10 +02:00
Kiril Videlov
5922ed7459 remove error type core::git::Error 2024-06-06 16:49:33 +02:00