-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat(plugin-git): support changelog and improve performance #283
Conversation
Pull Request Test Coverage Report for Build 11649116096Details
💛 - Coveralls |
Title should be something like
|
@@ -11,3 +12,26 @@ export const checkGitRepo = (cwd: string): boolean => { | |||
return false | |||
} | |||
} | |||
|
|||
export const checkGitRepoType = (cwd: string): GitType | null => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are creating a git repo with git init
, so repo type is a bad name to me.
Also I am wondering if we should check the first remote if origin doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If do it this way, we will need to execute multiple command lines here: first, use git remote
to list all of them, then get the first one, and finally execute git remote get-url xxx
.
Co-authored-by: Mister-Hope <[email protected]>
plugin-git
, support changelog of the page
my bad, infer not refer 😂 |
Before submitting the PR, please make sure you do the following
close #123
).What is the purpose of this pull request?
Description
The current plugin executes three commands separately to obtain
createdTime
,updatedTime
, andcontributors
for a single page. This results in even more command executions whenfilepaths
contains multiple files, which is the main reason for the slow collection of git information.Additionally, the
contributors
information often leads to duplicate statistics because the username in the local git configuration may not be the same as the username on the git hosting service, resulting in the same user having multiple usernames.This PR makes the following updates and modifications:
A single command is executed per file to collect all git information.
Adds a
contributorConfig
preset for contributors' information, supporting alias mapping.Adds
avatar
andurl
information for contributors.Adds a
changelog
field to collect the change logs for the current page.Adds an
filter
field to control whether information is collected for pages globally.Adds
contributors
andchangelog
infrontmatter
to control whether relevant information is collected for the current page.