Skip to content

git: Add global git integration enable/disable setting#43326

Merged
Anthony-Eid merged 4 commits intozed-industries:mainfrom
leoliu0605:#13304/setting-to-disable-git-globally
Dec 18, 2025
Merged

git: Add global git integration enable/disable setting#43326
Anthony-Eid merged 4 commits intozed-industries:mainfrom
leoliu0605:#13304/setting-to-disable-git-globally

Conversation

@leoliu0605
Copy link
Contributor

Closes #13304

Release Notes:

  • Add global git status and git diff on/off in one place instead of control everywhere

We can first review to ensure this change meets both Zed and user requirements, as well as code rules. Currently, we only support user-level settings. We can wait for this PR: #43173 to be merged, then modify it to support both user and project levels.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 22, 2025
@leoliu0605 leoliu0605 changed the title git: Add global git integration enable/disable setting git: add global git integration enable/disable setting Nov 22, 2025
@leoliu0605 leoliu0605 force-pushed the #13304/setting-to-disable-git-globally branch from 08d1db3 to 8646946 Compare November 22, 2025 13:40
@leoliu0605 leoliu0605 changed the title git: add global git integration enable/disable setting git: Add global git integration enable/disable setting Nov 22, 2025
Copy link
Contributor

@Anthony-Eid Anthony-Eid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job so far! The code is structured well, I just want a few naming conventions to be inline with Zed's patterns before merging.

I'll be happy to pair on this next week, if you want to get this merged and #43173 merged as well. https://cal.com/anthony-eid/community-pairing

Comment on lines +1297 to +1303
"enabled": {
// If true, all git integration features below are enabled or disabled independently.
// If false, all git integration features are disabled.
"global": true,
"status": true,
"diff": true
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our settings have a pattern already for disabling an area of integration (e.g. disable_ai) where the format is disable_{area of integration name}. Could you please update the naming to reflect this?

Also, can you flatten out the fields so a user could just write

"git": {
    "disable_git": true,
    "enable_status": false // enable is used as the prefix here because it's not a whole area of integration 
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +318 to +325
#[with_fallible_options]
#[derive(Clone, Copy, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom)]
#[serde(rename_all = "snake_case")]
pub struct GitEnabledSettings {
pub global: Option<bool>,
pub status: Option<bool>,
pub diff: Option<bool>,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to add a serde flatten attribute to flatten out this struct.

https://serde.rs/attr-flatten.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anthony-Eid
Copy link
Contributor

Also, these settings need to be added to the settings UI in the git page. You can do that by adding it to the settings_data function in crates/settings_ui/src/page_data.rs

@leoliu0605
Copy link
Contributor Author

Also, these settings need to be added to the settings UI in the git page. You can do that by adding it to the settings_data function in crates/settings_ui/src/page_data.rs

https://github.com/zed-industries/zed/pull/43326/changes#diff-b0c0f34361fe1a1ab7732356e23ee1c25e8bfbfcb97877a65a2b25077c20ca72R5288-R5383

@Anthony-Eid , please check the link for the changes, use dynamic items to make the UI settings clearer.

@leoliu0605
Copy link
Contributor Author

Great job so far! The code is structured well, I just want a few naming conventions to be inline with Zed's patterns before merging.

I'll be happy to pair on this next week, if you want to get this merged and #43173 merged as well. https://cal.com/anthony-eid/community-pairing

Hi @Anthony-Eid , I have scheduled time with you next week. Let's discuss then. Thank you.

@cole-miller cole-miller removed their assignment Dec 15, 2025
@Anthony-Eid Anthony-Eid enabled auto-merge (squash) December 18, 2025 16:44
Copy link
Contributor

@Anthony-Eid Anthony-Eid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes were made

@Anthony-Eid Anthony-Eid merged commit e10b9b7 into zed-industries:main Dec 18, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Community PRs to Done in Quality Week – December 2025 Dec 18, 2025
@esthertrapadoux
Copy link

Great work @leoliu0605 !!

@esthertrapadoux esthertrapadoux moved this to 🚢 Shipped by Community in Git board Dec 19, 2025
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
Closes #13304

Release Notes:

- Add global `git status` and `git diff` on/off in one place instead of
control everywhere

We can first review to ensure this change meets both `Zed` and user
requirements, as well as code rules. Currently, we only support
user-level settings. We can wait for this PR:
#43173 to be merged, then
modify it to support both user and project levels.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…s#43326)

Closes zed-industries#13304

Release Notes:

- Add global `git status` and `git diff` on/off in one place instead of
control everywhere

We can first review to ensure this change meets both `Zed` and user
requirements, as well as code rules. Currently, we only support
user-level settings. We can wait for this PR:
zed-industries#43173 to be merged, then
modify it to support both user and project levels.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…s#43326)

Closes zed-industries#13304

Release Notes:

- Add global `git status` and `git diff` on/off in one place instead of
control everywhere

We can first review to ensure this change meets both `Zed` and user
requirements, as well as code rules. Currently, we only support
user-level settings. We can wait for this PR:
zed-industries#43173 to be merged, then
modify it to support both user and project levels.
@leoliu0605 leoliu0605 deleted the #13304/setting-to-disable-git-globally branch February 3, 2026 06:28
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Feb 15, 2026
…s#43326)

Closes zed-industries#13304

Release Notes:

- Add global `git status` and `git diff` on/off in one place instead of
control everywhere

We can first review to ensure this change meets both `Zed` and user
requirements, as well as code rules. Currently, we only support
user-level settings. We can wait for this PR:
zed-industries#43173 to be merged, then
modify it to support both user and project levels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

Status: 🚢 Shipped by Community

Development

Successfully merging this pull request may close these issues.

Setting to disable git globally

4 participants