Commit Graph

86 Commits

Author SHA1 Message Date
Caleb Owens
765a967c60 Refactor initialized 2024-11-13 13:29:57 +01:00
Caleb Owens
30e6540a63 Removed unneeded instances of CommandContext passed about 2024-11-13 13:29:53 +01:00
Kiril Videlov
5bdb565884 Fix serialization bug: alias StackBranch head to target 2024-11-10 12:40:34 +01:00
Kiril Videlov
f404bca84a Rename functions and vars referencing branch to stack if the type is Stack 2024-11-09 23:23:21 +01:00
Kiril Videlov
62a74107dc Rename branch and branch_id function parameters to stack and stack_id
Internally only, skipping the API for now
2024-11-09 22:41:52 +01:00
Kiril Videlov
1c2871c907 rename Branch to StackBranch to remove ambiguity 2024-11-09 22:20:15 +01:00
Kiril Videlov
2559722db0 refactor: rename Branch target to head
Confusing name was a leftover from pre-refactor
2024-11-09 22:20:15 +01:00
Kiril Videlov
a4d4ec57a6 refactor: remove unused struct Series 2024-11-09 22:20:15 +01:00
Kiril Videlov
2b828cfa11 refactor: remove unused list_series method 2024-11-09 22:20:15 +01:00
Kiril Videlov
32c05ee726 refactor: remove list_series from unit tests 2024-11-09 22:20:15 +01:00
Kiril Videlov
49f6c8cfae refactor: rename branch->stack in places 2024-11-09 22:20:15 +01:00
Kiril Videlov
39a41a2194 refactor: stack push now uses stack.branches()
As opposed to stack.list_series() which does more unnecessary work
2024-11-09 22:20:15 +01:00
Kiril Videlov
7fcb6102eb Fixes a bug where stack listing fails if there is an archived branch 2024-11-07 11:09:19 +01:00
Mattias Granlund
54caba3951 Replace ForgeIdentifier with string type
- simplifying to keep things simple in the front end
2024-11-07 00:05:01 +01:00
Kiril Videlov
d763258bc8 Adds a method commits to Branch 2024-11-03 22:57:07 +01:00
Kiril Videlov
51c36128ce Remove unnecessary field remote_commit_ids_by_change_id 2024-11-03 20:37:27 +01:00
Kiril Videlov
4e3eabfad7 fix(stack): branch_base takes commit id directly
Using change ID for the merge base is not relevant
2024-11-03 13:57:18 +01:00
Kiril Videlov
64c28d7008 Fix a bug in commit_by_oid_or_change_id
It now correctly finds the commit if it happens to be the merge base and is referenced with changeID instead of commitID
2024-11-03 13:29:27 +01:00
Kiril Videlov
49ef4d5d27 Introduce a branch_base method on Stack for discovering the base of a branch 2024-11-03 12:53:12 +01:00
Kiril Videlov
64cba8ebfc Rename type PatchReference to Branch for clarity 2024-11-03 12:16:45 +01:00
Kiril Videlov
3a383e19bd
Merge pull request #5386 from gitbutlerapp/kv-branch-1
Fixes a bug where incorrect remote commits are shown when remote was rebased
2024-11-03 00:33:17 +01:00
Kiril Videlov
736ef0d648 Refactor: move patch reference structs to the stack crate
The separation no longer makes sense
2024-11-02 13:24:53 +01:00
Kiril Videlov
eab3f6208e Refactor Stack: make initialized() return Result
This way we dont need to repeat the error message in places where that is checked
Also make it private
2024-11-02 12:30:36 +01:00
Kiril Videlov
0a79974601 Refactor: add useful functions e.g. getting the stack commits or merge base to the Stack impl
Ideally we can move to a state where these types of operations have single well tested implementations
2024-11-02 12:16:05 +01:00
Kiril Videlov
d855660f25 refactor: stack tests - remove initialize function call
Stack cant be created unitialized anymore
2024-11-02 11:21:23 +01:00
dependabot[bot]
314840a46e
build(deps): bump the rust-updates group across 1 directory with 13 updates
Bumps the rust-updates group with 13 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [uuid](https://github.com/uuid-rs/uuid) | `1.10.0` | `1.11.0` |
| [serde](https://github.com/serde-rs/serde) | `1.0.210` | `1.0.214` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.64` | `1.0.66` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.40.0` | `1.41.0` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.89` | `1.0.92` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.30` | `0.3.31` |
| [console-subscriber](https://github.com/tokio-rs/console) | `0.4.0` | `0.4.1` |
| [once_cell](https://github.com/matklad/once_cell) | `1.20.1` | `1.20.2` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.8` | `0.12.9` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.128` | `1.0.132` |
| [file-id](https://github.com/notify-rs/notify) | `0.2.1` | `0.2.2` |
| [clap](https://github.com/clap-rs/clap) | `4.5.19` | `4.5.20` |
| [regex](https://github.com/rust-lang/regex) | `1.11.0` | `1.11.1` |



Updates `uuid` from 1.10.0 to 1.11.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.10.0...1.11.0)

Updates `serde` from 1.0.210 to 1.0.214
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.210...v1.0.214)

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

Updates `tokio` from 1.40.0 to 1.41.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.40.0...tokio-1.41.0)

Updates `anyhow` from 1.0.89 to 1.0.92
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.89...1.0.92)

Updates `futures` from 0.3.30 to 0.3.31
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.30...0.3.31)

Updates `console-subscriber` from 0.4.0 to 0.4.1
- [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.4.0...console-subscriber-v0.4.1)

Updates `once_cell` from 1.20.1 to 1.20.2
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.20.1...v1.20.2)

Updates `reqwest` from 0.12.8 to 0.12.9
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.12.8...v0.12.9)

Updates `serde_json` from 1.0.128 to 1.0.132
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/1.0.128...1.0.132)

Updates `file-id` from 0.2.1 to 0.2.2
- [Release notes](https://github.com/notify-rs/notify/releases)
- [Changelog](https://github.com/notify-rs/notify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/notify-rs/notify/compare/file-id-0.2.1...file-id-0.2.2)

Updates `clap` from 4.5.19 to 4.5.20
- [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.19...clap_complete-v4.5.20)

Updates `regex` from 1.11.0 to 1.11.1
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.0...1.11.1)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-updates
- 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: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-updates
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: futures
  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-patch
  dependency-group: rust-updates
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: file-id
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 18:16:24 +00:00
Kiril Videlov
860b0da2ab Create unique auto-generated branch names when creating lanes
At the same time, when creating a lane from a pre-existing branch, dont try to make a unique name
2024-11-01 17:35:03 +01:00
Kiril Videlov
be950b1cc0 Fixes a bug where incorrect remote commits are shown when remote was rebased 2024-10-31 19:54:52 +01:00
Kiril Videlov
0b6bcab859 Updating series name resets forge_id to None 2024-10-31 09:50:28 +01:00
Kiril Videlov
2ee3e2dcef fix adding a branch on the stack when there is an archived branch 2024-10-30 18:32:34 +01:00
Kiril Videlov
bd10692afb Only show non-archived branches in the UI 2024-10-30 12:52:55 +01:00
Kiril Videlov
94e345aeb0 Change pruning of integrated heads in the stack to just flag them as archived 2024-10-30 12:26:34 +01:00
Kiril Videlov
8f4cb6160f replace a Vec of Forge Identifers with an Option instead
Likely we wont need multiple
2024-10-30 10:32:44 +01:00
Kiril Videlov
70f7d82f14 Update create_virtual_branch_from_branch to take forge_id 2024-10-29 23:25:14 +01:00
Kiril Videlov
3844da2ac6 add tests for setting forge ids 2024-10-29 21:49:25 +01:00
Kiril Videlov
ba9ab65918 adds low level api for setting forge ids for a series/branch 2024-10-29 21:39:47 +01:00
Kiril Videlov
22310e018c introduce a new ForgeIdentifier type to be persisted 2024-10-29 21:21:09 +01:00
Kiril Videlov
8eff89a621 fix a bug where re-applying a lane causes branch names to be incremented 2024-10-29 16:31:33 +01:00
Kiril Videlov
7c61a9a236 Add test for stack pruning 2024-10-28 18:57:04 +01:00
Kiril Videlov
dc07cd1ce3 Prune integrated heads upon inegrating upstream 2024-10-28 17:51:19 +01:00
Kiril Videlov
4e84977516 Stack - handle the case where one of the stack heads can't be found
Handled by skipping in this case. What would be better is to not reach this state by updating the stack upon "update workspace"
2024-10-28 17:03:45 +01:00
Kiril Videlov
38c0453eed warn on unsafe index access in the stack crate 2024-10-27 22:27:55 +01:00
Kiril Videlov
b639859a65 fix reordering of series heads 2024-10-27 22:17:50 +01:00
Kiril Videlov
7e1a5c54f2 Implement new stackign api 2024-10-24 16:27:35 +02:00
Kiril Videlov
990d564625 Refactor list series for Stack 2024-10-23 17:12:31 +02:00
Kiril Videlov
abea43c5d4 Fixes a problem where re-applying a pushed branch creates a new reference rather than reusing the existing one
The most visible aspect to this issue was that the branch will not show any existing PRs afterwards
2024-10-23 11:47:53 +02:00
Kiril Videlov
068833059d Remove stack extention trait - now it can be an impl block 2024-10-22 16:08:59 +02:00
Kiril Videlov
ccec1868f8 Refactor - join stack and stack api crates
Separation was previously needed due to cycle dependency with the repo crate. 
The stack_ext is to be refactored as an impl on stack
2024-10-22 15:26:53 +02:00
Kiril Videlov
dd93fc16db
fixes a bug in handling the remote name
Seems like projects that were created long time ago do not have the push_remote_name field set up. Add correct handling for all those situations
2024-10-20 00:22:57 +02:00
Kiril Videlov
5b39495062 implement GC for branch entries
Garbage collects branches that are not in the workspace and hold no changes:
   1. They do not have a WIP commit
   2. They have no regular commits
2024-10-15 16:21:40 +02:00