# git: Reduce number of spawned git processes when retrieving remote URLs \(\#59053\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e770c941878bd201e1554210c7ea426cf1f7ad49)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e770c941878bd201e1554210c7ea426cf1f7ad49

Requested commit: e770c941878bd201e1554210c7ea426cf1f7ad49

Commit: e770c941878bd201e1554210c7ea426cf1f7ad49

Tree: 4ebfb103d61c4e233e4ee01aa37b0a69adedcaa8

Author: Lukas Geiger

Committer: GitHub

## Message

```
git: Reduce number of spawned git processes when retrieving remote URLs (#59053)

Currently Zed fetches remote URLs by sequentially calling `git remote
get-url origin` and `git remote get-url upstream`.
This PR introduces a new `remote_urls` function which uses `git remote
-v` to retrieve all remote fetch URLs with a single git process.

Followup on #59042 and #59042 in the hope to reduce the amount of
spawned git processes.

Probably best to review both commits separately.

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 listing git remotes
```

## Parents

- [a31d3505daa393db75f95a3acc4f8217b5319583](https://git.cafe/gitcafe/zed/commit/a31d3505daa393db75f95a3acc4f8217b5319583?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e770c941878bd201e1554210c7ea426cf1f7ad49?format=markdown)
