-
Notifications
You must be signed in to change notification settings - Fork 28
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
There should be an option to disable searching for lastTag #56
Comments
@AndrejZbin SGTM. Something like getRepoInfo(path, { findLastTag: false}) If you have time for an implementation I'd be happy to review |
@AndrejZbin thinking a little more on it, what do you think about making the properties lazy cached getters so you only pay the cost if you actually access the property? And potentially also exporting the individual functions? Something like module.exports = function getRepoInfo() {
return {
get branch() {
if(this._branch === undefined) { this._branch = branchInfo(); }
return this._branch;
},
get lastTag() {
if(this._lastTag === undefined) { this._lastTag = lastTagInfo(); }
return this._branch;
},
// ...
}
}
module.exports.lastTagInfo = lastTagInfo;
module.exports.branchInfo = branchInfo;
// ... |
@hjdivad sounds good. I am happy to implement it, unless you or someone else wants to do it :) |
@AndrejZbin if you have time to implement that would be wonderful. I'd be happy to review the PR. |
For repositories without tags or use cases where lastTag information is not required, findLastTag causes unnecessarily long execution time, as it might iterate though all or nearly all commits.
There should be an option to get repo info without lastTag information, as it would improve the execution time drastically.
The text was updated successfully, but these errors were encountered: