feat(emacs): add git-link
and new function git-link-with-commit
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
0fce415b93
commit
9a42f6ba48
1 changed files with 13 additions and 0 deletions
|
@ -11,6 +11,19 @@
|
||||||
("C-x g" . magit-status)))
|
("C-x g" . magit-status)))
|
||||||
(use-package forge :straight t
|
(use-package forge :straight t
|
||||||
:after (magit))
|
:after (magit))
|
||||||
|
(use-package git-link :straight t)
|
||||||
|
|
||||||
|
(defun git-link-with-commit ()
|
||||||
|
"Create a URL representing the current selection for the current commit."
|
||||||
|
(interactive)
|
||||||
|
(let* ((link-region (git-link--get-region))
|
||||||
|
(old-link (git-link (git-link--remote) (car link-region) (cadr link-region)))
|
||||||
|
(branch (git-link--branch))
|
||||||
|
(commit (git-link--commit))
|
||||||
|
(new-link (s-replace branch commit old-link)))
|
||||||
|
(kill-new new-link)
|
||||||
|
(message new-link)
|
||||||
|
new-link))
|
||||||
|
|
||||||
(provide 'priime-vc)
|
(provide 'priime-vc)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue