Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micro-optimize lib/git.zsh #1914

Closed
wants to merge 5 commits into from
Closed

Micro-optimize lib/git.zsh #1914

wants to merge 5 commits into from

Conversation

davvid
Copy link

@davvid davvid commented Jun 27, 2013

No description provided.

If we pre-define POST_GIT_1_7_2 then we can skip out on an extra
call to `git version`.
If neither DIRTY nor CLEAN is defined then this function is a noop,
so check up-front before making the call.

This speeds up prompts that empty out these values.
Use the `git rev-list` plumbing instead of `git log`, which
allows us to do without grep.

Limit the history to one commit as well.
The original code hard-coded 'origin' as the remote and called
current_branch() to get the corresponding remote branch name,
which may not necessarily be the correct upstream branch.

Use the the built-in @{upstream} syntax instead of calling
current_branch().

This improves performance and fixes a bug when the local and
remote branches do not have the same name.
Avoid looking for dirty submodules when git >= 1.7.2 using
the --ignore-submodules=dirty option.

Avoid looking at untracked files and other types of files when
the theme does not display them.

This dramatically speeds up performance.
@mcornella mcornella added Area: core Issue or PR related to core parts of the project Status: conflicts Pull Request that has conflicts with the master branch labels Mar 24, 2019
@mcornella
Copy link
Member

(Obsolete)

@mcornella mcornella closed this Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Issue or PR related to core parts of the project Status: conflicts Pull Request that has conflicts with the master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants