Sebastian Thiel
ebf693e667
prevent unnecessary copies in Hunk::with_*
methods
2024-04-21 11:35:25 +02:00
Sebastian Thiel
9e11127356
don't assume UTF8 encoding in commit message
...
Instead, fail gracefully by displaying fill-characters.
Ideally, we would be able to use the commit-encoding header field as well,
but one step at a time.
2024-04-21 11:35:25 +02:00
Sebastian Thiel
188fc2d5f1
Make sure UI types use strings instead of BString
...
Otherwise the frontend will see a byte-representation, and fails to operate
on the data.
2024-04-21 11:35:25 +02:00
Sebastian Thiel
27714d8e0d
Adjust GitHunk
to not require UTF8 for diffs
...
This will make the diffing engine more correct overall, as only for
display there will be a potentially lossy conversion.
This will also prevent it to be considered binary even though it is not.
2024-04-21 11:35:25 +02:00
Kiril Videlov
0fea544cd7
rm gb_repository from controller
2024-04-21 09:26:34 +02:00
Kiril Videlov
ee62577012
remove gb_repository from remote
2024-04-21 09:16:14 +02:00
Kiril Videlov
9ca847b2a3
remove gb_repository from base
2024-04-21 09:10:37 +02:00
Kiril Videlov
b8fcddb945
remove unused feature flag function
2024-04-20 10:32:49 +02:00
Sebastian Thiel
56d0943962
refactor
...
- don't convert paths to strings and use a set for membership checks
2024-04-20 09:10:11 +02:00
Sebastian Thiel
6e0706b6ef
Use the new worktree specific listing function ( #3552 )
...
It respects git excludes during traversal, which should also speed it
up when facing ignored direectories with many files.
2024-04-20 09:09:02 +02:00
Sebastian Thiel
cf81401b5a
add a function for worktree file listings specifically
...
This introduces `gix` to the codebase and uses it selectively
to traverse a worktree while respecting git excludes.
2024-04-20 09:07:17 +02:00
Kiril Videlov
69b048321e
Merge pull request #3564 from gitbutlerapp/update-virtual-branch-handles
...
update-virtual-branch-handles
2024-04-20 00:59:55 +02:00
Kiril Videlov
543e85dcfb
fix clippy
2024-04-20 00:47:42 +02:00
Kiril Videlov
118af702da
add some docs
2024-04-20 00:47:07 +02:00
Kiril Videlov
f95790f2fa
remove unused function on VirtualBranchesHandle
2024-04-20 00:46:58 +02:00
Kiril Videlov
72398719bc
rm test command
2024-04-20 00:38:18 +02:00
Kiril Videlov
6334336e7b
remove branch reader / writer
2024-04-19 23:48:11 +02:00
Kiril Videlov
86fe1e2735
remove target reader / writer
2024-04-19 23:29:13 +02:00
Kiril Videlov
e485566a2a
remove unused import
2024-04-19 22:57:05 +02:00
Kiril Videlov
0dccc5634a
rm gb_repository from create_virtual_branch_from_branch
2024-04-19 22:56:07 +02:00
Kiril Videlov
8fba308e43
rm gb_repository from move_commit
2024-04-19 22:55:35 +02:00
Kiril Videlov
a35ced3826
rm gb_repository from update_commit_message
2024-04-19 22:54:54 +02:00
Kiril Videlov
7aa574d5a0
rm gb_repository from squash
2024-04-19 22:54:13 +02:00
Kiril Videlov
953221b499
rm gb_repository from cherry_pick
2024-04-19 22:53:38 +02:00
Kiril Videlov
9b049271b7
rm gb_repository from amend
2024-04-19 22:52:58 +02:00
Kiril Videlov
01100a5407
rm gb_repository from commit
2024-04-19 22:52:17 +02:00
Kiril Videlov
a7219d38f2
rm gb_repository from reset_branch
2024-04-19 22:51:07 +02:00
Kiril Videlov
b6c6159b1b
rm gb_repository from delete_branch
2024-04-19 22:50:31 +02:00
Kiril Videlov
f1cee4bf11
rm gb_repository from merge_virtual_branch_upstream
2024-04-19 22:49:53 +02:00
Kiril Videlov
eb1c0ca721
rm gb_repository from list_virtual_branches
2024-04-19 22:48:43 +02:00
Kiril Videlov
1240177dcf
rm gb_repository from unapply_branch
2024-04-19 22:47:13 +02:00
Kiril Videlov
749cde0112
rm gb_repository from unapply_ownership
2024-04-19 22:45:33 +02:00
Kiril Videlov
45c1342a53
rm gb_repository from apply_branch
2024-04-19 22:44:42 +02:00
Kiril Videlov
21fdfb4272
rm gb_repository from go_back_to_integration
2024-04-19 22:43:26 +02:00
Kiril Videlov
676fb0e8fa
rm gb_repository from update_gitbutler_integration
2024-04-19 22:39:46 +02:00
Kiril Videlov
b77818c31e
rm gb_repository from update_branch
2024-04-19 22:23:24 +02:00
Kiril Videlov
b1c6af328e
rm gb_repository from get_status_by_branch
2024-04-19 22:18:35 +02:00
Kiril Videlov
954f960f1b
rm gb_repository from get_applied_status
2024-04-19 22:15:39 +02:00
Kiril Videlov
81f3cf47e3
rm gb_repository from push
2024-04-19 22:14:00 +02:00
Kiril Videlov
6dc51f4d12
rm gb_repository from is_remote_branch_mergeable
2024-04-19 22:12:37 +02:00
Kiril Videlov
2e1c46c0a6
rm gb_repository from is_virtual_branch_mergeable
2024-04-19 22:11:30 +02:00
Kiril Videlov
67a8d03254
rm gb_repository from verify branch
2024-04-19 22:09:28 +02:00
Kiril Videlov
6853f0859e
rm gb_repository param from create_virtual_branch
2024-04-19 22:05:33 +02:00
Kiril Videlov
e82483fb88
get_branch_target returns default on not found
...
Matching the previous semantics
2024-04-19 21:54:24 +02:00
Kiril Videlov
d57cba4d31
migrate base to VirtualBranchState
2024-04-19 21:41:22 +02:00
Kiril Videlov
2c5465639c
migrate repository to VirtualBranchState
2024-04-19 21:40:33 +02:00
Kiril Videlov
c152060cbf
migrate virtual_branches to VirtualBranchState
2024-04-19 21:39:33 +02:00
Kiril Videlov
098e80d484
migrate integration to VirtualBranchesHandle
2024-04-19 20:19:19 +02:00
Kiril Videlov
44faf660c3
separate list_branches and list_branch_ids
2024-04-19 19:53:32 +02:00
Kiril Videlov
4f43d075ee
migrate controller to VirtualBranchesHandle
2024-04-19 19:13:55 +02:00
Kiril Videlov
6383cd0d59
match VirtualBranchesHandle interface with readers
2024-04-19 19:12:44 +02:00
Kiril Videlov
0c11a0efcb
use toml vbranch state by default
2024-04-18 13:12:39 +02:00
Kiril Videlov
fdee7abe0b
remove unused show_file_at_tree
2024-04-18 12:12:28 +02:00
Sebastian Thiel
5d9e593887
refactor
...
- add note related to negative pathspecs and performance implication of the current impl.
- deduplicate code for readability
2024-04-18 11:06:38 +02:00
Sebastian Thiel
ccbe8fd738
improved error message when worktrees are encountered upon project-add ( #3062 )
...
Note that this is a first step towards making worktree support possible.
2024-04-17 18:37:20 +02:00
Kiril Videlov
044f427810
rm functions for adding context lines to hunks
2024-04-17 07:23:34 +02:00
Kiril Videlov
45361df57c
rm use_diff_context feature flag from project
2024-04-17 07:17:36 +02:00
Kiril Videlov
6f0fe2afa9
rm uses_diff_context from list vbranches return
2024-04-17 07:14:43 +02:00
Kiril Videlov
0d296bf9f0
remove functions for adding context lines
2024-04-17 07:02:39 +02:00
Kiril Videlov
993c7109b0
remove unused context_lines option struct
2024-04-17 07:00:19 +02:00
Kiril Videlov
0c331ee86a
remove context_lines parameters
2024-04-17 06:59:13 +02:00
Kiril Videlov
15458cb25f
remove use of diff_context feature flag
2024-04-17 06:52:08 +02:00
Kiril Videlov
17ae8eb119
fix clippy warning
2024-04-16 19:11:42 +02:00
daniilS
e12e741c2e
Fix typos in "conflict" in error message, comments, and a variable name
2024-04-16 15:40:14 +01:00
Sebastian Thiel
980d5907f9
Attach more information in case diffy::apply() fails ( #3451 )
...
It's made in such a way that strings aren't included, but hashed
to allow a little more insight than would otherwise be possible.
2024-04-16 15:28:14 +01:00
Mattias Granlund
2c7079497b
Refactor test for hunk intersection fn
...
Previous implementation of `joined` would fail this test:
```
st virtual_branches::r#virtual::tests::joined_test ... FAILED
at crates/gitbutler-core/src/virtual_branches/virtual.rs:4139:9:
assertion failed: joined(2, 3, 1, 4)
```
2024-04-16 13:26:28 +01:00
Mattias Granlund
1092d50ddd
Fix hunk locking when default target is different from locked_to
2024-04-16 10:55:17 +01:00
Mattias Granlund
e88d6f990a
Fix things that broke tests
...
- also fixes a few incorrect test assertions
2024-04-16 00:09:04 +02:00
Mattias Granlund
f22b824d41
Rename uncommitted_base -> integration_commit
2024-04-16 00:09:04 +02:00
Mattias Granlund
3005c06729
Include context lines in hunk hash
...
- git also uses context lines for identification when applying patches
2024-04-16 00:09:04 +02:00
Mattias Granlund
f4750762ed
Fix unapply_hunk with uncommitted_branch
...
- should have been fixed with the other commands
2024-04-16 00:09:04 +02:00
Mattias Granlund
918b78048d
Remove no-op function calculate_uncommitted_diffs
...
- seems like it goes full circle and produces its own input?
- should be investigated still
2024-04-16 00:09:04 +02:00
Mattias Granlund
6b412b1f47
Use uncommitted_base
in rest of amend, cherry_pick, etc
2024-04-16 00:09:04 +02:00
Mattias Granlund
c390c8a344
Use ucommitted base in commit
as well
2024-04-16 00:09:04 +02:00
Mattias Granlund
b85c7e39ad
Fix improper base when calculating virtual branches
...
- no need to deal with hunks that are already committed
2024-04-16 00:09:04 +02:00
Sebastian Thiel
e2ef2dc721
Only watch a single project at a time.
...
Previously it would watch every registered project, which could incur more work
on all parts of the application than necessary.
Now UI sends an event that indicates which project is active, allowing the
watch to be setup in that very moment. It's worth noting that the previously
watched project is automatically deregistered.
2024-04-15 07:19:15 +02:00
Sebastian Thiel
2e969d1507
collect filemonitor events into lists to avoid excessive recomputation.
...
Previously, each file change both in `.git` as well as in the worktree would
cause a complete recomputation. This computation included opening a git
repository at least once (probaby more often), to make an 'is-ignored' check.
The latter is very expensive in `git2` and gets more expensive the more
files there are.
Now the repository is opened when needed, and we re-use it for all applicable
file paths.
2024-04-15 07:11:16 +02:00
Sebastian Thiel
2eaba14819
dissolve the event queue in favor of method calls
...
The idea is that we don't parallelize over a channel anymore, but
instead just process filesystem events, one at a time.
This would allow each handler to become a function that gets its
state passed, and makes all the necessary calls verbatim, which
in turn makes it easy to follow what's happening.
If anything becomes to slow due to the serialization of event processing,
selective parallelization can be re-added.
2024-04-15 07:11:09 +02:00
Sebastian Thiel
3902bb9b2d
de-objectify all sub-handlers
...
Sub-Handlers are objects, and with that comes a lot of complexity.
However, there seems to be on need for it at all, and a first
steps is to turn these into methods to truly understand
what's going on.
2024-04-13 23:09:17 +02:00
Josh Junon
b818ce485b
Merge pull request #3463 from gitbutlerapp/revert-3448-remove-clippy-alloweds
...
Revert "Remove unused (?) allow clippy statements"
2024-04-12 18:05:54 +02:00
Josh Junon
db519a4eee
only allow systemexecutable on windows
2024-04-11 12:38:02 +02:00
Josh Junon
8e4ed63a07
Revert "Remove unused (?) allow clippy statements"
...
This reverts commit 7ee778a0eb
.
2024-04-09 14:50:31 +02:00
Toby Webb
7ee778a0eb
Remove unused (?) allow clippy statements
2024-04-09 12:52:09 +02:00
Josh Junon
4d78be2d95
fix clippy lints from toolchain update
2024-04-04 12:37:52 +02:00
Sebastian Thiel
91a6a3a879
doc: add information on how to use the new error types, and what to consider.
2024-04-01 17:41:31 +02:00
Sebastian Thiel
2aaacdfca7
chore: remove legacy error in favor of new error system
2024-04-01 17:33:14 +02:00
Sebastian Thiel
d0db6a67df
use the new 'app' error type everywhere
2024-04-01 16:19:09 +02:00
Sebastian Thiel
eba6bc1cef
feat: add error::Code
and ways to attach them in anyhow.
2024-04-01 16:14:34 +02:00
Sebastian Thiel
136a998623
chore: cleanup core::error
and app::error
...
* Remove `app` specific portions in core that were unused.
* Remove unused error-context and sentry integration which was unused everywhere.
2024-04-01 16:14:34 +02:00
Kiril Videlov
d94542d0c7
if use_state_handle enabled get state from toml
2024-04-01 00:21:07 +02:00
Kiril Videlov
a1bd1fafea
adds list branches & check file exists for vb state handle
2024-04-01 00:20:11 +02:00
Kiril Videlov
7a4dc32ba7
add toml state to branch and target readers
...
This allows reading to happen from either the meta git repo or the toml file
2024-03-31 23:07:44 +02:00
Kiril Videlov
a57ba4c683
add feature flag for reading vbs from toml
2024-03-31 22:21:04 +02:00
Kiril Videlov
de181f2107
refactor: move VirtualBranchesHandle construction out of branch reader/writer
...
When the migration is complete there will be no branch/target reader/writer. For now, inject the handle
2024-03-30 23:56:33 +01:00
Sebastian Thiel
72291ce4cb
chore: align 'app' and 'lib' crates imports.
...
This is done one-time (for now) using a nightly feature of cargo-fmt
as defined in `rustfmt-nightly.toml.`
It's planned to make this the default so imports will always be sorted.
For now it can be run manually with:
cargo +nightly fmt -- --config-path rustfmt-nightly.toml
or
pnpm rustfmtTBD
Please enter the message for your patch. Lines starting with
2024-03-30 22:43:16 +01:00
Sebastian Thiel
26c39f2a3f
chore: move library from top-level to gitbutler-core
...
This better expresses what it does, and leaves the `gitbutler-app`
in the top-level where it can serve as visible entrypoint.
2024-03-30 22:39:21 +01:00