Skip to content

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

Rename preview mode "history" to "log"

Maximilian Roos04611524c1a1
diff --git a/docs/content/select.md b/docs/content/select.md
index fe744f836..02d9a9ca8 100644
--- a/docs/content/select.md
+++ b/docs/content/select.md
@@ -27,7 +27,7 @@ wt select
Toggle between views with number keys:
1. **HEAD±** — Diff of uncommitted changes
-2. **history** — Recent commits on the branch
+2. **log** — Recent commits on the branch
3. **main…±** — Diff of all changes vs main branch
## Keybindings
diff --git a/src/cli.rs b/src/cli.rs
index 52f30e6b3..834eb4d37 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1409,7 +1409,7 @@ wt select
Toggle between views with number keys:
1. **HEAD±** — Diff of uncommitted changes
-2. **history** — Recent commits on the branch
+2. **log** — Recent commits on the branch
3. **main…±** — Diff of all changes vs main branch
## Keybindings
diff --git a/src/commands/select.rs b/src/commands/select.rs
index e8cf1b58d..fac48b796 100644
--- a/src/commands/select.rs
+++ b/src/commands/select.rs
@@ -185,7 +185,7 @@ fn shell_escape(s: &str) -> String {
///
/// Each mode shows a different aspect of the worktree:
/// 1. WorkingTree: Uncommitted changes (git diff HEAD --stat)
-/// 2. History: Commit history since diverging from main (git log with merge-base)
+/// 2. Log: Commit history since diverging from main (git log with merge-base)
/// 3. BranchDiff: Line diffs in commits ahead of main (git diff --stat main…)
///
/// Loosely aligned with `wt list` columns, though not a perfect match:
@@ -198,7 +198,7 @@ fn shell_escape(s: &str) -> String {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum PreviewMode {
WorkingTree = 1,
- History = 2,
+ Log = 2,
BranchDiff = 3,
}
@@ -278,7 +278,7 @@ impl PreviewLayout {
impl PreviewMode {
fn from_u8(n: u8) -> Self {
match n {
- 2 => Self::History,
+ 2 => Self::Log,
3 => Self::BranchDiff,
_ => Self::WorkingTree,
}
@@ -287,7 +287,7 @@ impl PreviewMode {
/// Preview state persistence (mode only, layout auto-detected)
///
-/// State file format: Single digit representing preview mode (1=WorkingTree, 2=History, 3=BranchDiff)
+/// State file format: Single digit representing preview mode (1=WorkingTree, 2=Log, 3=BranchDiff)
struct PreviewStateData;
impl PreviewStateData {
@@ -407,7 +407,7 @@ impl WorktreeSkimItem {
}
let tab1 = format_tab("1: HEAD±", mode == PreviewMode::WorkingTree);
- let tab2 = format_tab("2: history", mode == PreviewMode::History);
+ let tab2 = format_tab("2: log", mode == PreviewMode::Log);
let tab3 = format_tab("3: main…±", mode == PreviewMode::BranchDiff);
// Controls use dim yellow to distinguish from dimmed (white) tabs
@@ -428,7 +428,7 @@ impl WorktreeSkimItem {
fn preview_for_mode(&self, mode: PreviewMode, width: usize) -> String {
match mode {
PreviewMode::WorkingTree => self.render_working_tree_preview(width),
- PreviewMode::History => self.render_history_preview(width),
+ PreviewMode::Log => self.render_log_preview(width),
PreviewMode::BranchDiff => self.render_branch_diff_preview(width),
}
}
@@ -515,10 +515,10 @@ impl WorktreeSkimItem {
)
}
- /// Render Tab 2: History preview
- fn render_history_preview(&self, _width: usize) -> String {
+ /// Render Tab 2: Log preview
+ fn render_log_preview(&self, _width: usize) -> String {
use worktrunk::styling::INFO_EMOJI;
- const HISTORY_LIMIT: &str = "10";
+ const LOG_LIMIT: &str = "10";
let mut output = String::new();
let repo = Repository::current();
@@ -556,7 +556,7 @@ impl WorktreeSkimItem {
"--oneline",
"--color=always",
"-n",
- HISTORY_LIMIT,
+ LOG_LIMIT,
head,
]) {
output.push_str(&log_output);
@@ -585,7 +585,7 @@ impl WorktreeSkimItem {
"--format=%C(dim)%h %s%C(reset)",
"--color=always",
"-n",
- HISTORY_LIMIT,
+ LOG_LIMIT,
merge_base,
]) {
output.push_str(&log_output);
@@ -795,7 +795,7 @@ mod tests {
#[test]
fn test_preview_mode_from_u8() {
assert_eq!(PreviewMode::from_u8(1), PreviewMode::WorkingTree);
- assert_eq!(PreviewMode::from_u8(2), PreviewMode::History);
+ assert_eq!(PreviewMode::from_u8(2), PreviewMode::Log);
assert_eq!(PreviewMode::from_u8(3), PreviewMode::BranchDiff);
// Invalid values default to WorkingTree
assert_eq!(PreviewMode::from_u8(0), PreviewMode::WorkingTree);
@@ -847,7 +847,7 @@ mod tests {
.and_then(|s| s.trim().parse::<u8>().ok())
.map(PreviewMode::from_u8)
.unwrap_or(PreviewMode::WorkingTree);
- assert_eq!(mode, PreviewMode::History);
+ assert_eq!(mode, PreviewMode::Log);
let _ = fs::write(&state_path, "3");
let mode = fs::read_to_string(&state_path)
diff --git a/tests/integration_tests/select.rs b/tests/integration_tests/select.rs
index d043dacf0..5c90f6fc7 100644
--- a/tests/integration_tests/select.rs
+++ b/tests/integration_tests/select.rs
@@ -433,10 +433,10 @@ fn test_select_preview_panel_uncommitted() {
assert_snapshot!("select_preview_uncommitted", normalized);
}
-/// Test preview panel 2: history shows recent commits
+/// Test preview panel 2: log shows recent commits
#[test]
-fn test_select_preview_panel_history() {
+fn test_select_preview_panel_log() {
let mut repo = TestRepo::new();
repo.commit("Initial commit");
let feature_path = repo.add_worktree("feature");
@@ -467,7 +467,7 @@ fn test_select_preview_panel_history() {
}
let env_vars = repo.test_env_vars();
- // Type "feature" to filter, press 2 for history panel
+ // Type "feature" to filter, press 2 for log panel
let (raw_output, exit_code) = exec_in_pty_with_input_sequence(
get_cargo_bin("wt").to_str().unwrap(),
&["select"],
@@ -480,7 +480,7 @@ fn test_select_preview_panel_history() {
let screen = render_terminal_screen(&raw_output);
let normalized = normalize_output(&screen);
- assert_snapshot!("select_preview_history", normalized);
+ assert_snapshot!("select_preview_log", normalized);
}
/// Test preview panel 3: main…± shows diff vs main branch
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__select__select_preview_history.snap b/tests/integration_tests/snapshots/integration__integration_tests__select__select_preview_log.snap
similarity index 100%
rename from tests/integration_tests/snapshots/integration__integration_tests__select__select_preview_history.snap
rename to tests/integration_tests/snapshots/integration__integration_tests__select__select_preview_log.snap