;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require s f] 2) #@82 Execute CMD in a shell. Returns stdout if command succeeds,otherwise returns nil (defalias 'gitlab--shell-to-string #[(cmd) "\303\304\305\"rq\210\306\216\307 \310\n\311 #\312=\203\313 \202%\314\315\316\317\n\"C\",\207" [#1=#:temp-buffer glob-buf-stdout cmd generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] buffer-name call-process-shell-command nil 0 buffer-string signal error format "command \"%s\" failed with non-zero exit code"] 5 (#$ . 144) nil]) #@45 This duplicates functionality inside magit. (defalias 'gitlab--get-git-exec #[nil "\300\301!\207" [executable-find "git"] 2 (#$ . 656)]) #@26 Find the current branch. (defalias 'gitlab--get-branch #[nil "\301\302\303 \"\304\305!!)\207" [cmd format "%s rev-parse --abbrev-ref HEAD" gitlab--get-git-exec s-trim gitlab--shell-to-string] 3 (#$ . 799)]) #@38 Find the toplevel project directory. (defalias 'gitlab--get-top-level-dir #[nil "\301\302\303 \"\304\305!!)\207" [cmd format "%s rev-parse --show-toplevel" gitlab--get-git-exec s-trim gitlab--shell-to-string] 3 (#$ . 1014)]) #@139 Return directory path if in dired mode. Return full file path if viewing a file. For all other cases, return the toplevel git directory. (defalias 'gitlab--get-relevant-path #[nil "\302\230\203 \303 \207 \204\304 \207\301 \207" [major-mode buffer-file-name "dired-mode" dired-current-directory gitlab--get-top-level-dir] 2 (#$ . 1248)]) #@54 Return t if currently viewing a file, nil otherwise. (defalias 'gitlab--viewing-filep #[nil "??\205\301\207" [buffer-file-name t] 1 (#$ . 1596)]) #@43 Gets the project's gitlab group and name. (defalias 'gitlab--get-project-group+name #[nil "\301 \211\205\302\211\303\304\305$A@\306\304#@)\207" [origin gitlab--get-origin split-string ":" t "\n" ".git"] 7 (#$ . 1751)]) #@45 Get the full git url for the origin remote. (defalias 'gitlab--get-origin #[nil "\301\302\303 \"\304!)\207" [get-url-cmd format "%s remote get-url origin" gitlab--get-git-exec gitlab--shell-to-string] 3 (#$ . 1980) nil]) #@59 Find the current path relative to the toplevel directory. (defalias 'gitlab--get-current-path-relative #[nil "\300\301 \302 \"\207" [file-relative-name gitlab--get-relevant-path gitlab--get-top-level-dir] 3 (#$ . 2209)]) #@84 Return line number(s) if applicable. If region selected, returns range in url form (defalias 'gitlab--get-line-nums #[nil "\300 \204\301\207\302 \203\303\304\305\306 !\305\307 !#\207\303\310\305`!\"\207" [gitlab--viewing-filep "" use-region-p format "#L%d-%d" line-number-at-pos region-beginning region-end "#L%d"] 5 (#$ . 2436)]) #@37 Create gitlab url for current file. (defalias 'gitlab--make-url-current-file #[nil "\306 \307 \310 \311 \312\313 \314 \315\n\312\316\f #$#-\207" [gitlab-host host branch group+name path linenums gitlab--get-branch gitlab--get-project-group+name gitlab--get-current-path-relative gitlab--get-line-nums format "%s/%s" f-join "blob" "%s%s"] 11 (#$ . 2777)]) #@247 Add URL for current selection to killring, if applicable. If a Dired buffer is open, create a url to view to the directory listing in gitlab. If the current buffer is neither a file or Dired buffer, gets a url for the current project in gitlab. (defalias 'gitlab-kill #[nil "\301 \302!\210)\207" [url gitlab--make-url-current-file kill-new] 2 (#$ . 3145) nil]) #@229 Open browser to view current selection, if applicable, in gitlab. If a Dired buffer is open, browse to the directory listing in gitlab. If the current buffer is neither a file or Dired buffer, open the current project in gitlab (defalias 'gitlab-browse #[nil "\300\301 !\207" [browse-url gitlab--make-url-current-file] 2 (#$ . 3517) nil]) (provide 'gitlab-browse)