Skip to content

Commit 387efe5

Browse files
authored
Merge pull request #11101 from gitbutlerapp/kv-branch-64
feat(metrics): add Absorb command metric and CLI alias for absorb
2 parents c3c254a + 526f372 commit 387efe5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

crates/but/src/args.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ For examples see `but rub --help`."
198198
pub enum CommandName {
199199
#[clap(alias = "log")]
200200
Log,
201+
#[clap(alias = "absorb")]
202+
Absorb,
201203
#[clap(alias = "st")]
202204
Status,
203205
#[clap(alias = "stf", hide = true)]

crates/but/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ async fn match_subcommand(
374374
Subcommands::Absorb { source } => {
375375
let project = get_or_init_project(&args.current_dir)?;
376376
let result = absorb::handle(&project, args.json, source.as_deref());
377-
metrics_if_configured(app_settings, CommandName::Snapshot, props(start, &result)).ok();
377+
metrics_if_configured(app_settings, CommandName::Absorb, props(start, &result)).ok();
378378
result
379379
}
380380
Subcommands::Init { repo } => init::repo(&args.current_dir, args.json, repo)

crates/but/src/metrics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub enum Command {
5757
ForgeForget,
5858
PublishReview,
5959
Completions,
60+
Absorb,
6061
Unknown,
6162
}
6263

@@ -95,6 +96,7 @@ impl From<CommandName> for EventKind {
9596
CommandName::ForgeForget => EventKind::Cli(Command::ForgeForget),
9697
CommandName::PublishReview => EventKind::Cli(Command::PublishReview),
9798
CommandName::Completions => EventKind::Cli(Command::Completions),
99+
CommandName::Absorb => EventKind::Cli(Command::Absorb),
98100
CommandName::Unknown => EventKind::Cli(Command::Unknown),
99101
}
100102
}

0 commit comments

Comments
 (0)