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

IScriptHostControl.CurrentBranch() to decrease overhead #10849

Merged

Conversation

gerhardol
Copy link
Member

Proposed changes

Module.GetSelectedBranch() requires about 1 ms (15000 ticks) also if no Git command is required.
This info is already calculated in the revision grid and can be made available in the IScriptHostControl interface.
(An alternative is to add this to the event like for FilteredGitRefsProvider.)

Adding this in side panel, could be added elsewhere.
In for instance CommitInfo the reference to IScriptHostControl need to be provided after creation, so a few more steps.

Test methodology

Manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

CurrentBranch is already calculated in RevisionGrid
@ghost ghost assigned gerhardol Apr 1, 2023
@vbjay
Copy link
Contributor

vbjay commented Apr 1, 2023

If current branch is changed outside of current ge instance and you run, it will be wrong. Running the git command should be run to make sure of current branch.

@gerhardol
Copy link
Member Author

If current branch is changed outside of current ge instance and you run, it will be wrong. Running the git command should be run to make sure of current branch.

That applies to any change in the grid: commits, current branch etc, so this is even more consistent. You need to refresh if doing external changes.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

👍

GitUI/Script/IScriptHostControl.cs Outdated Show resolved Hide resolved
@RussKie RussKie added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Apr 2, 2023
@ghost ghost removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Apr 2, 2023
@gerhardol gerhardol merged commit 57829cb into gitextensions:master Apr 6, 2023
1 of 2 checks passed
@gerhardol gerhardol deleted the feature/scripthost-currentbranch branch April 6, 2023 20:02
@ghost ghost added this to the vNext milestone Apr 6, 2023
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.

None yet

4 participants