git-link
git-link copied to clipboard
allow to type a branch name
Hi, first, thanks for this package!
I have a request - I am sometimes working on a local branch (not pushed to a remote location) and in this case using git-link generate a wrong url. Would it be possible to allow to chose the branch in some cases? I am thinking of something simple, e.g:
M-x git-link => do not prompt, generate link C-u M-x git-link => ask for the remote name first C-u C-u M-x git-link => ask for the remote and the branch name
Note that the first two options are already working this way, so it should not break the workflow for other users.
What do you think? I could work on a simple PR to implement this if you like the idea.
Hi!
I am sometimes working on a local branch (not pushed to a remote location) and in this case using git-link generate a wrong url
Do you know about these options?
Would it be possible to allow to chose the branch in some cases?
Certainly seems reasonable.
I am thinking of something simple, e.g: M-x git-link => do not prompt, generate link C-u M-x git-link => ask for the remote name first C-u C-u M-x git-link => ask for the remote and the branch n
Also seems reasonable, though could this be done another way? Just curious.
What do you think? I could work on a simple PR to implement this if you like the idea.
Pull request it up! :neckbeard:
C-u M-x git-link => ask for the remote name first C-u C-u M-x git-link => ask for the remote and the branch name
But... what if someone only wants to specify the branch name? May get complicated.
At some point I wanted to remove git-link-commit
and incorporate it into git-link
. That's a lot of prefix options. So I guess my question of "could this be done another way" may be somewhat more relevant.
Maybe it's sign that adding git-link-commit
to git-link
is a bad idea. Or, that prompting for branch is 😈.
What about functions like these?
(defun git-link-master-branch ()
(interactive)
(let ((git-link-default-branch "master"))
(call-interactively 'git-link)))
(defun git-link-at-commit ()
(interactive)
(let ((git-link-use-commit t))
(call-interactively 'git-link)))