Giter Site home page Giter Site logo

git-open's People

Contributors

4u6u57 avatar bbeardsley avatar crossroad0201 avatar davidosomething avatar derimagia avatar elim avatar eush77 avatar ffes avatar glostis avatar jasonmccreary avatar jaxwood avatar kyuden avatar lovef avatar naereen avatar neoascetic avatar nwinkler avatar olegafx avatar orestisfl avatar paulirish avatar pborenstein avatar pierstoval avatar rcmachado avatar rec avatar redwolves avatar ryuheechul avatar sowmiyamuthuraman avatar supersandro2000 avatar trentrand avatar unixorn avatar victor141516 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-open's Issues

Rewrite in Python?

The sourcebase in bash hasn't been holding up well to all of the string manipulation.

I think it could use a rewrite. Plus it'd open us up to write some tests for all the string acrobatics it's gained.

Personally I'd prefer JavaScript but requiring node seems excessive. Python seems like a reasonable choice, but I'm personally open.

I won't have time to do this myself, so it's open to anyone interested.

Write a man page

git open --help tries to open the man page for the command but there is no man page.

Hopefully somebody is brave enough to write one!

Not sure if the source of such a man page should be troff or something better like restructuredtext or markdown (which can be converted to man pages with rst2man or md2man, but require additional build dependencies)

A large part of the documentation could come from the README.md

Add a --new-pr flag to open pull-request page

My common workflow is:

  1. create a branch, commit, push
  2. git open
  3. click on "Compare & pull request" button
  4. once the page loads, fill it out and submit PR

There's not much value in me opening the branch page. ideally a flag like --new-pr would open the create-a-pull-request link directly.

So:

env BROWSER=echo git open
# https://github.com/GoogleChrome/lighthouse/tree/bootuptime-edit

env BROWSER=echo git open --new-pr
# https://github.com/GoogleChrome/lighthouse/compare/bootuptime-edit?expand=1

anyone else interested in this one? (looks like #64 basically wanted the same thing)

do bitbucket/gitlab/vsts have similar URLs?

-Requirements?- OMZ Config

I am having trouble getting this to work with the .oh-my-zsh install instructions. First question does this require hub to be installed?

$  git --version
git version 2.6.4 (Apple Git-63)
$ git open
git: 'open' is not a git command. See 'git --help'.

Did you mean one of these?
    clean
    clone
    notes
    prune

hub

Is there any way you could get this into hub? It seems more like a missing feature in hub than its own feature! hub has a browse command to open the repo / issues / wiki, but not the pages. It's pretty neat, though.

https://github.com/github/hub

bad substitution

I get the following when I type git open

/Users/arian/.oh-my-zsh/custom/plugins/git-open/git-open: line 99: ${ssh_optcode^^}: bad substitution

If an incorrect URL is opened, please provide the following so we can write a test:

Example clone url:

[email protected]:abc/abc-dfg.git

Example branch name:

one-to-one-3

Expected web URL:

It went to the right url

https://github.foo.example.com/abc/abc-dfg/tree/one-to-one-3

Add support for Arch User Repository (AUR)

If an incorrect URL is opened, please provide the following so we can write a test:

Example clone URL:

https://aur.archlinux.org/git-open-git.git or ssh://[email protected]/git-open-git.git

Example branch name:

master

Expected web URL:

https://aur.archlinux.org/packages/git-open-git

It will be a simple fix. We can add a simple if condition with a regex to check if the URL is of the AUR, and if it is, we just need to append the /packages/ part to the URL.

For example,
URL opened by git open: https://aur.archlinux.org/git-open-git
Actual URL: https://aur.archlinux.org/packages/git-open-git

if [ $domain == "aur.archlinux.org" ]; then
  domain="$domain/packages"
fi

Opens ssh.github.com since upgrading

Since upgrading (from which version I'm not sure), git open is opening URLs at a nonexistent ssh subdomain. The repos were all cloned with SSH, in case that has something to do with it. This was never an issue before...

Thanks. Let me know if you need additional info.


If an incorrect URL is opened, please provide the following so we can write a test:

Example clone url:

https://github.com/goodguyry/postcss-tidy-columns

Example branch name:

master

Expected web URL:

https://github.com/goodguyry/postcss-tidy-columns

Actual web URL:

https://ssh.github.com/goodguyry/postcss-tidy-columns

[Feature Request] Open CI URL

Add a flag to open CI/CD tool URL:

git open --cx

Based on the contents of the repo we could identify the CI URLs. However, there are a lot of limitations. For travis, circleci etc. we could identify the URL easily but for self-hosted CI/CD tools like GoCD, Jenkins it will be difficult.

Adding this idea here so that someone could come up with a better way to do it. Let me know if this feature makes sense.

Failing gitlab tests

We have two failing tests after the rewrite has landed

 ✗ gitlab: separate domains
   (from function `assert_output' in file test/test_helper/bats-assert/src/assert.bash, line 239,
    in test file test/git-open.bats, line 186)
     `assert_output "https://gitlab.example.com/namespace/project"' failed
   fatal: remote origin already exists.
   Switched to a new branch 'master'

   -- output differs --
   expected : https://gitlab.example.com/namespace/project
   actual   : https://git.example.com/namespace/project
 ✗ gitlab: ssh://git@host:port origin
   (from function `assert_output' in file test/test_helper/bats-assert/src/assert.bash, line 239,
    in test file test/git-open.bats, line 220)
     `assert_output "https://repo.intranet/XXX/YYY"' failed
   fatal: remote origin already exists.
   Switched to a new branch 'master'

   -- output differs --
   expected : https://repo.intranet/XXX/YYY
   actual   : https://repo.intranet/7000/XXX/YYY
   --

@derimagia how did you want to handle these guys?

Page not found

I was testing this plugin with my repo and it opened the URL https://github.com/theoriginalbit/repo//master instead of https://github.com/theoriginalbit/repo/tree/master resulting in GitHub 404'ing.

git open pr

It would be nice to be able to run git open pr and get the first PR it finds for the current branch.

WSL support?

Could you please add support for bash on Windows?

git open a particular file

I was just thinking it would be cool to be able to do something like:

git-open /path/to/file

and have the browser open that file in that branch that one was in ...

Windows cmd installation instructions do not work

The readme says

Windows with cmd terminal
Save the git-open script in any place accessible via your %PATH% environment var.

but that doesn't work. Why would it as the git-open script uses !# which does not work on cmd. It no doubt does work in WSL. Unless git should find it and handle it? I plonked mine in c:\windows\system32, naughty by it should work there AFAIK

However npm I -g git-open installs it just fine.

Sadly though, using nvm-windows loses global installs when you switch versions ;(

Fish shell compatibility

I would like to use git-open with Fish but it doesn't worked.

I installed it with fisher plugin manager.

Do you think it could be possible to add git-open support to Fish?

Pipe stdout and stderr to /dev/null

On Ubuntu I get hundreds of lines of output when firefox starts up from the command line. To prevent, that, change the 2nd to last line of the script to:

$open $giturl &> /dev/null

Atlassian Stash support

It's true that HTTP URLs contain /scm/, but that's for read-only access. If you're working with a repo that you can push to, it has an SSH URL that looks like this:

ssh://[email protected]:7999/foo/ken-homedir.git

where foo is a 3-or-4-letter key for the Project (a grouping of repositories).

In this case, perhaps recognizing the port number or the global format of the URL might be necessary. Open to a patch for that?

An option to just print and not open the link

How about git open --print.

2 use cases:

  1. I wish to use the URL in some other script
  2. I have multiple browser windows open at any point in time, So I wish to open it in a particular window. git open --print | pbcopy would help a lot

The behavior of `git open issue` does not match README

The readme states:

$ git open issue
# If branches use naming convention of issues/#123,
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/issues/123

However, the current behaviour is better explained by:

$ git open issue
# If branches use naming convention of issues/#123,
# opens https://github.com/REMOTE_ORIGIN_USER/CURRENT_REPO/issues/123

The behaviour in the README makes sense and is intuitive, so it would be good if the actual program could match that.

Support for Gitlab?

Is there any plans to support Gitlab? Specially those repos that are self hosted.

no URL was open...

Hi, I'm using arch + tilix + ohmyzsh and it don't work...

any error message...

someone know how fix it?

even if I use:
npm install --global git-open

Thanks in advance,

Support for detached HEAD state?

If you're in a detached HEAD state, ${2:-$(git symbolic-ref -q --short HEAD)} gives nothing.

If you use git symbolic-ref HEAD and it fails with fatal: ref HEAD is not a symbolic ref, you're in a detached HEAD.

Being in this state, git status gives you, for example, HEAD detached at 1.1b1. You can extract the tag/branch/commit after HEAD detached at and complement the https://github.com/ORG/REPO/tree/EXTRACTED and be able to open repositories in detached HEAD. It worked with the short hash.

...or if you're into an even more pragmatic approach, do an if grep -v 'HEAD detached'; then and extract the hash. :)

More info about detached HEAD: https://stackoverflow.com/a/5772882

New release

Now that #132 has been landed, I'd appreciate a new release, so I don't need to install from git.

Thanks!

Simplify bitbucket src view URL

So bitbucket is supposed to be able to view a branch URL like:

bitbucket.com/user/repo/src/mybranch/

However we're currently mimicking the URL that the site generates like:

bitbucket.com/user/repo/src/commitsha/?at=branchname

I'd prefer to use the simple version, as @derimagia's rewrite does. However it turns out there's a problem with branches including a / (slash) in the name.


I've filed this issue upstream: https://bitbucket.org/site/master/issues/14422/source-view-url-of-branch-name-with

Until that's resolved, I think we'll need the longer URL (unless someone identifies a better workaround).

So for now, this is our downstream tracking issue until the BB one is fixed. 😉

cc @nwinkler @davidosomething

git open current upstream

If I have multiple remotes, and I do a git push -u other branchname, I would expect 'git open' to open whatever the current remote is, as opposed to using origin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.