-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
[New] Add --remote
arg
#31
Conversation
utils/getRepo.js
Outdated
return getRepos.match(pushRepoRegex)[0]; | ||
module.exports = function getRepo(remote = '') { | ||
if (isGitRepo().sha) { | ||
const getRepos = String(execSync(`git ls-remote --get-url ${remote}`)); |
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.
Is this data perhaps on the isGitRepo() object?
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.
Unfortunately this is the one drawback since it doesn't have repo name but seemingly has everything else. The isGitRepo().sha
is what I am using to check if its a git repo.
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.
These are the only properties it has:
info.branch // current branch
info.sha // current sha
info.abbreviatedSha // first 10 chars of the current sha
info.tag // tag for the current sha (or `null` if no tag exists)
info.lastTag // tag for the closest tagged ancestor
// (or `null` if no ancestor is tagged)
info.commitsSinceLastTag // number of commits since the closest tagged ancestor
// (`0` if this commit is tagged, or `Infinity` if no ancestor is tagged)
info.committer // committer for the current sha
info.committerDate // commit date for the current sha
info.author // author for the current sha
info.authorDate // authored date for the current sha
info.commitMessage // commit message for the current sha
info.root // root directory for the Git repo or submodule
// (if in a worktree, this is the directory containing the original copy)
info.commonGitDir // directory containing Git metadata for this repo or submodule
// (if in a worktree, this is the primary Git directory for the repo)
info.worktreeGitDir // if in a worktree, the directory containing Git metadata specific to
// this worktree; otherwise, this is the same as `commonGitDir`.
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.
gotcha. maybe we could make a PR to the package to add that info?
c097256
to
d483743
Compare
8d11f17
to
3ff9046
Compare
eb1f926
to
e15822e
Compare
As discussed in our meeting such as adding tests for |
It'd be ideal to add them here, but it's also totally fine to do it separately. Your preference. |
Actually let me land this now, so we can rebase the other one. |
No worries at all! When this lands I'll open another one to add the test |
I ended up refactoring a bit, using the "boxed primitive object" trick, and ended up doing two |
{ | ||
"files": "bin/**", | ||
"rules": { | ||
"no-throw-literal": "off", |
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.
this is because throwing a string literal skips an unnecessary stack trace :-)
Adds a remote flag to specify which remote the user wishes to choose from.
Also fixes issue where if
can-merge
is run outside of a git repo it will throw error.This closes #18