Skip to content

Commit

Permalink
fix: Don't print scary messages during on disk fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonrcarter committed Dec 10, 2022
1 parent 58ffb9d commit d2b07b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion git-branchless-lib/src/core/rewrite/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ impl ToString for RebaseCommand {
// the rewritten version of original_commit_oid.
let cleanup_plan = vec![
format!("exec git commit --amend --no-edit --reuse-message {original_commit_oid}"),
// FIXME This is causing "Skipping commit (was already applied upstream)" to be displayed for each fixup commit
// FIXME I'm assuming that $(...) is not portable and will need to be changed
"exec git branchless hook-skip-upstream-applied-commit $(git rev-parse @{1})".to_string(),
format!("exec git branchless hook-skip-upstream-applied-commit {original_commit_oid} $(git rev-parse HEAD)")
Expand Down
17 changes: 10 additions & 7 deletions git-branchless-lib/src/core/rewrite/rewrite_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,16 @@ pub fn hook_skip_upstream_applied_commit(
) -> eyre::Result<()> {
let repo = Repo::from_current_dir()?;
let commit = repo.find_commit_or_fail(commit_oid)?;
writeln!(
effects.get_output_stream(),
"Skipping commit (was already applied upstream): {}",
effects
.get_glyphs()
.render(commit.friendly_describe(effects.get_glyphs())?)?
)?;

if let MaybeZeroOid::Zero = rewritten_oid {
writeln!(
effects.get_output_stream(),
"Skipping commit (was already applied upstream): {}",
effects
.get_glyphs()
.render(commit.friendly_describe(effects.get_glyphs())?)?
)?;
}

if let Some(orig_head_reference) = repo.find_reference(&"ORIG_HEAD".into())? {
let resolved_orig_head = repo.resolve_reference(&orig_head_reference)?;
Expand Down

0 comments on commit d2b07b1

Please sign in to comment.