-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to type a branch name #30
Comments
Hi!
Do you know about these options?
Certainly seems reasonable.
Also seems reasonable, though could this be done another way? Just curious.
Pull request it up! |
But... what if someone only wants to specify the branch name? May get complicated. At some point I wanted to remove Maybe it's sign that adding |
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))) |
Hello o/ I really like Oftentimes I have the same requirement that this thread is describing, where I'd like to link to a branch on GitHub (or some forge), that isn't the branch that I'm currently working on. I had some hacks in place to handle it. But revisited this repo to see if there's been some work on it. Since So I extended the function @ibizaman came up with, above: (defun git-link-diffrent-branch (branch)
"Invoke `git-link', but with the `branch' name set to a different
branch than the one you're currently working on."
(interactive "P")
(let* ((default-remote-branch-name "main")
(git-link-current-branch-setting git-link-default-branch)
(git-link-default-branch (if branch
(completing-read
(format "Instead of '%s' branch replace with branch: " (git-link--branch))
(magit-list-branch-names))
default-remote-branch-name)))
(setq current-prefix-arg nil)
(call-interactively 'git-link)
(setq git-link-default-branch git-link-current-branch-setting))) Ideally, I'd like
Yes, this is all a PR away, but is it worth pursuing? Thanks |
@dotemacs yes I think so, the demand is there! |
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.
The text was updated successfully, but these errors were encountered: