Sebastian Thiel
f59268fb25
Allow local overrides for the target triple of production windows builds.
...
The use-case is somewhat specific as it allows developers to do:
```
export TRIPLE_OVERRIDE=x86_64-pc-windows-msvc
```
and build the binary as x86 even on an ARM VM.
The reason ARM builds don't work natively is the `win32` crate,
which simply doesn't work there.
It could be another step to replace it with something that does
to get ARM builds, but probably that will only happen once
there is demand for native ARM windows builds.
2024-05-25 15:05:43 +02:00
Sebastian Thiel
a176bf04cf
remove Windows experiment ( #3601 )
...
The sync-all didn't do anything, and one would still run into locked
files.
2024-05-25 09:10:11 +02:00
Sebastian Thiel
9245e3458f
now_since_unix_epoch_ms
now uses negative dates for times pre Unix-epoch
2024-05-25 07:45:18 +02:00
Sebastian Thiel
2ed708b298
remove chrono which was only used for 'now in milliseconds, relative to UNIX epoch'
2024-05-24 21:38:11 +02:00
Kiril Videlov
623500a25e
remove unsed branch from implementation
2024-05-24 20:29:31 +02:00
Kiril Videlov
319550d7b5
Merge pull request #3850 from Byron/review-and-refactor
...
Watcher adjustments
2024-05-24 16:38:18 +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
Caleb Owens
4cae28668b
Merge branch 'master' into revert-3830-core-util-duration-updates
2024-05-24 14:20:55 +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
Caleb Owens
42a7c8bce4
Update Oplog State to better use SystemTime
2024-05-24 12:09:15 +02:00
Kiril Videlov
2ecee6df21
Merge pull request #3846 from gitbutlerapp/sc-fix-rebase-issue
...
Return the merge result in the case the rebase bails
2024-05-24 11:02:33 +02:00
Caleb Owens
5d723f1d91
Update comment to accuratly reflect data stored
2024-05-24 10:46:47 +02:00
Scott Chacon
c58719b77d
oops.
2024-05-24 10:45:54 +02:00
Kiril Videlov
9db262936c
Merge pull request #3845 from gitbutlerapp/update-base-branch-anyhow
...
feat: Update base branch handling to use anyhow
2024-05-24 10:44:54 +02:00
Caleb Owens
b8a1dcb2f0
Revert "Replace integer timestamps with Duration"
2024-05-24 09:40:52 +01:00
Scott Chacon
757a4690ca
return the merge result in the case the rebase bails
2024-05-24 10:38:48 +02:00
Kiril Videlov
d5ff348a21
feat: Update base branch handling to use anyhow
2024-05-24 10:31:43 +02:00
Kiril Videlov
3749bcef51
snapshot before comitting is done in two steps now
...
this way we have the commit id
2024-05-24 00:35:31 +02:00
Kiril Videlov
d25cd4535e
prepare a snapshot before restoring from a snapshot instead of after
2024-05-24 00:23:34 +02:00
Kiril Videlov
3fef7b5474
support creating snapshots in 2 steps - prepare and commit
...
This allows us to create a snapshot (write the full trees state) first, perform some operations, i.e. the action taken by the user, and then finally commit the oplog.
In some cases we wanna skip comitting the oplog entry if the action done by the user fails. In some cases we might wanna save the error value as snapshot metadata.
2024-05-24 00:16:40 +02:00
Kiril Videlov
879005ae20
check lines since snapshot for all dirty branches
...
This is needed because new changes to a file may be locked to a branch which is not the "default" one
2024-05-23 22:37:10 +02:00
Kiril Videlov
db4bb914cc
improve auto snapshotting check performance
2024-05-23 22:17:46 +02:00
Kiril Videlov
c2a5014ed0
oplog state persists timestamp of last snapshot
2024-05-23 22:17:46 +02:00
Mattias Granlund
3096a23098
run cargo fmt
2024-05-23 15:59:43 +02:00
Scott Chacon
6ccb52bd63
whoops
2024-05-23 15:59:43 +02:00
Scott Chacon
7d6c36f4de
refactor: Replace manual rebase with cherry-rebase function.
2024-05-23 15:59:43 +02:00
Caleb Owens
983b2a3101
Merged origin/master into core-util-duration-updates
2024-05-23 14:26:28 +02:00
Caleb Owens
c2a1f6a7e7
Fix various tests
2024-05-23 14:26:16 +02:00
Kiril Videlov
2339be4551
Merge pull request #3827 from Byron/watcher-performance
2024-05-23 14:10:04 +02:00
Caleb Owens
d6cde8d722
Update comment to no longer say seconds
2024-05-23 14:09:27 +02:00
Caleb Owens
b81151c77d
Rename serializer
2024-05-23 14:09:20 +02:00
Caleb Owens
4a7e5f48dd
Merge origin/master into core-util-duration-updates
2024-05-23 14:04:54 +02:00
Caleb Owens
d55260c96a
Use Duration rather than various integer times for time
2024-05-23 14:02:48 +02:00
Kiril Videlov
c7aaa1a6b6
fix oplog test
2024-05-23 13:40:53 +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
Kiril Videlov
1312813051
move snapshot MoveCommit before the operation
2024-05-23 11:59:26 +02:00
Kiril Videlov
55da2e550e
move snapshot UpdateCommitMessage before the operation
2024-05-23 11:58:13 +02:00
Kiril Videlov
7ab0bbb989
move snapshot SquashCommit before the operation
2024-05-23 11:57:34 +02:00
Kiril Videlov
72cdec8c93
move snapshot CherryPick before the operation
2024-05-23 11:56:52 +02:00
Kiril Videlov
e0584534e5
move snapshot UndoCommit before the operation
2024-05-23 11:54:46 +02:00
Kiril Videlov
05039a2bbb
move snapshot ReorderCommit before the operation
2024-05-23 11:54:03 +02:00
Kiril Videlov
ff04bc0a59
move snapshot InsertBlankCommit before the operation
2024-05-23 11:53:16 +02:00
Kiril Videlov
168a218ebe
move snapshot MoveCommitFile before the operation
2024-05-23 11:52:27 +02:00
Kiril Videlov
f514ec752c
move snapshot AmendCommit before the operation
2024-05-23 11:51:18 +02:00
Kiril Videlov
7944fb4558
move snapshot DiscardFile before the operation
2024-05-23 11:50:34 +02:00
Kiril Videlov
6574a805a8
move snapshot DiscardHunk before the operation
2024-05-23 11:50:06 +02:00
Kiril Videlov
a418f22e23
move snapshot UpdateWorkspaceBase before the operation
2024-05-23 11:49:34 +02:00
Kiril Videlov
f94ff8fd41
move snapshot MergeUpstream to before the operation
2024-05-23 11:48:56 +02:00
Kiril Videlov
a65aec6054
move snapshot SetBaseBranch to before the operation
2024-05-23 11:48:00 +02:00
Kiril Videlov
4092464be4
move snapshot UndoCommit to before the operation
2024-05-23 11:46:52 +02:00
Kiril Videlov
77e01b5928
move snapshot CreateCommit to before the operation
2024-05-23 11:45:14 +02:00
Kiril Videlov
89fb842701
move snapshot UpdateBranch to before the operation
2024-05-23 11:39:23 +02:00
Kiril Videlov
753cc02a37
move snapshot UnapplyBranch to before the operation
2024-05-23 11:27:24 +02:00
Kiril Videlov
ea5f8e8dad
move snapshot CreateBranch to before the operation
2024-05-23 11:23:37 +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
Kiril Videlov
7bd3548030
move snapshot DeleteBranch to before the operation
2024-05-23 11:12:33 +02:00
Kiril Videlov
4e234d6b5c
move snapshot ApplyBranch before the operation
2024-05-23 11:07:30 +02:00
Mattias Granlund
2b33b79d48
Fix lint
2024-05-23 10:58:59 +02:00
Mattias Granlund
021180d8f1
Rename function
2024-05-23 10:58:59 +02:00
Mattias Granlund
af4833f091
Fix a few bugs
2024-05-23 10:58:59 +02:00
Mattias Granlund
cd419eca67
Refactor how we merge in commits from branch upstream
...
- send change_id to frontend for `RemoteCommit`
- split up massive function into three
- add a couple of checks to prevent unexpected state
- rebase if force push allowed (needs toggle)
2024-05-23 10:58:59 +02:00
Mattias Granlund
ed14ddf378
Simplify function with ? shorthand
2024-05-23 10:58:59 +02:00
Mattias Granlund
8b7e12e472
Remove explicit error type for merge_virtual_branch_upstream
2024-05-23 10:58:59 +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
Sebastian Thiel
e3b8e2a5e5
fix: assure commit.gpgsign
is detected correctly
...
Avoid stringly comparison for what is definitely a boolean
[as per the configuration](https://git-scm.com/docs/git-config#Documentation/git-config.txt-commitgpgSign ).
2024-05-23 10:18:35 +02:00
Sebastian Thiel
93508d7e7c
fix: assure tests aren't affected by local configuration
...
Otherwise, tests will pickup global configuration, which can affect them.
For instance, if `core.gpgsign` is true, it will cause commits to be signed
which can be slow, or hang entirely if gpg-agent requests a password.
Note that now there is possibly no tests that validates signing,
and doing so is difficult as it requires gpg and keys to be setup.
2024-05-23 10:12:40 +02:00
Kiril Videlov
b8dfcf7a82
Merge pull request #3822 from gitbutlerapp/revert-3820-oplog-diff-optimization
...
Revert "fixes incorrect snapshot diff"
2024-05-23 03:31:00 +02:00
Kiril Videlov
651a55d3fb
Revert "fixes incorrect snapshot diff"
2024-05-23 03:17:34 +02:00
Kiril Videlov
c3a18ef2b0
feat(oplog): Improve lines_since_snapshot
by using tree-to-tree comparison
...
This fixes an issue where snapshots are auto-created too often erroneously
2024-05-23 02:46:40 +02:00
Kiril Videlov
3517419090
fixes incorrect snapshot diff
2024-05-23 01:10:28 +02:00
Kiril Videlov
9dbebba5df
refactor: Improve error handling in branch_to_remote_branch() and list_remote_branches() functions
2024-05-22 14:20:41 +02:00
Kiril Videlov
660d296745
Merge pull request #3814 from gitbutlerapp/update-change-selected-for-changes-branch
...
fix: Use old branch name instead of selected_for_changes in Snapshot creation
2024-05-22 12:32:46 +02:00
Kiril Videlov
f68ce21962
fix: Use old branch name instead of selected_for_changes in Snapshot creation
2024-05-22 12:20:59 +02:00
Caleb Owens
f2471734b4
Fix timestamp compensation
2024-05-22 12:17:04 +02:00
Scott Chacon
8b7fe790e5
return all local branches as well as remote ones
...
also deduplicate them in the branch listing
2024-05-22 10:45:29 +02:00
Pavel Laptev
ec8b171fc7
Project menu items update + new "Open in VS code" ( #3804 )
2024-05-21 23:57:38 +02:00
Kiril Videlov
eda9651bf9
Merge pull request #3800 from anaisbetts/no-dosbox-on-sign
...
Don't show command prompt when commit signing is enabled
2024-05-21 23:33:22 +02:00
Kiril Videlov
9f318626f8
Merge pull request #3737 from anaisbetts/flushable-debounce
...
Avoid file locks by being smarter about when we try to rebuild our information
2024-05-21 13:47:54 +02:00
Ani Betts
a47ebbc22d
Don't show command prompt when commit signing is enabled
2024-05-21 12:04:41 +02:00
Mattias Granlund
21e98fd9f2
Simplify getting default target
...
- remove try function in favor of returning error
- drop unused function
2024-05-21 12:02:38 +02:00
Ani Betts
f54c12fd55
Halve the dead air time
2024-05-21 11:03:18 +02:00
Anaïs Betts
d23ca10028
Bring back tempfile moves
2024-05-21 10:36:22 +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
Pavel Laptev
6e6272983b
History and minor UI fixes ( #3797 )
...
* Convert Capital case to Uper case "History menu"
* UI updates: target branch styles
* Remove console.log
* CSS: space between "Trunk" and the timer
* UI: reversed chevron arrows fix
* remove commented console.log
* UX: toggle file preview in History
* UI: target branch set animation fix
2024-05-21 01:07:22 +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
Scott Chacon
18de60740b
formatting
2024-05-19 07:24:15 +02:00
Scott Chacon
2a89fa6b93
save and restore the gitbutler/integration branch
...
when we save the snapshots, save and restore the integration branch commit properly so we don't get in a weird state after restore
2024-05-19 07:07:55 +02:00
Kiril Videlov
b3a1699cbf
Merge pull request #3786 from gitbutlerapp/Virtual-branch-1
...
remove unneccessary CSPs
2024-05-18 18:26:51 +02:00
Kiril Videlov
7e070ac0f5
remove unneccessary CSPs
2024-05-18 18:13:24 +02:00
Kiril Videlov
07b863731f
Merge pull request #3785 from gitbutlerapp/fix-ollama-request-security
...
Fix ollama request security
2024-05-18 18:08:39 +02:00
Caleb Owens
6ae9b7ff6e
Fix ollama request security
2024-05-18 16:51:20 +01:00
Kiril Videlov
a9316492c9
fix: forgot the port
2024-05-18 17:49:05 +02:00
Kiril Videlov
8fa8cbfe6d
fix: Updated connect-src to allow local connections for ollama
2024-05-18 16:28:19 +02:00
Scott Chacon
733780f302
reformat
2024-05-17 15:16:04 +02:00
Scott Chacon
dcc1b37331
rewrite our oplog tests
2024-05-17 15:11:19 +02:00
Scott Chacon
1cbcbb3478
change the oplog file name
...
this is both to be a little more clear, but mainly to reset users from the previous logic
2024-05-17 15:11:19 +02:00
Scott Chacon
62e9a80512
add logic for the first parentless snapshot
2024-05-17 15:11:19 +02:00
Scott Chacon
0f3005e467
first pass at new oplog tree builder
...
creates a work tree and properly restores
note
2024-05-17 15:11:19 +02:00
Kiril Videlov
74fe02f109
feat: Add support for setting snapshot_lines_threshold in UpdateRequest
2024-05-17 12:44:20 +02:00
Pavel Laptev
1be1218a71
History View UI ( #3773 )
...
* Separated History logic layout into components
* Layout update, components split and cover new data
* Added file preview
* handle event trigger
* empty states added
* Temp store for snapshot files + threshold section
* formatting
* added a gap between elements in footer
* CSS: padding fix
2024-05-17 01:21:19 +02:00
Ani Betts
2ff2b1f7ec
Format
2024-05-15 20:27:26 +02:00
Ani Betts
ddc2cfeb67
Flush on window focus
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
Ani Betts
69cf9c8058
Don't use HOME env var
...
This environment variable doesn't exist on Windows
2024-05-15 17:39:23 +02:00
Ani Betts
1695ad5c53
Add dirs crate
2024-05-15 17:39:00 +02:00
Scott Chacon
5becf4e6a6
small fixes
2024-05-15 15:24:08 +02:00
Scott Chacon
b0c5c07a57
some change-id based tests
2024-05-15 15:21:19 +02:00
Scott Chacon
2ce4e5bfd0
remove a bunch of debugging
2024-05-15 14:48:26 +02:00
Scott Chacon
d267dbc77d
rust is not my favorite language
2024-05-15 13:40:27 +02:00
Scott Chacon
a23253e57d
who committed this?
2024-05-15 11:14:05 +02:00
Scott Chacon
9e817b4d04
Merged origin/master into add-commit-id
2024-05-15 10:43:34 +02:00
Scott
520d95aef2
merge upstream
2024-05-14 14:07:09 +00:00
Kiril Videlov
e93ddfac34
snapshot of restores keeps more metadata
2024-05-14 16:04:02 +02:00
Kiril Videlov
8bae084518
snapshots for move hunk include branch name
2024-05-14 14:55:27 +02:00
Kiril Videlov
631bc86031
snapshots of (un)appy branches contains name
2024-05-14 14:35:47 +02:00
Scott Chacon
4cde9ce71d
windows doesn't have permissions like this
2024-05-14 13:43:49 +02:00
Scott Chacon
202c551bc7
remove signing setting
2024-05-14 13:15:11 +02:00
Scott Chacon
b5c9f934d5
supporting gpg.ssh.program
2024-05-14 11:57:23 +02:00
Scott Chacon
d944cad533
merge upstream
...
temp
2024-05-14 10:25:29 +02:00
Scott Chacon
f106bfa246
basic ssh signing too
2024-05-14 10:08:22 +02:00
Kiril Videlov
80148f50fe
add sha to undo commit snapshot
2024-05-13 16:37:37 +02:00
Kiril Videlov
8849c9845e
add sha to commit snapshot
2024-05-13 16:24:40 +02:00
Scott Chacon
b17ab37a01
actually run gpg if specified
2024-05-13 16:19:45 +02:00
Kiril Videlov
62dadd96a8
remove unused index subscription
2024-05-13 14:18:56 +02:00
Kiril Videlov
06dfc95692
add message trailer for commit snapshots
2024-05-13 01:07:42 +02:00
Kiril Videlov
81e948774f
fix test
2024-05-12 23:42:04 +02:00
Kiril Videlov
336c7cb9bc
enable the new oplog snapshotting by default
2024-05-12 22:36:27 +02:00
Kiril Videlov
f8023ca735
refactor snapshotter trait
...
Implementing this on branch turned out ot be restrictive so implementing for Oplog
2024-05-12 19:57:42 +02:00
Kiril Videlov
262bbd8df7
on snapshot store branch name metadata
2024-05-12 19:49:51 +02:00
Kiril Videlov
d52a7f5e4f
fix an issue with incorrect snapshot metadata on branch update
2024-05-12 19:18:03 +02:00
Kiril Videlov
3e0914444f
remove unused crates in tauri
2024-05-12 04:19:19 +02:00
Kiril Videlov
0a12b3eac5
remove unused crates in core
2024-05-12 04:12:56 +02:00
Kiril Videlov
5b3273f542
remove unused sessions / deltas implementation
...
This is removed in favor of the new `ops` module
2024-05-12 03:39:04 +02:00
Kiril Videlov
d9c985db26
Merge pull request #3749 from gitbutlerapp/update-file-event-removal-of-session-id
...
remove sessions/deltas unused tauri events
2024-05-12 03:37:24 +02:00
Kiril Videlov
91e48c6730
remove sessions/deltas unused tauri events
2024-05-12 03:24:36 +02:00
Kiril Videlov
27f0802443
remove gb_reference from projects
2024-05-12 03:08:54 +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