Rework git toasts (#26420)

The notifications from git output could take up variable amounts of
screen space, and they were quite obnoxious when a git command printed
lots of output, such as fetching many new branches or verbose push
hooks.

This change makes the push/pull/fetch buttons trigger a small
notification toast, based on the output of the command that was ran. For
errors or commands with more output the user may want to see, there's an
"Open Log" button which opens a new buffer with the output of that
command.

It also uses this behavior for long error notifications for other git
commands like `commit` and `checkout`. The output of those commands can
be quite long due to arbitrary githooks running.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
Julia Ryan 2025-03-11 14:39:29 -07:00 committed by GitHub
parent e8208643bb
commit 2b94a35aaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 415 additions and 418 deletions

View file

@ -92,7 +92,7 @@ impl UpstreamTracking {
}
}
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct RemoteCommandOutput {
pub stdout: String,
pub stderr: String,
@ -912,7 +912,7 @@ fn run_remote_command(
let output = output?;
if !output.status.success() {
Err(anyhow!(
"Operation failed:\n{}",
"{}",
String::from_utf8_lossy(&output.stderr)
))
} else {