Sebastian Thiel
c81b140790
Assure the most-recent workspace head is used when emitting changed files.
...
The reason for this is that now the outcome of this can be re-used in `list_virtual_branches`,
which is sensitive to seeing the latest vbranch state which is not a given.
Calculating it makes sure there is no mismatch, and probably "can't be wrong".
Also note that `head_commit()` is still kept around as it's the idea to eventually
use it more.
2024-08-30 07:15:40 +02:00
Sebastian Thiel
a7b01bd641
Keep using get_workspace_head()
when no cached result is used.
...
That way, the application will not run into unexpected cases.
2024-08-29 09:34:54 +02:00
Sebastian Thiel
79798c7407
Exclude big files when performing a worktree diff.
...
This was lost previously when switching it over to a read-only
implementation.
Implementing it with an ignore list will take time, 400ms in the GitLab
repository, but it's not slower than it was before and it is always
preferred to not dump objects into the ODB unnecessarily.
2024-08-29 09:31:59 +02:00
Sebastian Thiel
a0e236110a
refactor
...
- move `gix` repository extension to where it belongs more naturally.
- make sure that `get_wd_tree()` is named more closely to what it really
does, and use it in more places.
2024-08-28 22:05:25 +02: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
Sebastian Thiel
7ce143954f
Do not dynamically calculate the head commit when listing virtual branches.
...
That way, the head is static which allows to re-use the worktree status across
multiple related calls.
Also, add a way to quickly get the `head_commit()` from a `git2::Repository`.
Note that this may cause breakage in the app, as now it will see the actual
head, not a computed one, but that should also help us to find places that
didn't properly update their state.
2024-08-28 21:16:43 +02:00
Sebastian Thiel
7e0878a14f
Use read-only worktree diff
...
The worktree diff is essentially a 'git status' with a given tree,
and that can be expressed with a diff of the workdir, the index and a tree.
This comes at the expense of not being able to control which file sizes are diffed.
2024-08-28 11:10:04 +02:00
Sebastian Thiel
dd724f310d
Also debug-trace information on list_virtual_branches
calls.
...
This can be useful for those who seek extra information, and while it's
dominating refresh times.
2024-08-28 11:09:33 +02:00
Kiril Videlov
06f50b4531
Merge branch 'master' into branch-stacking-first-stab
2024-08-27 14:13:08 +02:00
Kiril Videlov
b943c35293
code review fixes
2024-08-27 14:05:27 +02:00
Caleb Owens
3fb5077c4a
Somethign somethign matchy matchy design
2024-08-27 13:05:27 +02:00
Caleb Owens
d2d3afbf2b
Added unstaged changes event
2024-08-27 13:05:07 +02:00
Sebastian Thiel
06edec70cb
reuse the commit-graph between runs
...
This time, it contains whole commits and only flags are reset
between runs. With this amount of re-use, it will manage
to rival `git2`.
2024-08-27 12:17:54 +02:00
Sebastian Thiel
b081a115c8
Offload commit-walk to the commit-thread
...
That way, it can leverage already held commit-objects, and be faster
in the absence of a commitgraph.
2024-08-27 09:20:07 +02:00
Kiril Videlov
4b5a8d14ef
add commands for pushing change references
2024-08-26 21:38:40 +02:00
Kiril Videlov
cef701796d
update the create reference method to take change id
2024-08-26 20:49:01 +02:00
Sebastian Thiel
82aa2d1760
use gix
powered merge-base for performance and reduced memory consumption
2024-08-26 19:35:09 +02:00
Kiril Videlov
66257fba2f
rename reference module to change_reference
2024-08-26 19:15:58 +02:00
Kiril Videlov
89d1186b06
refactor this to be a ChangeReference
...
it turns out that a reference to a change_id is all that we need
2024-08-26 17:02:38 +02:00
Kiril Videlov
2ddb032ebf
show relevant commit refs if feature is toggled
2024-08-23 21:03:44 +02:00
Kiril Videlov
33e7d7b269
adds the ability to create branch refs from the UI
2024-08-23 18:07:24 +02:00
Sebastian Thiel
7ee0520ffb
Use latest rev_walk()
based API.
...
It's a bit more intuitive than `id().ancestors()` when coming from `git2`.
2024-08-23 13:08:37 +02:00
Caleb Owens
ec7a38f538
Merge pull request #4717 from gitbutlerapp/Rebase-revolution
...
Rebase revolution
2024-08-22 18:28:49 +02:00
Caleb Owens
893b3fc499
Use a default variant on enum
2024-08-22 18:04:11 +02:00
Caleb Owens
c987629262
Add project specific setting and refactor
2024-08-22 17:57:03 +02:00
Caleb Owens
0603fd7457
Sure up behaviour with blank commits and reordering
2024-08-22 15:15:23 +02:00
Mattias Granlund
8a741bcf2e
Delete entry from .toml file when branch is integrated
...
- virtual_branches.toml file was full of old entries
2024-08-22 13:46:55 +01:00
Sebastian Thiel
fcafaec2be
process merge-bases in the background
...
This way, only the first branch has to wait, all further branches will
likely have their merge-base already computed then.
2024-08-21 20:24:22 +02:00
Sebastian Thiel
bdd109047e
use latest gix
APIs for more convenience and increased readability.
2024-08-21 19:28:12 +02:00
Sebastian Thiel
e78ef9b115
enable max performance to be competitive in object database access.
...
This is very relevant for tree-diffing performance, and more could be tuned
here like pack-cache sizes and object cache sizes.
2024-08-21 19:28:12 +02:00
Sebastian Thiel
66c747e611
somewhat fix the ODB performance bottleneck with better caching.
2024-08-21 19:28:12 +02:00
Sebastian Thiel
a2382bde74
Use gix
to find branchs and get the local tracking branch
2024-08-21 19:28:12 +02:00
Sebastian Thiel
29ecbff318
Use gix
for tree-tree-diff
2024-08-21 19:28:12 +02:00
Sebastian Thiel
0db0f1a86a
Use gix
for simple ref-walk that won't go past the merge-base.
2024-08-21 19:28:12 +02:00
Sebastian Thiel
db600b48f9
add benchmark just for revwalking
2024-08-21 19:28:11 +02:00
Sebastian Thiel
42e4ab44f9
Make it more obvious where gitoxide
repositories are used.
2024-08-21 19:28:11 +02:00
Sebastian Thiel
7362bab7aa
Assure we can use different merge bases when showing branch details.
...
Alternatively, correct the assumption that there is a difference.
2024-08-21 19:28:11 +02:00
Sebastian Thiel
07dc9efe02
add tests for get_branch_listing_details()
2024-08-21 19:28:11 +02:00
Sebastian Thiel
e26bf2f54a
add benchmarks for branch details
2024-08-21 19:28:09 +02:00
Sebastian Thiel
96e0d3e83f
add --trace
to enable tracing
...
This is useful to get simple performance metrics.
2024-08-21 19:23:42 +02:00
Sebastian Thiel
77cbc50a68
branch listing and branch details for the CLI
2024-08-21 19:23:42 +02:00
Sebastian Thiel
d1fdcde139
minor refactor
2024-08-21 19:23:42 +02:00
Mattias Granlund
acf902c2e6
Fix applied -> in_workspace performance issue
...
- loop was taking > 1s for me
- my 8 branches (2 in workspace) were constantly being saved
2024-08-21 16:11:26 +01:00
Caleb Owens
ace6facb24
Getting behaviour locked in
2024-08-21 14:45:41 +02:00
Caleb Owens
e07b4b2d0d
Refactor some code
2024-08-20 10:51:34 +02:00
Caleb Owens
65fb462d64
Rebase revolution
...
Co-authored-by: Scott <schacon@gmail.com>
2024-08-19 18:10:28 +02:00
Caleb Owens
7ab7731a31
Add edit mode actions
...
More edit mode
2024-08-19 11:03:51 +02:00
Mattias Granlund
4fe8b6860f
Fix branch name deduplication
...
- do not include name of branch being updated when deduping
2024-08-16 15:16:40 +02:00
Kiril Videlov
74c8bce48d
add BranchReference type to the Branch persisted struct
...
This allows (virtual) branches to keep track of associated references
2024-08-10 21:35:40 +02:00
Sebastian Thiel
b92407a5df
branch-listing benchmarks now work again
...
They type system is more strict now, rejecting an invalid branch name outright.
2024-08-09 21:53:42 +02:00