git: Reduce amount of git commands when checking for pushed commits - #59069
Merged
Conversation
5 tasks
Veykril
reviewed
Jun 15, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jun 15, 2026
…ranch (#59087) Retrieving the default branch currently spawns up to 5 git processes sequentially which isn't ideal. This PR switches to a `git for-each-ref` and `git config` call to do the same checks while requiring spawning less git processes. I tested this in the UI and added a unit test to verify that the behaviour doesn't change. This PR follows the approach from #59069. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved performance of retrieving default git branch
Veykril
enabled auto-merge
June 15, 2026 09:20
Contributor
Author
|
Thanks for the fast review 🎉 |
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ranch (zed-industries#59087) Retrieving the default branch currently spawns up to 5 git processes sequentially which isn't ideal. This PR switches to a `git for-each-ref` and `git config` call to do the same checks while requiring spawning less git processes. I tested this in the UI and added a unit test to verify that the behaviour doesn't change. This PR follows the approach from zed-industries#59069. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved performance of retrieving default git branch
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ed-industries#59069) When uncommiting we check whether the commit already exists on a remote branch. This currently spawns a lot of git processes to do so, especially when having multiple remotes. This PR switches this to a single `git for-each-ref` call to do the same checks. I tested this in the UI and added some unit tests to verify this behaviour. This is a followup on zed-industries#59053, zed-industries#59044 and zed-industries#59042 with the goal to reduce overhead of the git handling. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved performance of git uncommit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When uncommiting we check whether the commit already exists on a remote branch. This currently spawns a lot of git processes to do so, especially when having multiple remotes.
This PR switches this to a single
git for-each-refcall to do the same checks. I tested this in the UI and added some unit tests to verify this behaviour.This is a followup on #59053, #59044 and #59042 with the goal to reduce overhead of the git handling.
Self-Review Checklist:
Release Notes: