paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.
MIT License
3.29k stars 247 forks source link

Add option to print the url #143

Closed arunvelsriram closed 5 years ago

arunvelsriram commented 5 years ago

Closes #137

When the print flag is set am just doing BROWSER="echo".

ffes commented 5 years ago

I am not going to review it in details, but the first thing I noticed is that the man page git-open.1.md is not updated and that there are no tests for this.

arunvelsriram commented 5 years ago

Updated man page, readme and squashed the commits.

I have question on the level of tests. Do I have to add tests for just one basic scenario or cover scenarios like different git services and using --print along with --issues?

derimagia commented 5 years ago

We should be fine with just one test, something like this:

@test "cli flags: print" {
  git remote set-url origin "git@github.com:user/repo.git"
  git checkout -B "master"
  BROWSER="assert_failure" run ../git-open -p
  assert_output "https://github.com/user/repo"
}

Can you do me a favor and remove these lines in the README as they are no longer needed? https://github.com/paulirish/git-open/blob/7eeee771ce9199893d10eaa655fe7ceec44758fa/README.md#L133-L137

arunvelsriram commented 5 years ago

@derimagia I have added test and updated the readme.