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

Check for diffBranch existence before fetch files #115

Merged
merged 3 commits into from
May 15, 2020

Conversation

WhiteYin
Copy link

This PR introduces a check to see if the diffBranch is existed. If not, lint all tracked files instead of fetch from origin branch or baseBranch.

Closes #114

@theenadayalank theenadayalank self-requested a review May 11, 2020 05:38
@theenadayalank
Copy link
Owner

Thank you @WhiteYin for taking the time to make this change. It has been a long time pending item that I have skipped for months. I'm really glad that you made this change.

}
catch(err) {
isdiffBranchExisted = checkForBranchExistence(baseBranch,remote);
debug('Check whether branch is existed: ', diffBranch);
Copy link
Owner

Choose a reason for hiding this comment

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

This PR is good to go with a success log stating that the base branch is existing.

Copy link
Owner

Choose a reason for hiding this comment

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

It would make the debugging process a bit easier.

Copy link
Author

@WhiteYin WhiteYin May 14, 2020

Choose a reason for hiding this comment

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

How about now? 😊

This PR is good to go with a success log stating that the base branch is existing.

Copy link
Owner

Choose a reason for hiding this comment

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

Cool 👍

@theenadayalank
Copy link
Owner

I apologize for the delay in the reviewing this PR.

}
catch(err) {
isdiffBranchExisted = checkForBranchExistence(baseBranch,remote);
debug('Check whether branch is existed: ', diffBranch);
Copy link
Owner

Choose a reason for hiding this comment

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

Cool 👍

@theenadayalank theenadayalank merged commit 7d6699a into theenadayalank:master May 15, 2020
@@ -107,6 +107,7 @@ if (process.stdout.isTTY) {

let committedGitFiles = [];
if (isdiffBranchExisted) {
log(success('Great, we find the ' + diffBranch + ' branch.'));
Copy link
Owner

@theenadayalank theenadayalank May 15, 2020

Choose a reason for hiding this comment

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

Unfortunately, I have merged this PR without noticing this line. I meant to add the log in debug mode. It's my fault that I didn't communicate well. I'm sorry for the inconvenience.

If you don't mind, could you raise another PR with a log message which prints only in debug mode?

If the base branch is found, you can put a log in debug mode. (something like Base branch exists)
If not found, a warning log can be printed in normal mode. (something like below)

⚠️The base branch(branch_name) doesn't exist
Hence all the files will be considered

Copy link
Author

Choose a reason for hiding this comment

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

Well,that's my fault.I will fix it later.

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.

fetchGitDiff runs error when the diffBranch is not existed
2 participants