File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 3535
3636; ;; Change Log:
3737
38+ ; ; 2024-11-03 - v0.9.3
39+ ; ; * Add support for linking to a different branch with git-link-diffrent-branch (@dotemacs)
40+ ; ;
3841; ; 2024-06-29 - v0.9.2
3942; ; * Add git-link-add-to-kill-ring to not add to kill ring (thanks Michael Hauser-Raspe)
4043; ; * Add prefix arg to open in browser when calling git-link-homepage (thanks Sibi Prabakaran)
@@ -819,6 +822,22 @@ shown via annotate in bitbucket."
819822 " annotate"
820823 " src" )))
821824
825+ ;;;### autoload
826+ (defun git-link-diffrent-branch (branch )
827+ " Invoke `git-link' , but with the `branch' name set to a different
828+ branch than the one you're currently working on."
829+ (interactive " P" )
830+ (let* ((default-remote-branch-name " main" )
831+ (git-link-current-branch-setting git-link-default-branch)
832+ (git-link-default-branch (if branch
833+ (completing-read
834+ (format " Instead of '%s ' branch replace with branch: " (git-link--branch))
835+ (magit-list-branch-names))
836+ default-remote-branch-name)))
837+ (setq current-prefix-arg nil )
838+ (call-interactively 'git-link )
839+ (setq git-link-default-branch git-link-current-branch-setting)))
840+
822841;;;### autoload
823842(defun git-link (remote start end )
824843 " Create a URL representing the current buffer's location in its
You can’t perform that action at this time.
0 commit comments