Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Speedup VCS Segment 4 #1058

Merged
merged 6 commits into from
Nov 10, 2018
Merged

Speedup VCS Segment 4 #1058

merged 6 commits into from
Nov 10, 2018

Conversation

dritter
Copy link
Member

@dritter dritter commented Nov 7, 2018

This PR changes the way how stashes are counted. Previously the stashes were counted via git stash list | wc -l, now they are counted without invoking wc or even git.

Secondly this fixes an issue with the untracked files: That code worked only within the current directory. So if you have untracked files in your repo root and change into a clean subdir, you never saw the untracked icon. This is now fixed.

Talking in speed:
time ( repeat 10; do; prompt_vcs "left" 1 false > /dev/null; done;) in my P9K dev repo with 65 stashes:
1,57s user 1,68s system 85% cpu 3,804 total
Old segment from next (5200a1b):
2,32s user 2,58s system 83% cpu 5,864 total

@Erowlin could you double check the speed improvements?

We cannot detect untracked files when we are inside of
a .git directory.
In this case is was previously not possible to get the untracked
status. Now we temporarily change the directory to the repo root
folder and then get the list of untracked files.
Changing directories while checking for untracked files broke
the display of git stashes. The hook was not called any more.
This is why we disabled checking for untracked files within a
.git folder.
Now the untracked files are always checked from
the root folder of the repo.
@dritter dritter mentioned this pull request Nov 7, 2018
@dritter dritter changed the title [WIP] Speedup VCS Segment 4 Speedup VCS Segment 4 Nov 7, 2018
@dritter dritter merged commit 3413126 into Powerlevel9k:next Nov 10, 2018
@dritter dritter mentioned this pull request Nov 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant