sshaw / git-link

Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location
399 stars 74 forks source link

Return link #38

Closed dougharris closed 4 years ago

dougharris commented 7 years ago

https://github.com/sshaw/git-link/issues/37

sshaw commented 7 years ago

Hi, thanks for this. It's been something I've been meaning to do for a while.

One question: don't you think it would be better to move this to a non-interactive function that doesn't touch the kill ring or open the link?

Something like:

(defun git-link-url (remote &optional start end)
  ;; build url
)

(defun git-link (remote start end)
  ;; interactive stuff
  (git-link--new (git-link-url remote start end)))
truthdoug commented 7 years ago

Yes - non-interactive would be better. The other thing I was thinking about was a shortcut that wouldn't require the remote param because most uses have only a single remote.

sshaw commented 7 years ago

The reason I included remote is so one can use it without having to depend on a buffer's contents.

It could default to the current buffer, but in general I think it's good for functions to not assume anything about global state.

sshaw commented 7 years ago

Also, what's your use case for getting the URL?

dougharris commented 7 years ago

I have a hand made, half-assed function that opens the commit but it relies on a manually maintained map of directories to remote repo URLs. I found git-link and it did much of the hard stuff that I wasn't doing.

So, I'm basically looking for the git-link-commit functionality but leaving without setting a variable that always opens the link. There are times where I want the URL without opening (e.g. for sharing with colleagues).

futuro commented 4 years ago

Hey y'all, I'd love to help push this across the finish line! My use case is I'm writing out org-mode capture templates and I want to be able to programmatically call git-link so that I share my exports with others in a meaningful way.

Let me know what I can do to help!

sshaw commented 4 years ago

Closing to to lack of activity and #69