Skip to content

Commit 1c8aff2

Browse files
committed
Adds new message CLI option
This option is used to specify the commit body for generated fixup commits
1 parent 98ff3ac commit 1c8aff2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub struct Config<'a> {
1919
pub rebase_options: &'a Vec<&'a str>,
2020
pub whole_file: bool,
2121
pub one_fixup_per_commit: bool,
22+
pub message: Option<&'a str>,
2223
}
2324

2425
pub fn run(logger: &slog::Logger, config: &Config) -> Result<()> {
@@ -987,5 +988,6 @@ mod tests {
987988
rebase_options: &Vec::new(),
988989
whole_file: false,
989990
one_fixup_per_commit: false,
991+
message: None,
990992
};
991993
}

src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ struct Cli {
4444
/// Only generate one fixup per commit
4545
#[clap(long, short = 'F')]
4646
one_fixup_per_commit: bool,
47+
/// Commit message body that is given to all fixup commits
48+
#[clap(long, short)]
49+
message: Option<String>,
4750
}
4851

4952
fn main() {
@@ -59,6 +62,7 @@ fn main() {
5962
gen_completions,
6063
whole_file,
6164
one_fixup_per_commit,
65+
message,
6266
} = Cli::parse();
6367

6468
if let Some(shell) = gen_completions {
@@ -109,6 +113,7 @@ fn main() {
109113
rebase_options: &rebase_options,
110114
whole_file,
111115
one_fixup_per_commit,
116+
message: message.as_deref(),
112117
},
113118
) {
114119
crit!(logger, "absorb failed"; "err" => e.to_string());

0 commit comments

Comments
 (0)