;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\301&\210\312\313\314\315#\207" [require org ol custom-declare-variable org-git-program "git" "Name of the git executable used to follow git links." :type (string) :group org-link-set-parameters "gitbare" :follow org-gitbare-open] 8) (defalias 'org-gitbare-open #[(str _) "\304!\211@ A@\305\n \"+\207" [str strlist gitdir object org-git-split-string org-git-open-file-internal] 4]) (defalias 'org-git-open-file-internal #[(gitdir object) "\306 \" \307\nQ\310 !\311 \f\"\312!\204F\313\f!\210\314\315\316\"\317\216rq\210\320 p#\210)rq\210\321\322\211\322\323%\210,\324!\210\325!q\210\316\211,\207" [gitdir object sha temporary-file-directory tmpdir filename org-git-blob-sha "org-git-" org-git-link-filename expand-file-name file-readable-p make-directory generate-new-buffer " *temp file*" t #[nil "\301!\205 \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] org-git-show write-region nil 0 org-open-file get-file-buffer tmpfile #1# #2=#:temp-file buffer-read-only] 6]) (org-link-set-parameters "git" :follow 'org-git-open :store 'org-git-store-link) (defalias 'org-git-open #[(str _) "\306!\211@ A@\307 8\310\311\n!!\211@ A@\312 \313Q\"\210\f\2058\214~\210eb\210\314\f!Sy).\207" [str strlist filepath commit line dirlist org-git-split-string 2 org-git-find-gitdir file-truename org-git-open-file-internal ":" string-to-number gitdir relpath] 6]) #@51 Given a directory name, return '(dirname basname) (defalias 'org-git-split-dirpath #[(dirpath) "\303\304!!\305\304!!\211 *D\207" [dirpath basename dirname file-name-directory directory-file-name file-name-nondirectory] 5 (#$ . 1558)]) #@358 Given a file (not necessarily existing) file path, return the a pair (gitdir relpath), where gitdir is the path to the first .git subdirectory found updstream and relpath is the rest of the path. Example: (org-git-find-gitdir "~/gitrepos/foo/bar.txt") returns '("/home/user/gitrepos/.git" "foo/bar.txt"). When not in a git repository, return nil. (defalias 'org-git-find-gitdir #[(path) "\304\305!!\306!\3072>\310\304\311\n\"!\2047\312\n!\211A@\313\230\203(\314\307\315\"\210 @\316 A@! P)\202\304\311\n\" D0*\207" [path relpath dir dirlist expand-file-name file-name-directory file-name-nondirectory toplevel file-exists-p ".git" org-git-split-dirpath "" throw nil file-name-as-directory] 5 (#$ . 1804)]) (defalias 'org-git-gitrepos-p 'org-git-find-gitdir "Return non-nil if path is in git repository") #@197 Given a string of the form "str1::str2::str3", return a list of three substrings '("str1" "str2" "str3"). If there are less than two double colons, str2 and/or str3 may be set the empty string. (defalias 'org-git-split-string #[(str) "\302\303\"\211G\304U\203 @\305\211E\2022 G\306U\203#\307 \305C\"\2022 G\310U\203. \2022\311\312\")\207" [str strlist split-string "::" 1 "" 2 append 3 error "org-git-split-string: only one or two :: allowed: %s"] 4 (#$ . 2636)]) #@189 Given an object description (see the man page of git-rev-parse), return the nondirectory part of the referenced filename, if it can be extracted. Otherwise, return a valid filename. (defalias 'org-git-link-filename #[(str) "\302\303\"\205 \304\305\"\211\205\306 !)\207" [str match string-match "[^:]+$" match-string 0 file-name-nondirectory] 4 (#$ . 3119)]) (defalias 'org-git-create-searchstring #[(branch timestring) "\302 \303R\207" [branch timestring "@{" "}"] 4]) #@47 Create git link part to file at specific time (defalias 'org-git-create-git-link #[(file &optional line) "\305\306!!@\307 !\310\311\312 \"\313\314\315\n \"\f\203#\316\317\f\"\202$\320\260+\207" [file gitdir branchname timestring line org-git-find-gitdir file-truename org-git-get-current-branch format-time-string "%Y-%m-%d" current-time "git:" "::" org-git-create-searchstring format "::%s" ""] 7 (#$ . 3607) "FFile: "]) #@33 Store git link to current file. (defalias 'org-git-store-link #[nil "\302 \205\303\302 !\304 \305 !\205\306\307\310\311\312 \"$*\207" [line file buffer-file-name abbreviate-file-name line-number-at-pos org-git-gitrepos-p org-store-link-props :type "git" :link org-git-create-git-link] 7 (#$ . 4043)]) (defalias 'org-git-insert-link-interactively #[(file searchstring &optional description) "\303\304\305 R\n\"c\207" [file searchstring description org-make-link-string "git:" "::"] 5 nil "FFile: \nsSearch string: \nsDescription: "]) #@64 Show the output of git --git-dir=gitdir show object in buffer. (defalias 'org-git-show #[(gitdir object buffer) "\304\305 \305\306\307\nP\310 &\311U?\205\312\313r q\210\314 )\"\207" [org-git-program buffer gitdir object call-process nil "--no-pager" "--git-dir=" "show" 0 error "git error: %s " buffer-string] 9 (#$ . 4590)]) #@37 Return sha of the referenced object (defalias 'org-git-blob-sha #[(gitdir object) "\304\305\306\"rq\210\307\216\310 \311\306\311\312\313\nP\314 &\315U\203$edS{\202)\316\317\320 \"+\207" [#1=#:temp-buffer org-git-program gitdir object generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process nil "--no-pager" "--git-dir=" "rev-parse" 0 error "git error: %s " buffer-string] 9 (#$ . 4926)]) #@40 Return the name of the current branch. (defalias 'org-git-get-current-branch #[(gitdir) "\303\304\305\"rq\210\306\216\307 \310\305\310\311\312\nP\313\314\315& \316U\204&\317\320\321 \"\2023eb\210\322\323!\2053\324dS{+\207" [#1=#:temp-buffer org-git-program gitdir generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process nil "--no-pager" "--git-dir=" "symbolic-ref" "-q" "HEAD" 0 error "git error: %s " buffer-string looking-at "^refs/heads/" 12] 10 (#$ . 5378)]) (provide 'ol-git-link)