# git: Do not run \`git stash list\` on every file save \(\#59042\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a31d3505daa393db75f95a3acc4f8217b5319583

Requested commit: a31d3505daa393db75f95a3acc4f8217b5319583

Commit: a31d3505daa393db75f95a3acc4f8217b5319583

Tree: baebca6fd487a23b3eda06e943fc9a47d67a8385

Author: Lukas Geiger

Committer: GitHub

## Message

```
git: Do not run `git stash list` on every file save (#59042)

Currently `git stash list` will run on every `paths_changed` event e.g.
every time files are modified or saved.
This is unnecessary since the git stashes will only change when a `git
stash` command is run. Which can either happen from within Zed or from a
terminal. Changes there are already tracked by monitoring
`.git/logs/refs/stash`.
I verified that Zed's git stash view still works as expected.

I'm noticing that Zed performs very badly when working with a large git
repo via SSH remote development. In particular I've noticed bad
performance when working with https://github.com/pytorch/pytorch which
includes lots of submodules.
I'm hoping that this PR will reduce the amount of git processes and
hopefully make it more responsive without having to manually add folders
to `file_scan_exclusions`.

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:

- Reduce git processes run on every file change
```

## Parents

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

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