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

git-status performance and safety fixes #64

Merged
merged 13 commits into from
Apr 14, 2024

Conversation

Stealthii
Copy link
Contributor

The main reason for this PR is that due to the sheer number of calls to git during these calculations, actual git commands were failing due to the locks. Multiple commands have been replaced with single, lock-safe checks and other comparisons made to reduce calls to upstream fixed.

Minor changes

  • Reduce call count for git-status calculations

Bug & security fixes

  • Numerical comparisons in git-status
  • Improved safety checks for git-status
  • Only apply Gitlab status checks to Gitlab repos

@Stealthii Stealthii force-pushed the bugfix/git-status-perf branch from bf43f31 to 1a9a6a3 Compare April 13, 2024 00:45
Copy link
Owner

@janoamaral janoamaral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks very good. Please, fix conflicts and I'll merge it.

@Stealthii Stealthii force-pushed the bugfix/git-status-perf branch from 1a9a6a3 to 01e9310 Compare April 13, 2024 23:19
egrep is non-standard and deprecated, use grep -E instead.
Replace use of string comparisons with -gt, -pt, and -eq.

This fixes an issue with git-status where the 20 second time comparison
wasn't adhered to.
Previously STATUS wasn't checked properly in cases where the command
failed, resulting in incorrect output. This has been replaced with a
numerical check which will ensure the correct output in both situations.
@Stealthii Stealthii force-pushed the bugfix/git-status-perf branch from 01e9310 to a92e057 Compare April 13, 2024 23:27
@Stealthii Stealthii requested a review from janoamaral April 14, 2024 00:36
@Stealthii
Copy link
Contributor Author

Stealthii commented Apr 14, 2024

Confirmed functionality on personal master branch! Updated a few known color references to the new theme variants.

@janoamaral janoamaral merged commit 346c50c into janoamaral:master Apr 14, 2024
1 check passed
@janoamaral janoamaral added the bug Something isn't working label Apr 14, 2024
@Stealthii Stealthii deleted the bugfix/git-status-perf branch April 14, 2024 13:29
uNyanda pushed a commit to uNyanda/tokyo-night-tmux that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants