Skip to content
Draft
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
10 changes: 10 additions & 0 deletions git-branchless-lib/src/core/rewrite/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ pub enum MergeConflictRemediation {

/// Indicate that the user should run `git move -m -s 'siblings(.)'`.
Insert,

// TODO: confirm this message
/// Indicate that the user should run `git move -m -x HEAD~ --onto HEAD`.
Before,
}

/// Information about a failure to merge that occurred while moving commits.
Expand Down Expand Up @@ -415,6 +419,12 @@ impl FailedMergeInfo {
"To resolve merge conflicts, run: git move -m -s 'siblings(.)'"
)?;
}
MergeConflictRemediation::Before => {
writeln!(
effects.get_output_stream(),
"To resolve merge conflicts, run: git move -m -x HEAD~ --onto HEAD"
)?;
}
}

Ok(())
Expand Down
5 changes: 5 additions & 0 deletions git-branchless-opts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ pub struct RecordArgs {
#[clap(action, short = 'I', long = "insert")]
pub insert: bool,

/// Insert the new commit before HEAD, as a child of HEAD~, then rebase
/// HEAD onto the new commit.
#[clap(action, long = "before", conflicts_with("insert"))]
pub before: bool,

/// After making the new commit, switch back to the previous commit.
#[clap(action, short = 's', long = "stash", conflicts_with_all(&["create", "detach"]))]
pub stash: bool,
Expand Down
Loading
Loading