Git telemetry (#26222)

Release Notes:

- git: Adds telemetry to git actions
This commit is contained in:
Conrad Irwin 2025-03-06 10:56:28 -07:00 committed by GitHub
parent 219d36f589
commit 9c054f207e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 0 deletions

View file

@ -1177,6 +1177,7 @@ impl GitPanel {
.focus_handle(cx)
.contains_focused(window, cx)
{
telemetry::event!("Git Committed", source = "Git Panel");
self.commit_changes(window, cx)
} else {
cx.propagate();
@ -1275,6 +1276,7 @@ impl GitPanel {
let Some(repo) = self.active_repository.clone() else {
return;
};
telemetry::event!("Git Uncommitted");
let confirmation = self.check_for_pushed_commits(window, cx);
let prior_head = self.load_commit_details("HEAD", cx);
@ -1477,6 +1479,7 @@ index 1234567..abcdef0 100644
let Some(repo) = self.active_repository.clone() else {
return;
};
telemetry::event!("Git Fetched");
let guard = self.start_remote_operation();
let askpass = self.askpass_delegate("git fetch", window, cx);
cx.spawn(|this, mut cx| async move {
@ -1512,6 +1515,7 @@ index 1234567..abcdef0 100644
let Some(branch) = repo.read(cx).current_branch() else {
return;
};
telemetry::event!("Git Pulled");
let branch = branch.clone();
let remote = self.get_current_remote(window, cx);
cx.spawn_in(window, move |this, mut cx| async move {
@ -1566,6 +1570,7 @@ index 1234567..abcdef0 100644
let Some(branch) = repo.read(cx).current_branch() else {
return;
};
telemetry::event!("Git Pushed");
let branch = branch.clone();
let options = if force_push {
PushOptions::Force
@ -2276,6 +2281,10 @@ index 1234567..abcdef0 100644
.disabled(!can_commit || self.modal_open)
.on_click({
cx.listener(move |this, _: &ClickEvent, window, cx| {
telemetry::event!(
"Git Committed",
source = "Git Panel"
);
this.commit_changes(window, cx)
})
}),