git_ui: Show author name on commits in branch picker (#36812)

See related discussion
https://github.com/zed-industries/zed/discussions/36511.

<img alt="zed"
src="https://github.com/user-attachments/assets/da7fc30d-2504-48f4-a392-7c8d5cd8acb1"
/>

Release Notes:

- Added option to show the author name in a branch picker commit
information

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Lev Zakharov
2025-09-09 18:44:46 +00:00
committed by GitHub
co-authored by Conrad Irwin
parent 9529cd18d1
commit 46fb521333
11 changed files with 98 additions and 5 deletions
+2
View File
@@ -4752,6 +4752,7 @@ fn branch_to_proto(branch: &git::repository::Branch) -> proto::Branch {
sha: commit.sha.to_string(),
subject: commit.subject.to_string(),
commit_timestamp: commit.commit_timestamp,
author_name: commit.author_name.to_string(),
}),
}
}
@@ -4781,6 +4782,7 @@ fn proto_to_branch(proto: &proto::Branch) -> git::repository::Branch {
sha: commit.sha.to_string().into(),
subject: commit.subject.to_string().into(),
commit_timestamp: commit.commit_timestamp,
author_name: commit.author_name.to_string().into(),
has_parent: true,
}
}),
+22
View File
@@ -405,6 +405,10 @@ pub struct GitSettings {
///
/// Default: on
pub inline_blame: Option<InlineBlameSettings>,
/// Which information to show in the branch picker.
///
/// Default: on
pub branch_picker: Option<BranchPickerSettings>,
/// How hunks are displayed visually in the editor.
///
/// Default: staged_hollow
@@ -509,6 +513,24 @@ impl Default for InlineBlameSettings {
}
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct BranchPickerSettings {
/// Whether to show author name as part of the commit information.
///
/// Default: false
#[serde(default)]
pub show_author_name: bool,
}
impl Default for BranchPickerSettings {
fn default() -> Self {
Self {
show_author_name: true,
}
}
}
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq, JsonSchema, Hash)]
pub struct BinarySettings {
pub path: Option<String>,