feat(timeout): add "timeout_ms" and "max_parent_commits" options#297
Open
linrongbin16 wants to merge 11 commits intomasterfrom
Open
feat(timeout): add "timeout_ms" and "max_parent_commits" options#297linrongbin16 wants to merge 11 commits intomasterfrom
linrongbin16 wants to merge 11 commits intomasterfrom
Conversation
linrongbin16
commented
Apr 1, 2026
| end | ||
| else | ||
| for i = 1, 50 do | ||
| for i = 1, max_parent_commits do |
Owner
Author
There was a problem hiding this comment.
I guess the "super long commands running time" is mostly caused by here.
Because in worst case, it will run some git commands for 50 times, which of course cost too long time. I reduced this parameter to 5. Usually in a correctly remote-url configured git repository, it should be called for only once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #296
Adds a "timeout_ms" (in milliseconds) option, by default it is
1000ms(1 sec).As this plugin will run multiple git commands in a local git repository to find out all the correct remote git host information it needs to construct a remote git permlink. If running commands cost too long time, which is greater than "timeout_ms", then it will directly return an error message.
Also adds a "max_parent_commits" (count) option, by default it is
10.This plugin will try to find the correct commit ID to match between local git repo and remote git repo, with following method:
git rev-parse @{u}, in a correctly remote-url configured git repo, this should work.git rev-parse HEADto find out the latest remote repo commit ID.git rev-parse HEAD~{1,10}to find out a closest compatible commit ID in remote git repo. In this case, the10is the maximum parent commits we will try. In previous implement, this max value is50, which can cost a long time. In this PR, I add this "max_parent_commits" option to let user decide how many commits they want to find.Test Platforms
Test Hosts
Test Functions
GitLink(!)to copy git link (or open in browser).GitLink(!) blameto copy the/blamelink (or open in browser).GitLink(!) default_branchto open the/main//masterlink in browser (or open in browser).GitLink(!) current_branchto open the current branch link in browser (or open in browser).