Skip to content

Alternative output format when printing the created fixup commits #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@ 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,
"fixup" => dest_commit_locator,
"header" => format!("+{},-{}", diff.insertions(), diff.deletions()),
);
} else {
Expand Down
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 :)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no self-explanatory comments please. anyone who wants to know why we did this can blame it

.use_custom_timestamp(|_| Ok(()))
.build()
.fuse();
let drain = std::sync::Mutex::new(drain).fuse();

let drain = slog::LevelFilter::new(
Expand Down