Skip to content

Commit 4e937e5

Browse files
committed
Make gh-config understand gitconfig values with the "!" prefix
1 parent f9300c1 commit 4e937e5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

init-git.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,18 @@
4747
(ido-completing-read "git-svn command: " git-svn--available-commands nil t)))))
4848

4949

50+
;;----------------------------------------------------------------------------
51+
;; gist fixes
52+
;;----------------------------------------------------------------------------
53+
54+
;; If using a "password = !some command" in .gitconfig, we need to
55+
;; run the specified command to find the actual value
56+
57+
(defadvice gh-config (after sanityinc/maybe-execute-bang (key) activate)
58+
(when (and (string= key "password")
59+
(string-prefix-p "!" ad-return-value))
60+
(setq ad-return-value (shell-command-to-string (substring ad-return-value 1)))))
61+
62+
5063

5164
(provide 'init-git)

0 commit comments

Comments
 (0)