Skip to content

Commit cd7dbfe

Browse files
authored
feat(sync): add conflict prediction before sync (#141)
1 parent 6f80c90 commit cd7dbfe

File tree

18 files changed

+1378
-87
lines changed

18 files changed

+1378
-87
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ resolver = "3"
33
members = ["crates/*"]
44

55
[workspace.package]
6-
version = "0.7.0"
6+
version = "0.8.0"
77
edition = "2024"
88
license = "MIT"
99
repository = "https://github.com/auswm85/rung"
1010
rust-version = "1.88"
1111

1212
[workspace.dependencies]
1313
# Internal crates
14-
rung-core = { version = "0.7.0", path = "crates/rung-core" }
15-
rung-git = { version = "0.7.0", path = "crates/rung-git" }
16-
rung-github = { version = "0.7.0", path = "crates/rung-github" }
14+
rung-core = { version = "0.8.0", path = "crates/rung-core" }
15+
rung-git = { version = "0.8.0", path = "crates/rung-git" }
16+
rung-github = { version = "0.8.0", path = "crates/rung-github" }
1717

1818
# Git operations
1919
git2 = "0.19"

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,22 @@ Sync the stack by rebasing all branches when the base moves forward.
168168

169169
```bash
170170
rung sync # Sync all branches
171+
rung sync --check # Predict conflicts before syncing
171172
rung sync --dry-run # Preview what would happen
172173
rung sync --base develop # Sync against a different base branch
173174
```
174175

175-
If conflicts occur:
176+
Check for conflicts before syncing:
177+
178+
```bash
179+
$ rung sync --check
180+
⚠️ Potential conflicts detected:
181+
182+
feature-a → main
183+
• file.rs (abc123: "Add feature")
184+
```
185+
186+
If conflicts occur during sync:
176187

177188
```bash
178189
# Resolve conflicts, then:
@@ -185,6 +196,7 @@ rung sync --abort
185196

186197
**Options:**
187198

199+
- `--check` - Predict conflicts without performing sync *(v0.8.0+)*
188200
- `--dry-run` - Show what would be done without making changes
189201
- `--continue` - Continue after resolving conflicts
190202
- `--abort` - Abort and restore from backup

crates/rung-cli/src/commands/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ pub enum Commands {
121121
#[arg(long)]
122122
dry_run: bool,
123123

124+
/// Predict conflicts without performing sync.
125+
/// Shows which branches would have conflicts and which files.
126+
#[arg(long)]
127+
check: bool,
128+
124129
/// Continue a paused sync after resolving conflicts.
125130
#[arg(long, name = "continue")]
126131
continue_: bool,

0 commit comments

Comments
 (0)