-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use local git repository to get git diffs #153
Conversation
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.
I've left a few comments. Mostly to improve a bit of readability and code reuse. Let me know what do you think!
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.
Just minor comments
function vipgoci_git_version(): ?string { | ||
static $git_version_cached = null; | ||
|
||
if ( null !== $git_version_cached ) { |
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.
Early returns <3
string $commit_id_b | ||
): array { | ||
|
||
vipgoci_log( |
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.
I think these tabs and break lines were unintentional?
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.
Resolved in d1471e7
I'm assuming you are referring to line 779 (now removed). The tabs on line 781, 782 and so forth are intentional to make the code easier to read.
vipgoci_gitrepo_diffs_fetch_uncached(): * Overall statistics on changes * For files renamed, previous file name is provided vipgoci_gitrepo_diffs_fetch(): * Overall statistics on changes, takes into account filters
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.
phpcs scanning turned up:
This bot provides automated PHP Linting and PHPCS scanning, read more here.
git-repo.php
Outdated
'commit_id_b' => $commit_id_b, | ||
) | ||
); | ||
$test = ''; |
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.
Let
vipgoci_github_diffs_fetch()
use local git repository for its source ofgit diff
results instead of using the GitHub API. Rename the function to indicate that it uses the local git-repository as well. Add unit-tests as needed and update older ones.This will solve #135 .
TODO:
MiscPatchChangedLinesTest
unit-test to use thevip-go-ci-tests
repository, see here.vipgoci_github_diffs_fetch()
into two: cached and uncached versionsvipgoci_github_diffs_fetch()
tovipgoci_gitrepo_diffs_fetch()
and move togit-repo.php
.a/
andb/
vipgoci_gitrepo_diffs_fetch_uncached()
-- overall statistics on changes, previous name of files renamedvipgoci_gitrepo_diffs_fetch()
-- overall statistics on changes, takes effects of filter into account