Commit Graph

70 Commits

Author SHA1 Message Date
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
Kiril Videlov
d164457299 update_base_branch returns unapplied branches list
If merge conflicts caused branches to become unapplied, return them as a list
2024-06-01 13:11:53 +02:00
Ani Betts
035736a245
Fix the test paths 2024-05-31 15:27:16 +02:00
Ani Betts
4363f0fcc4
Leave these exports here in case we need them later 2024-05-31 15:27:16 +02:00
Ani Betts
73ab4bdd90
First hack at readding the tests 2024-05-31 15:27:16 +02:00
Ani Betts
3e34a92634
Chill out some of these logs 2024-05-31 15:27:16 +02:00
Ani Betts
bc31c65fc3
Let's just get it working 2024-05-31 15:27:16 +02:00
Ani Betts
2b3690308c
Roll back to v0.3.1 + flush changes 2024-05-31 15:27:15 +02:00
Kiril Videlov
2e788de86f
Revert "fix: performance issue " 2024-05-30 20:10:23 +02:00
Kiril Videlov
e6f75dae0f fix: performance issue
this is an undo of cdf508e04c
2024-05-30 19:35:10 +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
Kiril Videlov
762bb31dea first stab at resurecting git sync 2024-05-25 23:07:40 +02:00
Sebastian Thiel
e68b789a32
remove unused methods in FileId map, and revert to what seemed functional.
Previously, roots were always empty and it was unclear what the purpose
of the customization was.

It's probably best to re-add it along with a test maybe.
2024-05-24 16:21:26 +02:00
Sebastian Thiel
cdf508e04c
Show what changed to get the version we currently have
This reverts commit 547f2ffada.

That way it's more obvious when looking at the history what was added
and changed.
2024-05-24 15:44:13 +02:00
Sebastian Thiel
547f2ffada
re-add original code to see what changed 2024-05-24 15:42:17 +02:00
Sebastian Thiel
6596f3956e
adapt debouncer tests with the changed codebase 2024-05-24 15:38:46 +02:00
Sebastian Thiel
edd8d54950
copy tests from notify-debouncer-full as well (verbatim)
While at it, remove the docs as they are referring to the original source code.
Tests should help to understand how it is supposed to work.

Note that the copy is verbatim and modifications will happen in a separate commit,
along with the necessary license declarations.
2024-05-24 13:50:03 +02:00
Sebastian Thiel
86edb4627d
reorganize watcher modules for more consistency 2024-05-24 13:28:34 +02:00
Sebastian Thiel
80b9598d5a
remove (some) unused code; minor refactor 2024-05-24 13:28:33 +02:00
Sebastian Thiel
2080b62864
add license for code taken from notify-debouncer-full 2024-05-24 13:19:37 +02:00
Sebastian Thiel
5906eb1a35
change debounce-events to trace so they don't dominate the log
Ideally it's usable even in debug mode.
2024-05-24 12:41:26 +02:00
Kiril Videlov
db4bb914cc improve auto snapshotting check performance 2024-05-23 22:17:46 +02:00
Sebastian Thiel
850045e9d3
Allow to watch multiple directories in case of special setups
Like worktrees - these could work now from a watchers perspective.
2024-05-23 13:04:02 +02:00
Sebastian Thiel
9ad010bd0f
Assure we fail gracefully git-dir and worktree-dir are unusual
This could be supported, but would require more changes to get right.
For now, fail gracefully instead of failing strangely because we don't
watch everything that needs watching.
2024-05-23 12:55:45 +02:00
Sebastian Thiel
05118086dd
Use gitoxide in file-watcher
This allows for faster opening times, and more more efficient
exclude checks.
2024-05-23 11:13:56 +02:00
Sebastian Thiel
a83e6809ab
Only open a repository when project-files are involved.
There are many filesystem events that are not touching files which
could be ignored.
Now we detect this case in advance and only open the project repository
if we know there are files to check for their ignore state.

That way, there should overall be less IO, which is good for performance
particularly on Windows.
2024-05-23 10:50:38 +02:00
Ani Betts
f54c12fd55
Halve the dead air time 2024-05-21 11:03:18 +02:00
Ani Betts
12143b0a54
Embrace your Chill, cargo 2024-05-21 10:39:00 +02:00
Ani Betts
b4b0de6a3c
Merge remote-tracking branch 'upstream/master' into flushable-debounce
* upstream/master: (85 commits)
  History and minor UI fixes (#3797)
  History fixes (#3796)
  make GitGuardian happy
  bump playwright version
  add vitest exclude for node_modules
  Remove unused exports from ipc
  Update auth.ts to use absolute import
  Use correct invoke function
  setup for async tasks on oplog update
  formatting
  save and restore the gitbutler/integration branch
  remove unneccessary CSPs
  Fix ollama request security
  fix: forgot the port
  feat: Set default snapshot lines threshold to 20 when undefined
  fix: Updated connect-src to allow local connections for ollama
  Minor tweaks to CSS and use real branch name
  Unmount history component when hidden
  Fix bug leaving PR button visible
  Small refactor of history component
  ...
2024-05-21 10:29:42 +02:00
Kiril Videlov
662a62c2f2 setup for async tasks on oplog update
As we start building out code collaboration we wanna have the ability to push gitbutler state to, when enabled
2024-05-19 15:53:27 +02:00
Ani Betts
2ff2b1f7ec
Format 2024-05-15 20:27:26 +02:00
Ani Betts
e9cd5d3dca
Rewrite the timeouts
Change the strategy of how timeouts work, from a simple timer, to
something a bit more nuanced
2024-05-15 20:27:26 +02:00
Ani Betts
326e9fee02
Wire flushing into the Watcher
Give the main window a mechanism to flush pending changes via a Channel
2024-05-15 20:27:26 +02:00
Ani Betts
28de8135d2
Add a new mechanism to flush on "idle"
Optionally, if we detect that no change notifications have appeared for
a certain number of ticks, we will automatically flush pending
notifications
2024-05-15 20:27:26 +02:00
Ani Betts
1c3d8d3997
Allow events to be explicitly flushed
This adds a new method to allow us to explicitly flush pending change
notifications
2024-05-15 20:27:25 +02:00
Ani Betts
fe35b1f65f
Import notify_debounce_full
We need to make some changes to notify_debounce_full and it seems like
the project is unmaintained, let's copy-paste some code
2024-05-15 20:27:25 +02:00
Kiril Videlov
62dadd96a8
remove unused index subscription 2024-05-13 14:18:56 +02:00
Kiril Videlov
91e48c6730
remove sessions/deltas unused tauri events 2024-05-12 03:24:36 +02:00
Kiril Videlov
3eaaccc2e0
remove deltas calculation on file change
This is being replaced by the new `ops` module

Along with the respective tests. There were only session/deletas related assertions in the watcher tests
2024-05-12 02:54:19 +02:00
Kiril Videlov
d51761a654 remove unused flush event 2024-05-12 02:22:05 +02:00
Kiril Videlov
18cf10a143
remove unused fetch_gb_data 2024-05-12 02:13:02 +02:00
Kiril Videlov
bca8e13dfb
remove unused push_gb_data 2024-05-12 02:05:07 +02:00
Kiril Videlov
903991eea7
use default snapshot_lines_threshold 2024-05-08 02:58:30 +02:00
Kiril Videlov
93d5e61530 rename module snapshots to ops 2024-05-08 00:29:38 +02:00
Kiril Videlov
2c065a602e rename module of oplog trait 2024-05-08 00:29:38 +02:00
Josh Junon
dce8ead62f
use simpler virtual branch handle fetch in tests (and fix strange uncaught compilation error) 2024-05-06 20:22:40 +02:00