dgtized / github-clone.el

Fork and clone Github projects from Emacs
58 stars 14 forks source link

feature: add browse-url utilities #10

Closed Silex closed 8 years ago

Silex commented 8 years ago

Hello,

It'd be nice to be able to:

Here is a draft for it (not working anymore because of magit update):

;; Taken from http://endlessparentheses.com/easily-create-github-prs-from-magit.html?source=rss
(defun git/visit-pull-request-url ()
  "Visit the current branch's PR on Github."
  (interactive)
  (browse-url
   (format "https://github.com/%s/compare/%s"
     (replace-regexp-in-string
      "\\`.+github\\.com:\\(.+\\)\\.git\\'" "\\1"
      (magit-get "remote"
                 (magit-get-current-remote)
                 "url"))
     (magit-get-current-branch))))

Maybe the api could be:

dgtized commented 8 years ago

I don't think any of those require using the github API, and are just url construction. Currently I use https://github.com/osener/github-browse-file for related functionality, would that be more appropriate there?

Silex commented 8 years ago

Hum, yes that could work. Good idea, thanks.