From 4a80069a133782c1311cb2338b85fd9f203b1e00 Mon Sep 17 00:00:00 2001 From: altsem Date: Tue, 28 Jul 2026 16:58:51 +0200 Subject: [PATCH 1/5] refactor(layout): new trait 'Measure' for items inserted into a LayoutTree --- src/ui.rs | 23 ++-- src/ui/layout/mod.rs | 251 +++++++++++++++++++++---------------------- 2 files changed, 139 insertions(+), 135 deletions(-) diff --git a/src/ui.rs b/src/ui.rs index 5c0891c758..5e585aa392 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -7,7 +7,7 @@ use crate::screen; use crate::style::{Color, Modifier, Style}; use crate::term::TermBackend; use crate::text_input::Status; -use crate::ui::layout::LayoutItem; +use crate::ui::layout::{LayoutItem, Measure}; use itertools::Itertools; use layout::LayoutTree; use layout::OPTS; @@ -31,6 +31,17 @@ pub(crate) enum UiItem<'a> { } pub(crate) type UiTree<'a> = LayoutTree>; +impl Measure for UiItem<'_> { + fn measure(&self) -> [u16; 2] { + match self { + UiItem::Span(text, _style) => [UnicodeWidthStr::width(text.as_ref()) as u16, 1], + // Styles are only ever attached to containers, which are sized by + // their children, so this is never the size of anything drawn. + UiItem::Style(_style) => [1, 1], + } + } +} + pub(crate) fn ui(term: &mut TermBackend, state: &mut State) -> Res<()> { let size = term.size().unwrap(); let mut layout = UiTree::new(); @@ -153,18 +164,12 @@ pub(crate) fn layout_span<'a>(layout: &mut UiTree<'a>, span: (Cow<'a, str>, Styl match span.0 { Cow::Borrowed(s) => { for word in words(s) { - layout.leaf_with_size( - UiItem::Span(Cow::Borrowed(word), span.1), - [UnicodeWidthStr::width(word) as u16, 1], - ); + layout.leaf(UiItem::Span(Cow::Borrowed(word), span.1)); } } Cow::Owned(s) => { for word in words(&s) { - layout.leaf_with_size( - UiItem::Span(Cow::Owned(word.into()), span.1), - [UnicodeWidthStr::width(word) as u16, 1], - ); + layout.leaf(UiItem::Span(Cow::Owned(word.into()), span.1)); } } } diff --git a/src/ui/layout/mod.rs b/src/ui/layout/mod.rs index 8d5c8ee1d1..97b7d47084 100644 --- a/src/ui/layout/mod.rs +++ b/src/ui/layout/mod.rs @@ -6,13 +6,17 @@ use std::iter; use direction::Direction; use node::*; -use unicode_width::UnicodeWidthStr; use vec2::Vec2; pub use node::OPTS; const ROOT_INDEX: usize = usize::MAX; +/// Sizes an item as it is added to the tree. +pub trait Measure { + fn measure(&self) -> [u16; 2]; +} + #[derive(Debug)] pub struct LayoutTree { data: Vec>, @@ -122,16 +126,7 @@ impl Default for LayoutTree { } } -impl LayoutTree<&'static str> { - /// Add a text leaf, calculating size based on string length - #[allow(dead_code)] - pub fn text(&mut self, text: &'static str) -> &mut Self { - self.leaf_with_size(text, [UnicodeWidthStr::width(text) as u16, 1]); - self - } -} - -impl LayoutTree { +impl LayoutTree { pub fn horizontal)>( &mut self, data: Option, @@ -178,12 +173,9 @@ impl LayoutTree { } } - #[allow(dead_code)] pub fn leaf(&mut self, data: T) -> &mut Self { - self.leaf_with_size(data, [1, 1]) - } + let size = data.measure(); - pub fn leaf_with_size(&mut self, data: T, size: [u16; 2]) -> &mut Self { self.add(node::Node { data: Some(data), opts: OPTS, @@ -407,9 +399,16 @@ pub struct LayoutItem { #[cfg(test)] mod tests { use itertools::Itertools; + use unicode_width::UnicodeWidthStr; use super::*; + impl Measure for &str { + fn measure(&self) -> [u16; 2] { + [UnicodeWidthStr::width(*self) as u16, 1] + } + } + /// Render the layout to a string for testing purposes. /// Note: ASCII only — does not support Unicode beyond single-byte chars. fn render_to_string(layout: LayoutTree<&'static str>) -> String { @@ -443,8 +442,8 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS, |layout| { // Neither should grow - layout.text("Hello"); - layout.text("Hello"); + layout.leaf("Hello"); + layout.leaf("Hello"); }); let mut iter = layout.dist_main_fill(0, Vec2(10, 3)); @@ -456,11 +455,11 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS, |layout| { layout.horizontal(None, OPTS, |layout| { - layout.text("One"); + layout.leaf("One"); }); // This should shrink to 0 vertically and then grow to 3 layout.horizontal(None, OPTS.fill_y(), |layout| { - layout.text("Two"); + layout.leaf("Two"); }); }); @@ -475,10 +474,10 @@ mod tests { layout.vertical(None, OPTS, |layout| { // Both should grow, favoring the first layout.horizontal(None, OPTS.fill_y(), |layout| { - layout.text("One"); + layout.leaf("One"); }); layout.horizontal(None, OPTS.fill_y(), |layout| { - layout.text("Two"); + layout.leaf("Two"); }); }); @@ -492,8 +491,8 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS, |layout| { - layout.text("Hello"); - layout.text("lol"); + layout.leaf("Hello"); + layout.leaf("lol"); }); layout.compute([5, 2]); @@ -505,9 +504,9 @@ mod tests { let mut layout = LayoutTree::new(); layout.horizontal(None, OPTS, |layout| { - layout.text("A"); - layout.text("BB"); - layout.text("CCC"); + layout.leaf("A"); + layout.leaf("BB"); + layout.leaf("CCC"); }); layout.compute([6, 1]); @@ -519,9 +518,9 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS, |layout| { - layout.text("First"); - layout.text("Second"); - layout.text("Third"); + layout.leaf("First"); + layout.leaf("Second"); + layout.leaf("Third"); }); layout.compute([6, 3]); @@ -536,13 +535,13 @@ mod tests { // 0 layout.vertical(None, OPTS, |layout| { // 1 - layout.text("A"); // 2 - layout.text("B"); // 3 + layout.leaf("A"); // 2 + layout.leaf("B"); // 3 }); layout.vertical(None, OPTS, |layout| { // 4 - layout.text("C"); // 5 - layout.text("D"); // 6 + layout.leaf("C"); // 5 + layout.leaf("D"); // 6 }); }); @@ -554,7 +553,7 @@ mod tests { fn clear_layout() { let mut layout = LayoutTree::new(); - layout.text("Test"); + layout.leaf("Test"); layout.clear(); assert_eq!(layout.iter().count(), 0); @@ -566,12 +565,12 @@ mod tests { layout.vertical(None, OPTS, |layout| { layout.horizontal(None, OPTS, |layout| { - layout.text("12345"); - layout.text("The very start of this will be visible (a T)"); + layout.leaf("12345"); + layout.leaf("The very start of this will be visible (a T)"); }); layout.horizontal(None, OPTS, |layout| { - layout.text("123456"); - layout.text("This is completely outside of the layout and ignored"); + layout.leaf("123456"); + layout.leaf("This is completely outside of the layout and ignored"); }); }); @@ -584,9 +583,9 @@ mod tests { let mut layout = LayoutTree::new(); layout.horizontal(None, OPTS, |layout| { - layout.text("AAA"); - layout.text("BBB"); - layout.text("CCC"); + layout.leaf("AAA"); + layout.leaf("BBB"); + layout.leaf("CCC"); }); layout.compute([6, 2]); @@ -601,8 +600,8 @@ mod tests { let mut layout = LayoutTree::new(); layout.horizontal(None, OPTS, |layout| { - layout.text("AAAA"); - layout.text("BBBB"); + layout.leaf("AAAA"); + layout.leaf("BBBB"); }); layout.compute([6, 2]); @@ -621,9 +620,9 @@ mod tests { layout.vertical(None, OPTS, |layout| { layout.vertical(None, OPTS.fill_y(), |layout| { layout.horizontal(None, OPTS, |layout| { - layout.text("word1"); - layout.text("word2"); - layout.text("word3"); + layout.leaf("word1"); + layout.leaf("word2"); + layout.leaf("word3"); }); }); }); @@ -641,8 +640,8 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS, |layout| { - layout.text("Line 1"); - layout.text("Line 2"); + layout.leaf("Line 1"); + layout.leaf("Line 2"); }); layout.compute([10, 2]); @@ -660,13 +659,13 @@ mod tests { layout.horizontal(None, OPTS, |layout| { layout.vertical(None, OPTS, |layout| { - layout.text("1"); - layout.text("2"); + layout.leaf("1"); + layout.leaf("2"); }); layout.vertical(None, OPTS, |layout| { - layout.text("1"); - layout.text("2"); - layout.text("X"); + layout.leaf("1"); + layout.leaf("2"); + layout.leaf("X"); }); }); @@ -679,7 +678,7 @@ mod tests { let mut layout = LayoutTree::new(); layout.horizontal(None, OPTS, |layout| { - layout.text("café").text("naïve"); + layout.leaf("café").leaf("naïve"); }); layout.compute([10, 1]); @@ -692,8 +691,8 @@ mod tests { let mut layout = LayoutTree::new(); layout.horizontal(None, OPTS.gap(2), |layout| { - layout.text("one"); - layout.text("two"); + layout.leaf("one"); + layout.leaf("two"); }); layout.compute([8, 1]); @@ -705,8 +704,8 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS.gap(1), |layout| { - layout.text("one"); - layout.text("two"); + layout.leaf("one"); + layout.leaf("two"); }); layout.compute([3, 3]); @@ -719,9 +718,9 @@ mod tests { layout.vertical(None, OPTS, |layout| { layout.vertical(None, OPTS.fill_y(), |layout| { - layout.text("flex"); + layout.leaf("flex"); }); - layout.text("actual"); + layout.leaf("actual"); }); layout.compute([8, 3]); @@ -734,7 +733,7 @@ mod tests { layout.vertical(Some("root"), OPTS, |layout| { layout.horizontal(Some("grow"), OPTS.fill_xy(), |layout| { - layout.text("hello"); + layout.leaf("hello"); }); }); @@ -753,9 +752,9 @@ mod tests { let mut layout = LayoutTree::new(); layout.vertical(None, OPTS, |layout| { - layout.text("one"); - layout.text("twoooo"); - layout.text("three"); + layout.leaf("one"); + layout.leaf("twoooo"); + layout.leaf("three"); }); layout.compute([6, 1]); @@ -768,10 +767,10 @@ mod tests { layout.vertical(None, OPTS, |layout| { layout.vertical(None, OPTS.fill_y(), |layout| { - layout.text("flex 1"); - layout.text("flex 2"); + layout.leaf("flex 1"); + layout.leaf("flex 2"); }); - layout.text("actual"); + layout.leaf("actual"); }); layout.compute([6, 2]); @@ -785,12 +784,12 @@ mod tests { layout.vertical(None, OPTS, |layout| { layout.vertical(None, OPTS.fill_y(), |layout| { layout.vertical(None, OPTS, |layout| { - layout.text("This should not be visible'"); + layout.leaf("This should not be visible'"); }); }); layout.vertical(None, OPTS, |layout| { - layout.text("WEEEEE"); + layout.leaf("WEEEEE"); }); }); @@ -811,7 +810,7 @@ mod tests { layout.horizontal(None, OPTS.fill_x(), |layout| { // 0,1 -> 0,1 layout.horizontal(None, OPTS.fill_x(), |layout| { - layout.text("visible"); + layout.leaf("visible"); }); }); }); @@ -834,80 +833,80 @@ mod tests { // Screen layout.vertical(None, OPTS.fill_x(), |layout| { layout.horizontal(Some(""), OPTS.fill_x(), |layout| { - layout.text("On branch master"); + layout.leaf("On branch master"); }); - layout.text("Your branch is up to date with 'origin/master'"); + layout.leaf("Your branch is up to date with 'origin/master'"); }); - layout.text(""); - layout.text("Recent commits"); - layout.text("9eb6a63 refactor/ui origin/refactor/ui fix more rendering issues"); - layout.text("b5fffd4 fix styling issues in Screen"); - layout.text("61e6c1b refactor: extract type of LayoutTree"); - layout.text("df3bcb5 get rid of frequent clone() in LayoutTree"); - layout.text("9864859 refactor(ui): less allocs"); - layout.text("aa2811e refactor: new LayoutTree module to improve on ui headaches"); - layout.text( + layout.leaf(""); + layout.leaf("Recent commits"); + layout.leaf("9eb6a63 refactor/ui origin/refactor/ui fix more rendering issues"); + layout.leaf("b5fffd4 fix styling issues in Screen"); + layout.leaf("61e6c1b refactor: extract type of LayoutTree"); + layout.leaf("df3bcb5 get rid of frequent clone() in LayoutTree"); + layout.leaf("9864859 refactor(ui): less allocs"); + layout.leaf("aa2811e refactor: new LayoutTree module to improve on ui headaches"); + layout.leaf( "5374ab3 master origin/master test: add file:// in clone_and_commit fn as well", ); - layout.text("7a66235 test: get rid of setup_init, and try fix test-repo assertion"); - layout.text( + layout.leaf("7a66235 test: get rid of setup_init, and try fix test-repo assertion"); + layout.leaf( "75463c8 test/fix-ci test: forgot to create testfiles/ when running tests", ); }); layout.vertical(None, OPTS, |layout| { // Menu - layout.text("───────────────────────────────────────────────────────────────"); + layout.leaf("───────────────────────────────────────────────────────────────"); layout.horizontal(None, OPTS.gap(2), |layout| { layout.vertical(None, OPTS, |layout| { - layout.text("Help"); - layout.text("Y Show Refs"); - layout.text(" Toggle section"); - layout.text("k/ Up "); - layout.text("j/ Down"); - layout.text("/ Up line"); - layout.text("/ Down line"); - layout.text("/ Prev section"); - layout.text("/ Next section"); - layout.text("/ Parent section"); - layout.text(" Half page up"); - layout.text(" Half page down"); - layout.text("g+r Refresh"); - layout.text("q/ Quit/Close"); + layout.leaf("Help"); + layout.leaf("Y Show Refs"); + layout.leaf(" Toggle section"); + layout.leaf("k/ Up "); + layout.leaf("j/ Down"); + layout.leaf("/ Up line"); + layout.leaf("/ Down line"); + layout.leaf("/ Prev section"); + layout.leaf("/ Next section"); + layout.leaf("/ Parent section"); + layout.leaf(" Half page up"); + layout.leaf(" Half page down"); + layout.leaf("g+r Refresh"); + layout.leaf("q/ Quit/Close"); }); layout.vertical(None, OPTS, |layout| { - layout.text("Submenu"); - layout.text("b Branch"); - layout.text("c Commit"); - layout.text("f Fetch"); - layout.text("h/? Help"); - layout.text("l Log"); - layout.text("M Remote"); - layout.text("F Pull"); - layout.text("P Push"); - layout.text("r Rebase"); - layout.text("X Reset"); - layout.text("V Revert"); - layout.text("z Stash"); - layout.text(""); + layout.leaf("Submenu"); + layout.leaf("b Branch"); + layout.leaf("c Commit"); + layout.leaf("f Fetch"); + layout.leaf("h/? Help"); + layout.leaf("l Log"); + layout.leaf("M Remote"); + layout.leaf("F Pull"); + layout.leaf("P Push"); + layout.leaf("r Rebase"); + layout.leaf("X Reset"); + layout.leaf("V Revert"); + layout.leaf("z Stash"); + layout.leaf(""); }); layout.vertical(None, OPTS, |layout| { - layout.text("@@ -271,7 +271,7"); - layout.text("s Stage"); - layout.text("u Unstage"); - layout.text(" Show"); - layout.text("K Discard"); - layout.text(""); - layout.text(""); - layout.text(""); - layout.text(""); - layout.text(""); - layout.text(""); - layout.text(""); - layout.text(""); - layout.text(""); + layout.leaf("@@ -271,7 +271,7"); + layout.leaf("s Stage"); + layout.leaf("u Unstage"); + layout.leaf(" Show"); + layout.leaf("K Discard"); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); + layout.leaf(""); }); }); }); From e832f86b1bc4cec0739f8c0f821c231cdd0848a2 Mon Sep 17 00:00:00 2001 From: altsem Date: Tue, 28 Jul 2026 18:31:26 +0200 Subject: [PATCH 2/5] refactor(layout): Make layout unit generic --- src/screen/mod.rs | 6 +- src/ui.rs | 18 +-- src/ui/cmd_log.rs | 6 +- src/ui/layout/direction.rs | 10 +- src/ui/layout/mod.rs | 252 +++++++++++++++++++++++-------------- src/ui/layout/node.rs | 93 +++++++------- src/ui/layout/vec2.rs | 117 ++++++++++++----- src/ui/menu.rs | 20 +-- src/ui/picker.rs | 26 ++-- 9 files changed, 337 insertions(+), 211 deletions(-) diff --git a/src/screen/mod.rs b/src/screen/mod.rs index 9c313e4140..6a73c03326 100644 --- a/src/screen/mod.rs +++ b/src/screen/mod.rs @@ -1,6 +1,6 @@ use crate::config::StyleConfig; use crate::style::Style; -use crate::ui::layout::{LayoutTree, OPTS}; +use crate::ui::layout::{LayoutTree, opts}; use crate::ui::{UiItem, UiTree, layout_span}; use crate::{item_data::ItemData, ui}; use itertools::Itertools; @@ -550,7 +550,7 @@ struct ItemView { } pub(crate) fn layout_screen<'a>(layout: &mut UiTree<'a>, screen: &'a Screen, hide_cursor: bool) { - layout.vertical(None, OPTS.fill_x(), |layout| { + layout.vertical(None, opts().fill_x(), |layout| { for view in screen.item_views(screen.size) { layout_item(layout, screen, hide_cursor, view); } @@ -565,7 +565,7 @@ fn layout_item<'a>(layout: &mut UiTree<'a>, screen: &'a Screen, hide_cursor: boo let line_sel = line_selection_highlight(style, &line, is_line_sel); let bg = area_sel.patch(line_sel); - layout.horizontal(Some(UiItem::Style(bg)), OPTS.fill_x(), |layout| { + layout.horizontal(Some(UiItem::Style(bg)), opts().fill_x(), |layout| { let gutter_char = if !hide_cursor && line.highlighted { gutter_char(style, is_line_sel, bg) } else { diff --git a/src/ui.rs b/src/ui.rs index 5e585aa392..58181d47ff 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -10,7 +10,7 @@ use crate::text_input::Status; use crate::ui::layout::{LayoutItem, Measure}; use itertools::Itertools; use layout::LayoutTree; -use layout::OPTS; +use layout::opts; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; @@ -32,6 +32,8 @@ pub(crate) enum UiItem<'a> { pub(crate) type UiTree<'a> = LayoutTree>; impl Measure for UiItem<'_> { + type Unit = u16; + fn measure(&self) -> [u16; 2] { match self { UiItem::Span(text, _style) => [UnicodeWidthStr::width(text.as_ref()) as u16, 1], @@ -46,13 +48,13 @@ pub(crate) fn ui(term: &mut TermBackend, state: &mut State) -> Res<()> { let size = term.size().unwrap(); let mut layout = UiTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.vertical(None, OPTS.fill_xy(), |layout| { + layout.vertical(None, opts(), |layout| { + layout.vertical(None, opts().fill_xy(), |layout| { let hide_cursor = state.picker.is_some(); screen::layout_screen(layout, state.screens.last().unwrap(), hide_cursor); }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { menu::layout_menu(layout, state, size.0 as usize); cmd_log::layout_cmd_log( layout, @@ -104,7 +106,7 @@ fn layout_prompt<'a>(layout: &mut UiTree<'a>, state: &'a State, width: usize) { let prompt_style = Style::from(&state.config.style.prompt); repeat_chars(layout, width, DASHES, separator_style); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout_span( layout, ( @@ -155,7 +157,7 @@ fn layout_picker<'a>(layout: &mut UiTree<'a>, state: &'a State, width: usize) { /// Lays out `content` as a single row of its own. pub(crate) fn layout_line<'a>(layout: &mut UiTree<'a>, content: Cow<'a, str>, style: Style) { - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout_span(layout, (content, style)); }); } @@ -188,7 +190,7 @@ pub(crate) fn repeat_chars(layout: &mut UiTree, count: usize, chars: &'static st let full = count / grapheme_count; let partial = count % grapheme_count; - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { for _ in 0..full { layout_span(layout, (chars.into(), style)); } @@ -210,7 +212,7 @@ pub(crate) fn repeat_chars(layout: &mut UiTree, count: usize, chars: &'static st fn clear_blanks( term: &mut TermBackend, size: (u16, u16), - items: Vec>>, + items: Vec, u16>>, ) -> Result<(), Error> { let mut at = [0, 0]; let mut bg = Style::new(); diff --git a/src/ui/cmd_log.rs b/src/ui/cmd_log.rs index ca29b4ee04..6173f6c968 100644 --- a/src/ui/cmd_log.rs +++ b/src/ui/cmd_log.rs @@ -4,7 +4,7 @@ use crate::style::Style; use crate::cmd_log::{CmdLog, CmdLogEntry}; use crate::config::Config; -use crate::ui::layout::OPTS; +use crate::ui::layout::opts; use crate::ui::{DASHES, UiTree, layout_line, layout_span, repeat_chars}; pub(crate) fn layout_cmd_log<'a>( @@ -19,7 +19,7 @@ pub(crate) fn layout_cmd_log<'a>( repeat_chars(layout, width, DASHES, Style::from(&config.style.separator)); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { for entry in &log.entries { layout_entry(layout, entry, config); } @@ -30,7 +30,7 @@ pub(crate) fn layout_cmd_log<'a>( fn layout_entry<'a>(layout: &mut UiTree<'a>, entry: &Arc>, config: &Config) { match &*entry.read().unwrap() { CmdLogEntry::Cmd { args, out } => { - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout_span( layout, ( diff --git a/src/ui/layout/direction.rs b/src/ui/layout/direction.rs index a83991be78..81251a05d2 100644 --- a/src/ui/layout/direction.rs +++ b/src/ui/layout/direction.rs @@ -1,4 +1,4 @@ -use super::vec2::Vec2; +use super::vec2::{Scalar, Vec2}; #[derive(Debug, Clone, Copy, PartialEq)] pub enum Direction { @@ -7,10 +7,12 @@ pub enum Direction { } impl Direction { - pub(crate) fn axis(&self) -> Vec2 { + /// The unit vector along this direction, used to mask a `Vec2` down to one + /// axis. + pub(crate) fn axis(&self) -> Vec2 { match self { - Direction::Horizontal => Vec2(1, 0), - Direction::Vertical => Vec2(0, 1), + Direction::Horizontal => Vec2(U::ONE, U::ZERO), + Direction::Vertical => Vec2(U::ZERO, U::ONE), } } } diff --git a/src/ui/layout/mod.rs b/src/ui/layout/mod.rs index 97b7d47084..dd07c2067d 100644 --- a/src/ui/layout/mod.rs +++ b/src/ui/layout/mod.rs @@ -8,18 +8,22 @@ use direction::Direction; use node::*; use vec2::Vec2; -pub use node::OPTS; +pub use node::{Opts, opts}; +pub use vec2::Scalar; const ROOT_INDEX: usize = usize::MAX; -/// Sizes an item as it is added to the tree. +/// Sizes an item as it is added to the tree, in whichever unit the layout is +/// measured in. pub trait Measure { - fn measure(&self) -> [u16; 2]; + type Unit: Scalar; + + fn measure(&self) -> [Self::Unit; 2]; } #[derive(Debug)] -pub struct LayoutTree { - data: Vec>, +pub struct LayoutTree { + data: Vec>, index: TreeIndex, } @@ -90,7 +94,7 @@ pub enum Pass { Fill, } -impl LayoutTree { +impl LayoutTree { pub fn new() -> Self { LayoutTree { data: Vec::new(), @@ -104,12 +108,16 @@ impl LayoutTree { self.index.current_parent = ROOT_INDEX; } - pub(crate) fn add(&mut self, data: Node) { + pub(crate) fn add(&mut self, data: Node) { self.data.push(data); self.index.parents.push(self.index.current_parent); } - pub(crate) fn add_with_children(&mut self, data: Node, insert_fn: F) { + pub(crate) fn add_with_children( + &mut self, + data: Node, + insert_fn: F, + ) { self.add(data); let our_parent = self.index.current_parent; self.index.current_parent = self.index.parents.len() - 1; @@ -120,7 +128,7 @@ impl LayoutTree { } } -impl Default for LayoutTree { +impl Default for LayoutTree { fn default() -> Self { Self::new() } @@ -130,7 +138,7 @@ impl LayoutTree { pub fn horizontal)>( &mut self, data: Option, - opts: Opts, + opts: Opts, layout_fn: F, ) -> &mut Self { { @@ -140,8 +148,8 @@ impl LayoutTree { dir: Direction::Horizontal, ..opts }, - size: Vec2(0, 0), - content: Vec2(0, 0), + size: Vec2::zero(), + content: Vec2::zero(), pos: None, }; @@ -153,7 +161,7 @@ impl LayoutTree { pub fn vertical)>( &mut self, data: Option, - opts: Opts, + opts: Opts, layout_fn: F, ) -> &mut Self { { @@ -163,8 +171,8 @@ impl LayoutTree { dir: Direction::Vertical, ..opts }, - size: Vec2(0, 0), - content: Vec2(0, 0), + size: Vec2::zero(), + content: Vec2::zero(), pos: None, }; @@ -178,7 +186,7 @@ impl LayoutTree { self.add(node::Node { data: Some(data), - opts: OPTS, + opts: opts(), size: size.into(), content: size.into(), pos: None, @@ -187,16 +195,16 @@ impl LayoutTree { self } - pub fn compute(&mut self, avail_size: [u16; 2]) { + pub fn compute(&mut self, avail_size: [T::Unit; 2]) { let Some(root) = self.index.iter_roots().next() else { panic!("no root"); }; let size = Vec2::from(avail_size); - self.data[root].pos = Some(Vec2(0, 0)); + self.data[root].pos = Some(Vec2::zero()); for pass in [Pass::Fit, Pass::Fill] { - if let Some(root_size) = self.compute_subtree(root, Vec2(0, 0), size, pass) { + if let Some(root_size) = self.compute_subtree(root, Vec2::zero(), size, pass) { self.data[root].size = root_size; } } @@ -205,28 +213,28 @@ impl LayoutTree { fn compute_subtree( &mut self, parent: usize, - outer_start: Vec2, - outer_avail_size: Vec2, + outer_start: Vec2, + outer_avail_size: Vec2, pass: Pass, - ) -> Option { + ) -> Option> { let child = self.index.iter_children(parent).next()?; let parent_opts = self.data[parent].opts; let main_axis = parent_opts.dir.axis(); let cross_axis = main_axis.flip(); - let padding = Vec2(parent_opts.pad, parent_opts.pad) * main_axis; + let padding = Vec2::splat(parent_opts.pad) * main_axis; let avail_size = outer_avail_size .saturating_sub(padding) .saturating_sub(padding); let mut current_child = Some(child); - let mut cursor = Vec2(0, 0); - let mut size = Vec2(0, 0); + let mut cursor = Vec2::zero(); + let mut size = Vec2::zero(); // Intrinsic extent, accumulated independently of any fill shrinking. - let mut content_cursor = Vec2(0, 0); - let mut content = Vec2(0, 0); + let mut content_cursor = Vec2::zero(); + let mut content = Vec2::zero(); let fill_avail = match pass { - Pass::Fit => Vec2(0, 0), + Pass::Fit => Vec2::zero(), Pass::Fill => avail_size.saturating_sub(self.data[parent].size), }; @@ -252,13 +260,12 @@ impl LayoutTree { self.data[child].content = child_content; content = content.max(content_cursor + child_content); - content_cursor += - main_axis * (Vec2(parent_opts.gap, parent_opts.gap) + child_content); + content_cursor += main_axis * (Vec2::splat(parent_opts.gap) + child_content); // On an axis this child fills it may shrink, so take the flow // extent. On an axis it does not fill, its size is its content. let fill_mask = self.data[child].opts.fill; - let content_mask = Vec2(1, 1).saturating_sub(fill_mask); + let content_mask = Vec2::one().saturating_sub(fill_mask); let resolved = flow * fill_mask + child_content * content_mask; if is_main_fill { @@ -271,7 +278,7 @@ impl LayoutTree { } Pass::Fill => { let fill = { - let mut sum = Vec2(0, 0); + let mut sum = Vec2::zero(); if is_main_fill { sum += main_fill_iter.next().unwrap() } @@ -308,7 +315,7 @@ impl LayoutTree { // Fits completely on next line cursor = next_line; child_pos = Some(outer_start + padding + cursor); - } else if (cursor + Vec2(1, 1)).fits(avail_size) { + } else if (cursor + Vec2::one()).fits(avail_size) { // Can't wrap, but we can fit at least one cell where the cursor currently is child_pos = Some(outer_start + padding + cursor); child_size = child_size.min(avail_size.saturating_sub(cursor)); @@ -317,7 +324,7 @@ impl LayoutTree { if child_pos.is_some() { size = size.max(cursor + child_size); - cursor += main_axis * (Vec2(parent_opts.gap, parent_opts.gap) + child_size); + cursor += main_axis * (Vec2::splat(parent_opts.gap) + child_size); } self.data[child].pos = child_pos; @@ -340,8 +347,8 @@ impl LayoutTree { fn dist_main_fill( &self, parent: usize, - size_to_distribute: Vec2, - ) -> impl Iterator + use { + size_to_distribute: Vec2, + ) -> impl Iterator> + use { let axis = self.data[parent].opts.dir.axis(); let along_axis = size_to_distribute * axis; let count = self @@ -351,11 +358,12 @@ impl LayoutTree { .count() as u16; let (quot, rem) = if count > 0 { - let quot = along_axis / Vec2(count, count); - let rem = along_axis % Vec2(count, count); + let count = Vec2::splat(count.into()); + let quot = along_axis / count; + let rem = along_axis - quot * count; (quot, rem) } else { - (Vec2(0, 0), Vec2(0, 0)) + (Vec2::zero(), Vec2::zero()) }; iter::once(quot + rem) @@ -363,7 +371,7 @@ impl LayoutTree { .take(count as usize) } - pub fn iter(&self) -> impl Iterator> { + pub fn iter(&self) -> impl Iterator> { self.index.iter().filter_map(|index| { let Node { data: Some(data), @@ -376,7 +384,7 @@ impl LayoutTree { return None; }; - if size.0 == 0 || size.1 == 0 { + if size.0 == T::Unit::ZERO || size.1 == T::Unit::ZERO { return None; } @@ -390,10 +398,10 @@ impl LayoutTree { } #[derive(Debug)] -pub struct LayoutItem { +pub struct LayoutItem { pub data: T, - pub pos: [u16; 2], - pub size: [u16; 2], + pub pos: [U; 2], + pub size: [U; 2], } #[cfg(test)] @@ -404,11 +412,63 @@ mod tests { use super::*; impl Measure for &str { + type Unit = u16; + fn measure(&self) -> [u16; 2] { [UnicodeWidthStr::width(*self) as u16, 1] } } + /// An item measured in a non-integer unit. Sizes are chosen as binary + /// fractions so that the arithmetic below is exact. + #[derive(Debug, Clone)] + struct Fractional(f32, f32); + + impl Measure for Fractional { + type Unit = f32; + + fn measure(&self) -> [f32; 2] { + [self.0, self.1] + } + } + + #[test] + fn float_units_are_placed_at_fractional_offsets() { + let mut layout = LayoutTree::new(); + + layout.horizontal(None, opts(), |layout| { + layout.leaf(Fractional(2.5, 1.0)); + layout.leaf(Fractional(2.5, 1.0)); + }); + + layout.compute([5.0, 1.0]); + let mut iter = layout.iter().map(|item| (item.pos, item.size)); + assert_eq!(Some(([0.0, 0.0], [2.5, 1.0])), iter.next()); + assert_eq!(Some(([2.5, 0.0], [2.5, 1.0])), iter.next()); + assert_eq!(None, iter.next()); + } + + #[test] + fn float_fill_distributes_the_whole_extent() { + let mut layout = LayoutTree::new(); + + layout.vertical(None, opts(), |layout| { + for _ in 0..3 { + layout.horizontal(None, opts().fill_y(), |layout| { + layout.leaf(Fractional(1.0, 1.0)); + }); + } + }); + + // 10 does not divide evenly by 3, which is where a `%`-derived + // remainder would hand the first filler space already shared out. + let shares = layout.dist_main_fill(0, Vec2(0.0, 10.0)).collect_vec(); + assert_eq!(3, shares.len()); + + let total: f32 = shares.iter().map(|share| share.1).sum(); + assert!((total - 10.0).abs() < 1e-4, "distributed {total} of 10.0"); + } + /// Render the layout to a string for testing purposes. /// Note: ASCII only — does not support Unicode beyond single-byte chars. fn render_to_string(layout: LayoutTree<&'static str>) -> String { @@ -440,7 +500,7 @@ mod tests { #[test] fn test_iter_distribute_size_no_flex() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { // Neither should grow layout.leaf("Hello"); layout.leaf("Hello"); @@ -453,12 +513,12 @@ mod tests { #[test] fn test_iter_distribute_size_one_flex() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.horizontal(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("One"); }); // This should shrink to 0 vertically and then grow to 3 - layout.horizontal(None, OPTS.fill_y(), |layout| { + layout.horizontal(None, opts().fill_y(), |layout| { layout.leaf("Two"); }); }); @@ -471,12 +531,12 @@ mod tests { #[test] fn test_iter_distribute_size_all_flex() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { // Both should grow, favoring the first - layout.horizontal(None, OPTS.fill_y(), |layout| { + layout.horizontal(None, opts().fill_y(), |layout| { layout.leaf("One"); }); - layout.horizontal(None, OPTS.fill_y(), |layout| { + layout.horizontal(None, opts().fill_y(), |layout| { layout.leaf("Two"); }); }); @@ -490,7 +550,7 @@ mod tests { fn single_text() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("Hello"); layout.leaf("lol"); }); @@ -503,7 +563,7 @@ mod tests { fn horizontal_layout() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("A"); layout.leaf("BB"); layout.leaf("CCC"); @@ -517,7 +577,7 @@ mod tests { fn vertical_layout() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("First"); layout.leaf("Second"); layout.leaf("Third"); @@ -531,14 +591,14 @@ mod tests { fn nested_layouts() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { // 0 - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { // 1 layout.leaf("A"); // 2 layout.leaf("B"); // 3 }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { // 4 layout.leaf("C"); // 5 layout.leaf("D"); // 6 @@ -563,12 +623,12 @@ mod tests { fn out_of_bounds_horizontal() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.horizontal(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("12345"); layout.leaf("The very start of this will be visible (a T)"); }); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("123456"); layout.leaf("This is completely outside of the layout and ignored"); }); @@ -582,7 +642,7 @@ mod tests { fn test_horizontal_wrap() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("AAA"); layout.leaf("BBB"); layout.leaf("CCC"); @@ -599,7 +659,7 @@ mod tests { fn test_wrap_before_truncate() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("AAAA"); layout.leaf("BBBB"); }); @@ -617,9 +677,9 @@ mod tests { fn nested_grow_wrap() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.vertical(None, OPTS.fill_y(), |layout| { - layout.horizontal(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { + layout.vertical(None, opts().fill_y(), |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("word1"); layout.leaf("word2"); layout.leaf("word3"); @@ -639,7 +699,7 @@ mod tests { fn test_no_trailing_newline() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("Line 1"); layout.leaf("Line 2"); }); @@ -657,12 +717,12 @@ mod tests { fn out_of_bounds_vertical() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS, |layout| { - layout.vertical(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("1"); layout.leaf("2"); }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("1"); layout.leaf("2"); layout.leaf("X"); @@ -677,7 +737,7 @@ mod tests { fn unicode_text_width() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout.leaf("café").leaf("naïve"); }); @@ -690,7 +750,7 @@ mod tests { fn horizontal_gap() { let mut layout = LayoutTree::new(); - layout.horizontal(None, OPTS.gap(2), |layout| { + layout.horizontal(None, opts().gap(2), |layout| { layout.leaf("one"); layout.leaf("two"); }); @@ -703,7 +763,7 @@ mod tests { fn vertical_gap() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS.gap(1), |layout| { + layout.vertical(None, opts().gap(1), |layout| { layout.leaf("one"); layout.leaf("two"); }); @@ -716,8 +776,8 @@ mod tests { fn grow() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.vertical(None, OPTS.fill_y(), |layout| { + layout.vertical(None, opts(), |layout| { + layout.vertical(None, opts().fill_y(), |layout| { layout.leaf("flex"); }); layout.leaf("actual"); @@ -731,8 +791,8 @@ mod tests { fn nested_grow_preserves_cross_axis() { let mut layout = LayoutTree::new(); - layout.vertical(Some("root"), OPTS, |layout| { - layout.horizontal(Some("grow"), OPTS.fill_xy(), |layout| { + layout.vertical(Some("root"), opts(), |layout| { + layout.horizontal(Some("grow"), opts().fill_xy(), |layout| { layout.leaf("hello"); }); }); @@ -751,7 +811,7 @@ mod tests { fn overflow() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("one"); layout.leaf("twoooo"); layout.leaf("three"); @@ -765,8 +825,8 @@ mod tests { fn shrink() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.vertical(None, OPTS.fill_y(), |layout| { + layout.vertical(None, opts(), |layout| { + layout.vertical(None, opts().fill_y(), |layout| { layout.leaf("flex 1"); layout.leaf("flex 2"); }); @@ -781,14 +841,14 @@ mod tests { fn shrinks_nested() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.vertical(None, OPTS.fill_y(), |layout| { - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { + layout.vertical(None, opts().fill_y(), |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("This should not be visible'"); }); }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("WEEEEE"); }); }); @@ -803,13 +863,13 @@ mod tests { fn nested_horizontal_fill_does_not_hide_siblings() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { // 0,0 -> 0,5 - layout.vertical(None, OPTS.fill_y(), |layout| { + layout.vertical(None, opts().fill_y(), |layout| { // 0,1 -> 0,1 - layout.horizontal(None, OPTS.fill_x(), |layout| { + layout.horizontal(None, opts().fill_x(), |layout| { // 0,1 -> 0,1 - layout.horizontal(None, OPTS.fill_x(), |layout| { + layout.horizontal(None, opts().fill_x(), |layout| { layout.leaf("visible"); }); }); @@ -828,11 +888,11 @@ mod tests { fn gitu_mockup() { let mut layout = LayoutTree::new(); - layout.vertical(None, OPTS, |layout| { - layout.vertical(None, OPTS.fill_xy(), |layout| { + layout.vertical(None, opts(), |layout| { + layout.vertical(None, opts().fill_xy(), |layout| { // Screen - layout.vertical(None, OPTS.fill_x(), |layout| { - layout.horizontal(Some(""), OPTS.fill_x(), |layout| { + layout.vertical(None, opts().fill_x(), |layout| { + layout.horizontal(Some(""), opts().fill_x(), |layout| { layout.leaf("On branch master"); }); layout.leaf("Your branch is up to date with 'origin/master'"); @@ -855,12 +915,12 @@ mod tests { ); }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { // Menu layout.leaf("───────────────────────────────────────────────────────────────"); - layout.horizontal(None, OPTS.gap(2), |layout| { - layout.vertical(None, OPTS, |layout| { + layout.horizontal(None, opts().gap(2), |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("Help"); layout.leaf("Y Show Refs"); layout.leaf(" Toggle section"); @@ -876,7 +936,7 @@ mod tests { layout.leaf("g+r Refresh"); layout.leaf("q/ Quit/Close"); }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("Submenu"); layout.leaf("b Branch"); layout.leaf("c Commit"); @@ -892,7 +952,7 @@ mod tests { layout.leaf("z Stash"); layout.leaf(""); }); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout.leaf("@@ -271,7 +271,7"); layout.leaf("s Stage"); layout.leaf("u Unstage"); diff --git a/src/ui/layout/node.rs b/src/ui/layout/node.rs index 8c5f750453..72e5c7c627 100644 --- a/src/ui/layout/node.rs +++ b/src/ui/layout/node.rs @@ -1,84 +1,91 @@ -use super::vec2::Vec2; +use super::vec2::{Scalar, Vec2}; use super::direction::Direction; -pub const OPTS: Opts = Opts { - dir: Direction::Horizontal, - fill: Vec2(0, 0), - gap: 0, - pad: 0, -}; +/// Shorthand for [`Opts::new`], which is spelled out at every node. +pub fn opts() -> Opts { + Opts::new() +} #[derive(Debug, Copy, Clone)] -pub struct Opts { +pub struct Opts { /// Layout direction for children of this node. pub(crate) dir: Direction, - pub(crate) fill: Vec2, + pub(crate) fill: Vec2, /// The space between each direct child of this node. - pub(crate) gap: u16, - pub(crate) pad: u16, + pub(crate) gap: U, + pub(crate) pad: U, } -impl Default for Opts { +impl Default for Opts { fn default() -> Self { - OPTS + Self::new() } } -impl Opts { - pub fn fill_x(self) -> Opts { +impl Opts { + pub fn new() -> Self { + Self { + dir: Direction::Horizontal, + fill: Vec2::zero(), + gap: U::ZERO, + pad: U::ZERO, + } + } + + pub fn fill_x(self) -> Self { Self { - fill: Vec2(1, 0), + fill: Vec2(U::ONE, U::ZERO), ..self } } #[allow(dead_code)] - pub fn fill_y(self) -> Opts { + pub fn fill_y(self) -> Self { Self { - fill: Vec2(0, 1), + fill: Vec2(U::ZERO, U::ONE), ..self } } - pub fn fill_xy(self) -> Opts { + pub fn fill_xy(self) -> Self { Self { - fill: Vec2(1, 1), + fill: Vec2::one(), ..self } } - pub fn gap(self, gap: u16) -> Self { + pub fn gap(self, gap: U) -> Self { Self { gap, ..self } } - pub fn pad(self, pad: u16) -> Opts { + pub fn pad(self, pad: U) -> Self { Self { pad, ..self } } - pub(crate) fn is_main_fill(&self, parent: &Opts) -> bool { - self.fill * parent.dir.axis() != Vec2(0, 0) + pub(crate) fn is_main_fill(&self, parent: &Self) -> bool { + self.fill * parent.dir.axis() != Vec2::zero() } - pub(crate) fn is_cross_fill(&self, parent: &Opts) -> bool { - self.fill * parent.dir.axis().flip() != Vec2(0, 0) + pub(crate) fn is_cross_fill(&self, parent: &Self) -> bool { + self.fill * parent.dir.axis().flip() != Vec2::zero() } } #[derive(Debug)] -pub(crate) struct Node { +pub(crate) struct Node { pub(crate) data: Option, /// layout options - pub(crate) opts: Opts, + pub(crate) opts: Opts, /// space actually occupied by this node, updated as nodes are added - pub(crate) size: Vec2, + pub(crate) size: Vec2, /// Intrinsic (content) size of this subtree, ignoring fill shrinking. /// A fill node may shrink below this, but an ancestor that does *not* fill /// a given axis still needs the content extent to size itself on that axis. - pub(crate) content: Vec2, + pub(crate) content: Vec2, /// Offset from parent's top-left corner, updated as nodes are added. /// This will remain `None` if there's no valid position for the element. - pub(crate) pos: Option, + pub(crate) pos: Option>, } #[cfg(test)] @@ -95,19 +102,19 @@ mod tests { ..Default::default() }; - assert!(super::OPTS.fill_x().is_main_fill(&horizontal)); - assert!(super::OPTS.fill_y().is_main_fill(&vertical)); - assert!(super::OPTS.fill_xy().is_main_fill(&horizontal)); - assert!(super::OPTS.fill_xy().is_main_fill(&vertical)); + assert!(super::opts::().fill_x().is_main_fill(&horizontal)); + assert!(super::opts::().fill_y().is_main_fill(&vertical)); + assert!(super::opts::().fill_xy().is_main_fill(&horizontal)); + assert!(super::opts::().fill_xy().is_main_fill(&vertical)); - assert!(!super::OPTS.fill_x().is_main_fill(&vertical)); - assert!(!super::OPTS.fill_y().is_main_fill(&horizontal)); - assert!(!super::OPTS.fill_x().is_cross_fill(&horizontal)); - assert!(!super::OPTS.fill_y().is_cross_fill(&vertical)); + assert!(!super::opts::().fill_x().is_main_fill(&vertical)); + assert!(!super::opts::().fill_y().is_main_fill(&horizontal)); + assert!(!super::opts::().fill_x().is_cross_fill(&horizontal)); + assert!(!super::opts::().fill_y().is_cross_fill(&vertical)); - assert!(!super::OPTS.is_main_fill(&horizontal)); - assert!(!super::OPTS.is_main_fill(&vertical)); - assert!(!super::OPTS.is_cross_fill(&horizontal)); - assert!(!super::OPTS.is_cross_fill(&vertical)); + assert!(!super::opts::().is_main_fill(&horizontal)); + assert!(!super::opts::().is_main_fill(&vertical)); + assert!(!super::opts::().is_cross_fill(&horizontal)); + assert!(!super::opts::().is_cross_fill(&vertical)); } } diff --git a/src/ui/layout/vec2.rs b/src/ui/layout/vec2.rs index f7768cc955..9aa6e927b7 100644 --- a/src/ui/layout/vec2.rs +++ b/src/ui/layout/vec2.rs @@ -1,27 +1,75 @@ use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Sub, SubAssign}; +/// The unit a layout is measured in, e.g. terminal cells or pixels. +/// +/// `PartialOrd` rather than `Ord` so that floats qualify; `From` is what +/// lets the engine turn a child count into a unit when distributing fill space. +pub trait Scalar: + Copy + + PartialOrd + + std::fmt::Debug + + From + + Add + + Sub + + Mul + + Div + + Rem +{ + const ZERO: Self; + const ONE: Self; +} + +macro_rules! impl_scalar { + ($($ty:ty => $zero:expr, $one:expr);* $(;)?) => { + $( + impl Scalar for $ty { + const ZERO: Self = $zero; + const ONE: Self = $one; + } + )* + }; +} + +impl_scalar! { + u16 => 0, 1; + u32 => 0, 1; + u64 => 0, 1; + usize => 0, 1; + f32 => 0.0, 1.0; + f64 => 0.0, 1.0; +} + #[derive(Clone, Copy, PartialEq, Eq, Hash)] -pub(crate) struct Vec2(pub(crate) u16, pub(crate) u16); +pub(crate) struct Vec2(pub(crate) U, pub(crate) U); + +/// Comparisons go through `PartialOrd`, so a NaN operand yields `rhs`. +fn max(lhs: U, rhs: U) -> U { + if lhs > rhs { lhs } else { rhs } +} -impl std::fmt::Debug for Vec2 { +fn min(lhs: U, rhs: U) -> U { + if lhs < rhs { lhs } else { rhs } +} + +impl std::fmt::Debug for Vec2 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_fmt(format_args!("Vec2({}, {})", self.0, self.1)) + f.write_fmt(format_args!("Vec2({:?}, {:?})", self.0, self.1)) } } -impl From<[u16; 2]> for Vec2 { - fn from([x, y]: [u16; 2]) -> Self { +impl From<[U; 2]> for Vec2 { + fn from([x, y]: [U; 2]) -> Self { Self(x, y) } } -impl From for [u16; 2] { - fn from(Vec2(x, y): Vec2) -> Self { +impl From> for [U; 2] { + fn from(Vec2(x, y): Vec2) -> Self { [x, y] } } -impl Add for Vec2 { +impl Add for Vec2 { type Output = Self; fn add(self, rhs: Self) -> Self::Output { @@ -29,7 +77,7 @@ impl Add for Vec2 { } } -impl Sub for Vec2 { +impl Sub for Vec2 { type Output = Self; fn sub(self, rhs: Self) -> Self::Output { @@ -37,7 +85,7 @@ impl Sub for Vec2 { } } -impl Mul for Vec2 { +impl Mul for Vec2 { type Output = Self; fn mul(self, rhs: Self) -> Self::Output { @@ -45,7 +93,7 @@ impl Mul for Vec2 { } } -impl Div for Vec2 { +impl Div for Vec2 { type Output = Self; fn div(self, rhs: Self) -> Self::Output { @@ -53,7 +101,7 @@ impl Div for Vec2 { } } -impl Rem for Vec2 { +impl Rem for Vec2 { type Output = Self; fn rem(self, rhs: Self) -> Self::Output { @@ -61,48 +109,55 @@ impl Rem for Vec2 { } } -impl AddAssign for Vec2 { +impl AddAssign for Vec2 { fn add_assign(&mut self, rhs: Self) { - self.0 += rhs.0; - self.1 += rhs.1; + *self = *self + rhs; } } -impl SubAssign for Vec2 { +impl SubAssign for Vec2 { fn sub_assign(&mut self, rhs: Self) { - self.0 -= rhs.0; - self.1 -= rhs.1; + *self = *self - rhs; } } -impl MulAssign for Vec2 { +impl MulAssign for Vec2 { fn mul_assign(&mut self, rhs: Self) { - self.0 *= rhs.0; - self.1 *= rhs.1; + *self = *self * rhs; } } -impl DivAssign for Vec2 { +impl DivAssign for Vec2 { fn div_assign(&mut self, rhs: Self) { - self.0 /= rhs.0; - self.1 /= rhs.1; + *self = *self / rhs; } } -impl RemAssign for Vec2 { +impl RemAssign for Vec2 { fn rem_assign(&mut self, rhs: Self) { - self.0 %= rhs.0; - self.1 %= rhs.1; + *self = *self % rhs; } } -impl Vec2 { +impl Vec2 { + pub(crate) fn zero() -> Self { + Self(U::ZERO, U::ZERO) + } + + pub(crate) fn one() -> Self { + Self(U::ONE, U::ONE) + } + + pub(crate) fn splat(value: U) -> Self { + Self(value, value) + } + pub(crate) fn max(self, rhs: Self) -> Self { - Self(self.0.max(rhs.0), self.1.max(rhs.1)) + Self(max(self.0, rhs.0), max(self.1, rhs.1)) } pub(crate) fn min(self, rhs: Self) -> Self { - Self(self.0.min(rhs.0), self.1.min(rhs.1)) + Self(min(self.0, rhs.0), min(self.1, rhs.1)) } pub(crate) fn fits(&self, other: Self) -> bool { @@ -113,7 +168,7 @@ impl Vec2 { Self(self.1, self.0) } - pub(crate) fn saturating_sub(&self, other: Vec2) -> Vec2 { + pub(crate) fn saturating_sub(&self, other: Vec2) -> Vec2 { *self - self.min(other) } } diff --git a/src/ui/menu.rs b/src/ui/menu.rs index 24deb527f5..24176f9084 100644 --- a/src/ui/menu.rs +++ b/src/ui/menu.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; use crate::menu::arg::Arg; use crate::style::Style; use crate::ui::item::layout_item; -use crate::ui::layout::OPTS; +use crate::ui::layout::opts; use crate::ui::{self, UiTree, layout_line, layout_span, repeat_chars}; use crate::{app::State, config::Config, ops::Op}; use itertools::Itertools; @@ -60,13 +60,13 @@ pub(crate) fn layout_menu<'a>(layout: &mut UiTree<'a>, state: &'a State, width: let separator_style = Style::from(&style.separator); - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { ui::repeat_chars(layout, width, ui::DASHES, separator_style); - layout.horizontal(None, OPTS.gap(3).pad(1), |layout| { + layout.horizontal(None, opts().gap(3).pad(1), |layout| { // Column 1: Main menu commands if !non_menu_binds.is_empty() { - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout_line( layout, pending.menu.to_string().into(), @@ -93,7 +93,7 @@ pub(crate) fn layout_menu<'a>(layout: &mut UiTree<'a>, state: &'a State, width: // Column 2: Submenus if !menu_binds.is_empty() { - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { layout_line(layout, "Submenu".into(), Style::from(&style.menu.heading)); layout_keybinds_table( @@ -117,9 +117,9 @@ pub(crate) fn layout_menu<'a>(layout: &mut UiTree<'a>, state: &'a State, width: } // Column 3: Target commands and arguments - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { if !target_binds.is_empty() { - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout_item(layout, item, config, Style::new()); }); @@ -179,15 +179,15 @@ fn layout_keybinds_table<'a>( .unwrap_or(0) + 1; - layout.vertical(None, OPTS, |layout| { + layout.vertical(None, opts(), |layout| { for (key, value) in rows { let padding = max_width - UnicodeWidthStr::width(key.as_ref()); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout_line(layout, key, key_style); repeat_chars(layout, padding, SPACES, Style::new()); - layout.horizontal(None, OPTS, |layout| match value { + layout.horizontal(None, opts(), |layout| match value { MenuValue::Text(text) => layout_span(layout, (text, Style::new())), MenuValue::Arg(arg) => { layout_span(layout, (arg.display.into(), Style::new())); diff --git a/src/ui/picker.rs b/src/ui/picker.rs index d616fde7b9..6319bd684c 100644 --- a/src/ui/picker.rs +++ b/src/ui/picker.rs @@ -5,7 +5,7 @@ use unicode_segmentation::UnicodeSegmentation; use crate::config::Config; use crate::picker::PickerState; -use crate::ui::layout::OPTS; +use crate::ui::layout::opts; use crate::ui::{DASHES, UiTree, layout_cursor, layout_span, repeat_chars}; const MAX_ITEMS_DISPLAY: usize = 10; @@ -23,7 +23,7 @@ pub(crate) fn layout_picker<'a>( let prompt_style: Style = (&config.style.picker.prompt).into(); let info_style: Style = (&config.style.picker.info).into(); - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { let status_text = format!(" {}/{} ", state.filtered_count(), state.total_items()); layout_span(layout, (status_text.into(), info_style)); @@ -57,7 +57,7 @@ pub(crate) fn layout_picker<'a>( Style::new() }; - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { // Selection indicator (cursor bar like status screen) if is_selected { let cursor_style: Style = (&config.style.cursor).into(); @@ -79,7 +79,7 @@ pub(crate) fn layout_picker<'a>( // Fill remaining rows with empty lines to maintain fixed height for _ in rendered_count..MAX_ITEMS_DISPLAY { - layout.horizontal(None, OPTS, |layout| { + layout.horizontal(None, opts(), |layout| { layout_span(layout, (" ".into(), Style::new())); }); } @@ -201,7 +201,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -229,7 +229,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -249,7 +249,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -278,7 +278,7 @@ mod tests { } let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -307,7 +307,7 @@ mod tests { } let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -338,7 +338,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -363,7 +363,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -391,7 +391,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 40); }); layout.compute([40, 15]); @@ -406,7 +406,7 @@ mod tests { let config = test_config(); let mut layout = LayoutTree::new(); - layout.vertical(None, crate::ui::layout::OPTS, |layout| { + layout.vertical(None, crate::ui::layout::opts(), |layout| { layout_picker(layout, &state, &config, 20); }); layout.compute([20, 15]); From 15304fde15c9fcdae1b49a211197cf378599391f Mon Sep 17 00:00:00 2001 From: altsem Date: Tue, 28 Jul 2026 22:27:23 +0200 Subject: [PATCH 3/5] feat(log): show author and date for each commit closes: #500, #156 --- src/config.rs | 2 + src/default_config.toml | 2 + src/item_data.rs | 2 + src/items.rs | 33 ++++++++++++++++ src/tests/helpers/ui.rs | 17 ++++++++ .../snapshots/gitu__tests__binary_file.snap | 4 +- .../gitu__tests__branch__branch_menu.snap | 4 +- ...u__tests__branch__checkout_new_branch.snap | 4 +- .../gitu__tests__branch__checkout_picker.snap | 4 +- ...tests__branch__checkout_picker_cancel.snap | 4 +- ...ts__branch__checkout_select_from_list.snap | 6 +-- ...ts__branch__checkout_use_custom_input.snap | 4 +- .../gitu__tests__branch__delete_picker.snap | 4 +- ...__tests__branch__delete_picker_cancel.snap | 4 +- ...ests__branch__delete_select_from_list.snap | 4 +- ...tests__branch__delete_unmerged_branch.snap | 4 +- ...ests__branch__delete_use_custom_input.snap | 4 +- ..._tests__branch__rename_current_branch.snap | 4 +- .../gitu__tests__branch__rename_picker.snap | 4 +- ...__tests__branch__rename_picker_cancel.snap | 4 +- ...ests__branch__rename_select_from_list.snap | 4 +- .../gitu__tests__branch__spinoff_branch.snap | 4 +- ..._spinoff_branch_with_unmerged_commits.snap | 6 +-- ...ests__branch__spinoff_existing_branch.snap | 4 +- ...gitu__tests__cherry_pick__cherry_pick.snap | 6 +-- ...tests__cherry_pick__cherry_pick_abort.snap | 8 ++-- ...rry_pick__cherry_pick_conflict_status.snap | 8 ++-- ...ts__cherry_pick__cherry_pick_continue.snap | 8 ++-- ..._tests__cherry_pick__cherry_pick_menu.snap | 4 +- ...s__cherry_pick__cherry_pick_no_commit.snap | 4 +- ...ests__cherry_pick__cherry_pick_prompt.snap | 4 +- ...herry_pick__cherry_pick_prompt_cancel.snap | 4 +- .../snapshots/gitu__tests__chmod_file.snap | 6 +-- .../gitu__tests__commit__commit_extend.snap | 4 +- ...__tests__commit__commit_instant_fixup.snap | 8 ++-- ...fixup_stashes_changes_and_keeps_empty.snap | 8 ++-- .../gitu__tests__commit__commit_menu.snap | 4 +- .../snapshots/gitu__tests__copied_file.snap | 6 +-- .../snapshots/gitu__tests__crlf_diff.snap | 6 +-- .../snapshots/gitu__tests__deleted_file.snap | 6 +-- ...tu__tests__discard__discard_file_move.snap | 6 +-- ...ests__discard__discard_unstaged_delta.snap | 6 +-- ...tests__discard__discard_unstaged_hunk.snap | 6 +-- ...tests__discard__discard_unstaged_line.snap | 6 +-- ...ests__discard__discard_untracked_file.snap | 4 +- ...iscard__discard_untracked_staged_file.snap | 4 +- ...__editor__exit_from_picker_exits_menu.snap | 4 +- ...ts__editor__re_enter_picker_from_menu.snap | 4 +- .../snapshots/gitu__tests__ext_diff.snap | 4 +- ...u__tests__fetch__fetch_from_elsewhere.snap | 4 +- ...s__fetch__fetch_from_elsewhere_prompt.snap | 4 +- ..._tests__fetch__fetch_from_push_remote.snap | 4 +- ..._fetch__fetch_from_push_remote_prompt.snap | 4 +- ...tu__tests__fetch__fetch_from_upstream.snap | 4 +- ...ts__fetch__fetch_from_upstream_prompt.snap | 4 +- ...enu_existing_push_remote_and_upstream.snap | 4 +- ..._fetch_menu_no_remote_or_upstream_set.snap | 4 +- .../snapshots/gitu__tests__fetch_all.snap | 4 +- .../gitu__tests__go_down_past_collapsed.snap | 8 ++-- .../gitu__tests__hide_untracked.snap | 4 +- .../gitu__tests__inside_submodule.snap | 4 +- src/tests/snapshots/gitu__tests__log.snap | 8 ++-- .../gitu__tests__log__grep_prompt.snap | 10 ++--- .../gitu__tests__log__grep_second.snap | 4 +- .../gitu__tests__log__grep_second_other.snap | 4 +- .../gitu__tests__log__grep_set_example.snap | 10 ++--- .../gitu__tests__log__limit_2_commits.snap | 6 +-- ...tu__tests__log__limit_2_commits_other.snap | 6 +-- .../gitu__tests__log__limit_invalid.snap | 10 ++--- .../gitu__tests__log__limit_prompt.snap | 10 ++--- .../gitu__tests__log__limit_set_10.snap | 10 ++--- .../gitu__tests__log__log_other.snap | 8 ++-- .../gitu__tests__log__log_other_input.snap | 8 ++-- .../gitu__tests__log__log_other_invalid.snap | 10 ++--- .../gitu__tests__log__log_other_prompt.snap | 10 ++--- .../gitu__tests__merge__merge_ff_only.snap | 6 +-- .../gitu__tests__merge__merge_menu.snap | 4 +- .../gitu__tests__merge__merge_no_ff.snap | 8 ++-- .../gitu__tests__merge__merge_picker.snap | 4 +- ...tu__tests__merge__merge_picker_cancel.snap | 4 +- ...sts__merge__merge_picker_custom_input.snap | 4 +- ..._picker_duplicate_names_select_branch.snap | 6 +-- ...rge_picker_duplicate_names_select_tag.snap | 6 +-- ..._tests__merge__merge_select_from_list.snap | 6 +-- ..._tests__merge__merge_use_custom_input.snap | 4 +- .../gitu__tests__merge_conflict.snap | 12 +++--- .../gitu__tests__mouse_select_hunk_line.snap | 4 +- ...ests__mouse_select_ignore_empty_lines.snap | 6 +-- ...sts__mouse_select_ignore_empty_region.snap | 6 +-- .../gitu__tests__mouse_select_item.snap | 6 +-- ..._tests__mouse_show_ignore_empty_lines.snap | 6 +-- ...tests__mouse_show_ignore_empty_region.snap | 6 +-- ...tu__tests__mouse_toggle_selected_item.snap | 6 +-- .../gitu__tests__mouse_wheel_scroll_up.snap | 4 +- .../snapshots/gitu__tests__moved_file.snap | 6 +-- .../snapshots/gitu__tests__new_commit.snap | 6 +-- .../snapshots/gitu__tests__new_file.snap | 4 +- .../gitu__tests__non_ascii_filename.snap | 6 +-- .../snapshots/gitu__tests__non_utf8_diff.snap | 6 +-- ...itu__tests__pull__pull_from_elsewhere.snap | 4 +- ...sts__pull__pull_from_elsewhere_prompt.snap | 4 +- ...enu_existing_push_remote_and_upstream.snap | 4 +- ...__pull_menu_no_remote_or_upstream_set.snap | 4 +- .../gitu__tests__pull__pull_push_remote.snap | 4 +- ..._tests__pull__pull_push_remote_prompt.snap | 4 +- ...__tests__pull__pull_setup_push_remote.snap | 4 +- ...itu__tests__pull__pull_setup_upstream.snap | 4 +- ...ull__pull_setup_upstream_same_as_head.snap | 4 +- .../gitu__tests__pull__pull_upstream.snap | 6 +-- ...tu__tests__pull__pull_upstream_prompt.snap | 4 +- .../gitu__tests__push__force_push.snap | 6 +-- ...push__open_push_menu_after_dash_input.snap | 6 +-- .../gitu__tests__push__push_elsewhere.snap | 4 +- ...u__tests__push__push_elsewhere_prompt.snap | 4 +- ...enu_existing_push_remote_and_upstream.snap | 4 +- ...itu__tests__push__push_menu_no_branch.snap | 4 +- ...__push_menu_no_remote_or_upstream_set.snap | 4 +- .../gitu__tests__push__push_push_remote.snap | 4 +- ..._tests__push__push_push_remote_prompt.snap | 6 +-- ...__tests__push__push_setup_push_remote.snap | 4 +- ...itu__tests__push__push_setup_upstream.snap | 6 +-- ...ush__push_setup_upstream_same_as_head.snap | 6 +-- .../gitu__tests__push__push_upstream.snap | 6 +-- ...tu__tests__push__push_upstream_prompt.snap | 4 +- .../gitu__tests__quit__confirm_quit.snap | 4 +- ...itu__tests__quit__confirm_quit_prompt.snap | 4 +- .../snapshots/gitu__tests__quit__quit.snap | 4 +- .../gitu__tests__quit__quit_from_menu.snap | 4 +- ...gitu__tests__rebase__rebase_elsewhere.snap | 6 +-- ...ests__rebase__rebase_elsewhere_prompt.snap | 4 +- .../gitu__tests__rebase__rebase_menu.snap | 4 +- .../gitu__tests__rebase_conflict.snap | 8 ++-- ...itu__tests__recent_commits_with_limit.snap | 6 +-- .../gitu__tests__remote__add_remote.snap | 4 +- ...tests__remote__add_remote_name_prompt.snap | 4 +- ..._tests__remote__add_remote_url_prompt.snap | 4 +- .../gitu__tests__remote__remote_menu.snap | 4 +- .../gitu__tests__remote__remove_remote.snap | 4 +- .../gitu__tests__remote__rename_remote.snap | 4 +- ...ts__remote__rename_remote_name_prompt.snap | 4 +- ...remote__rename_remote_new_name_prompt.snap | 4 +- .../gitu__tests__reset__reset_hard.snap | 4 +- .../gitu__tests__reset__reset_menu.snap | 6 +-- .../gitu__tests__reset__reset_mixed.snap | 4 +- .../gitu__tests__reset__reset_soft.snap | 4 +- ...gitu__tests__reset__reset_soft_prompt.snap | 6 +-- ..._tests__reverse__reverse_staged_delta.snap | 6 +-- ...ests__reverse__reverse_unstaged_delta.snap | 6 +-- ...tests__reverse__reverse_unstaged_hunk.snap | 6 +-- ...tests__reverse__reverse_unstaged_line.snap | 6 +-- .../snapshots/gitu__tests__revert_abort.snap | 8 ++-- .../snapshots/gitu__tests__revert_commit.snap | 6 +-- .../gitu__tests__revert_commit_prompt.snap | 4 +- .../gitu__tests__revert_conflict.snap | 8 ++-- .../snapshots/gitu__tests__revert_menu.snap | 4 +- ...itu__tests__stage__stage_all_unstaged.snap | 8 ++-- ...tu__tests__stage__stage_all_untracked.snap | 4 +- ...itu__tests__stage__stage_changes_crlf.snap | 6 +-- ..._stage__stage_deleted_executable_file.snap | 8 ++-- ...itu__tests__stage__stage_deleted_file.snap | 6 +-- ...stage__stage_file_with_spaces_in_name.snap | 4 +- ...itu__tests__stage__stage_removed_line.snap | 4 +- .../gitu__tests__stage__staged_file.snap | 4 +- ...tests__stage_last_hunk_of_first_delta.snap | 8 ++-- .../snapshots/gitu__tests__stash__stash.snap | 4 +- .../gitu__tests__stash__stash_apply.snap | 4 +- ...tu__tests__stash__stash_apply_default.snap | 4 +- ...itu__tests__stash__stash_apply_prompt.snap | 4 +- .../gitu__tests__stash__stash_drop.snap | 4 +- ...itu__tests__stash__stash_drop_default.snap | 4 +- ...gitu__tests__stash__stash_drop_prompt.snap | 4 +- .../gitu__tests__stash__stash_index.snap | 4 +- ...itu__tests__stash__stash_index_prompt.snap | 4 +- ...tu__tests__stash__stash_keeping_index.snap | 4 +- ...ts__stash__stash_keeping_index_prompt.snap | 4 +- .../gitu__tests__stash__stash_pop.snap | 4 +- ...gitu__tests__stash__stash_pop_default.snap | 4 +- .../gitu__tests__stash__stash_pop_prompt.snap | 4 +- .../gitu__tests__stash__stash_prompt.snap | 4 +- ...itu__tests__stash__stash_working_tree.snap | 4 +- ...sts__stash__stash_working_tree_prompt.snap | 4 +- ...orking_tree_when_everything_is_staged.snap | 4 +- ...h_working_tree_when_nothing_is_staged.snap | 4 +- .../gitu__tests__stash_list_with_limit.snap | 4 +- .../gitu__tests__syntax_highlighted.snap | 6 +-- .../snapshots/gitu__tests__tab_diff.snap | 6 +-- ...nstage_added_file_with_spaces_in_name.snap | 4 +- ...u__tests__unstage__unstage_added_line.snap | 4 +- ...u__tests__unstage__unstage_all_staged.snap | 4 +- ...tage__unstage_deleted_executable_file.snap | 8 ++-- ..._tests__unstage__unstage_deleted_file.snap | 6 +-- .../gitu__tests__unstaged_changes.snap | 6 +-- .../gitu__tests__updated_externally.snap | 4 +- src/ui/item.rs | 28 +++++++++++-- src/ui/layout/mod.rs | 39 +++++++++++++------ ..._node_wraps_within_the_extent_it_gets.snap | 6 +++ 196 files changed, 598 insertions(+), 499 deletions(-) create mode 100644 src/ui/layout/snapshots/gitu__ui__layout__tests__fill_node_wraps_within_the_extent_it_gets.snap diff --git a/src/config.rs b/src/config.rs index a8a496d1a8..93d4f48cef 100644 --- a/src/config.rs +++ b/src/config.rs @@ -112,6 +112,8 @@ pub struct StyleConfig { pub branch: StyleConfigEntry, pub remote: StyleConfigEntry, pub tag: StyleConfigEntry, + pub author: StyleConfigEntry, + pub age: StyleConfigEntry, #[serde(default)] pub blame: BlameStyleConfig, diff --git a/src/default_config.toml b/src/default_config.toml index 800149cadd..2ebbb6d243 100644 --- a/src/default_config.toml +++ b/src/default_config.toml @@ -99,6 +99,8 @@ hash = { fg = "yellow" } branch = { fg = "green" } remote = { fg = "red" } tag = { fg = "yellow" } +author = { fg = "magenta" } +age = { mods = "DIM" } blame.line_num = { mods = "DIM" } blame.code_line = { mods = "DIM" } diff --git a/src/item_data.rs b/src/item_data.rs index 466c347a86..0c2e9ee687 100644 --- a/src/item_data.rs +++ b/src/item_data.rs @@ -17,6 +17,8 @@ pub(crate) enum ItemData { short_id: String, associated_references: Vec, summary: String, + author: String, + age: String, }, Untracked(PathBuf), Delta { diff --git a/src/items.rs b/src/items.rs index 68774fb5b2..88077bdb7e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -12,6 +12,7 @@ use std::hash::Hash; use std::hash::Hasher; use std::iter; use std::rc::Rc; +use std::time::SystemTime; pub type ItemId = u64; @@ -144,6 +145,36 @@ pub(crate) fn stash_list(repo: &Repository, limit: usize) -> Res> { .collect::>()) } +fn short_age(time: git2::Time) -> String { + const MINUTE: i64 = 60; + const HOUR: i64 = 60 * MINUTE; + const DAY: i64 = 24 * HOUR; + const WEEK: i64 = 7 * DAY; + const MONTH: i64 = 30 * DAY; + const YEAR: i64 = 365 * DAY; + + let now = SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .map_or(0, |since_epoch| since_epoch.as_secs() as i64); + + // A commit dated in the future reads as brand new, rather than as a negative age. + let age = (now - time.seconds()).max(0); + + if age < HOUR { + format!("{}m", age / MINUTE) + } else if age < DAY { + format!("{}h", age / HOUR) + } else if age < WEEK { + format!("{}d", age / DAY) + } else if age < MONTH { + format!("{}w", age / WEEK) + } else if age < YEAR { + format!("{}M", age / MONTH) + } else { + format!("{}y", age / YEAR) + } +} + pub(crate) fn log( repo: &Repository, limit: usize, @@ -210,6 +241,8 @@ pub(crate) fn log( short_id, associated_references, summary: commit.summary().unwrap_or("").to_string(), + author: commit.author().name().unwrap_or("").to_string(), + age: short_age(commit.author().when()), }; Ok(Some(Item { diff --git a/src/tests/helpers/ui.rs b/src/tests/helpers/ui.rs index ecc17016a5..402039040f 100644 --- a/src/tests/helpers/ui.rs +++ b/src/tests/helpers/ui.rs @@ -113,6 +113,9 @@ impl TestContext { redact(&mut debug_output, "From file://(.*)\n"); redact(&mut debug_output, "To file://(/.*)\n"); + // The fixtures' commit dates are fixed, so their age grows as time + // passes. Only its width, which the layout depends on, is kept. + redact_all(&mut debug_output, r"(\d+[mhdwMy]) \|"); debug_output } @@ -126,6 +129,20 @@ fn redact(debug_output: &mut String, regex: &str) { } } +/// Replaces every capture with `_`, so that what was redacted stays visible. +fn redact_all(debug_output: &mut String, regex: &str) { + let re = Regex::new(regex).unwrap(); + let ranges = re + .captures_iter(debug_output) + .map(|caps| caps.get(1).unwrap().range()) + .collect::>(); + + for range in ranges.into_iter().rev() { + let placeholder = "_".repeat(range.len()); + debug_output.replace_range(range, &placeholder); + } +} + pub fn keys(input: &str) -> Vec { let ("", keys) = parse_test_keys(input).unwrap() else { unreachable!(); diff --git a/src/tests/snapshots/gitu__tests__binary_file.snap b/src/tests/snapshots/gitu__tests__binary_file.snap index 445124e698..2d868c0966 100644 --- a/src/tests/snapshots/gitu__tests__binary_file.snap +++ b/src/tests/snapshots/gitu__tests__binary_file.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() ▌added binary-file | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 667054dbc230d885 +styles_hash: a4136f2f4fbe0a68 diff --git a/src/tests/snapshots/gitu__tests__branch__branch_menu.snap b/src/tests/snapshots/gitu__tests__branch__branch_menu.snap index d4b1410cf3..d5c8590abb 100644 --- a/src/tests/snapshots/gitu__tests__branch__branch_menu.snap +++ b/src/tests/snapshots/gitu__tests__branch__branch_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() K Delete branch | m Rename branch | q/esc Quit/Close | -styles_hash: f3500db39944be2f +styles_hash: 932fdf42b6b7789f diff --git a/src/tests/snapshots/gitu__tests__branch__checkout_new_branch.snap b/src/tests/snapshots/gitu__tests__branch__checkout_new_branch.snap index d54d3de533..1003b0fc50 100644 --- a/src/tests/snapshots/gitu__tests__branch__checkout_new_branch.snap +++ b/src/tests/snapshots/gitu__tests__branch__checkout_new_branch.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch new | | Recent commits | - b66a0bf main new origin/main add initial-file | + b66a0bf main new origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git checkout -b new | Switched to a new branch 'new' | -styles_hash: afd3b8aa17fb4c8f +styles_hash: b25c3a955ed49870 diff --git a/src/tests/snapshots/gitu__tests__branch__checkout_picker.snap b/src/tests/snapshots/gitu__tests__branch__checkout_picker.snap index 8ea38e9937..5f274b2179 100644 --- a/src/tests/snapshots/gitu__tests__branch__checkout_picker.snap +++ b/src/tests/snapshots/gitu__tests__branch__checkout_picker.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: b250c9a77d4d5cec +styles_hash: 44b69210eca90db6 diff --git a/src/tests/snapshots/gitu__tests__branch__checkout_picker_cancel.snap b/src/tests/snapshots/gitu__tests__branch__checkout_picker_cancel.snap index 70854b33da..daf81f28ca 100644 --- a/src/tests/snapshots/gitu__tests__branch__checkout_picker_cancel.snap +++ b/src/tests/snapshots/gitu__tests__branch__checkout_picker_cancel.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 7b605cf80abe284 +styles_hash: d6ae4172afe777b1 diff --git a/src/tests/snapshots/gitu__tests__branch__checkout_select_from_list.snap b/src/tests/snapshots/gitu__tests__branch__checkout_select_from_list.snap index 9273691df9..fcd5f6c959 100644 --- a/src/tests/snapshots/gitu__tests__branch__checkout_select_from_list.snap +++ b/src/tests/snapshots/gitu__tests__branch__checkout_select_from_list.snap @@ -5,8 +5,8 @@ expression: ctx.redact_buffer() ▌On branch feature-a | | Recent commits | - 3b23a7d feature-a add feature-a commit | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + 3b23a7d feature-a add feature-a commit Author Name __ | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git checkout feature-a | Switched to branch 'feature-a' | -styles_hash: 2f476764ee015367 +styles_hash: 9ca73e6aebfb5b3 diff --git a/src/tests/snapshots/gitu__tests__branch__checkout_use_custom_input.snap b/src/tests/snapshots/gitu__tests__branch__checkout_use_custom_input.snap index 74beacd7e8..205bb65f39 100644 --- a/src/tests/snapshots/gitu__tests__branch__checkout_use_custom_input.snap +++ b/src/tests/snapshots/gitu__tests__branch__checkout_use_custom_input.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌No branch | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ Or undo this operation with: git switch - | Turn off this advice by setting config variable advice.detachedHead to false | HEAD is now at b66a0bf add initial-file | -styles_hash: d9a7a96bb61e275e +styles_hash: c397223f348cda2a diff --git a/src/tests/snapshots/gitu__tests__branch__delete_picker.snap b/src/tests/snapshots/gitu__tests__branch__delete_picker.snap index 6b665fe9bf..abee9aba17 100644 --- a/src/tests/snapshots/gitu__tests__branch__delete_picker.snap +++ b/src/tests/snapshots/gitu__tests__branch__delete_picker.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 950ad1ca1b25dd92 +styles_hash: 665845d168c258bd diff --git a/src/tests/snapshots/gitu__tests__branch__delete_picker_cancel.snap b/src/tests/snapshots/gitu__tests__branch__delete_picker_cancel.snap index 70854b33da..daf81f28ca 100644 --- a/src/tests/snapshots/gitu__tests__branch__delete_picker_cancel.snap +++ b/src/tests/snapshots/gitu__tests__branch__delete_picker_cancel.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 7b605cf80abe284 +styles_hash: d6ae4172afe777b1 diff --git a/src/tests/snapshots/gitu__tests__branch__delete_select_from_list.snap b/src/tests/snapshots/gitu__tests__branch__delete_select_from_list.snap index e660e59fd7..078e77b9e5 100644 --- a/src/tests/snapshots/gitu__tests__branch__delete_select_from_list.snap +++ b/src/tests/snapshots/gitu__tests__branch__delete_select_from_list.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Branch is not fully merged. Really delete? (y or n) › █ | -styles_hash: cac1287c177321c0 +styles_hash: dd00d7ffeafd6b61 diff --git a/src/tests/snapshots/gitu__tests__branch__delete_unmerged_branch.snap b/src/tests/snapshots/gitu__tests__branch__delete_unmerged_branch.snap index 1d46549ae8..c549b1753e 100644 --- a/src/tests/snapshots/gitu__tests__branch__delete_unmerged_branch.snap +++ b/src/tests/snapshots/gitu__tests__branch__delete_unmerged_branch.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git branch -d -f bugfix-123 | Deleted branch bugfix-123 (was 33a8c4d). | -styles_hash: 52f5b75cab04a311 +styles_hash: 759341d48e2c00dc diff --git a/src/tests/snapshots/gitu__tests__branch__delete_use_custom_input.snap b/src/tests/snapshots/gitu__tests__branch__delete_use_custom_input.snap index e660e59fd7..078e77b9e5 100644 --- a/src/tests/snapshots/gitu__tests__branch__delete_use_custom_input.snap +++ b/src/tests/snapshots/gitu__tests__branch__delete_use_custom_input.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Branch is not fully merged. Really delete? (y or n) › █ | -styles_hash: cac1287c177321c0 +styles_hash: dd00d7ffeafd6b61 diff --git a/src/tests/snapshots/gitu__tests__branch__rename_current_branch.snap b/src/tests/snapshots/gitu__tests__branch__rename_current_branch.snap index fa06c447ec..fe531b86cc 100644 --- a/src/tests/snapshots/gitu__tests__branch__rename_current_branch.snap +++ b/src/tests/snapshots/gitu__tests__branch__rename_current_branch.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main-rename origin/main add initial-file | + b66a0bf main-rename origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git branch -m main main-rename | -styles_hash: 89a6b9cc378b1c3b +styles_hash: cdd17ab2f6b423d6 diff --git a/src/tests/snapshots/gitu__tests__branch__rename_picker.snap b/src/tests/snapshots/gitu__tests__branch__rename_picker.snap index 79cbcacdf6..68f91afb5b 100644 --- a/src/tests/snapshots/gitu__tests__branch__rename_picker.snap +++ b/src/tests/snapshots/gitu__tests__branch__rename_picker.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: c6f2b0c353de4247 +styles_hash: 716a4076251fe3e1 diff --git a/src/tests/snapshots/gitu__tests__branch__rename_picker_cancel.snap b/src/tests/snapshots/gitu__tests__branch__rename_picker_cancel.snap index 70854b33da..daf81f28ca 100644 --- a/src/tests/snapshots/gitu__tests__branch__rename_picker_cancel.snap +++ b/src/tests/snapshots/gitu__tests__branch__rename_picker_cancel.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 7b605cf80abe284 +styles_hash: d6ae4172afe777b1 diff --git a/src/tests/snapshots/gitu__tests__branch__rename_select_from_list.snap b/src/tests/snapshots/gitu__tests__branch__rename_select_from_list.snap index 7f7ffe8ffd..ae1a3af41c 100644 --- a/src/tests/snapshots/gitu__tests__branch__rename_select_from_list.snap +++ b/src/tests/snapshots/gitu__tests__branch__rename_select_from_list.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git branch -m feature-a feature-rename | -styles_hash: 5c61e2b785462988 +styles_hash: ea53b2f4331c1749 diff --git a/src/tests/snapshots/gitu__tests__branch__spinoff_branch.snap b/src/tests/snapshots/gitu__tests__branch__spinoff_branch.snap index 0679dd2cd9..3f7913555a 100644 --- a/src/tests/snapshots/gitu__tests__branch__spinoff_branch.snap +++ b/src/tests/snapshots/gitu__tests__branch__spinoff_branch.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch new | | Recent commits | - b66a0bf main new v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main new v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() $ git checkout -b new | Switched to a new branch 'new' | > Branch main not changed | -styles_hash: 24d0651b7748f079 +styles_hash: eee8af3391ff9252 diff --git a/src/tests/snapshots/gitu__tests__branch__spinoff_branch_with_unmerged_commits.snap b/src/tests/snapshots/gitu__tests__branch__spinoff_branch_with_unmerged_commits.snap index f4acfc8c29..38d4663645 100644 --- a/src/tests/snapshots/gitu__tests__branch__spinoff_branch_with_unmerged_commits.snap +++ b/src/tests/snapshots/gitu__tests__branch__spinoff_branch_with_unmerged_commits.snap @@ -5,8 +5,8 @@ expression: ctx.redact_buffer() ▌On branch new | | Recent commits | - c84f226 new add first commit | - b66a0bf main origin/main add initial-file | + c84f226 new add first commit Author Name __ | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ Switched to a new branch 'new' $ git update-ref -m "reset: moving to b66a0bf82020d6a386e94d0fceedec1f817d20c7" | refs/heads/main b66a0bf82020d6a386e94d0fceedec1f817d20c7 | > Branch main was reset to b66a0bf82020d6a386e94d0fceedec1f817d20c7 | -styles_hash: 14991fd5fd26b58d +styles_hash: ad7dfdd7bbbb1b66 diff --git a/src/tests/snapshots/gitu__tests__branch__spinoff_existing_branch.snap b/src/tests/snapshots/gitu__tests__branch__spinoff_existing_branch.snap index 32ceb39c3b..ac7c61c60d 100644 --- a/src/tests/snapshots/gitu__tests__branch__spinoff_existing_branch.snap +++ b/src/tests/snapshots/gitu__tests__branch__spinoff_existing_branch.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file | + b66a0bf main v1.0.0 v2.0.0 origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ! Cannot spin-off feature-a. It already exists | -styles_hash: a93310bcec6f8973 +styles_hash: c339398f64300331 diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick.snap index 1510c598a3..35cb2c339a 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick.snap @@ -2,8 +2,8 @@ source: src/tests/cherry_pick.rs expression: ctx.redact_buffer() --- -▌b9ef0d7 main other-branch add cherry-file | - b66a0bf origin/main add initial-file | +▌b9ef0d7 main other-branch add cherry-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git cherry-pick other-branch | -styles_hash: f3a37ee58f76a6c1 +styles_hash: e9f10e1b677b521d diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_abort.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_abort.snap index b4c42b4c48..a73f085c9b 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_abort.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_abort.snap @@ -6,9 +6,9 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 2 commit(s). | | Recent commits | - 487ec57 main modify conflict-file | - 415b98a add conflict-file | - b66a0bf origin/main add initial-file | + 487ec57 main modify conflict-file Author Name __ | + 415b98a add conflict-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git cherry-pick --abort | -styles_hash: b757c2512bb1402b +styles_hash: 101bd38f6a1f8188 diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_conflict_status.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_conflict_status.snap index 32a258c2c9..a5633a9d54 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_conflict_status.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_conflict_status.snap @@ -11,9 +11,9 @@ expression: ctx.redact_buffer() unmerged conflict-file… | | Recent commits | - 487ec57 main modify conflict-file | - 415b98a add conflict-file | - b66a0bf origin/main add initial-file | + 487ec57 main modify conflict-file Author Name __ | + 415b98a add conflict-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 48a7724d7616702c +styles_hash: 7af2b19ecff6e61c diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_continue.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_continue.snap index dada7d6a7c..9d3f3ec5a2 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_continue.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_continue.snap @@ -11,9 +11,9 @@ expression: ctx.redact_buffer() unmerged conflict-file… | | Recent commits | - 487ec57 main modify conflict-file | - 415b98a add conflict-file | - b66a0bf origin/main add initial-file | + 487ec57 main modify conflict-file Author Name __ | + 415b98a add conflict-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | ────────────────────────────────────────────────────────────────────────────────| $ git cherry-pick --continue | @@ -22,4 +22,4 @@ hint: Fix them up in the work tree, and then use 'git add/rm ' hint: as appropriate to mark resolution and make a commit. | fatal: Exiting because of an unresolved conflict. | ! 'git cherry-pick--continue' exited with code: 128 | -styles_hash: d1efaefa69a22e79 +styles_hash: ba7a1b0c1d3b847a diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_menu.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_menu.snap index 9f22d5a3fa..373d456475 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_menu.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() c Continue -n Don't commit (--no-commit) | A Cherry-pick commit(s) -s Add Signed-off-by lines (--signoff) | q/esc Quit/Close | -styles_hash: 5c7ec187d6f8e88d +styles_hash: 39e931207bc75ed5 diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_no_commit.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_no_commit.snap index ac79a899ad..413a8805b5 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_no_commit.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_no_commit.snap @@ -2,7 +2,7 @@ source: src/tests/cherry_pick.rs expression: ctx.redact_buffer() --- -▌b66a0bf main origin/main add initial-file | +▌b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() $ git cherry-pick --no-commit Aother-branch | fatal: bad revision 'Aother-branch' | ! 'git cherry-pick--no-commitAother-branch' exited with code: 128 | -styles_hash: ae8ffd321649ca3f +styles_hash: 3519610333b8eb28 diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt.snap index d950abd60c..83f09dd230 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt.snap @@ -2,7 +2,7 @@ source: src/tests/cherry_pick.rs expression: ctx.redact_buffer() --- - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: f16f0086760d9b1 +styles_hash: fdfc7d3451e22d97 diff --git a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt_cancel.snap b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt_cancel.snap index 47991c0644..3720917cac 100644 --- a/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt_cancel.snap +++ b/src/tests/snapshots/gitu__tests__cherry_pick__cherry_pick_prompt_cancel.snap @@ -2,7 +2,7 @@ source: src/tests/cherry_pick.rs expression: ctx.redact_buffer() --- -▌b66a0bf main origin/main add initial-file | +▌b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 2a60169a6477b57a +styles_hash: 74136530bbac8274 diff --git a/src/tests/snapshots/gitu__tests__chmod_file.snap b/src/tests/snapshots/gitu__tests__chmod_file.snap index 834760bb21..f5f183be47 100644 --- a/src/tests/snapshots/gitu__tests__chmod_file.snap +++ b/src/tests/snapshots/gitu__tests__chmod_file.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() modified test-file… | | Recent commits | - d95f7af main add test-file | - b66a0bf origin/main add initial-file | + d95f7af main add test-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 48cb59b6ba00374c +styles_hash: d9c1f5b4a6f674ae diff --git a/src/tests/snapshots/gitu__tests__commit__commit_extend.snap b/src/tests/snapshots/gitu__tests__commit__commit_extend.snap index 250d13869f..482fc3de34 100644 --- a/src/tests/snapshots/gitu__tests__commit__commit_extend.snap +++ b/src/tests/snapshots/gitu__tests__commit__commit_extend.snap @@ -7,7 +7,7 @@ expression: ctx.redact_buffer() each, respectively. | | Recent commits | - 5dfe782 main add initial-file | + 5dfe782 main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ each, respectively. | ────────────────────────────────────────────────────────────────────────────────| $ git commit --amend --no-edit | -styles_hash: 5ae7f274843081cb +styles_hash: 8471c865337c63cd diff --git a/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup.snap b/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup.snap index c4c48a5058..25772beaf6 100644 --- a/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup.snap +++ b/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup.snap @@ -6,9 +6,9 @@ expression: ctx.redact_buffer() Your branch is ahead of 'origin/main' by 2 commit(s). | | Recent commits | - 2809bd7 main modify instant_fixup.txt | - fa09c62 add instant_fixup.txt | -▌b66a0bf origin/main add initial-file | + 2809bd7 main modify instant_fixup.txt Author Name __ | + fa09c62 add instant_fixup.txt Author Name __ | +▌b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ $ git commit --fixup efc77f3bea683ce4ea27f2e9d7d1bdf04c91a57f 1 file changed, 1 insertion(+), 1 deletion(-) | $ git rebase -i -q --autostash --keep-empty --autosquash | efc77f3bea683ce4ea27f2e9d7d1bdf04c91a57f^ | -styles_hash: 34a63ec32b3bafb +styles_hash: d392f921a090c51 diff --git a/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup_stashes_changes_and_keeps_empty.snap b/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup_stashes_changes_and_keeps_empty.snap index 05705d7f3e..ff6e9a38e4 100644 --- a/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup_stashes_changes_and_keeps_empty.snap +++ b/src/tests/snapshots/gitu__tests__commit__commit_instant_fixup_stashes_changes_and_keeps_empty.snap @@ -10,9 +10,9 @@ expression: ctx.redact_buffer() +unstaged | | Recent commits | - bada738 main empty commit | - 2809bd7 modify instant_fixup.txt | - fa09c62 add instant_fixup.txt | + bada738 main empty commit Author Name __ | + 2809bd7 modify instant_fixup.txt Author Name __ | + fa09c62 add instant_fixup.txt Author Name __ | ────────────────────────────────────────────────────────────────────────────────| $ git commit --fixup efc77f3bea683ce4ea27f2e9d7d1bdf04c91a57f | [main bec1be7] fixup! modify instant_fixup.txt | @@ -22,4 +22,4 @@ $ git rebase -i -q --autostash --keep-empty --autosquash efc77f3bea683ce4ea27f2e9d7d1bdf04c91a57f^ | Applied autostash. | Created autostash: d682ced | -styles_hash: 33fe1f4f566a5d2a +styles_hash: 903012281066b556 diff --git a/src/tests/snapshots/gitu__tests__commit__commit_menu.snap b/src/tests/snapshots/gitu__tests__commit__commit_menu.snap index f3e946fa00..24881d6813 100644 --- a/src/tests/snapshots/gitu__tests__commit__commit_menu.snap +++ b/src/tests/snapshots/gitu__tests__commit__commit_menu.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() added new_file.txt… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() q/esc Quit/Close -R Claim authorship and reset author date (--reset-author) | -s Add Signed-off-by line (--signoff) | -v Show diff of changes to be committed (--verbose) | -styles_hash: 178efd168e126b3e +styles_hash: 65376678f1c47587 diff --git a/src/tests/snapshots/gitu__tests__copied_file.snap b/src/tests/snapshots/gitu__tests__copied_file.snap index 4d18817e12..62a4c6a6a7 100644 --- a/src/tests/snapshots/gitu__tests__copied_file.snap +++ b/src/tests/snapshots/gitu__tests__copied_file.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() added copied-file… | | Recent commits | - b00a756 main add new-file | - b66a0bf origin/main add initial-file | + b00a756 main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 7f74f4c358d0d1d1 +styles_hash: c43cc46ab7c8023e diff --git a/src/tests/snapshots/gitu__tests__crlf_diff.snap b/src/tests/snapshots/gitu__tests__crlf_diff.snap index f926c4ef58..19a096260d 100644 --- a/src/tests/snapshots/gitu__tests__crlf_diff.snap +++ b/src/tests/snapshots/gitu__tests__crlf_diff.snap @@ -13,8 +13,8 @@ expression: ctx.redact_buffer() +changed | | Recent commits | - 13d662a main add crlf.txt | - b66a0bf origin/main add initial-file | + 13d662a main add crlf.txt Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 11bdd1533d7fbfb7 +styles_hash: a4404453dbbfb78e diff --git a/src/tests/snapshots/gitu__tests__deleted_file.snap b/src/tests/snapshots/gitu__tests__deleted_file.snap index f2b5c3840c..325edc1016 100644 --- a/src/tests/snapshots/gitu__tests__deleted_file.snap +++ b/src/tests/snapshots/gitu__tests__deleted_file.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() deleted new-file… | | Recent commits | - b00a756 main add new-file | - b66a0bf origin/main add initial-file | + b00a756 main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: e279097c411f8396 +styles_hash: 61648977f88d1449 diff --git a/src/tests/snapshots/gitu__tests__discard__discard_file_move.snap b/src/tests/snapshots/gitu__tests__discard__discard_file_move.snap index 88ebdcd403..9fe1ca3652 100644 --- a/src/tests/snapshots/gitu__tests__discard__discard_file_move.snap +++ b/src/tests/snapshots/gitu__tests__discard__discard_file_move.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | -▌46c81ca main add new-file | - b66a0bf origin/main add initial-file | +▌46c81ca main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse --index --recount | -styles_hash: 408bd4bdde94e463 +styles_hash: 39b0f45322f853a7 diff --git a/src/tests/snapshots/gitu__tests__discard__discard_unstaged_delta.snap b/src/tests/snapshots/gitu__tests__discard__discard_unstaged_delta.snap index d69e716ae8..75a55372f3 100644 --- a/src/tests/snapshots/gitu__tests__discard__discard_unstaged_delta.snap +++ b/src/tests/snapshots/gitu__tests__discard__discard_unstaged_delta.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | -▌4f3ed19 main add file-one | - b66a0bf origin/main add initial-file | +▌4f3ed19 main add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse --recount | -styles_hash: 3fc4d06472e98a9d +styles_hash: 9dbe5daa14c6b938 diff --git a/src/tests/snapshots/gitu__tests__discard__discard_unstaged_hunk.snap b/src/tests/snapshots/gitu__tests__discard__discard_unstaged_hunk.snap index a37db694d1..1fe65b64c6 100644 --- a/src/tests/snapshots/gitu__tests__discard__discard_unstaged_hunk.snap +++ b/src/tests/snapshots/gitu__tests__discard__discard_unstaged_hunk.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - 4f3ed19 main add file-one | -▌b66a0bf origin/main add initial-file | + 4f3ed19 main add file-one Author Name __ | +▌b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse --recount | -styles_hash: 605627068763c1ee +styles_hash: e4521de1675079b9 diff --git a/src/tests/snapshots/gitu__tests__discard__discard_unstaged_line.snap b/src/tests/snapshots/gitu__tests__discard__discard_unstaged_line.snap index 109a5ff86d..a04880f393 100644 --- a/src/tests/snapshots/gitu__tests__discard__discard_unstaged_line.snap +++ b/src/tests/snapshots/gitu__tests__discard__discard_unstaged_line.snap @@ -12,8 +12,8 @@ expression: ctx.redact_buffer() ▌-BAR | | Recent commits | - 4f3ed19 main add file-one | - b66a0bf origin/main add initial-file | + 4f3ed19 main add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse --recount | -styles_hash: 3dc1a544e2914fd9 +styles_hash: 2a85024c348cf828 diff --git a/src/tests/snapshots/gitu__tests__discard__discard_untracked_file.snap b/src/tests/snapshots/gitu__tests__discard__discard_untracked_file.snap index 48b297513d..48fbb6ecdb 100644 --- a/src/tests/snapshots/gitu__tests__discard__discard_untracked_file.snap +++ b/src/tests/snapshots/gitu__tests__discard__discard_untracked_file.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | -▌b66a0bf main origin/main add initial-file | +▌b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git clean --force some-file | Removing some-file | -styles_hash: 33182dff4f601327 +styles_hash: bc3098aa85be7d49 diff --git a/src/tests/snapshots/gitu__tests__discard__discard_untracked_staged_file.snap b/src/tests/snapshots/gitu__tests__discard__discard_untracked_staged_file.snap index c32cff8eda..da5c602c82 100644 --- a/src/tests/snapshots/gitu__tests__discard__discard_untracked_staged_file.snap +++ b/src/tests/snapshots/gitu__tests__discard__discard_untracked_staged_file.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | -▌b66a0bf main origin/main add initial-file | +▌b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse --index --recount | -styles_hash: ea25e9ecaba87b2d +styles_hash: 57c221f81aa06fc5 diff --git a/src/tests/snapshots/gitu__tests__editor__exit_from_picker_exits_menu.snap b/src/tests/snapshots/gitu__tests__editor__exit_from_picker_exits_menu.snap index 8e8f3416f4..babaacdaac 100644 --- a/src/tests/snapshots/gitu__tests__editor__exit_from_picker_exits_menu.snap +++ b/src/tests/snapshots/gitu__tests__editor__exit_from_picker_exits_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__editor__re_enter_picker_from_menu.snap b/src/tests/snapshots/gitu__tests__editor__re_enter_picker_from_menu.snap index 22c9b55ce1..e26c184104 100644 --- a/src/tests/snapshots/gitu__tests__editor__re_enter_picker_from_menu.snap +++ b/src/tests/snapshots/gitu__tests__editor__re_enter_picker_from_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 9ee80d670d7d5d8b +styles_hash: 68d8822de3a377e7 diff --git a/src/tests/snapshots/gitu__tests__ext_diff.snap b/src/tests/snapshots/gitu__tests__ext_diff.snap index 4ae7c906a9..b2344dac38 100644 --- a/src/tests/snapshots/gitu__tests__ext_diff.snap +++ b/src/tests/snapshots/gitu__tests__ext_diff.snap @@ -16,10 +16,10 @@ expression: ctx.redact_buffer() +staged | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | | | -styles_hash: 875d69d553a5f62a +styles_hash: 9e15de10235efbcb diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere.snap index 30ea435fbf..72ddf7e14e 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git fetch origin | -styles_hash: dde9bcfbe8787ef9 +styles_hash: e126db7c380bc646 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere_prompt.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere_prompt.snap index a5c56c5bfa..f3a829e603 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere_prompt.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_from_elsewhere_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Select remote: › █ | -styles_hash: 27b62992ccb47712 +styles_hash: 802b36a3883cd0c0 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote.snap index 30ea435fbf..72ddf7e14e 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git fetch origin | -styles_hash: dde9bcfbe8787ef9 +styles_hash: e126db7c380bc646 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote_prompt.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote_prompt.snap index 2033fa1999..4e9726ce49 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote_prompt.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_from_push_remote_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Set pushRemote then fetch: › █ | -styles_hash: ad681b11abeab0fe +styles_hash: 8736c53d605d0 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream.snap index 30ea435fbf..72ddf7e14e 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git fetch origin | -styles_hash: dde9bcfbe8787ef9 +styles_hash: e126db7c380bc646 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream_prompt.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream_prompt.snap index 19e138d0ab..98013e746f 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream_prompt.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_from_upstream_prompt.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Set upstream then fetch: › █ | -styles_hash: c82b1e41e00ab83d +styles_hash: e5d62babd37ae543 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_menu_existing_push_remote_and_upstream.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_menu_existing_push_remote_and_upstream.snap index 0ec28e6aee..1f03f69005 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_menu_existing_push_remote_and_upstream.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_menu_existing_push_remote_and_upstream.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u from origin | e from elsewhere | q/esc Quit/Close | -styles_hash: bd383ea18c28e750 +styles_hash: 3b2f116b54be63b2 diff --git a/src/tests/snapshots/gitu__tests__fetch__fetch_menu_no_remote_or_upstream_set.snap b/src/tests/snapshots/gitu__tests__fetch__fetch_menu_no_remote_or_upstream_set.snap index b7090055a7..5b218f54a5 100644 --- a/src/tests/snapshots/gitu__tests__fetch__fetch_menu_no_remote_or_upstream_set.snap +++ b/src/tests/snapshots/gitu__tests__fetch__fetch_menu_no_remote_or_upstream_set.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u from upstream, setting that | e from elsewhere | q/esc Quit/Close | -styles_hash: 440a2e96e23b3a85 +styles_hash: c6fa14e930b4b5cb diff --git a/src/tests/snapshots/gitu__tests__fetch_all.snap b/src/tests/snapshots/gitu__tests__fetch_all.snap index 9cdd373dd5..336c447d67 100644 --- a/src/tests/snapshots/gitu__tests__fetch_all.snap +++ b/src/tests/snapshots/gitu__tests__fetch_all.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is behind 'origin/main' by 1 commit(s). | | Recent commits | - b66a0bf main add initial-file | + b66a0bf main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() $ git fetch --all --jobs 10 | From file:// b66a0bf..d07f2d3 main -> origin/main | -styles_hash: 8a8e7ce3455f812c +styles_hash: b42c796433b2d974 diff --git a/src/tests/snapshots/gitu__tests__go_down_past_collapsed.snap b/src/tests/snapshots/gitu__tests__go_down_past_collapsed.snap index 4a7ea56bb2..0c3ed1644d 100644 --- a/src/tests/snapshots/gitu__tests__go_down_past_collapsed.snap +++ b/src/tests/snapshots/gitu__tests__go_down_past_collapsed.snap @@ -10,9 +10,9 @@ expression: ctx.redact_buffer() ▌modified file-two… | | Recent commits | - e45938a main add file-two | - b3cf8e8 add file-one | - b66a0bf origin/main add initial-file | + e45938a main add file-two Author Name __ | + b3cf8e8 add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 779d350d6a38043e +styles_hash: 3fca55fb49934ad5 diff --git a/src/tests/snapshots/gitu__tests__hide_untracked.snap b/src/tests/snapshots/gitu__tests__hide_untracked.snap index 85bea39a79..1b53d2cabe 100644 --- a/src/tests/snapshots/gitu__tests__hide_untracked.snap +++ b/src/tests/snapshots/gitu__tests__hide_untracked.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__inside_submodule.snap b/src/tests/snapshots/gitu__tests__inside_submodule.snap index 85bea39a79..1b53d2cabe 100644 --- a/src/tests/snapshots/gitu__tests__inside_submodule.snap +++ b/src/tests/snapshots/gitu__tests__inside_submodule.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__log.snap b/src/tests/snapshots/gitu__tests__log.snap index 644d910288..38b2d430ec 100644 --- a/src/tests/snapshots/gitu__tests__log.snap +++ b/src/tests/snapshots/gitu__tests__log.snap @@ -2,9 +2,9 @@ source: src/tests/mod.rs expression: ctx.redact_buffer() --- -▌0c2c6c3 main a-tag add secondfile | - 223428c annotated add firstfile | - b66a0bf origin/main add initial-file | +▌0c2c6c3 main a-tag add secondfile Author Name __ | + 223428c annotated add firstfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 47d7b32e1c94166c +styles_hash: 4178da3e6ca7da32 diff --git a/src/tests/snapshots/gitu__tests__log__grep_prompt.snap b/src/tests/snapshots/gitu__tests__log__grep_prompt.snap index 817c6ced08..8f2b3ef809 100644 --- a/src/tests/snapshots/gitu__tests__log__grep_prompt.snap +++ b/src/tests/snapshots/gitu__tests__log__grep_prompt.snap @@ -6,10 +6,10 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 8bb5532 main add first commit | - 6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() q/esc Quit/Close | ────────────────────────────────────────────────────────────────────────────────| ? Search messages: › █ | -styles_hash: f2eebb39c405f80c +styles_hash: 880fcd2eadaeef1f diff --git a/src/tests/snapshots/gitu__tests__log__grep_second.snap b/src/tests/snapshots/gitu__tests__log__grep_second.snap index 324f7364be..6d5eb2ac1b 100644 --- a/src/tests/snapshots/gitu__tests__log__grep_second.snap +++ b/src/tests/snapshots/gitu__tests__log__grep_second.snap @@ -2,7 +2,7 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- -▌6c08cf7 add second commit | +▌6c08cf7 add second commit Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: c60740e4f1c77f24 +styles_hash: d7069ddaa611c83d diff --git a/src/tests/snapshots/gitu__tests__log__grep_second_other.snap b/src/tests/snapshots/gitu__tests__log__grep_second_other.snap index 324f7364be..6d5eb2ac1b 100644 --- a/src/tests/snapshots/gitu__tests__log__grep_second_other.snap +++ b/src/tests/snapshots/gitu__tests__log__grep_second_other.snap @@ -2,7 +2,7 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- -▌6c08cf7 add second commit | +▌6c08cf7 add second commit Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: c60740e4f1c77f24 +styles_hash: d7069ddaa611c83d diff --git a/src/tests/snapshots/gitu__tests__log__grep_set_example.snap b/src/tests/snapshots/gitu__tests__log__grep_set_example.snap index fd5375438b..68efd0c61f 100644 --- a/src/tests/snapshots/gitu__tests__log__grep_set_example.snap +++ b/src/tests/snapshots/gitu__tests__log__grep_set_example.snap @@ -6,10 +6,10 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 8bb5532 main add first commit | - 6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() l current -F Search messages (--grep=example) | o other -n Limit number of commits (-n=256) | q/esc Quit/Close | -styles_hash: c3ce2be766716a22 +styles_hash: e5cbb35512f17847 diff --git a/src/tests/snapshots/gitu__tests__log__limit_2_commits.snap b/src/tests/snapshots/gitu__tests__log__limit_2_commits.snap index 854bdd466c..5d4318a2dd 100644 --- a/src/tests/snapshots/gitu__tests__log__limit_2_commits.snap +++ b/src/tests/snapshots/gitu__tests__log__limit_2_commits.snap @@ -2,8 +2,8 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- -▌8bb5532 main add first commit | - 6c08cf7 add second commit | +▌8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 60358599816f45c +styles_hash: f42d1be019af8018 diff --git a/src/tests/snapshots/gitu__tests__log__limit_2_commits_other.snap b/src/tests/snapshots/gitu__tests__log__limit_2_commits_other.snap index 854bdd466c..5d4318a2dd 100644 --- a/src/tests/snapshots/gitu__tests__log__limit_2_commits_other.snap +++ b/src/tests/snapshots/gitu__tests__log__limit_2_commits_other.snap @@ -2,8 +2,8 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- -▌8bb5532 main add first commit | - 6c08cf7 add second commit | +▌8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 60358599816f45c +styles_hash: f42d1be019af8018 diff --git a/src/tests/snapshots/gitu__tests__log__limit_invalid.snap b/src/tests/snapshots/gitu__tests__log__limit_invalid.snap index 97e5950660..dbf6d7a7c6 100644 --- a/src/tests/snapshots/gitu__tests__log__limit_invalid.snap +++ b/src/tests/snapshots/gitu__tests__log__limit_invalid.snap @@ -6,10 +6,10 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 8bb5532 main add first commit | - 6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ! Value must be a number greater than 0 | -styles_hash: 7eab8669eff1a2e4 +styles_hash: 5c2a82023115d6cc diff --git a/src/tests/snapshots/gitu__tests__log__limit_prompt.snap b/src/tests/snapshots/gitu__tests__log__limit_prompt.snap index 99299c482c..7126bca9ec 100644 --- a/src/tests/snapshots/gitu__tests__log__limit_prompt.snap +++ b/src/tests/snapshots/gitu__tests__log__limit_prompt.snap @@ -6,10 +6,10 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 8bb5532 main add first commit | - 6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() q/esc Quit/Close | ────────────────────────────────────────────────────────────────────────────────| ? Limit number of commits (default 256): › █ | -styles_hash: 62cf3084d4145092 +styles_hash: 15e73bd9294d10 diff --git a/src/tests/snapshots/gitu__tests__log__limit_set_10.snap b/src/tests/snapshots/gitu__tests__log__limit_set_10.snap index 2547dc0422..24a20d9db7 100644 --- a/src/tests/snapshots/gitu__tests__log__limit_set_10.snap +++ b/src/tests/snapshots/gitu__tests__log__limit_set_10.snap @@ -6,10 +6,10 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 8bb5532 main add first commit | - 6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() l current -F Search messages (--grep) | o other -n Limit number of commits (-n=10) | q/esc Quit/Close | -styles_hash: 706331cc5663f6bb +styles_hash: 931dfd744b566591 diff --git a/src/tests/snapshots/gitu__tests__log__log_other.snap b/src/tests/snapshots/gitu__tests__log__log_other.snap index 54bbfdd6cc..14ca5bf8dd 100644 --- a/src/tests/snapshots/gitu__tests__log__log_other.snap +++ b/src/tests/snapshots/gitu__tests__log__log_other.snap @@ -2,9 +2,9 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- -▌6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | +▌6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 289a0cd5847e04b0 +styles_hash: a3e9d5b6c2c0bec8 diff --git a/src/tests/snapshots/gitu__tests__log__log_other_input.snap b/src/tests/snapshots/gitu__tests__log__log_other_input.snap index 54bbfdd6cc..14ca5bf8dd 100644 --- a/src/tests/snapshots/gitu__tests__log__log_other_input.snap +++ b/src/tests/snapshots/gitu__tests__log__log_other_input.snap @@ -2,9 +2,9 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- -▌6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | +▌6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 289a0cd5847e04b0 +styles_hash: a3e9d5b6c2c0bec8 diff --git a/src/tests/snapshots/gitu__tests__log__log_other_invalid.snap b/src/tests/snapshots/gitu__tests__log__log_other_invalid.snap index 469a922969..87ea32a3eb 100644 --- a/src/tests/snapshots/gitu__tests__log__log_other_invalid.snap +++ b/src/tests/snapshots/gitu__tests__log__log_other_invalid.snap @@ -6,10 +6,10 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 8bb5532 main add first commit | - 6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | + 6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| ! Couldn't find git revision: failed to parse revision specifier - Invalid | pattern ' '; class=Invalid (3); code=InvalidSpec (-12) | -styles_hash: 9fcf3c3e448ea67b +styles_hash: 3a34ae7f25fd827 diff --git a/src/tests/snapshots/gitu__tests__log__log_other_prompt.snap b/src/tests/snapshots/gitu__tests__log__log_other_prompt.snap index bd98581a57..6bb411c8bf 100644 --- a/src/tests/snapshots/gitu__tests__log__log_other_prompt.snap +++ b/src/tests/snapshots/gitu__tests__log__log_other_prompt.snap @@ -2,10 +2,10 @@ source: src/tests/log.rs expression: ctx.redact_buffer() --- - 8bb5532 main add first commit | -▌6c08cf7 add second commit | - 79e63f1 add third commit | - b66a0bf origin/main add initial-file | + 8bb5532 main add first commit Author Name __ | +▌6c08cf7 add second commit Author Name __ | + 79e63f1 add third commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Log rev (default 6c08cf78a4544ae4dda8e6161a61070867c60246): › █ | -styles_hash: 179fa0488686d01b +styles_hash: 548691784d636073 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_ff_only.snap b/src/tests/snapshots/gitu__tests__merge__merge_ff_only.snap index 00b77254a7..51f114b958 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_ff_only.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_ff_only.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - 46c81ca main other-branch add new-file | - b66a0bf origin/main add initial-file | + 46c81ca main other-branch add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git merge --ff-only other-branch | -styles_hash: fca97718c66f94c4 +styles_hash: e56af6906782eac8 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_menu.snap b/src/tests/snapshots/gitu__tests__merge__merge_menu.snap index b461392f76..27180cafcd 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_menu.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() a abort -n No fast-forward (--no-ff) | c continue | q/ Quit/Close | -styles_hash: 6076d7c1a8622919 +styles_hash: a71c84f554de9671 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_no_ff.snap b/src/tests/snapshots/gitu__tests__merge__merge_no_ff.snap index 9a1ee0283b..398a5017d1 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_no_ff.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_no_ff.snap @@ -6,9 +6,9 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 2 commit(s). | | Recent commits | - 4d7c2d6 main Merge branch 'other-branch' | - b66a0bf origin/main add initial-file | - 46c81ca other-branch add new-file | + 4d7c2d6 main Merge branch 'other-branch' Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | + 46c81ca other-branch add new-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git merge --no-ff other-branch | -styles_hash: 1b316859ae953e65 +styles_hash: fd9978137bbcc376 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_picker.snap b/src/tests/snapshots/gitu__tests__merge__merge_picker.snap index 4955dddf5e..137121f191 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_picker.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_picker.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: c25a5258336b74b8 +styles_hash: debce7d14d87f2dc diff --git a/src/tests/snapshots/gitu__tests__merge__merge_picker_cancel.snap b/src/tests/snapshots/gitu__tests__merge__merge_picker_cancel.snap index 28130892a2..3daa006ce1 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_picker_cancel.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_picker_cancel.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__merge__merge_picker_custom_input.snap b/src/tests/snapshots/gitu__tests__merge__merge_picker_custom_input.snap index 5cbeede7ea..e761eee9e8 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_picker_custom_input.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_picker_custom_input.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 2b22a7699d978802 +styles_hash: a1dd364da2824096 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_branch.snap b/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_branch.snap index a605e6471d..0b2f6506cb 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_branch.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_branch.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - 46369c5 main other v1.0.0 add other commit | - b66a0bf origin/main add initial-file | + 46369c5 main other v1.0.0 add other commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() $ git merge v1.0.0 | warning: refname 'v1.0.0' is ambiguous. | warning: refname 'v1.0.0' is ambiguous. | -styles_hash: 18b35e057dbb09a6 +styles_hash: f27598170d3d1208 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_tag.snap b/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_tag.snap index bba09ede7c..26c36e60cd 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_tag.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_picker_duplicate_names_select_tag.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - 46369c5 main other v1.0.0 add other commit | - b66a0bf origin/main add initial-file | + 46369c5 main other v1.0.0 add other commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git merge refs/tags/v1.0.0 | -styles_hash: 8f456f85cedc4d7c +styles_hash: 81167356eacbf6e1 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_select_from_list.snap b/src/tests/snapshots/gitu__tests__merge__merge_select_from_list.snap index 38baf89923..063339bf13 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_select_from_list.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_select_from_list.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - 3b23a7d feature-a main v1.0.0 add feature-a commit | - b66a0bf origin/main add initial-file | + 3b23a7d feature-a main v1.0.0 add feature-a commit Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git merge feature-a | -styles_hash: 6d38fe575fb2440d +styles_hash: d2bed94dbb249409 diff --git a/src/tests/snapshots/gitu__tests__merge__merge_use_custom_input.snap b/src/tests/snapshots/gitu__tests__merge__merge_use_custom_input.snap index 4f4c01881b..7e05485711 100644 --- a/src/tests/snapshots/gitu__tests__merge__merge_use_custom_input.snap +++ b/src/tests/snapshots/gitu__tests__merge__merge_use_custom_input.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git merge b66a0bf82020d6a386e94d0fceedec1f817d20c7 | -styles_hash: 73e9fdd5d2c4fca5 +styles_hash: b6235e3a4068cc0b diff --git a/src/tests/snapshots/gitu__tests__merge_conflict.snap b/src/tests/snapshots/gitu__tests__merge_conflict.snap index fbe395ed42..d722d0e7f5 100644 --- a/src/tests/snapshots/gitu__tests__merge_conflict.snap +++ b/src/tests/snapshots/gitu__tests__merge_conflict.snap @@ -13,13 +13,13 @@ expression: ctx.redact_buffer() unmerged new-file-2… | | Recent commits | - 44bb4dc main modify new-file-2 | - 174f1f4 modify new-file | - b57d72c add new-file-2 | - 46c81ca add new-file | - b66a0bf origin/main add initial-file | + 44bb4dc main modify new-file-2 Author Name __ | + 174f1f4 modify new-file Author Name __ | + b57d72c add new-file-2 Author Name __ | + 46c81ca add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | | -styles_hash: 70ddc098023ff277 +styles_hash: 138f9965bfc1ec5b diff --git a/src/tests/snapshots/gitu__tests__mouse_select_hunk_line.snap b/src/tests/snapshots/gitu__tests__mouse_select_hunk_line.snap index 87a5cf0b5b..2cd9495162 100644 --- a/src/tests/snapshots/gitu__tests__mouse_select_hunk_line.snap +++ b/src/tests/snapshots/gitu__tests__mouse_select_hunk_line.snap @@ -16,10 +16,10 @@ expression: ctx.redact_buffer() added testfile… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | | | -styles_hash: a8106d9752eb08f7 +styles_hash: 1a2bc37441f14c16 diff --git a/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_lines.snap b/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_lines.snap index d3fc68ac0c..0ff46b4d3d 100644 --- a/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_lines.snap +++ b/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_lines.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() ▌modified testfile… | | Recent commits | - cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | + cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: c8491f47b65cb53b +styles_hash: 22cf030000def3cb diff --git a/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_region.snap b/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_region.snap index d3fc68ac0c..0ff46b4d3d 100644 --- a/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_region.snap +++ b/src/tests/snapshots/gitu__tests__mouse_select_ignore_empty_region.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() ▌modified testfile… | | Recent commits | - cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | + cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: c8491f47b65cb53b +styles_hash: 22cf030000def3cb diff --git a/src/tests/snapshots/gitu__tests__mouse_select_item.snap b/src/tests/snapshots/gitu__tests__mouse_select_item.snap index 85ce58da9f..40f7e26973 100644 --- a/src/tests/snapshots/gitu__tests__mouse_select_item.snap +++ b/src/tests/snapshots/gitu__tests__mouse_select_item.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | -▌cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | +▌cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 8384a852e904d4e1 +styles_hash: 2715d6e82568f6a7 diff --git a/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_lines.snap b/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_lines.snap index c6d2097990..0e87debdb0 100644 --- a/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_lines.snap +++ b/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_lines.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() ▌stash@0 On main: firststash | | Recent commits | - cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | + cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: abb13d9c1779e6fc +styles_hash: 3710357229f60706 diff --git a/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_region.snap b/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_region.snap index c6d2097990..0e87debdb0 100644 --- a/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_region.snap +++ b/src/tests/snapshots/gitu__tests__mouse_show_ignore_empty_region.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() ▌stash@0 On main: firststash | | Recent commits | - cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | + cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: abb13d9c1779e6fc +styles_hash: 3710357229f60706 diff --git a/src/tests/snapshots/gitu__tests__mouse_toggle_selected_item.snap b/src/tests/snapshots/gitu__tests__mouse_toggle_selected_item.snap index 1f3132fed8..e2019c06fc 100644 --- a/src/tests/snapshots/gitu__tests__mouse_toggle_selected_item.snap +++ b/src/tests/snapshots/gitu__tests__mouse_toggle_selected_item.snap @@ -14,12 +14,12 @@ expression: ctx.redact_buffer() ▌+moretest | | Recent commits | - cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | + cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | | | | -styles_hash: 7ff7988689cb4002 +styles_hash: 51b6aec06d616ab1 diff --git a/src/tests/snapshots/gitu__tests__mouse_wheel_scroll_up.snap b/src/tests/snapshots/gitu__tests__mouse_wheel_scroll_up.snap index 5e3ad7b242..3cdbc223fe 100644 --- a/src/tests/snapshots/gitu__tests__mouse_wheel_scroll_up.snap +++ b/src/tests/snapshots/gitu__tests__mouse_wheel_scroll_up.snap @@ -21,5 +21,5 @@ expression: ctx.redact_buffer() modified file30… | | Recent commits | - ae744cc main add file30 | -styles_hash: 5f4e827357c1ae2c + ae744cc main add file30 Author Name __ | +styles_hash: 4f2f62ac350724c1 diff --git a/src/tests/snapshots/gitu__tests__moved_file.snap b/src/tests/snapshots/gitu__tests__moved_file.snap index 57a5c55368..2dbc0cefc5 100644 --- a/src/tests/snapshots/gitu__tests__moved_file.snap +++ b/src/tests/snapshots/gitu__tests__moved_file.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() renamed new-file -> moved-file… | | Recent commits | - 46c81ca main add new-file | - b66a0bf origin/main add initial-file | + 46c81ca main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: d39ea159178d85b8 +styles_hash: ef98d30186a29009 diff --git a/src/tests/snapshots/gitu__tests__new_commit.snap b/src/tests/snapshots/gitu__tests__new_commit.snap index 556f265c72..c42d5727ff 100644 --- a/src/tests/snapshots/gitu__tests__new_commit.snap +++ b/src/tests/snapshots/gitu__tests__new_commit.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - e7eb2bd main add new-file | - b66a0bf origin/main add initial-file | + e7eb2bd main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 99cd49a2de846aca +styles_hash: b2801eef61626397 diff --git a/src/tests/snapshots/gitu__tests__new_file.snap b/src/tests/snapshots/gitu__tests__new_file.snap index 3f44b492b3..6a471bc2e5 100644 --- a/src/tests/snapshots/gitu__tests__new_file.snap +++ b/src/tests/snapshots/gitu__tests__new_file.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() new-file | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 5a2305acc18d235e +styles_hash: 8f382da2d4e8bde7 diff --git a/src/tests/snapshots/gitu__tests__non_ascii_filename.snap b/src/tests/snapshots/gitu__tests__non_ascii_filename.snap index 34bd67936e..5f100e3d0f 100644 --- a/src/tests/snapshots/gitu__tests__non_ascii_filename.snap +++ b/src/tests/snapshots/gitu__tests__non_ascii_filename.snap @@ -12,8 +12,8 @@ expression: ctx.redact_buffer() ▌+hahaha | | Recent commits | - 8efa733 main add höhöhö | - b66a0bf origin/main add initial-file | + 8efa733 main add höhöhö Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: ab172fef81cd0c1b +styles_hash: 652a3fe56d70a1ec diff --git a/src/tests/snapshots/gitu__tests__non_utf8_diff.snap b/src/tests/snapshots/gitu__tests__non_utf8_diff.snap index 6838b173a4..5786a14053 100644 --- a/src/tests/snapshots/gitu__tests__non_utf8_diff.snap +++ b/src/tests/snapshots/gitu__tests__non_utf8_diff.snap @@ -13,8 +13,8 @@ expression: ctx.redact_buffer() +FileFile with invalid UTF-8: �� | | Recent commits | - 7c3d61a main add non_utf8.txt | - b66a0bf origin/main add initial-file | + 7c3d61a main add non_utf8.txt Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: dfa2cd7993ecbc65 +styles_hash: 30aa89db154a524c diff --git a/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere.snap b/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere.snap index 11d6ba1adb..28a14d95fe 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git pull origin | Already up to date. | -styles_hash: e36f64119a8fa528 +styles_hash: 20503bf465a90fca diff --git a/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere_prompt.snap b/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere_prompt.snap index e442c7e5a5..b28b22eab0 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere_prompt.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_from_elsewhere_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Select remote: › █ | -styles_hash: 27b62992ccb47712 +styles_hash: 802b36a3883cd0c0 diff --git a/src/tests/snapshots/gitu__tests__pull__pull_menu_existing_push_remote_and_upstream.snap b/src/tests/snapshots/gitu__tests__pull__pull_menu_existing_push_remote_and_upstream.snap index de0fa0156f..6f1b9daad0 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_menu_existing_push_remote_and_upstream.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_menu_existing_push_remote_and_upstream.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u from origin/main | e from elsewhere | q/esc Quit/Close | -styles_hash: 4a11b7c07eb8d40f +styles_hash: 9ec56ef74ead0a83 diff --git a/src/tests/snapshots/gitu__tests__pull__pull_menu_no_remote_or_upstream_set.snap b/src/tests/snapshots/gitu__tests__pull__pull_menu_no_remote_or_upstream_set.snap index d5ad932c03..f4460deb3f 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_menu_no_remote_or_upstream_set.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_menu_no_remote_or_upstream_set.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u upstream, setting that | e from elsewhere | q/esc Quit/Close | -styles_hash: 637e0025914b9fa1 +styles_hash: b2607e9232ac098a diff --git a/src/tests/snapshots/gitu__tests__pull__pull_push_remote.snap b/src/tests/snapshots/gitu__tests__pull__pull_push_remote.snap index 965e73a79c..f190348bfe 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_push_remote.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_push_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ $ git pull origin refs/heads/main From file:// * branch main -> FETCH_HEAD | Already up to date. | -styles_hash: cd9783096eb47a06 +styles_hash: 15121907887c0e9e diff --git a/src/tests/snapshots/gitu__tests__pull__pull_push_remote_prompt.snap b/src/tests/snapshots/gitu__tests__pull__pull_push_remote_prompt.snap index 1d74815b6f..a7911e26ea 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_push_remote_prompt.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_push_remote_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Set pushRemote then pull: › █ | -styles_hash: a5d5f61ccef869f +styles_hash: ea6d072e588c409f diff --git a/src/tests/snapshots/gitu__tests__pull__pull_setup_push_remote.snap b/src/tests/snapshots/gitu__tests__pull__pull_setup_push_remote.snap index de0fa0156f..6f1b9daad0 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_setup_push_remote.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_setup_push_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u from origin/main | e from elsewhere | q/esc Quit/Close | -styles_hash: 4a11b7c07eb8d40f +styles_hash: 9ec56ef74ead0a83 diff --git a/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream.snap b/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream.snap index a99e0b0846..51b5804408 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'main'. | | Recent commits | - b66a0bf main new-branch origin/main add initial-file | + b66a0bf main new-branch origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u from main | e from elsewhere | q/esc Quit/Close | -styles_hash: d08770b212d329e1 +styles_hash: cb234ec6f97cbace diff --git a/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream_same_as_head.snap b/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream_same_as_head.snap index cad2009e99..8120821cc8 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream_same_as_head.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_setup_upstream_same_as_head.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch new-branch | | Recent commits | - b66a0bf main new-branch origin/main add initial-file | + b66a0bf main new-branch origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git branch --set-upstream-to new-branch | warning: not setting branch 'new-branch' as its own upstream | -styles_hash: 18594f01cd281b8f +styles_hash: 3f964eeb1cca6c39 diff --git a/src/tests/snapshots/gitu__tests__pull__pull_upstream.snap b/src/tests/snapshots/gitu__tests__pull__pull_upstream.snap index dcaf2aa2a0..0640d3e1b3 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_upstream.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_upstream.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - d07f2d3 main origin/main add remote-file | - b66a0bf add initial-file | + d07f2d3 main origin/main add remote-file Author Name __ | + b66a0bf add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ Fast-forward remote-file | 1 + | 1 file changed, 1 insertion(+) | create mode 100644 remote-file | -styles_hash: b6ce47a26557253d +styles_hash: 777dffb6900c18bd diff --git a/src/tests/snapshots/gitu__tests__pull__pull_upstream_prompt.snap b/src/tests/snapshots/gitu__tests__pull__pull_upstream_prompt.snap index abab688c94..dea5564888 100644 --- a/src/tests/snapshots/gitu__tests__pull__pull_upstream_prompt.snap +++ b/src/tests/snapshots/gitu__tests__pull__pull_upstream_prompt.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Set upstream then pull: › █ | -styles_hash: ba13237f9bab9178 +styles_hash: bfdc161893306f4e diff --git a/src/tests/snapshots/gitu__tests__push__force_push.snap b/src/tests/snapshots/gitu__tests__push__force_push.snap index 5d91e79edc..14b0738fc0 100644 --- a/src/tests/snapshots/gitu__tests__push__force_push.snap +++ b/src/tests/snapshots/gitu__tests__push__force_push.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - e7eb2bd main origin/main add new-file | - b66a0bf add initial-file | + e7eb2bd main origin/main add new-file Author Name __ | + b66a0bf add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() $ git push --force-with-lease origin refs/heads/main:refs/heads/main | To file:// b66a0bf..e7eb2bd main -> main | -styles_hash: b915bcc23d3116ec +styles_hash: a1e4c48222379879 diff --git a/src/tests/snapshots/gitu__tests__push__open_push_menu_after_dash_input.snap b/src/tests/snapshots/gitu__tests__push__open_push_menu_after_dash_input.snap index b625e85b66..a545482fe2 100644 --- a/src/tests/snapshots/gitu__tests__push__open_push_menu_after_dash_input.snap +++ b/src/tests/snapshots/gitu__tests__push__open_push_menu_after_dash_input.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - e7eb2bd main add new-file | - b66a0bf origin/main add initial-file | + e7eb2bd main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u to origin/main -F Force (--force) | e to elsewhere -f Force with lease (--force-with-lease) | q/esc Quit/Close -h Disable hooks (--no-verify) | -styles_hash: 7526b958731867e9 +styles_hash: ab6a41ee8fc8fc92 diff --git a/src/tests/snapshots/gitu__tests__push__push_elsewhere.snap b/src/tests/snapshots/gitu__tests__push__push_elsewhere.snap index b263b74de9..1356ca92ae 100644 --- a/src/tests/snapshots/gitu__tests__push__push_elsewhere.snap +++ b/src/tests/snapshots/gitu__tests__push__push_elsewhere.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git push origin | Everything up-to-date | -styles_hash: e36f64119a8fa528 +styles_hash: 20503bf465a90fca diff --git a/src/tests/snapshots/gitu__tests__push__push_elsewhere_prompt.snap b/src/tests/snapshots/gitu__tests__push__push_elsewhere_prompt.snap index 4318e8305e..81817c80fc 100644 --- a/src/tests/snapshots/gitu__tests__push__push_elsewhere_prompt.snap +++ b/src/tests/snapshots/gitu__tests__push__push_elsewhere_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Select remote: › █ | -styles_hash: 27b62992ccb47712 +styles_hash: 802b36a3883cd0c0 diff --git a/src/tests/snapshots/gitu__tests__push__push_menu_existing_push_remote_and_upstream.snap b/src/tests/snapshots/gitu__tests__push__push_menu_existing_push_remote_and_upstream.snap index 78994d4f0a..64724f5ee6 100644 --- a/src/tests/snapshots/gitu__tests__push__push_menu_existing_push_remote_and_upstream.snap +++ b/src/tests/snapshots/gitu__tests__push__push_menu_existing_push_remote_and_upstream.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u to origin/main -F Force (--force) | e to elsewhere -f Force with lease (--force-with-lease) | q/esc Quit/Close -h Disable hooks (--no-verify) | -styles_hash: 7d2fbf4f1a23e447 +styles_hash: efce8527ddf6e007 diff --git a/src/tests/snapshots/gitu__tests__push__push_menu_no_branch.snap b/src/tests/snapshots/gitu__tests__push__push_menu_no_branch.snap index da728267e7..26f0bbc827 100644 --- a/src/tests/snapshots/gitu__tests__push__push_menu_no_branch.snap +++ b/src/tests/snapshots/gitu__tests__push__push_menu_no_branch.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌No branch | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ! Head is not a branch | -styles_hash: d260d25f0d19e8e +styles_hash: 2d9118b5dc6c867b diff --git a/src/tests/snapshots/gitu__tests__push__push_menu_no_remote_or_upstream_set.snap b/src/tests/snapshots/gitu__tests__push__push_menu_no_remote_or_upstream_set.snap index f9c8e16596..104dd7b3b2 100644 --- a/src/tests/snapshots/gitu__tests__push__push_menu_no_remote_or_upstream_set.snap +++ b/src/tests/snapshots/gitu__tests__push__push_menu_no_remote_or_upstream_set.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u upstream, setting that -F Force (--force) | e to elsewhere -f Force with lease (--force-with-lease) | q/esc Quit/Close -h Disable hooks (--no-verify) | -styles_hash: 43714840095b2bfd +styles_hash: e605336b0f2438af diff --git a/src/tests/snapshots/gitu__tests__push__push_push_remote.snap b/src/tests/snapshots/gitu__tests__push__push_push_remote.snap index 84245bca6c..d15415819b 100644 --- a/src/tests/snapshots/gitu__tests__push__push_push_remote.snap +++ b/src/tests/snapshots/gitu__tests__push__push_push_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git push origin refs/heads/main:refs/heads/main | Everything up-to-date | -styles_hash: 90200a7dd1c6e23a +styles_hash: d073c2a5995161b8 diff --git a/src/tests/snapshots/gitu__tests__push__push_push_remote_prompt.snap b/src/tests/snapshots/gitu__tests__push__push_push_remote_prompt.snap index 89b529cd25..e316595519 100644 --- a/src/tests/snapshots/gitu__tests__push__push_push_remote_prompt.snap +++ b/src/tests/snapshots/gitu__tests__push__push_push_remote_prompt.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - e7eb2bd main add new-file | - b66a0bf origin/main add initial-file | + e7eb2bd main add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Set pushRemote then push: › █ | -styles_hash: d828804d73527c4f +styles_hash: a3bf954f04d712a5 diff --git a/src/tests/snapshots/gitu__tests__push__push_setup_push_remote.snap b/src/tests/snapshots/gitu__tests__push__push_setup_push_remote.snap index 78994d4f0a..64724f5ee6 100644 --- a/src/tests/snapshots/gitu__tests__push__push_setup_push_remote.snap +++ b/src/tests/snapshots/gitu__tests__push__push_setup_push_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u to origin/main -F Force (--force) | e to elsewhere -f Force with lease (--force-with-lease) | q/esc Quit/Close -h Disable hooks (--no-verify) | -styles_hash: 7d2fbf4f1a23e447 +styles_hash: efce8527ddf6e007 diff --git a/src/tests/snapshots/gitu__tests__push__push_setup_upstream.snap b/src/tests/snapshots/gitu__tests__push__push_setup_upstream.snap index dbc9543e9c..33e8250419 100644 --- a/src/tests/snapshots/gitu__tests__push__push_setup_upstream.snap +++ b/src/tests/snapshots/gitu__tests__push__push_setup_upstream.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'main'. | | Recent commits | - e7eb2bd main new-branch add new-file | - b66a0bf origin/main add initial-file | + e7eb2bd main new-branch add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() u to main -F Force (--force) | e to elsewhere -f Force with lease (--force-with-lease) | q/esc Quit/Close -h Disable hooks (--no-verify) | -styles_hash: d8ef8e3b4e8b12dd +styles_hash: 6a64446f37ded6a5 diff --git a/src/tests/snapshots/gitu__tests__push__push_setup_upstream_same_as_head.snap b/src/tests/snapshots/gitu__tests__push__push_setup_upstream_same_as_head.snap index 7273e86ec4..6fbfcaa6db 100644 --- a/src/tests/snapshots/gitu__tests__push__push_setup_upstream_same_as_head.snap +++ b/src/tests/snapshots/gitu__tests__push__push_setup_upstream_same_as_head.snap @@ -5,8 +5,8 @@ expression: ctx.redact_buffer() ▌On branch new-branch | | Recent commits | - e7eb2bd new-branch add new-file | - b66a0bf main origin/main add initial-file | + e7eb2bd new-branch add new-file Author Name __ | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git branch --set-upstream-to new-branch | warning: not setting branch 'new-branch' as its own upstream | -styles_hash: 2bcaab435dbe1378 +styles_hash: a07ffe2495c4f50a diff --git a/src/tests/snapshots/gitu__tests__push__push_upstream.snap b/src/tests/snapshots/gitu__tests__push__push_upstream.snap index 83d9661259..b759a56e14 100644 --- a/src/tests/snapshots/gitu__tests__push__push_upstream.snap +++ b/src/tests/snapshots/gitu__tests__push__push_upstream.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - e7eb2bd main origin/main add new-file | - b66a0bf add initial-file | + e7eb2bd main origin/main add new-file Author Name __ | + b66a0bf add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() $ git push origin refs/heads/main:refs/heads/main | To file:// b66a0bf..e7eb2bd main -> main | -styles_hash: 86d7176114348d55 +styles_hash: 15f378db5802bbad diff --git a/src/tests/snapshots/gitu__tests__push__push_upstream_prompt.snap b/src/tests/snapshots/gitu__tests__push__push_upstream_prompt.snap index 9fc7036b5d..c64c7f10d5 100644 --- a/src/tests/snapshots/gitu__tests__push__push_upstream_prompt.snap +++ b/src/tests/snapshots/gitu__tests__push__push_upstream_prompt.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Set upstream then push: › █ | -styles_hash: ba13237f9bab9178 +styles_hash: bfdc161893306f4e diff --git a/src/tests/snapshots/gitu__tests__quit__confirm_quit.snap b/src/tests/snapshots/gitu__tests__quit__confirm_quit.snap index fcc8baa002..60007f0b2e 100644 --- a/src/tests/snapshots/gitu__tests__quit__confirm_quit.snap +++ b/src/tests/snapshots/gitu__tests__quit__confirm_quit.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__quit__confirm_quit_prompt.snap b/src/tests/snapshots/gitu__tests__quit__confirm_quit_prompt.snap index 89c55f46a5..b9dbb216c9 100644 --- a/src/tests/snapshots/gitu__tests__quit__confirm_quit_prompt.snap +++ b/src/tests/snapshots/gitu__tests__quit__confirm_quit_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Really quit? (y or n) › █ | -styles_hash: 93ed7b333b2ffd22 +styles_hash: 50d4d3b67a749d50 diff --git a/src/tests/snapshots/gitu__tests__quit__quit.snap b/src/tests/snapshots/gitu__tests__quit__quit.snap index fcc8baa002..60007f0b2e 100644 --- a/src/tests/snapshots/gitu__tests__quit__quit.snap +++ b/src/tests/snapshots/gitu__tests__quit__quit.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__quit__quit_from_menu.snap b/src/tests/snapshots/gitu__tests__quit__quit_from_menu.snap index fcc8baa002..60007f0b2e 100644 --- a/src/tests/snapshots/gitu__tests__quit__quit_from_menu.snap +++ b/src/tests/snapshots/gitu__tests__quit__quit_from_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere.snap b/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere.snap index c02a8a83c5..07d45b7b51 100644 --- a/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere.snap +++ b/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere.snap @@ -5,8 +5,8 @@ expression: ctx.redact_buffer() ▌On branch other-branch | | Recent commits | - 46c81ca main other-branch add new-file | - b66a0bf origin/main add initial-file | + 46c81ca main other-branch add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git rebase --autostash main | Successfully rebased and updated refs/heads/other-branch. | -styles_hash: 20cf77cd40a6d649 +styles_hash: c7f6f763e3f91901 diff --git a/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere_prompt.snap b/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere_prompt.snap index 63076aa66e..09c942358e 100644 --- a/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere_prompt.snap +++ b/src/tests/snapshots/gitu__tests__rebase__rebase_elsewhere_prompt.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() On branch other-branch | | Recent commits | - b66a0bf other-branch origin/main add initial-file | + b66a0bf other-branch origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 4791402e3deec007 +styles_hash: c59a51692694ab68 diff --git a/src/tests/snapshots/gitu__tests__rebase__rebase_menu.snap b/src/tests/snapshots/gitu__tests__rebase__rebase_menu.snap index 6b0cb122aa..4d5df5764b 100644 --- a/src/tests/snapshots/gitu__tests__rebase__rebase_menu.snap +++ b/src/tests/snapshots/gitu__tests__rebase__rebase_menu.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch other-branch | | Recent commits | - b66a0bf other-branch origin/main add initial-file | + b66a0bf other-branch origin/main add initial-file Author Name __ | | ────────────────────────────────────────────────────────────────────────────────| Rebase Arguments | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 416c0ac7d3db7f70 +styles_hash: 814db1ed750863dd diff --git a/src/tests/snapshots/gitu__tests__rebase_conflict.snap b/src/tests/snapshots/gitu__tests__rebase_conflict.snap index 8373742308..130a34e398 100644 --- a/src/tests/snapshots/gitu__tests__rebase_conflict.snap +++ b/src/tests/snapshots/gitu__tests__rebase_conflict.snap @@ -11,9 +11,9 @@ expression: ctx.redact_buffer() unmerged new-file… | | Recent commits | - ed5ed59 main modify new-file | - 46c81ca add new-file | - b66a0bf origin/main add initial-file | + ed5ed59 main modify new-file Author Name __ | + 46c81ca add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 5533e392052aceb3 +styles_hash: 3058cb5941064968 diff --git a/src/tests/snapshots/gitu__tests__recent_commits_with_limit.snap b/src/tests/snapshots/gitu__tests__recent_commits_with_limit.snap index 4c577953fb..d0e3cf5788 100644 --- a/src/tests/snapshots/gitu__tests__recent_commits_with_limit.snap +++ b/src/tests/snapshots/gitu__tests__recent_commits_with_limit.snap @@ -6,8 +6,8 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 3 commit(s). | | Recent commits | - 421fbe4 main add thirdfile | - 0c2c6c3 add secondfile | + 421fbe4 main add thirdfile Author Name __ | + 0c2c6c3 add secondfile Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 571c653ad285c374 +styles_hash: 1c6aea3a56e79bf7 diff --git a/src/tests/snapshots/gitu__tests__remote__add_remote.snap b/src/tests/snapshots/gitu__tests__remote__add_remote.snap index da83887f8e..cdb9f747f2 100644 --- a/src/tests/snapshots/gitu__tests__remote__add_remote.snap +++ b/src/tests/snapshots/gitu__tests__remote__add_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git remote add test localhost | -styles_hash: 59157445a4a6240a +styles_hash: 456e19ac6040cde4 diff --git a/src/tests/snapshots/gitu__tests__remote__add_remote_name_prompt.snap b/src/tests/snapshots/gitu__tests__remote__add_remote_name_prompt.snap index 3c60f5d383..86fcdc75c7 100644 --- a/src/tests/snapshots/gitu__tests__remote__add_remote_name_prompt.snap +++ b/src/tests/snapshots/gitu__tests__remote__add_remote_name_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Remote name: › █ | -styles_hash: b233f4cd45b013cb +styles_hash: b34d8dd7b6452ff3 diff --git a/src/tests/snapshots/gitu__tests__remote__add_remote_url_prompt.snap b/src/tests/snapshots/gitu__tests__remote__add_remote_url_prompt.snap index 0d45eb5649..2e7e06fc4e 100644 --- a/src/tests/snapshots/gitu__tests__remote__add_remote_url_prompt.snap +++ b/src/tests/snapshots/gitu__tests__remote__add_remote_url_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Remote url: › █ | -styles_hash: b6ca886ae9935933 +styles_hash: c42a6c2e1701612c diff --git a/src/tests/snapshots/gitu__tests__remote__remote_menu.snap b/src/tests/snapshots/gitu__tests__remote__remote_menu.snap index d830e823c6..e19b759845 100644 --- a/src/tests/snapshots/gitu__tests__remote__remote_menu.snap +++ b/src/tests/snapshots/gitu__tests__remote__remote_menu.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() K remove remote | r rename remote | q/esc Quit/Close | -styles_hash: bda3f6303d72b6b4 +styles_hash: f0b3d15664a45e6 diff --git a/src/tests/snapshots/gitu__tests__remote__remove_remote.snap b/src/tests/snapshots/gitu__tests__remote__remove_remote.snap index 31617d3952..0b6a735421 100644 --- a/src/tests/snapshots/gitu__tests__remote__remove_remote.snap +++ b/src/tests/snapshots/gitu__tests__remote__remove_remote.snap @@ -5,7 +5,7 @@ expression: ctx.redact_buffer() ▌On branch main | | Recent commits | - b66a0bf main add initial-file | + b66a0bf main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git remote remove origin | -styles_hash: 28202c97ccf86688 +styles_hash: f38bbbcefb723df8 diff --git a/src/tests/snapshots/gitu__tests__remote__rename_remote.snap b/src/tests/snapshots/gitu__tests__remote__rename_remote.snap index 4ec28206d7..8e82610b01 100644 --- a/src/tests/snapshots/gitu__tests__remote__rename_remote.snap +++ b/src/tests/snapshots/gitu__tests__remote__rename_remote.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin2/main'. | | Recent commits | - b66a0bf main origin2/main add initial-file | + b66a0bf main origin2/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git remote rename origin origin2 | -styles_hash: 1deab4cb8adf653a +styles_hash: db2e91a25b912ff4 diff --git a/src/tests/snapshots/gitu__tests__remote__rename_remote_name_prompt.snap b/src/tests/snapshots/gitu__tests__remote__rename_remote_name_prompt.snap index 13c229253d..2578f8c8fb 100644 --- a/src/tests/snapshots/gitu__tests__remote__rename_remote_name_prompt.snap +++ b/src/tests/snapshots/gitu__tests__remote__rename_remote_name_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Rename remote: › █ | -styles_hash: 27b62992ccb47712 +styles_hash: 802b36a3883cd0c0 diff --git a/src/tests/snapshots/gitu__tests__remote__rename_remote_new_name_prompt.snap b/src/tests/snapshots/gitu__tests__remote__rename_remote_new_name_prompt.snap index 1893f2c9e0..6b2e9d8e23 100644 --- a/src/tests/snapshots/gitu__tests__remote__rename_remote_new_name_prompt.snap +++ b/src/tests/snapshots/gitu__tests__remote__rename_remote_new_name_prompt.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Rename to: › █ | -styles_hash: 39fd6cbc76086bbb +styles_hash: d234beab6b72dd64 diff --git a/src/tests/snapshots/gitu__tests__reset__reset_hard.snap b/src/tests/snapshots/gitu__tests__reset__reset_hard.snap index e72fe663e8..a9904a9e40 100644 --- a/src/tests/snapshots/gitu__tests__reset__reset_hard.snap +++ b/src/tests/snapshots/gitu__tests__reset__reset_hard.snap @@ -6,7 +6,7 @@ expression: ctx.redact_buffer() ▌Your branch is up to date with 'origin/main'. | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 146fca7ccd68cab7 +styles_hash: 780c22238adfdcbd diff --git a/src/tests/snapshots/gitu__tests__reset__reset_menu.snap b/src/tests/snapshots/gitu__tests__reset__reset_menu.snap index f91cf4cbb1..63212c3d25 100644 --- a/src/tests/snapshots/gitu__tests__reset__reset_menu.snap +++ b/src/tests/snapshots/gitu__tests__reset__reset_menu.snap @@ -2,8 +2,8 @@ source: src/tests/reset.rs expression: ctx.redact_buffer() --- - ba1a85d main add unwanted-file | -▌b66a0bf origin/main add initial-file | + ba1a85d main add unwanted-file Author Name __ | +▌b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() m mixed | h hard | q/esc Quit/Close | -styles_hash: 83a9f669e53d0e1c +styles_hash: 631e5e77751e1cc6 diff --git a/src/tests/snapshots/gitu__tests__reset__reset_mixed.snap b/src/tests/snapshots/gitu__tests__reset__reset_mixed.snap index 3fa4fcd976..0894a370c4 100644 --- a/src/tests/snapshots/gitu__tests__reset__reset_mixed.snap +++ b/src/tests/snapshots/gitu__tests__reset__reset_mixed.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() unwanted-file | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 8d0a6a68bd80d839 +styles_hash: 8576d93f08bf2318 diff --git a/src/tests/snapshots/gitu__tests__reset__reset_soft.snap b/src/tests/snapshots/gitu__tests__reset__reset_soft.snap index cfb81e633d..ca26b49419 100644 --- a/src/tests/snapshots/gitu__tests__reset__reset_soft.snap +++ b/src/tests/snapshots/gitu__tests__reset__reset_soft.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() added unwanted-file | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: f5205687ef182b5f +styles_hash: bc37204623dd2828 diff --git a/src/tests/snapshots/gitu__tests__reset__reset_soft_prompt.snap b/src/tests/snapshots/gitu__tests__reset__reset_soft_prompt.snap index e2c0e31663..4b3b82a82d 100644 --- a/src/tests/snapshots/gitu__tests__reset__reset_soft_prompt.snap +++ b/src/tests/snapshots/gitu__tests__reset__reset_soft_prompt.snap @@ -2,8 +2,8 @@ source: src/tests/reset.rs expression: ctx.redact_buffer() --- - ba1a85d main add unwanted-file | -▌b66a0bf origin/main add initial-file | + ba1a85d main add unwanted-file Author Name __ | +▌b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Soft reset to (default origin/main): › q█ | -styles_hash: a45602c82423cd02 +styles_hash: 4a9ab12ee0605e66 diff --git a/src/tests/snapshots/gitu__tests__reverse__reverse_staged_delta.snap b/src/tests/snapshots/gitu__tests__reverse__reverse_staged_delta.snap index 6d6c878112..83b14f7940 100644 --- a/src/tests/snapshots/gitu__tests__reverse__reverse_staged_delta.snap +++ b/src/tests/snapshots/gitu__tests__reverse__reverse_staged_delta.snap @@ -17,12 +17,12 @@ expression: out modified file-one… | | Recent commits | - 9f4a45e main add file-one | - b66a0bf origin/main add initial-file | + 9f4a45e main add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse | -styles_hash: feb0752ac6cf0f53 +styles_hash: 1a57c2df7157bd8d [file before] blahonga diff --git a/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_delta.snap b/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_delta.snap index aa11de333d..8df0fda96b 100644 --- a/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_delta.snap +++ b/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_delta.snap @@ -6,8 +6,8 @@ expression: out Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | -▌9f4a45e main add file-one | - b66a0bf origin/main add initial-file | +▌9f4a45e main add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,7 +22,7 @@ expression: out | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse | -styles_hash: e2df43c3a6393f68 +styles_hash: e448e29830691556 [file before] blahonga diff --git a/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_hunk.snap b/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_hunk.snap index b157ef4365..8d769712c5 100644 --- a/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_hunk.snap +++ b/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_hunk.snap @@ -6,8 +6,8 @@ expression: out Your branch is ahead of 'origin/main' by 1 commit(s). | | Recent commits | - 9f4a45e main add file-one | -▌b66a0bf origin/main add initial-file | + 9f4a45e main add file-one Author Name __ | +▌b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,7 +22,7 @@ expression: out | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse | -styles_hash: 96d36739f332031 +styles_hash: 134b7062bc48884 [file before] blahonga diff --git a/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_line.snap b/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_line.snap index c4f09c7598..fc63828ced 100644 --- a/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_line.snap +++ b/src/tests/snapshots/gitu__tests__reverse__reverse_unstaged_line.snap @@ -14,15 +14,15 @@ expression: out ▌ BAZ | | Recent commits | - 9f4a45e main add file-one | - b66a0bf origin/main add initial-file | + 9f4a45e main add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | | ────────────────────────────────────────────────────────────────────────────────| $ git apply --reverse --recount | -styles_hash: d8eeebb35b94d8e3 +styles_hash: bbb095bbf9ae88ac [file before] blahonga diff --git a/src/tests/snapshots/gitu__tests__revert_abort.snap b/src/tests/snapshots/gitu__tests__revert_abort.snap index 5a63de37d6..ac6121e90d 100644 --- a/src/tests/snapshots/gitu__tests__revert_abort.snap +++ b/src/tests/snapshots/gitu__tests__revert_abort.snap @@ -6,9 +6,9 @@ expression: ctx.redact_buffer() ▌Your branch is ahead of 'origin/main' by 2 commit(s). | | Recent commits | - 7294ba4 main modify new-file | - 57409cb add new-file | - b66a0bf origin/main add initial-file | + 7294ba4 main modify new-file Author Name __ | + 57409cb add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git revert --abort | -styles_hash: 487a1d3b5b030afc +styles_hash: e6f959d90ee0bb3b diff --git a/src/tests/snapshots/gitu__tests__revert_commit.snap b/src/tests/snapshots/gitu__tests__revert_commit.snap index f4d05d4e30..537125e943 100644 --- a/src/tests/snapshots/gitu__tests__revert_commit.snap +++ b/src/tests/snapshots/gitu__tests__revert_commit.snap @@ -2,8 +2,8 @@ source: src/tests/mod.rs expression: ctx.redact_buffer() --- -▌6324471 main Revert "add initial-file" | - b66a0bf origin/main add initial-file | +▌6324471 main Revert "add initial-file" Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git revert --edit --no-edit main | -styles_hash: ba25c067bfa23389 +styles_hash: 5cb875281c9f055e diff --git a/src/tests/snapshots/gitu__tests__revert_commit_prompt.snap b/src/tests/snapshots/gitu__tests__revert_commit_prompt.snap index 4921f21062..afd9861e8c 100644 --- a/src/tests/snapshots/gitu__tests__revert_commit_prompt.snap +++ b/src/tests/snapshots/gitu__tests__revert_commit_prompt.snap @@ -2,7 +2,7 @@ source: src/tests/mod.rs expression: ctx.redact_buffer() --- -▌b66a0bf main origin/main add initial-file | +▌b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Revert commit (default main): › █ | -styles_hash: 9a9a7b67c0681857 +styles_hash: 876a2195717529a1 diff --git a/src/tests/snapshots/gitu__tests__revert_conflict.snap b/src/tests/snapshots/gitu__tests__revert_conflict.snap index 7114445165..698c7eead9 100644 --- a/src/tests/snapshots/gitu__tests__revert_conflict.snap +++ b/src/tests/snapshots/gitu__tests__revert_conflict.snap @@ -11,9 +11,9 @@ expression: ctx.redact_buffer() unmerged new-file… | | Recent commits | - 7294ba4 main modify new-file | - 57409cb add new-file | - b66a0bf origin/main add initial-file | + 7294ba4 main modify new-file Author Name __ | + 57409cb add new-file Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 468505792b7ec211 +styles_hash: 10ac5ca57578e4aa diff --git a/src/tests/snapshots/gitu__tests__revert_menu.snap b/src/tests/snapshots/gitu__tests__revert_menu.snap index d291bf9031..c5c69c627c 100644 --- a/src/tests/snapshots/gitu__tests__revert_menu.snap +++ b/src/tests/snapshots/gitu__tests__revert_menu.snap @@ -2,7 +2,7 @@ source: src/tests/mod.rs expression: ctx.redact_buffer() --- -▌b66a0bf main origin/main add initial-file | +▌b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() c Continue -E Don't edit commit message (--no-edit) | V Revert commit(s) -s Add Signed-off-by lines (--signoff) | q/esc Quit/Close | -styles_hash: 7112c073199b1f56 +styles_hash: 89b4e55187671654 diff --git a/src/tests/snapshots/gitu__tests__stage__stage_all_unstaged.snap b/src/tests/snapshots/gitu__tests__stage__stage_all_unstaged.snap index 9fe18e7f4c..883fc62c9d 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_all_unstaged.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_all_unstaged.snap @@ -10,9 +10,9 @@ expression: ctx.redact_buffer() ▌modified secondfile… | | Recent commits | - 0c2c6c3 main add secondfile | - 223428c add firstfile | - b66a0bf origin/main add initial-file | + 0c2c6c3 main add secondfile Author Name __ | + 223428c add firstfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git add -u . | -styles_hash: 3df0aa726902e9ad +styles_hash: f568615a9a389abe diff --git a/src/tests/snapshots/gitu__tests__stage__stage_all_untracked.snap b/src/tests/snapshots/gitu__tests__stage__stage_all_untracked.snap index 2d8dd4c7d2..4d97ee12d5 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_all_untracked.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_all_untracked.snap @@ -10,7 +10,7 @@ expression: ctx.redact_buffer() ▌added file-b | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git add file-a file-b | -styles_hash: 3a1c73d40e0d57d0 +styles_hash: 9079ad1b3941c6c8 diff --git a/src/tests/snapshots/gitu__tests__stage__stage_changes_crlf.snap b/src/tests/snapshots/gitu__tests__stage__stage_changes_crlf.snap index 6ca9ecd181..ef9fa718c9 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_changes_crlf.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_changes_crlf.snap @@ -13,8 +13,8 @@ expression: ctx.redact_buffer() ▌ testtest | | Recent commits | - bbe772c main add testfile | - b66a0bf origin/main add initial-file | + bbe772c main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: ce9d7828718125e1 +styles_hash: 38f74dd9f21937ad diff --git a/src/tests/snapshots/gitu__tests__stage__stage_deleted_executable_file.snap b/src/tests/snapshots/gitu__tests__stage__stage_deleted_executable_file.snap index 8469dba813..277619a8bc 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_deleted_executable_file.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_deleted_executable_file.snap @@ -9,9 +9,9 @@ expression: ctx.redact_buffer() ▌deleted script.sh… | | Recent commits | - af83421 main add executable script | - 289f1e5 add script.sh | - b66a0bf origin/main add initial-file | + af83421 main add executable script Author Name __ | + 289f1e5 add script.sh Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git add script.sh | -styles_hash: 1873a4f8ed35670a +styles_hash: 883e7c52495cce64 diff --git a/src/tests/snapshots/gitu__tests__stage__stage_deleted_file.snap b/src/tests/snapshots/gitu__tests__stage__stage_deleted_file.snap index 5fbff9d96b..690c8bd968 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_deleted_file.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_deleted_file.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() ▌deleted to-delete… | | Recent commits | - 0341425 main add to-delete | - b66a0bf origin/main add initial-file | + 0341425 main add to-delete Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git add to-delete | -styles_hash: cf57a6fd17d99b12 +styles_hash: f6d3f6ef453ef313 diff --git a/src/tests/snapshots/gitu__tests__stage__stage_file_with_spaces_in_name.snap b/src/tests/snapshots/gitu__tests__stage__stage_file_with_spaces_in_name.snap index 572d386706..ca313d68f8 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_file_with_spaces_in_name.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_file_with_spaces_in_name.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() ▌added file with space.txt | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git add file with space.txt | -styles_hash: b5589f2e5b138e2b +styles_hash: 64956c9840a901b0 diff --git a/src/tests/snapshots/gitu__tests__stage__stage_removed_line.snap b/src/tests/snapshots/gitu__tests__stage__stage_removed_line.snap index 93961b3145..b5070b0f65 100644 --- a/src/tests/snapshots/gitu__tests__stage__stage_removed_line.snap +++ b/src/tests/snapshots/gitu__tests__stage__stage_removed_line.snap @@ -19,7 +19,7 @@ expression: ctx.redact_buffer() testtest | | Recent commits | - 223428c main add firstfile | + 223428c main add firstfile Author Name __ | ────────────────────────────────────────────────────────────────────────────────| $ git apply --cached --recount | -styles_hash: 8f07bb5498255060 +styles_hash: b4d566d95b65cf9b diff --git a/src/tests/snapshots/gitu__tests__stage__staged_file.snap b/src/tests/snapshots/gitu__tests__stage__staged_file.snap index 706b22bd82..d51800b207 100644 --- a/src/tests/snapshots/gitu__tests__stage__staged_file.snap +++ b/src/tests/snapshots/gitu__tests__stage__staged_file.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() added new-file… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: e4bf0a553da4097a +styles_hash: 99868aa2f9d8803e diff --git a/src/tests/snapshots/gitu__tests__stage_last_hunk_of_first_delta.snap b/src/tests/snapshots/gitu__tests__stage_last_hunk_of_first_delta.snap index 34dc622283..7be356ff6a 100644 --- a/src/tests/snapshots/gitu__tests__stage_last_hunk_of_first_delta.snap +++ b/src/tests/snapshots/gitu__tests__stage_last_hunk_of_first_delta.snap @@ -15,11 +15,11 @@ expression: ctx.redact_buffer() blahonga | | Recent commits | - e45938a main add file-two | - b3cf8e8 add file-one | - b66a0bf origin/main add initial-file | + e45938a main add file-two Author Name __ | + b3cf8e8 add file-one Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | ────────────────────────────────────────────────────────────────────────────────| $ git apply --cached | -styles_hash: 7b6225633ca64544 +styles_hash: 9adae80f833033c7 diff --git a/src/tests/snapshots/gitu__tests__stash__stash.snap b/src/tests/snapshots/gitu__tests__stash__stash.snap index cf036a9e6f..c75718e29b 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() stash@0 On main: test | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash push --include-untracked --message test | Saved working directory and index state On main: test | -styles_hash: 38fa64e4b2914d7a +styles_hash: ebbdaf89aad19005 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_apply.snap b/src/tests/snapshots/gitu__tests__stash__stash_apply.snap index 61c87006f1..4b83f66691 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_apply.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_apply.snap @@ -15,11 +15,11 @@ expression: ctx.redact_buffer() stash@1 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | | ────────────────────────────────────────────────────────────────────────────────| $ git stash apply -q 1 | -styles_hash: 200cabb23831b52c +styles_hash: a8ac27ce0e3246df diff --git a/src/tests/snapshots/gitu__tests__stash__stash_apply_default.snap b/src/tests/snapshots/gitu__tests__stash__stash_apply_default.snap index 3212b56f91..720215f972 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_apply_default.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_apply_default.snap @@ -13,7 +13,7 @@ expression: ctx.redact_buffer() stash@1 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash apply -q 0 | Already up to date. | -styles_hash: fe20d9472776be1c +styles_hash: 7737dc08feaf09aa diff --git a/src/tests/snapshots/gitu__tests__stash__stash_apply_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_apply_prompt.snap index e647be4a38..0dc6e91bec 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_apply_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_apply_prompt.snap @@ -10,7 +10,7 @@ expression: ctx.redact_buffer() stash@1 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Apply stash (default 0): › █ | -styles_hash: 57707ad00ed829a4 +styles_hash: f647c63b357625f8 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_drop.snap b/src/tests/snapshots/gitu__tests__stash__stash_drop.snap index adbd717a5b..3be5d9f71f 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_drop.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_drop.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() stash@0 On main: file-two | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash drop 1 | Dropped refs/stash@{1} (6e4ee08a012b0675b1f27465f158930aa1088b7a) | -styles_hash: b1759c31e1cf2e64 +styles_hash: 4eb35160e26a3ffa diff --git a/src/tests/snapshots/gitu__tests__stash__stash_drop_default.snap b/src/tests/snapshots/gitu__tests__stash__stash_drop_default.snap index d71597253f..1938aad59b 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_drop_default.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_drop_default.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() stash@0 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash drop 0 | Dropped refs/stash@{0} (866ae6e6fb018bbc32c37e658e097d95dceee8c0) | -styles_hash: b1759c31e1cf2e64 +styles_hash: 4eb35160e26a3ffa diff --git a/src/tests/snapshots/gitu__tests__stash__stash_drop_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_drop_prompt.snap index 600a3a44a2..8294447ea2 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_drop_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_drop_prompt.snap @@ -10,7 +10,7 @@ expression: ctx.redact_buffer() stash@1 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Drop stash (default 0): › █ | -styles_hash: 80440fb30c8c16c3 +styles_hash: 5b95904b897f86e7 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_index.snap b/src/tests/snapshots/gitu__tests__stash__stash_index.snap index 44c4581ee9..970dc3f7d2 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_index.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_index.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() stash@0 On main: test | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash push --staged --message test | Saved working directory and index state On main: test | -styles_hash: 9f6c6a25872375b3 +styles_hash: 554f19abc74fa1e7 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_index_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_index_prompt.snap index 79d83f7260..8545ae4a96 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_index_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_index_prompt.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() added file-one… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Stash message: › █ | -styles_hash: cf71f21e02e3f49d +styles_hash: 4eeaf5493a814da2 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_keeping_index.snap b/src/tests/snapshots/gitu__tests__stash__stash_keeping_index.snap index a3403c58e0..74912eca67 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_keeping_index.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_keeping_index.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() stash@0 On main: test | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash push --keep-index --include-untracked --message test | Saved working directory and index state On main: test | -styles_hash: 62b29f66c7e857c7 +styles_hash: 4114b5a3e057615f diff --git a/src/tests/snapshots/gitu__tests__stash__stash_keeping_index_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_keeping_index_prompt.snap index 79d83f7260..8545ae4a96 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_keeping_index_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_keeping_index_prompt.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() added file-one… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Stash message: › █ | -styles_hash: cf71f21e02e3f49d +styles_hash: 4eeaf5493a814da2 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_pop.snap b/src/tests/snapshots/gitu__tests__stash__stash_pop.snap index 955342ecf7..76c0f31e11 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_pop.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_pop.snap @@ -14,7 +14,7 @@ expression: ctx.redact_buffer() stash@0 On main: file-two | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git stash pop -q 1 | -styles_hash: 4e1df32c020cfc7 +styles_hash: d7747e2fe3281794 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_pop_default.snap b/src/tests/snapshots/gitu__tests__stash__stash_pop_default.snap index 5d4fb19c37..9713c2af68 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_pop_default.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_pop_default.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() stash@0 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash pop -q 0 | Already up to date. | -styles_hash: dc0dbeaba237d74a +styles_hash: 16c934e3686254a0 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_pop_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_pop_prompt.snap index 15f0159dc1..8520c379ef 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_pop_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_pop_prompt.snap @@ -10,7 +10,7 @@ expression: ctx.redact_buffer() stash@1 On main: file-one | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Pop stash (default 0): › █ | -styles_hash: d4ee762d695afc2 +styles_hash: 5da17440c8dbe252 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_prompt.snap index 79d83f7260..8545ae4a96 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_prompt.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() added file-one… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Stash message: › █ | -styles_hash: cf71f21e02e3f49d +styles_hash: 4eeaf5493a814da2 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_working_tree.snap b/src/tests/snapshots/gitu__tests__stash__stash_working_tree.snap index 9aa2e3673c..aac9d1d43f 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_working_tree.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_working_tree.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() stash@0 On main: test | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ Saved working directory and index state WIP on main: b66a0bf add initial-file $ git stash push --include-untracked --message test | Saved working directory and index state On main: test | $ git stash pop -q 1 | -styles_hash: 68515006e12f2317 +styles_hash: 9105c2c99fe44f70 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_working_tree_prompt.snap b/src/tests/snapshots/gitu__tests__stash__stash_working_tree_prompt.snap index 79d83f7260..8545ae4a96 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_working_tree_prompt.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_working_tree_prompt.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() added file-one… | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ? Stash message: › █ | -styles_hash: cf71f21e02e3f49d +styles_hash: 4eeaf5493a814da2 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_everything_is_staged.snap b/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_everything_is_staged.snap index 07591ba33c..6b1bf3c2e4 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_everything_is_staged.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_everything_is_staged.snap @@ -12,7 +12,7 @@ expression: ctx.redact_buffer() ▌+blahonga | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| ! Cannot stash: working tree is empty | -styles_hash: afd809f8df8f4679 +styles_hash: cef1b68b62a4b57 diff --git a/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_nothing_is_staged.snap b/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_nothing_is_staged.snap index cf036a9e6f..c75718e29b 100644 --- a/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_nothing_is_staged.snap +++ b/src/tests/snapshots/gitu__tests__stash__stash_working_tree_when_nothing_is_staged.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() stash@0 On main: test | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() ────────────────────────────────────────────────────────────────────────────────| $ git stash push --include-untracked --message test | Saved working directory and index state On main: test | -styles_hash: 38fa64e4b2914d7a +styles_hash: ebbdaf89aad19005 diff --git a/src/tests/snapshots/gitu__tests__stash_list_with_limit.snap b/src/tests/snapshots/gitu__tests__stash_list_with_limit.snap index 2dc8f42d18..1f777e5bd7 100644 --- a/src/tests/snapshots/gitu__tests__stash_list_with_limit.snap +++ b/src/tests/snapshots/gitu__tests__stash_list_with_limit.snap @@ -10,7 +10,7 @@ expression: ctx.redact_buffer() stash@1 On main: secondstash | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: e6394d1f97d1c740 +styles_hash: b8f553b632f83f2a diff --git a/src/tests/snapshots/gitu__tests__syntax_highlighted.snap b/src/tests/snapshots/gitu__tests__syntax_highlighted.snap index ae3c1ff413..77e2785bf9 100644 --- a/src/tests/snapshots/gitu__tests__syntax_highlighted.snap +++ b/src/tests/snapshots/gitu__tests__syntax_highlighted.snap @@ -14,12 +14,12 @@ expression: ctx.redact_buffer() ▌ } | | Recent commits | - 5d25264 main add syntax-highlighted.rs | - b66a0bf origin/main add initial-file | + 5d25264 main add syntax-highlighted.rs Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | | | | -styles_hash: 6cb9c3325337796e +styles_hash: def2eb78b7d62cb diff --git a/src/tests/snapshots/gitu__tests__tab_diff.snap b/src/tests/snapshots/gitu__tests__tab_diff.snap index bc161454c3..25de5a1482 100644 --- a/src/tests/snapshots/gitu__tests__tab_diff.snap +++ b/src/tests/snapshots/gitu__tests__tab_diff.snap @@ -12,8 +12,8 @@ expression: ctx.redact_buffer() + this has a tab prefixed | | Recent commits | - 0295453 main add tab.txt | - b66a0bf origin/main add initial-file | + 0295453 main add tab.txt Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 8e07e0435805fafd +styles_hash: 9ceed5bf09b4f615 diff --git a/src/tests/snapshots/gitu__tests__unstage__unstage_added_file_with_spaces_in_name.snap b/src/tests/snapshots/gitu__tests__unstage__unstage_added_file_with_spaces_in_name.snap index ad48e0eec6..5274a67b0c 100644 --- a/src/tests/snapshots/gitu__tests__unstage__unstage_added_file_with_spaces_in_name.snap +++ b/src/tests/snapshots/gitu__tests__unstage__unstage_added_file_with_spaces_in_name.snap @@ -9,7 +9,7 @@ expression: ctx.redact_buffer() ▌file with space.txt | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git restore --staged file with space.txt | -styles_hash: 2ccf6c2919834e +styles_hash: 88229c86af3c34e3 diff --git a/src/tests/snapshots/gitu__tests__unstage__unstage_added_line.snap b/src/tests/snapshots/gitu__tests__unstage__unstage_added_line.snap index 2c9865b29d..f6b5cd9560 100644 --- a/src/tests/snapshots/gitu__tests__unstage__unstage_added_line.snap +++ b/src/tests/snapshots/gitu__tests__unstage__unstage_added_line.snap @@ -19,7 +19,7 @@ expression: ctx.redact_buffer() +blrergh | | Recent commits | - 223428c main add firstfile | + 223428c main add firstfile Author Name __ | ────────────────────────────────────────────────────────────────────────────────| $ git apply --cached --reverse --recount | -styles_hash: 94c81e31c9f7cd7c +styles_hash: 10f48bc08e12c1d1 diff --git a/src/tests/snapshots/gitu__tests__unstage__unstage_all_staged.snap b/src/tests/snapshots/gitu__tests__unstage__unstage_all_staged.snap index 23b81ba50c..f591e4cea8 100644 --- a/src/tests/snapshots/gitu__tests__unstage__unstage_all_staged.snap +++ b/src/tests/snapshots/gitu__tests__unstage__unstage_all_staged.snap @@ -11,7 +11,7 @@ expression: ctx.redact_buffer() ▌unaffected | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git reset HEAD -- | -styles_hash: 828d215dcad428cf +styles_hash: e0692c6beb9dc87a diff --git a/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_executable_file.snap b/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_executable_file.snap index 98d6987e4b..be1431603d 100644 --- a/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_executable_file.snap +++ b/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_executable_file.snap @@ -9,9 +9,9 @@ expression: ctx.redact_buffer() ▌deleted script.sh… | | Recent commits | - af83421 main add executable script | - 289f1e5 add script.sh | - b66a0bf origin/main add initial-file | + af83421 main add executable script Author Name __ | + 289f1e5 add script.sh Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git restore --staged script.sh | -styles_hash: 6c24691ba5576b20 +styles_hash: 679d9dc1c1d743d2 diff --git a/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_file.snap b/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_file.snap index cfce13dfa1..50db71785c 100644 --- a/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_file.snap +++ b/src/tests/snapshots/gitu__tests__unstage__unstage_deleted_file.snap @@ -9,8 +9,8 @@ expression: ctx.redact_buffer() ▌deleted to-delete… | | Recent commits | - 0341425 main add to-delete | - b66a0bf origin/main add initial-file | + 0341425 main add to-delete Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | ────────────────────────────────────────────────────────────────────────────────| $ git restore --staged to-delete | -styles_hash: f7c0e5a57ae9043f +styles_hash: 9ebc3e96897ceb0e diff --git a/src/tests/snapshots/gitu__tests__unstaged_changes.snap b/src/tests/snapshots/gitu__tests__unstaged_changes.snap index b5be38b57e..bfaef72cf2 100644 --- a/src/tests/snapshots/gitu__tests__unstaged_changes.snap +++ b/src/tests/snapshots/gitu__tests__unstaged_changes.snap @@ -13,8 +13,8 @@ expression: ctx.redact_buffer() ▌ testtest | | Recent commits | - cd4d2d1 main add testfile | - b66a0bf origin/main add initial-file | + cd4d2d1 main add testfile Author Name __ | + b66a0bf origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: ce9d7828718125e1 +styles_hash: 38f74dd9f21937ad diff --git a/src/tests/snapshots/gitu__tests__updated_externally.snap b/src/tests/snapshots/gitu__tests__updated_externally.snap index d5dd23db0f..3fdd1537c8 100644 --- a/src/tests/snapshots/gitu__tests__updated_externally.snap +++ b/src/tests/snapshots/gitu__tests__updated_externally.snap @@ -14,7 +14,7 @@ expression: ctx.redact_buffer() +test | | Recent commits | - b66a0bf main origin/main add initial-file | + b66a0bf main origin/main add initial-file Author Name __ | | | | @@ -22,4 +22,4 @@ expression: ctx.redact_buffer() | | | -styles_hash: 44acd39fd75ac09a +styles_hash: ca57e8c71067697a diff --git a/src/ui/item.rs b/src/ui/item.rs index 19ce528322..467214d781 100644 --- a/src/ui/item.rs +++ b/src/ui/item.rs @@ -7,6 +7,7 @@ use crate::gitu_diff::Status; use crate::highlight; use crate::item_data::{ItemData, Ref, SectionHeader}; use crate::items::Item; +use crate::ui::layout::opts; use crate::ui::{UiTree, layout_span}; /// Lays out an [`Item`] as spans in the caller's container, which is expected to @@ -63,6 +64,8 @@ pub(crate) fn layout_item<'a>( short_id, associated_references, summary, + author, + age, .. } => { layout_span( @@ -73,13 +76,30 @@ pub(crate) fn layout_item<'a>( ), ); - for reference in associated_references { + layout.horizontal(None, opts().fill_x(), |layout| { + for reference in associated_references { + layout_span(layout, (" ".into(), base)); + layout_reference(layout, reference, config, base); + } + layout_span(layout, (" ".into(), base)); - layout_reference(layout, reference, config, base); - } + layout_span(layout, (summary.as_str().into(), base)); + }); layout_span(layout, (" ".into(), base)); - layout_span(layout, (summary.as_str().into(), base)); + layout_span( + layout, + ( + author.as_str().into(), + base.patch(Style::from(&style.author)), + ), + ); + layout_span(layout, (" ".into(), base)); + layout_span( + layout, + (age.as_str().into(), base.patch(Style::from(&style.age))), + ); + layout_span(layout, (" ".into(), base)); } ItemData::Untracked(path) => { layout_span( diff --git a/src/ui/layout/mod.rs b/src/ui/layout/mod.rs index dd07c2067d..95757d23c3 100644 --- a/src/ui/layout/mod.rs +++ b/src/ui/layout/mod.rs @@ -288,17 +288,16 @@ impl LayoutTree { sum }; - let child_avail_size = avail_size - .saturating_sub(cursor) - .min(self.data[child].size + fill); - - if self - .compute_subtree(child, child_start, child_avail_size, pass) - .is_some() - { - child_avail_size - } else { - self.data[child].size + let fill_mask = self.data[child].opts.fill; + let content_mask = Vec2::one().saturating_sub(fill_mask); + + let remaining = avail_size.saturating_sub(cursor); + let granted = remaining.min(self.data[child].size + fill); + let child_avail_size = granted * fill_mask + remaining * content_mask; + + match self.compute_subtree(child, child_start, child_avail_size, pass) { + Some(placed) => granted * fill_mask + placed * content_mask, + None => self.data[child].size, } } }; @@ -559,6 +558,24 @@ mod tests { insta::assert_snapshot!(render_to_string(layout)); } + #[test] + fn fill_node_wraps_within_the_extent_it_gets() { + let mut layout = LayoutTree::new(); + + layout.horizontal(None, opts(), |layout| { + // Measures as one row at the full width, but only gets 6 columns. + layout.horizontal(None, opts().fill_x(), |layout| { + layout.leaf("hello"); + layout.leaf(" "); + layout.leaf("world"); + }); + layout.leaf("author"); + }); + + layout.compute([12, 2]); + insta::assert_snapshot!(render_to_string(layout)); + } + #[test] fn horizontal_layout() { let mut layout = LayoutTree::new(); diff --git a/src/ui/layout/snapshots/gitu__ui__layout__tests__fill_node_wraps_within_the_extent_it_gets.snap b/src/ui/layout/snapshots/gitu__ui__layout__tests__fill_node_wraps_within_the_extent_it_gets.snap new file mode 100644 index 0000000000..95b4e6bb37 --- /dev/null +++ b/src/ui/layout/snapshots/gitu__ui__layout__tests__fill_node_wraps_within_the_extent_it_gets.snap @@ -0,0 +1,6 @@ +--- +source: src/ui/layout/mod.rs +expression: render_to_string(layout) +--- +hello author +world From 58ecf26dd3520c384b051a081f84bdf36042ab1a Mon Sep 17 00:00:00 2001 From: altsem Date: Tue, 28 Jul 2026 23:26:18 +0200 Subject: [PATCH 4/5] fix crash introduced in screen rewrite when scrolling past bottom --- src/screen/mod.rs | 40 +++++++++++++++++++++++++++++++++++++++- src/ui/item.rs | 30 +++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/screen/mod.rs b/src/screen/mod.rs index 6a73c03326..f887c32765 100644 --- a/src/screen/mod.rs +++ b/src/screen/mod.rs @@ -349,7 +349,8 @@ impl Screen { fn move_cursor_to_screen_center(&mut self) { let half_screen = self.size.1 as usize / 2; - self.cursor = self.line_index[self.scroll + half_screen]; + let center = (self.scroll + half_screen).min(self.line_index.len().saturating_sub(1)); + self.cursor = self.line_index[center]; } fn clamp_cursor(&mut self) { @@ -613,3 +614,40 @@ fn area_selection_highlight(style: &StyleConfig, line: &ItemView) -> Style { Style::new() } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::config::init_test_config; + + fn screen_of(item_count: usize, size: (u16, u16)) -> Screen { + let config = Arc::new(init_test_config().unwrap()); + + Screen::new( + config, + size, + Box::new(move || { + Ok((0..item_count) + .map(|i| Item { + id: i as u64, + data: ItemData::Raw(format!("item {i}")), + ..Default::default() + }) + .collect()) + }), + ) + .unwrap() + } + + /// Scrolling is allowed a couple of lines past the content, so on a screen + /// the content doesn't fill, its center lands past the last line. + #[test] + fn recenter_cursor_on_a_screen_the_content_doesnt_fill() { + let mut screen = screen_of(3, (80, 20)); + + screen.scroll_view_down(2); + screen.refresh().unwrap(); + + assert_eq!(2, screen.cursor); + } +} diff --git a/src/ui/item.rs b/src/ui/item.rs index 467214d781..ff253770e9 100644 --- a/src/ui/item.rs +++ b/src/ui/item.rs @@ -9,6 +9,12 @@ use crate::item_data::{ItemData, Ref, SectionHeader}; use crate::items::Item; use crate::ui::layout::opts; use crate::ui::{UiTree, layout_span}; +use unicode_segmentation::UnicodeSegmentation; +use unicode_width::UnicodeWidthStr; + +/// What an author name is cut down to, so that a long one doesn't crowd out the +/// summary. +const AUTHOR_WIDTH: usize = 15; /// Lays out an [`Item`] as spans in the caller's container, which is expected to /// be a single row. @@ -90,7 +96,7 @@ pub(crate) fn layout_item<'a>( layout_span( layout, ( - author.as_str().into(), + truncate(author, AUTHOR_WIDTH), base.patch(Style::from(&style.author)), ), ); @@ -273,6 +279,28 @@ pub(crate) fn layout_item<'a>( } } +/// Cuts `text` down to `width` columns, the last of which is an ellipsis. +fn truncate(text: &str, width: usize) -> Cow<'_, str> { + if text.width() <= width { + return Cow::Borrowed(text); + } + + let mut truncated = String::new(); + let mut taken = 0; + + for grapheme in text.graphemes(true) { + if taken + grapheme.width() > width - 1 { + break; + } + + truncated.push_str(grapheme); + taken += grapheme.width(); + } + + truncated.push('…'); + Cow::Owned(truncated) +} + fn layout_reference<'a>(layout: &mut UiTree<'a>, reference: &'a Ref, config: &Config, base: Style) { let (name, style) = match reference { Ref::Tag(tag) => (tag, &config.style.tag), From 43971faab74f667967a4125e6dc74e4959a380f9 Mon Sep 17 00:00:00 2001 From: altsem Date: Tue, 28 Jul 2026 23:59:28 +0200 Subject: [PATCH 5/5] config(log): new general.log_author_width option (default 15) --- src/config.rs | 1 + src/default_config.toml | 1 + src/ui/item.rs | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/config.rs b/src/config.rs index 93d4f48cef..a9d9dcdda1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -57,6 +57,7 @@ pub struct GeneralConfig { pub collapsed_sections: Vec, pub stash_list_limit: usize, pub recent_commits_limit: usize, + pub log_author_width: usize, pub mouse_support: bool, pub mouse_scroll_lines: usize, } diff --git a/src/default_config.toml b/src/default_config.toml index 2ebbb6d243..d95974629d 100644 --- a/src/default_config.toml +++ b/src/default_config.toml @@ -11,6 +11,7 @@ collapsed_sections = [] refresh_on_file_change.enabled = true stash_list_limit = 10 recent_commits_limit = 10 +log_author_width = 15 mouse_support = false mouse_scroll_lines = 3 diff --git a/src/ui/item.rs b/src/ui/item.rs index ff253770e9..53f1142928 100644 --- a/src/ui/item.rs +++ b/src/ui/item.rs @@ -12,10 +12,6 @@ use crate::ui::{UiTree, layout_span}; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; -/// What an author name is cut down to, so that a long one doesn't crowd out the -/// summary. -const AUTHOR_WIDTH: usize = 15; - /// Lays out an [`Item`] as spans in the caller's container, which is expected to /// be a single row. /// @@ -96,7 +92,7 @@ pub(crate) fn layout_item<'a>( layout_span( layout, ( - truncate(author, AUTHOR_WIDTH), + truncate(author, config.general.log_author_width), base.patch(Style::from(&style.author)), ), ); @@ -285,6 +281,11 @@ fn truncate(text: &str, width: usize) -> Cow<'_, str> { return Cow::Borrowed(text); } + // The ellipsis takes a column of its own, leaving nothing to show at width 0. + if width == 0 { + return Cow::Borrowed(""); + } + let mut truncated = String::new(); let mut taken = 0;