Commit Graph

57 Commits

Author SHA1 Message Date
Kiril Videlov
95e946b8a1
Remove unnecessary VirtualBranchActions struct 2024-09-06 14:12:14 +02:00
Mattias Granlund
0db82ea38c Replace all relevant occurrences of integration with workspace 2024-09-02 20:53:19 +03:00
Mattias Granlund
5f9c2e5832 Rename gitbutler/integration -> gitbutler/workspace 2024-09-02 20:53:19 +03:00
Sebastian Thiel
751e091f6f
Reuse the worktree-diff during 'recalulate-everything'
It's used for emission of changed files, but also for listing
branch information.

Make sure we only run the worktree-status once to save time.

This also unifies the acquisition of the `HEAD^{commit}`,
which one day will be a natural feature once `gix::Repository`
is used.
2024-08-28 21:42:29 +02:00
Caleb Owens
d2d3afbf2b
Added unstaged changes event 2024-08-27 13:05:07 +02:00
Caleb Owens
e0d7b56cb5 Provide current mode to frontend 2024-08-13 17:05:28 +02:00
Caleb Owens
c98421171e Introduce edit mode
asdf
2024-08-13 14:14:02 +02:00
Kiril Videlov
83679206cd
separate syncing of oplog from regular refs 2024-07-30 21:29:54 +02:00
Caleb Owens
4563ddb995
Fix gitbutler/integration nuking itself 2024-07-29 19:22:04 +02:00
Caleb Owens
742d6bc4d5 Use operating modes in watcher to decide whether to perform operations 2024-07-29 13:38:31 +02:00
Caleb Owens
21bad4f30f repo -> repository 2024-07-29 11:13:25 +02:00
Caleb Owens
f4569ff4da Yes Kiril, I know its an abrv., but its consistent with what Byron started 2024-07-29 10:46:17 +02:00
Caleb Owens
366ccfecdf Rename ProjectRepository to CommandContext 2024-07-29 10:43:18 +02:00
Sebastian Thiel
39099ba41c
run the nightly cargo fmt with pnpm fmt
This also optimizes imports/uses, which is done only occasionally.
2024-07-28 21:02:40 +02:00
Sebastian Thiel
9e236e3469
remove async except for in gitbutler-git
The reason is that it's unclear if maybe it's there for a good reason,
and I don't want to break the complex code in there.
2024-07-28 20:47:35 +02:00
Kiril Videlov
b7e2f60b89
remove references to virtual branch controller from event handler
After recent refactors, this state is useless
2024-07-20 13:44:03 +02:00
Sebastian Thiel
822fd92b9d
Enforce locking by making locks part of the public oplog API.
This way, all methods that care about the `oplog` also have to
care about choosing the right lock.
2024-07-15 21:09:33 +02:00
Sebastian Thiel
09ca2d0284
enforce in-process-synchronization during worktree updates and prolonged reads in oplog
That way it's assured that reads and writes don't intersect, but assure we only
hold such lock for the shortest amount of time for reads and and for the
full duration of writes.
2024-07-15 14:21:15 +02:00
Sebastian Thiel
4a7b63a56e
various refactors in main functions called during project load
* use `ctx` as name instead of `project_repository` to make lines shorter
  and more readable. This could be done everywhere once the type-name changes
  as well.
* Where possible, avoid using `&self` for `VirtualBranchActions` as there is no state.
  For now I avoided to remove its usage as field in the filesystem monitor.
* Use a more modern way to use state in `tauri` commands.
* Add the `Ext` suffix to what clearly is extension traits.
2024-07-14 21:32:55 +02:00
Mattias Granlund
f832e0b83a Fix double loading of things on open
- fetch event is already in use by front end for reloading
2024-07-12 01:30:04 +03:00
Kiril Videlov
c8658b9a23
rename gitbutler-virtual to gitbutler-branch-actions
This is to establish a patter of which crates represent a higher level logic
2024-07-10 14:49:48 +02:00
Kiril Videlov
ae6dc38ac7
rename virtual branches controller to actions 2024-07-10 12:11:36 +02:00
Sebastian Thiel
0b735b58f3
avoid proxying author-images in favor to letting the frontend do the caching (#4007)
The frontend should be better at this due to being a browser engine, which can naturally
handle slow network links and firewalls.

Caching should also be better and more consistent as cache-related headers are respected.

This should speed up display times of new branches significantly, ideally without blocking
the UI at all.
2024-07-09 21:24:23 +02:00
Kiril Videlov
db9d29b467
Rename ProjectRepo to ProjectRepository
This is casue some ppl dont like abbrevs
2024-07-09 13:45:04 +02:00
Kiril Videlov
989f27a0d6
move error module to it's own crate 2024-07-09 11:13:39 +02:00
Kiril Videlov
de200c8e20
move reference module from core to its own crate 2024-07-09 01:14:28 +02:00
Kiril Videlov
0c9c781bd5
Renaming crate gitbutler-branch to gitbutler-virtual
This is more descriptive to what logic lives inside. Further, this allows for splitting up the just branch bits in a separate crate (which is currently in gitbutler-core)
2024-07-08 20:56:00 +02:00
Kiril Videlov
83a1d4a1e5
extract user as its own crate out of core 2024-07-08 18:58:29 +02:00
Kiril Videlov
f042854b1c
combine the assets proxying implementaiton in one file
Now it's only used in one place
2024-07-08 18:23:51 +02:00
Kiril Videlov
e93896621f
move project module in a separate gitbutler-project crate 2024-07-08 15:33:26 +02:00
Kiril Videlov
e258710502
move ProjectRepo into its own crate
This type currently acts more or less like a command context that lives for the duration of the request. Regardless of if we wanna keep this pattern or not, separating it out helps us split up core
2024-07-08 13:23:03 +02:00
Kiril Videlov
66e8e8b91b
remove useless indirection when getting repo head 2024-07-07 23:24:45 +02:00
Kiril Videlov
ca2ffaac68
separate complex actions on Project repo in a separate trait 2024-07-07 22:28:27 +02:00
Kiril Videlov
143b3252a7
rename Repository type to ProjectRepo
Less misleading this way..
2024-07-07 22:09:45 +02:00
Kiril Videlov
c36f67f148
move oplog to its own crate
This protects us from cyclic dependencies. Unfortunatelly as part of this, i had to introduce the imp Project as trait implementations since now Project is foreign
2024-07-07 20:00:01 +02:00
Kiril Videlov
d456ba5e77
move cloud sync functionality to its own crate 2024-07-07 19:22:41 +02:00
Kiril Videlov
948c89e8be
move virtual outside of core 2024-07-07 15:51:07 +02:00
Kiril Videlov
7d078de52f
start moving virtual_branches to separate crate
We want to move towards having each functional domain in a separate crate. 
The main benefit of that for our project is that this will enforce a unidirectional dependency graph (i.e. no cycles).
Starting off with virutal_branches - a lot of the implementation is still in core (i.e. virtual.rs), that will be moved in a separate PR. 

Furthermore, the virtual branches controller (as well as virtual.rs) contain functions not directly related to branches (e.g. commit reordering etc). That will be furthe separate in a crate.
2024-07-07 13:32:35 +02:00
Kiril Videlov
dfd15dc821
remove unused function 2024-07-04 15:36:36 +02:00
Kiril Videlov
fe7f1167bf
virtua branches controller - rm deps on project controller 2024-07-04 15:26:10 +02: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
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
Kiril Videlov
4ae1847a28 remove core::git::Reference type 2024-06-02 19:03:03 +02:00
Sebastian Thiel
567a077582
simplify core::errors and remove all the cruft 2024-06-01 14:37:41 +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
Caleb Owens
0db12b5115 Don't pass references to project_id 2024-05-29 10:47:11 +02:00
Sebastian Thiel
b0e73e5c89
oplog review 2024-05-28 17:22:02 +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