Skip to content

Fix slow tig status in large repo when given a subdirectory path#1424

Open
apawn wants to merge 1 commit into
jonas:masterfrom
apawn:master
Open

Fix slow tig status in large repo when given a subdirectory path#1424
apawn wants to merge 1 commit into
jonas:masterfrom
apawn:master

Conversation

@apawn
Copy link
Copy Markdown

@apawn apawn commented May 21, 2026

Summary

git status is quite slow in large repositories like chromium, but git status <path> is much faster because it limits the scan to the given pathspec. while tig status <path> was as slow as tig status.

This change makes the status view pass path arguments to the underlying Git commands and skip the full index refresh when path filtering is active.

Changes

  • Pass %(fileargs) to git diff-index, git diff-files, and git ls-files when loading the status view
  • Enable file argument expansion in status_run() (same mechanism as log/diff views)
  • Skip git update-index --refresh when a path filter is active (this was the main bottleneck in large repos)
  • Add VIEW_FILE_FILTER to the status view
  • Add test/status/file-filter-test

Result

  • Before:
    It used to take ages—around 37 seconds—looking like the app completely froze.
20260522161217_rec_
  • After: Reduced to ~1 second, drastically improving the user experience for this widely used feature.
20260522161148_rec_

Test plan

  • make test/status/file-filter-test
  • In a large repo, verify tig status subdir is much faster than tig status
  • Verify tig status subdir shows the same changes as git status subdir
  • Verify tig status (without path) still works as before

@apawn apawn changed the title Fix slow tig status when given a subdirectory path Fix slow tig status in large repo when given a subdirectory path May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant