;; Time-stamp: <2016-05-19 22:24:54 kmodi>

;; Git Link
;; https://github.com/sshaw/git-link

(use-package git-link
  :load-path "elisp/git-link"
  :bind (:map region-bindings-mode-map
         ("g" . modi/git-link-force-hash))
  :init
  (progn
    (bind-to-modi-map "g" #'git-link-commit))
  :config
  (progn
    (setq git-link-commit-fallback-use-latest-commit t)

    (defun modi/git-link-force-hash ()
      "This function is the same as `git-link' except that it copies the link
with the commit hash in the link even if branch name is available."
      (interactive)
      (let ((git-link-use-commit t))
        (call-interactively #'git-link)))))


(provide 'setup-git-link)

;; Time-stamp: <2016-07-14 15:37:44 kmodi>

;; Git Link
;; https://github.com/sshaw/git-link

(use-package git-link
  :load-path "elisp/git-link"
  :bind (:map region-bindings-mode-map
         ("g" . modi/git-link))
  :init
  (progn
    (bind-to-modi-map "g" #'modi/git-link)
    (bind-to-modi-map "G" #'git-link-commit))
  :config
  (progn
    (setq git-link-commit-fallback-use-latest-commit t)

    (defun modi/git-link (use-branch-maybe)
      "Get git link with the exact commit hash, not the branch name.
If USE-BRANCH-MAYBE is non-nil, use branch name in the link if available."
      (interactive "P")
      (let ((git-link-use-commit (if use-branch-maybe
                                     nil
                                   t))
            ;; Reset the current-prefix-arg, do not pass that to `git-link'.
            current-prefix-arg)
        (call-interactively #'git-link)))))


(provide 'setup-git-link)

Update git-link bindings, improve modi/git-link
Update git-link bindings, improve modi/git-link

kaushalmodi/.emacs.d,kaushalmodi/.emacs.d