From 7bfbdbccda07df94417739a29dce133997091855 Mon Sep 17 00:00:00 2001 From: Ariel Fridman Date: Fri, 11 Apr 2025 18:36:30 +0300 Subject: [PATCH 1/3] Removes timestamp from logs This was done sine they are not really helpful to the avarage user, and take up precious line space that will be used in later commits for better stuff :) --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c0d70a6..799a90b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,12 @@ fn main() { } let decorator = slog_term::TermDecorator::new().build(); - let drain = slog_term::FullFormat::new(decorator).build().fuse(); + let drain = slog_term::FullFormat::new(decorator) + // Don't write a timestamp, as requested in #126 + // I am currently running git absorb myself, I know what time it is :) + .use_custom_timestamp(|_| Ok(())) + .build() + .fuse(); let drain = std::sync::Mutex::new(drain).fuse(); let drain = slog::LevelFilter::new( From f0dedc9b8b4518aad78ec4a03be656e8b4f0e488 Mon Sep 17 00:00:00 2001 From: Ariel Fridman Date: Fri, 11 Apr 2025 18:56:55 +0300 Subject: [PATCH 2/3] Moves to using short commit ids for rebase logs This is more readble by the avarage user, still usable in the git CLI when copy-pasting and saves us a metric ton of precious line space :) --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index de914c1..ddad829 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -327,8 +327,10 @@ fn run_with_repo(logger: &slog::Logger, config: &Config, repo: &git2::Repository &head_tree, &[&head_commit], )?)?; + let commit_short_id = head_commit.as_object().short_id()?; + let commit_short_id = commit_short_id.as_str().expect("the commit short id is always a valid ascii string by definition (its a hex string)"); info!(logger, "committed"; - "commit" => head_commit.id().to_string(), + "commit" => commit_short_id, "header" => format!("+{},-{}", diff.insertions(), diff.deletions()), ); } else { From cfa60c47e2aedd3465b9cfc7af5e53b417366e9f Mon Sep 17 00:00:00 2001 From: Ariel Fridman Date: Fri, 11 Apr 2025 18:58:14 +0300 Subject: [PATCH 3/3] Adds the summary of the commit we are fixing up to the logs Do note that if you used the absorb.fixupTargetAlwaysSHA option (or its cli equvalient), you will see the commit hash instead. I don't think its interesting enough to fix (maybe this is even the intended behaviour?) You decide! --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index ddad829..a297648 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -331,6 +331,7 @@ fn run_with_repo(logger: &slog::Logger, config: &Config, repo: &git2::Repository let commit_short_id = commit_short_id.as_str().expect("the commit short id is always a valid ascii string by definition (its a hex string)"); info!(logger, "committed"; "commit" => commit_short_id, + "fixup" => dest_commit_locator, "header" => format!("+{},-{}", diff.insertions(), diff.deletions()), ); } else {