Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat: Refactor `wt list --format=json` output

Maximilian Roos6d2ed82535e5
diff --git a/CLAUDE.md b/CLAUDE.md
index a660ef423..139b4ae83 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -539,17 +539,105 @@ cargo bench --bench completion
## JSON Output Format
-Use `wt list --format=json --full` for structured data access. Objects have:
+Use `wt list --format=json` for structured data access. The output is an array of objects with `type: "worktree" | "branch"`.
+
+### Common Fields (all objects)
+
+- `type`: "worktree" | "branch"
+- `head_sha`: commit SHA
+- `timestamp`: commit timestamp (Unix epoch)
+- `commit_message`: commit message text
+- `ahead`, `behind`: commits ahead/behind main branch
+- `branch_diff`: `{added, deleted}` - line diff vs main
+- `has_conflicts`: boolean - merge conflicts with main
+- `upstream_remote`, `upstream_ahead`, `upstream_behind`: remote tracking status
+- `pr_status`: PR/CI status object (null if not available)
+- `user_status`: user-defined status from `worktrunk.status` config (optional)
+
+### Worktree-Specific Fields
+
+- `path`: absolute path to worktree
+- `branch`: branch name (null if detached)
+- `bare`, `detached`: boolean flags
+- `locked`, `prunable`: reason strings (null if not applicable)
+- `working_tree_diff`: `{added, deleted}` - uncommitted changes
+- `working_tree_diff_with_main`: `{added, deleted}` or null
+ - `null`: not computed (optimization when trees clearly differ)
+ - `{added: 0, deleted: 0}`: working tree matches main exactly
+- `worktree_state`: "rebase" | "merge" | null - git operation in progress
+- `is_primary`: boolean - is main/primary worktree
+- `status_symbols`: structured status object (see below)
+
+### Branch-Specific Fields
+
+- `name`: branch name
+
+### Status Symbols Structure (worktrees only)
+
+The `status_symbols` object provides structured access to status indicators:
+
+- `has_conflicts`: boolean - merge conflicts detected
+- `branch_state`: "" | "≡" | "∅"
+ - "≡": working tree matches main
+ - "∅": no commits and clean
+- `git_operation`: "" | "↻" | "⋈"
+ - "↻": rebase in progress
+ - "⋈": merge in progress
+- `worktree_attrs`: string - combination of:
+ - "◇": bare worktree
+ - "⊠": locked
+ - "⚠": prunable
+- `main_divergence`: "" | "↑" | "↓" | "↕"
+ - "↑": ahead of main
+ - "↓": behind main
+ - "↕": diverged (both ahead and behind)
+- `upstream_divergence`: "" | "⇡" | "⇣" | "⇅"
+ - "⇡": ahead of remote
+ - "⇣": behind remote
+ - "⇅": diverged from remote
+- `working_tree`: string - combination of:
+ - "?": untracked files
+ - "!": modified files
+ - "+": staged changes
+ - "»": renamed files
+ - "✘": deleted files
+
+### Display Fields (json-pretty format only)
+
+These fields contain ANSI-formatted strings for human-readable output:
+
+- `commits_display` (branches only)
+- `branch_diff_display` (branches only)
+- `upstream_display` (optional)
+- `ci_status_display` (optional)
+- `status_display`:
+ - Worktrees: rendered status symbols + user status
+ - Branches: user status or "·"
+- `working_diff_display` (worktrees only, optional)
+
+**Note**: Display fields are omitted when empty/null.
+
+### Query Examples
-**Core fields:**
-- `type`: "worktree" | "not_worktree"
-- `worktree.path`, `worktree.branch`, `worktree.head`
-- `timestamp`, `commit_message`, `is_primary`
+```bash
+# Get main worktree info
+jq '.[] | select(.branch == "main") | {path, ahead, behind}'
+
+# Find worktrees with uncommitted changes
+jq '.[] | select(.type == "worktree" and .working_tree_diff.added > 0)'
-**Diff stats:** `ahead`/`behind`, `working_tree_diff`, `branch_diff`, `working_tree_diff_with_main` (each: `{added, deleted}`)
+# Find worktrees with conflicts
+jq '.[] | select(.type == "worktree" and .status_symbols.has_conflicts)'
-**Remote tracking:** `upstream_remote`, `upstream_ahead`, `upstream_behind`
+# Find worktrees in rebase or merge
+jq '.[] | select(.type == "worktree" and .status_symbols.git_operation != "")'
-**State:** `has_conflicts`, `worktree_state` (null | "bisect" | "rebase" | etc.), `pr_status`, `ci_status`, `is_stale`
+# Get branches ahead of main
+jq '.[] | select(.ahead > 0) | {branch: (.branch // .name), ahead}'
-Query: `jq '.[] | select(.worktree.branch == "main") | {path: .worktree.path, ahead, behind}'`
+# Find branches without worktrees
+jq '.[] | select(.type == "branch") | .name'
+
+# Get worktrees that match main exactly
+jq '.[] | select(.type == "worktree" and .working_tree_diff_with_main.added == 0 and .working_tree_diff_with_main.deleted == 0)'
+```
diff --git a/src/commands/list/layout.rs b/src/commands/list/layout.rs
index 7a5c11c95..f94e2063d 100644
--- a/src/commands/list/layout.rs
+++ b/src/commands/list/layout.rs
@@ -844,15 +844,13 @@ mod tests {
};
let info1 = WorktreeInfo {
- worktree: worktrunk::git::Worktree {
- path: PathBuf::from("/test"),
- head: "abc123".to_string(),
- branch: Some("main".to_string()),
- bare: false,
- detached: false,
- locked: None,
- prunable: None,
- },
+ path: PathBuf::from("/test"),
+ head: "abc123".to_string(),
+ branch: Some("main".to_string()),
+ bare: false,
+ detached: false,
+ locked: None,
+ prunable: None,
commit: CommitDetails {
timestamp: 0,
commit_message: "Test".to_string(),
@@ -922,15 +920,13 @@ mod tests {
// Create test data with specific widths to verify position calculation
let info = WorktreeInfo {
- worktree: worktrunk::git::Worktree {
- path: PathBuf::from("/test/path"),
- head: "abc12345".to_string(),
- branch: Some("feature".to_string()),
- bare: false,
- detached: false,
- locked: None,
- prunable: None,
- },
+ path: PathBuf::from("/test/path"),
+ head: "abc12345".to_string(),
+ branch: Some("feature".to_string()),
+ bare: false,
+ detached: false,
+ locked: None,
+ prunable: None,
commit: CommitDetails {
timestamp: 1234567890,
commit_message: "Test commit message".to_string(),
@@ -999,15 +995,13 @@ mod tests {
// Create minimal data - most columns will be empty
let info = WorktreeInfo {
- worktree: worktrunk::git::Worktree {
- path: PathBuf::from("/test"),
- head: "abc12345".to_string(),
- branch: Some("main".to_string()),
- bare: false,
- detached: false,
- locked: None,
- prunable: None,
- },
+ path: PathBuf::from("/test"),
+ head: "abc12345".to_string(),
+ branch: Some("main".to_string()),
+ bare: false,
+ detached: false,
+ locked: None,
+ prunable: None,
commit: CommitDetails {
timestamp: 1234567890,
commit_message: "Test".to_string(),
@@ -1067,15 +1061,13 @@ mod tests {
// visible(branch) → empty(working_diff) → empty(ahead_behind) → empty(branch_diff)
// → empty(states) → visible(path)
let info = WorktreeInfo {
- worktree: worktrunk::git::Worktree {
- path: PathBuf::from("/test/worktree"),
- head: "abc12345".to_string(),
- branch: Some("feature-x".to_string()),
- bare: false,
- detached: false,
- locked: None,
- prunable: None,
- },
+ path: PathBuf::from("/test/worktree"),
+ head: "abc12345".to_string(),
+ branch: Some("feature-x".to_string()),
+ bare: false,
+ detached: false,
+ locked: None,
+ prunable: None,
commit: CommitDetails {
timestamp: 1234567890,
commit_message: "Test commit".to_string(),
diff --git a/src/commands/list/model.rs b/src/commands/list/model.rs
index bf40de165..87e006c17 100644
--- a/src/commands/list/model.rs
+++ b/src/commands/list/model.rs
@@ -54,11 +54,27 @@ impl DisplayFields {
#[derive(serde::Serialize)]
pub struct WorktreeInfo {
- pub worktree: worktrunk::git::Worktree,
+ // Worktree identity fields (flattened from worktrunk::git::Worktree)
+ pub path: PathBuf,
+ #[serde(rename = "head_sha")]
+ pub head: String,
+ pub branch: Option<String>,
+ pub bare: bool,
+ pub detached: bool,
+ pub locked: Option<String>,
+ pub prunable: Option<String>,
+
+ // Commit details
#[serde(flatten)]
pub commit: CommitDetails,
+
+ // Divergence from main
#[serde(flatten)]
pub counts: AheadBehind,
+ #[serde(flatten)]
+ pub branch_diff: BranchDiffTotals,
+
+ // Working tree state
pub working_tree_diff: LineDiff,
/// Diff between working tree and main branch.
/// `None` means "not computed" (optimization: skipped when trees differ).
@@ -66,14 +82,18 @@ pub struct WorktreeInfo {
/// `Some((a, d))` means a lines added, d deleted vs main.
#[serde(skip_serializing_if = "Option::is_none")]
pub working_tree_diff_with_main: Option<LineDiff>,
- #[serde(flatten)]
- pub branch_diff: BranchDiffTotals,
+ pub worktree_state: Option<String>,
+ pub has_conflicts: bool,
+
+ // Metadata
pub is_primary: bool,
+
+ // Remote/upstream
#[serde(flatten)]
pub upstream: UpstreamStatus,
- pub worktree_state: Option<String>,
+
+ // Status
pub pr_status: Option<PrStatus>,
- pub has_conflicts: bool,
/// Git status symbols (=, ↑, ↓, ⇡, ⇣, ?, !, +, », ✘) indicating working tree state
pub status_symbols: StatusSymbols,
/// User-defined status from worktrunk.status git config
@@ -90,6 +110,7 @@ pub struct WorktreeInfo {
#[derive(serde::Serialize)]
pub struct BranchInfo {
pub name: String,
+ #[serde(rename = "head_sha")]
pub head: String,
#[serde(flatten)]
pub commit: CommitDetails,
@@ -226,7 +247,7 @@ pub struct ListData {
impl ListItem {
pub fn branch_name(&self) -> &str {
match self {
- ListItem::Worktree(wt) => wt.worktree.branch.as_deref().unwrap_or("(detached)"),
+ ListItem::Worktree(wt) => wt.branch.as_deref().unwrap_or("(detached)"),
ListItem::Branch(br) => &br.name,
}
}
@@ -244,7 +265,7 @@ impl ListItem {
pub fn head(&self) -> &str {
match self {
- ListItem::Worktree(info) => &info.worktree.head,
+ ListItem::Worktree(info) => &info.head,
ListItem::Branch(info) => &info.head,
}
}
@@ -285,7 +306,7 @@ impl ListItem {
}
pub fn worktree_path(&self) -> Option<&PathBuf> {
- self.worktree_info().map(|info| &info.worktree.path)
+ self.worktree_info().map(|info| &info.path)
}
pub fn pr_status(&self) -> Option<&PrStatus> {
@@ -961,17 +982,25 @@ impl WorktreeInfo {
};
Ok(WorktreeInfo {
- worktree: wt.clone(),
+ // Flatten worktree fields
+ path: wt.path.clone(),
+ head: wt.head.clone(),
+ branch: wt.branch.clone(),
+ bare: wt.bare,
+ detached: wt.detached,
+ locked: wt.locked.clone(),
+ prunable: wt.prunable.clone(),
+ // Remaining fields
commit,
counts,
+ branch_diff,
working_tree_diff,
working_tree_diff_with_main,
- branch_diff,
+ worktree_state,
+ has_conflicts,
is_primary,
upstream,
- worktree_state,
pr_status,
- has_conflicts,
status_symbols: symbols,
user_status,
display,
diff --git a/src/commands/list/render.rs b/src/commands/list/render.rs
index 41a952d25..0643eb2ed 100644
--- a/src/commands/list/render.rs
+++ b/src/commands/list/render.rs
@@ -290,7 +290,7 @@ impl<'a> ListRowContext<'a> {
) -> Option<Style> {
let base_style = self.worktree_info.and_then(|info| {
let is_current = current_worktree_path
- .map(|p| p == &info.worktree.path)
+ .map(|p| p == &info.path)
.unwrap_or(false);
match (is_current, info.is_primary) {
(true, _) => Some(CURRENT),
@@ -386,7 +386,7 @@ impl ColumnLayout {
return StyledLine::new();
};
let mut cell = StyledLine::new();
- let path_str = shorten_path(&info.worktree.path, common_prefix);
+ let path_str = shorten_path(&info.path, common_prefix);
if let Some(style) = ctx.text_style {
cell.push_styled(path_str, style);
} else {
diff --git a/src/commands/select.rs b/src/commands/select.rs
index 77abc2c7c..d83cdfc2f 100644
--- a/src/commands/select.rs
+++ b/src/commands/select.rs
@@ -149,7 +149,7 @@ impl WorktreeSkimItem {
return "No worktree (branch only)\n".to_string();
};
- let path = wt_info.worktree.path.display().to_string();
+ let path = wt_info.path.display().to_string();
self.render_diff_preview(&["-C", &path, "diff", "HEAD"], "No uncommitted changes")
}
diff --git a/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap b/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap
index 483b4eff5..68ea0cabb 100644
--- a/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap
+++ b/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap
@@ -12,10 +12,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp2IgNi2/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpLFo230/test-config.toml
---
success: true
exit_code: 0
@@ -23,38 +24,36 @@ exit_code: 0
[
{
"type": "worktree",
- "worktree": {
- "path": "[REPO]",
- "head": "[SHA]",
- "branch": "main",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[REPO]",
+ "head_sha": "a27cd57d20a6211799da676e70edefa5152f99fe",
+ "branch": "main",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Main commit 2",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": true,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "",
@@ -67,34 +66,32 @@ exit_code: 0
},
{
"type": "worktree",
- "worktree": {
- "path": "[WORKTREE_FEATURE_AHEAD]",
- "head": "[SHA]",
- "branch": "feature-ahead",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[WORKTREE_FEATURE_AHEAD]",
+ "head_sha": "f16cd37915d5ee93903252f5cf877c76c54f3d50",
+ "branch": "feature-ahead",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Feature commit 2",
"ahead": 2,
"behind": 2,
- "working_tree_diff": {
- "added": 1,
- "deleted": 1
- },
"branch_diff": {
"added": 1,
"deleted": 0
},
+ "working_tree_diff": {
+ "added": 1,
+ "deleted": 1
+ },
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": false,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "",
@@ -111,34 +108,32 @@ exit_code: 0
},
{
"type": "worktree",
- "worktree": {
- "path": "[WORKTREE_FEATURE_BEHIND]",
- "head": "[SHA]",
- "branch": "feature-behind",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[WORKTREE_FEATURE_BEHIND]",
+ "head_sha": "6c3da84215d400bf6e05a7f9cd1efcfbd825b9e9",
+ "branch": "feature-behind",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit on main",
"ahead": 0,
"behind": 2,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": false,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "∅",
diff --git a/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap b/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap
index 4f85b9f5b..7dc403092 100644
--- a/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap
+++ b/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap
@@ -12,10 +12,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpS5lSrA/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyW6sML/test-config.toml
---
success: true
exit_code: 0
@@ -23,38 +24,36 @@ exit_code: 0
[
{
"type": "worktree",
- "worktree": {
- "path": "[REPO]",
- "head": "[SHA]",
- "branch": "main",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[REPO]",
+ "head_sha": "b834638e33dbc6b37002685ee0777f4b8f1af904",
+ "branch": "main",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": true,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "",
@@ -67,38 +66,36 @@ exit_code: 0
},
{
"type": "worktree",
- "worktree": {
- "path": "[WORKTREE_FEATURE_DETACHED]",
- "head": "[SHA]",
- "branch": "feature-detached",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[WORKTREE_FEATURE_DETACHED]",
+ "head_sha": "b834638e33dbc6b37002685ee0777f4b8f1af904",
+ "branch": "feature-detached",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": false,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "≡",
@@ -112,38 +109,36 @@ exit_code: 0
},
{
"type": "worktree",
- "worktree": {
- "path": "[WORKTREE_LOCKED_FEATURE]",
- "head": "[SHA]",
- "branch": "locked-feature",
- "bare": false,
- "detached": false,
- "locked": "Testing",
- "prunable": null
- },
+ "path": "[WORKTREE_LOCKED_FEATURE]",
+ "head_sha": "b834638e33dbc6b37002685ee0777f4b8f1af904",
+ "branch": "locked-feature",
+ "bare": false,
+ "detached": false,
+ "locked": "Testing",
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": false,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "≡",
diff --git a/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap b/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap
index 93a708abc..c6048aafb 100644
--- a/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap
+++ b/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap
@@ -12,10 +12,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpuw0Gca/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMrJiag/test-config.toml
---
success: true
exit_code: 0
@@ -23,38 +24,36 @@ exit_code: 0
[
{
"type": "worktree",
- "worktree": {
- "path": "[REPO]",
- "head": "[SHA]",
- "branch": "main",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[REPO]",
+ "head_sha": "b834638e33dbc6b37002685ee0777f4b8f1af904",
+ "branch": "main",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": true,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "",
@@ -67,38 +66,36 @@ exit_code: 0
},
{
"type": "worktree",
- "worktree": {
- "path": "[WORKTREE_WITH_STATUS]",
- "head": "[SHA]",
- "branch": "with-status",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[WORKTREE_WITH_STATUS]",
+ "head_sha": "b834638e33dbc6b37002685ee0777f4b8f1af904",
+ "branch": "with-status",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": false,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "≡",
@@ -113,38 +110,36 @@ exit_code: 0
},
{
"type": "worktree",
- "worktree": {
- "path": "[WORKTREE_WITHOUT_STATUS]",
- "head": "[SHA]",
- "branch": "without-status",
- "bare": false,
- "detached": false,
- "locked": null,
- "prunable": null
- },
+ "path": "[WORKTREE_WITHOUT_STATUS]",
+ "head_sha": "b834638e33dbc6b37002685ee0777f4b8f1af904",
+ "branch": "without-status",
+ "bare": false,
+ "detached": false,
+ "locked": null,
+ "prunable": null,
"timestamp": 0,
"commit_message": "Initial commit",
"ahead": 0,
"behind": 0,
- "working_tree_diff": {
+ "branch_diff": {
"added": 0,
"deleted": 0
},
- "working_tree_diff_with_main": {
+ "working_tree_diff": {
"added": 0,
"deleted": 0
},
- "branch_diff": {
+ "working_tree_diff_with_main": {
"added": 0,
"deleted": 0
},
+ "worktree_state": null,
+ "has_conflicts": false,
"is_primary": false,
"upstream_remote": null,
"upstream_ahead": 0,
"upstream_behind": 0,
- "worktree_state": null,
"pr_status": null,
- "has_conflicts": false,
"status_symbols": {
"has_conflicts": false,
"branch_state": "≡",