Commit Graph

898 Commits

Author SHA1 Message Date
Sebastian Thiel
0fbfa141b4
Don't touch disk once per path to conflict::resolve() multiple of them 2024-07-19 10:44:12 +02:00
Sebastian Thiel
5946c4ca9a
conflict::*()functions don't impose UTF-8 on paths
That way it's compatible to more kinds of paths, on more filesystem.
It assumes that the content of the `conflict` file is never moved
across platforms.
2024-07-19 10:44:12 +02:00
Pavel Laptev
efb5c13725 refactor: Normalize branch name by replacing invalid characters with hyphens. 2024-07-18 14:32:30 +02:00
Kiril Videlov
6101c5c66f
move hunk and diff code to a separate crate, out of the branch one 2024-07-17 20:16:48 +02:00
Kiril Videlov
e6ccf764ee
supresss clippy warning about type complexity 2024-07-17 18:48:45 +02:00
Kiril Videlov
d5fffbd4ac
move HunkLock struct to branch actions crate 2024-07-17 18:30:23 +02:00
Kiril Videlov
5d74440d4c
remove lock attribute from diff hunk structs 2024-07-17 18:23:49 +02:00
Kiril Videlov
9eeb47b63f
get_applied_status returns locks 2024-07-17 12:01:50 +02:00
Kiril Videlov
3ad6b3fd10
Merge pull request #4409 from gitbutlerapp/dependabot/cargo/rust-updates-9e51e1549e
Bump the rust-updates group across 1 directory with 8 updates
2024-07-16 22:14:28 +02:00
Kiril Videlov
eed5643569
Merge pull request #4410 from Byron/lock-upgrades
clearer read-write separation
2024-07-16 22:14:16 +02:00
Caleb Owens
b5d2c8a54f
Merge pull request #4415 from gitbutlerapp/update-svelte
Fix up branches list
2024-07-16 19:48:03 +02:00
Caleb Owens
90d1465e5d
Fix up branches list 2024-07-16 19:39:46 +02:00
Sebastian Thiel
4526006bf9
Show that not all users of get_applied_status need write permissions...
...according to tests.
2024-07-16 17:33:53 +02:00
dependabot[bot]
cdafe5bc2c
Bump the rust-updates group across 1 directory with 8 updates
Bumps the rust-updates group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [serde](https://github.com/serde-rs/serde) | `1.0.203` | `1.0.204` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.61` | `1.0.62` |
| [console-subscriber](https://github.com/tokio-rs/console) | `0.2.0` | `0.3.0` |
| [open](https://github.com/Byron/open-rs) | `5.2.0` | `5.3.0` |
| [sysinfo](https://github.com/GuillaumeGomez/sysinfo) | `0.30.12` | `0.30.13` |
| [rstest](https://github.com/la10736/rstest) | `0.20.0` | `0.21.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.8` | `4.5.9` |
| [diffy](https://github.com/bmwill/diffy) | `0.3.0` | `0.4.0` |



Updates `serde` from 1.0.203 to 1.0.204
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

Updates `thiserror` from 1.0.61 to 1.0.62
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62)

Updates `console-subscriber` from 0.2.0 to 0.3.0
- [Release notes](https://github.com/tokio-rs/console/releases)
- [Changelog](https://github.com/tokio-rs/console/blob/main/release-plz.toml)
- [Commits](https://github.com/tokio-rs/console/compare/console-subscriber-v0.2.0...console-subscriber-v0.3.0)

Updates `open` from 5.2.0 to 5.3.0
- [Release notes](https://github.com/Byron/open-rs/releases)
- [Changelog](https://github.com/Byron/open-rs/blob/main/changelog.md)
- [Commits](https://github.com/Byron/open-rs/compare/v5.2.0...v5.3.0)

Updates `sysinfo` from 0.30.12 to 0.30.13
- [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GuillaumeGomez/sysinfo/commits/v0.30.13)

Updates `rstest` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/v0.20.0...v0.21.0)

Updates `clap` from 4.5.8 to 4.5.9
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.8...v4.5.9)

Updates `diffy` from 0.3.0 to 0.4.0
- [Changelog](https://github.com/bmwill/diffy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bmwill/diffy/commits)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: console-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-updates
- dependency-name: open
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-updates
- dependency-name: sysinfo
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: rstest
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-updates
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: diffy
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-16 15:22:10 +00:00
Kiril Videlov
cc8d7c9206 upgrade version of the windows crate 2024-07-16 16:48:42 +02:00
Kiril Videlov
2f06fcb7cf
upgrade mock_instant version 2024-07-16 15:51:15 +02:00
Pavel Laptev
b888fbc834
normilize-branch-name-update (#4392)
* refactor: Normalized branch name handling

* Refactor: use only one normalize function (rust)

* Deletion: unused `normalizeBranchName` function

* Update lib.rs

* Changed test to reflect new functionality

---------

Co-authored-by: Caleb Owens <caleb@gitbutler.com>
2024-07-16 11:23:09 +02:00
Kiril Videlov
fcce329118
Merge pull request #4399 from gitbutlerapp/Fix-for-the-something-went-wrong-situation
Fix for the "something went wrong" situation
2024-07-16 10:51:15 +02:00
Nico Domino
bc8d00bb88
fix: update wp.com csp to wildcard subdomain (#4397) 2024-07-16 08:35:27 +00:00
Kiril Videlov
b9c26df9a1
indicate when a hunk is poisoned
This means that the hunk is 'locked/depends on' multiple branches, and because of this, it cannot be manipulated
2024-07-16 10:34:32 +02:00
Kiril Videlov
dac6c118e0
dont explode when a patch failed to apply
This condition arises when a hunk in fact depends on hunks from two other commits from two separate branches (i.e. it's a hunk that fuses with both)
2024-07-16 10:33:18 +02:00
Kiril Videlov
d6ec849f5e
let hunk locking discover all locks 2024-07-16 10:17:07 +02:00
Nico Domino
879746c665
feat: add io.wp.com to img-src CSP for gravatar / auth0 fallback avatars (#4396) 2024-07-16 08:15:38 +00:00
Kiril Videlov
8ccd8d511e
Merge pull request #4349 from Byron/refactor
refactor and PoC for worktree mutability handling
2024-07-15 23:02:01 +02:00
Sebastian Thiel
613a773c77
fix remaining tests that depend on the auto-creation of vbranches 2024-07-15 22:36:44 +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
Mattias Granlund
6692acd261 Simplify SystemEditor readable 2024-07-15 14:34:55 +01: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
3e79238e7f
assure conflicts::mark() writes its file atomically
That way it can't be observed half-written, or remain in a half-written
state in case of crash.
2024-07-15 08:20:06 +02:00
Sebastian Thiel
b3b87b34a5
reduce tauri state
This is in preparation for making operations that access the filesystems
less stateful, which in turn makes it less akward to identify writing
methods with `&mut` lateron.

This includes accepting that all we really need is a single directory
to generate everything else we need on the fly. This simplifies commands.

For good measure, this also simplifies imports of smaller crates that are
involved.
2024-07-14 22:27:53 +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
Sebastian Thiel
f48d0e2746
adapt to changes in gitbutler-branch crate 2024-07-14 21:32:55 +02:00
Sebastian Thiel
85b4e564cd
simplify module paths of gitbutler-branch crate 2024-07-14 21:32:55 +02:00
Sebastian Thiel
4501b5dd51
minimize the public API of the branch crate
Only keep public what needs to be public right now, which always
helps with refactoring later.
2024-07-14 21:32:55 +02:00
Sebastian Thiel
4805f6e7e7
adapt to changes in gitbutler-branch-actions 2024-07-14 21:32:55 +02:00
Sebastian Thiel
5e408f6b2d
Assure a single path to an item (struct, fn)
Also, simplify paths and optimize them (to some extend) to seem
non-redundant when `use`ing them.
2024-07-14 21:32:55 +02:00
Sebastian Thiel
0079f2bcbe
minimize the public API of gitbutler-branch-actions crate.
Also avoid private traits where functions would be easier to use.
2024-07-14 21:32:54 +02:00
Sebastian Thiel
6fb6201ab9
assure docs can be built without warnings by default.
It's a good way to review import paths and the public API.
2024-07-14 21:32:49 +02:00
Sebastian Thiel
eaa18da9d0
Make the ProjectSelector multi-window aware
That way it will not allow to open a project if it's known to be open already.
2024-07-12 15:19:09 +02:00
Sebastian Thiel
38f800d877
assure the multi-window lock actually works
This includes the UI is responding to issues.
2024-07-12 15:19:09 +02:00
Sebastian Thiel
24b8bdaa86
Open new existing projects with Alt + click in project popup.
This is intentionally non-obvious for now while it's new.
2024-07-12 15:19:09 +02:00
Sebastian Thiel
c310942b12
keep track of state per window
This allows multiple application windows to be opened and managed.
2024-07-12 15:19:09 +02:00
Sebastian Thiel
ccd6a6fe0d
let UI trigger necessary updates on addition and removal 2024-07-12 15:19:09 +02:00
Sebastian Thiel
00303704f4
add project-lock to generalized state
This means the current watcher also includes a file-lock for the current project.
Later this can be generalized to be per-window.
2024-07-12 15:19:09 +02:00
Sebastian Thiel
4d2a153aed
Use extractors for project-commands
That way, it's clearer what facilities or global state
are used when invoking a particular command.
2024-07-12 15:19:09 +02:00
Sebastian Thiel
c51be90aea
Merge pull request #4338 from gitbutlerapp/Fix-double-remote-fetch
Fix double remote fetch
2024-07-12 10:37:34 +02:00
Sebastian Thiel
5f4e0adb28
remove now unused default_target() function 2024-07-12 10:30:56 +02:00
Mattias Granlund
58d3cd5aff Fix double fetching of remote
- all remotes already fetched in existing iter/map
2024-07-12 00:38:46 +01: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
Caleb Owens
c982e78567
Merge pull request #4328 from gitbutlerapp/split-branch-manager-into-seprate-traits
Use impls rather than private traits
2024-07-10 17:50:35 +02:00