You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but: add split_commit tool and plumb workspace integration
Implements split_commit tool entry point, types, serde (SplitCommit, CommitShard), and command logic for orchestrating splits and wiring Rust workspace core API. This also updates workspace module exports, error types, and results to expose Vec<gix::ObjectId> and new workspace split outcome types.
Copy file name to clipboardExpand all lines: crates/but-action/src/lib.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ pub fn freestyle(
90
90
- `absorb`: Take a set of file changes and amend them into the existing commits in the project.
91
91
This requires you to figure out where the changes should go based on the locks, assingments and any other user provided information.
92
92
- `split a commit`: Take an existing commit and split it into multiple commits based on the the user directive.
93
-
This is a multi-step operation where you will need to create one or more black commits, and the move the file changes from the original commit to the new commits.
93
+
This can be achieved by using the `split_commit` tool.
94
94
- `split a branch`: Take an existing branch and split it into two branches. This basically takes a set of committed file changes and moves them to a new branch, removing them from the original branch.
95
95
This is useful when you want to separate the changes into a new branch for further work.
96
96
In order to do this, you will need to get the branch changes for the intended source branch (call the `get_branch_changes` tool), and then call the split branch tool with the changes you want to split off.
The stack id should refer to a stack in the workspace that contains the source commit.
1417
+
</important_notes>
1418
+
")]
1419
+
pubsource_stack_id:String,
1420
+
/// The commit id to split.
1421
+
#[schemars(description = "
1422
+
<description>
1423
+
The commit id of the commit to split.
1424
+
</description>
1425
+
1426
+
<important_notes>
1427
+
The commit id should refer to a commit in the workspace.
1428
+
This is the commit whose changes will be split into multiple new commits.
1429
+
The commit id should be contained in the stack specified by `source_stack_id`.
1430
+
</important_notes>
1431
+
")]
1432
+
pubsource_commit_id:String,
1433
+
1434
+
/// The definitions for each new commit shard.
1435
+
#[schemars(description = "
1436
+
<description>
1437
+
The definitions for each new commit shard.
1438
+
Each shard specifies the commit message and the list of files to include in that shard.
1439
+
</description>
1440
+
1441
+
<important_notes>
1442
+
Each shard must have a unique set of files (no overlap).
1443
+
All files in the source commit must be assigned to a shard.
1444
+
The order of the shards determines the order of the resulting commits (first being the newest or 'child-most' commit and las being the oldest or 'parent-most').
1445
+
</important_notes>
1446
+
")]
1447
+
pubshards:Vec<CommitShard>,
1448
+
}
1449
+
1450
+
implToolforSplitCommit{
1451
+
fnname(&self) -> String{
1452
+
"split_commit".to_string()
1453
+
}
1454
+
1455
+
fndescription(&self) -> String{
1456
+
"
1457
+
<description>
1458
+
Split a single commit into multiple new commits, each with its own message and file set.
1459
+
</description>
1460
+
1461
+
<important_notes>
1462
+
This tool allows you to break up a commit into several smaller commits, each defined by a shard.
1463
+
Each shard must have a unique set of files, and all files in the source commit must be assigned to a shard.
1464
+
The order of the shards determines the order of the resulting commits.
0 commit comments