Closed dougharris closed 4 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)))
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.
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.
Also, what's your use case for getting the URL?
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).
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!
Closing to to lack of activity and #69
https://github.com/sshaw/git-link/issues/37