Skip to content

Commit 5e16f25

Browse files
authored
Merge pull request #11063 from gitbutlerapp/metrics-handle-all-commands
Handle all CommandName variants in metrics::Command
2 parents c400600 + e73ce5f commit 5e16f25

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

crates/but/src/metrics.rs

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,36 @@ pub enum EventKind {
2727
pub enum Command {
2828
Log,
2929
Status,
30+
Stf,
3031
Rub,
32+
Commit,
33+
Push,
34+
New,
35+
Describe,
36+
Oplog,
37+
Restore,
38+
Undo,
39+
Snapshot,
40+
Gui,
41+
BaseCheck,
42+
BaseUpdate,
43+
BranchNew,
44+
BranchDelete,
45+
BranchList,
46+
BranchUnapply,
3147
ClaudePreTool,
3248
ClaudePostTool,
3349
ClaudeStop,
50+
CursorAfterEdit,
51+
CursorStop,
52+
Worktree,
53+
Mark,
54+
Unmark,
55+
ForgeAuth,
56+
ForgeListUsers,
57+
ForgeForget,
58+
PublishReview,
59+
Completions,
3460
Unknown,
3561
}
3662

@@ -39,11 +65,37 @@ impl From<CommandName> for EventKind {
3965
match command_name {
4066
CommandName::Log => EventKind::Cli(Command::Log),
4167
CommandName::Status => EventKind::Cli(Command::Status),
68+
CommandName::Stf => EventKind::Cli(Command::Stf),
4269
CommandName::Rub => EventKind::Cli(Command::Rub),
70+
CommandName::Commit => EventKind::Cli(Command::Commit),
71+
CommandName::Push => EventKind::Cli(Command::Push),
72+
CommandName::New => EventKind::Cli(Command::New),
73+
CommandName::Describe => EventKind::Cli(Command::Describe),
74+
CommandName::Oplog => EventKind::Cli(Command::Oplog),
75+
CommandName::Restore => EventKind::Cli(Command::Restore),
76+
CommandName::Undo => EventKind::Cli(Command::Undo),
77+
CommandName::Snapshot => EventKind::Cli(Command::Snapshot),
78+
CommandName::Gui => EventKind::Cli(Command::Gui),
79+
CommandName::BaseCheck => EventKind::Cli(Command::BaseCheck),
80+
CommandName::BaseUpdate => EventKind::Cli(Command::BaseUpdate),
81+
CommandName::BranchNew => EventKind::Cli(Command::BranchNew),
82+
CommandName::BranchDelete => EventKind::Cli(Command::BranchDelete),
83+
CommandName::BranchList => EventKind::Cli(Command::BranchList),
84+
CommandName::BranchUnapply => EventKind::Cli(Command::BranchUnapply),
4385
CommandName::ClaudePreTool => EventKind::Cli(Command::ClaudePreTool),
4486
CommandName::ClaudePostTool => EventKind::Cli(Command::ClaudePostTool),
4587
CommandName::ClaudeStop => EventKind::Cli(Command::ClaudeStop),
46-
_ => EventKind::Cli(Command::Unknown),
88+
CommandName::CursorAfterEdit => EventKind::Cli(Command::CursorAfterEdit),
89+
CommandName::CursorStop => EventKind::Cli(Command::CursorStop),
90+
CommandName::Worktree => EventKind::Cli(Command::Worktree),
91+
CommandName::Mark => EventKind::Cli(Command::Mark),
92+
CommandName::Unmark => EventKind::Cli(Command::Unmark),
93+
CommandName::ForgeAuth => EventKind::Cli(Command::ForgeAuth),
94+
CommandName::ForgeListUsers => EventKind::Cli(Command::ForgeListUsers),
95+
CommandName::ForgeForget => EventKind::Cli(Command::ForgeForget),
96+
CommandName::PublishReview => EventKind::Cli(Command::PublishReview),
97+
CommandName::Completions => EventKind::Cli(Command::Completions),
98+
CommandName::Unknown => EventKind::Cli(Command::Unknown),
4799
}
48100
}
49101
}

0 commit comments

Comments
 (0)