commit | author | age
|
5cb5f7
|
1 |
;ELC |
C |
2 |
;;; Compiled |
|
3 |
;;; in Emacs version 26.1 |
|
4 |
;;; with all optimizations. |
|
5 |
|
|
6 |
;;; This file uses dynamic docstrings, first added in Emacs 19.29. |
|
7 |
|
|
8 |
;;; This file does not contain utf-8 non-ASCII characters, |
|
9 |
;;; and so can be loaded in Emacs versions earlier than 23. |
|
10 |
|
|
11 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
12 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
13 |
|
|
14 |
|
|
15 |
(byte-code "\300\301!\210\302\303\304\305\306\307%\210\310\311\312\313\314DD\315\306\303\316\317\320\321& \207" [require magit custom-declare-group magit-extras nil "Additional functionality for Magit." :group magit-extensions custom-declare-variable magit-gitk-executable funcall function #[0 "\301=\203 \302\303\304\305\306$\211\205 \307!\205 \211\262\206# \310\311!\206# \311\207" [system-type windows-nt magit-git-string "-c" "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" "X" "gitk.exe" file-executable-p executable-find "gitk"] 5] "The Gitk executable." :set-after (magit-git-executable) :type string] 10) |
|
16 |
#@47 Run `git gui' for the current git repository. |
|
17 |
(defalias 'magit-run-git-gui #[0 "\302 \211\203 \211\303 \304\305\304\306%)\202 \307 \207" [default-directory magit-git-executable magit-toplevel magit-process-file nil 0 "gui" magit--not-inside-repository-error] 7 (#$ . 1031) nil]) |
|
18 |
#@334 Run `git gui blame' on the given FILENAME and COMMIT. |
|
19 |
Interactively run it for the current file and the `HEAD', with a |
|
20 |
prefix or when the current file cannot be determined let the user |
|
21 |
choose. When the current buffer is visiting FILENAME instruct |
|
22 |
blame to center around the line point is on. |
|
23 |
|
|
24 |
(fn COMMIT FILENAME &optional LINENUM) |
|
25 |
(defalias 'magit-run-git-gui-blame #[770 "\302 \211\203( \211\303\304 \305\306\305\307\310\311\n\205 \312\313\f\"C
D\"&)\202* \314 \207" [default-directory magit-git-executable magit-toplevel apply magit-process-file nil 0 "gui" "blame" append format "--line=%d" magit--not-inside-repository-error] 16 (#$ . 1320) (byte-code "\302\211\204 \303\262\304\302\305\"\211\262\204 \306\307!\262\310\311\"\262\211\3121, \304 !0\202. \210\302\232\2054 \313 E\207" [current-prefix-arg buffer-file-name nil "HEAD" magit-file-relative-name tracked magit-read-branch-or-commit "Blame from revision" magit-read-file-from-rev "Blame file" (error) line-number-at-pos] 7)]) |
|
26 |
#@39 Run `gitk' in the current repository. |
|
27 |
(defalias 'magit-run-gitk #[0 "\301\302\303#\207" [magit-gitk-executable magit-process-file nil 0] 4 (#$ . 2334) nil]) |
|
28 |
#@50 Run `gitk --branches' in the current repository. |
|
29 |
(defalias 'magit-run-gitk-branches #[0 "\301\302\303\302\304%\207" [magit-gitk-executable magit-process-file nil 0 "--branches"] 6 (#$ . 2498) nil]) |
|
30 |
#@45 Run `gitk --all' in the current repository. |
|
31 |
(defalias 'magit-run-gitk-all #[0 "\301\302\303\302\304%\207" [magit-gitk-executable magit-process-file nil 0 "--all"] 6 (#$ . 2703) nil]) |
|
32 |
#@693 Drop into `magit-status' from file switching. |
|
33 |
|
|
34 |
This command does not work in Emacs 26. It does work in Emacs 25 |
|
35 |
and Emacs 27. See https://github.com/magit/magit/issues/3634 and |
|
36 |
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31707. |
|
37 |
|
|
38 |
To make this command available use something like: |
|
39 |
|
|
40 |
(add-hook \='ido-setup-hook |
|
41 |
(lambda () |
|
42 |
(define-key ido-completion-map |
|
43 |
(kbd "C-x g") \='ido-enter-magit-status))) |
|
44 |
|
|
45 |
Starting with Emacs 25.1 the Ido keymaps are defined just once |
|
46 |
instead of every time Ido is invoked, so now you can modify it |
|
47 |
like pretty much every other keymap: |
|
48 |
|
|
49 |
(define-key ido-common-completion-map |
|
50 |
(kbd "C-x g") \='ido-enter-magit-status) |
|
51 |
(defalias 'ido-enter-magit-status #[0 "\301\303\211\304 \207" [ido-exit fallback ido-fallback magit-status exit-minibuffer] 3 (#$ . 2894) nil]) |
|
52 |
#@183 Visit file at point using Dired. |
|
53 |
With a prefix argument, visit in another window. If there |
|
54 |
is no file at point, then instead visit `default-directory'. |
|
55 |
|
|
56 |
(fn &optional OTHER-WINDOW) |
|
57 |
(defalias 'magit-dired-jump #[256 "\300\301 \211\205 \302\303!\203 \304!\202 !\262\"\207" [dired-jump magit-file-at-point expand-file-name file-directory-p file-name-as-directory] 7 (#$ . 3740) "P"]) |
|
58 |
#@76 Show log for all marked files, or the current file. |
|
59 |
|
|
60 |
(fn &optional FOLLOW) |
|
61 |
(defalias 'magit-dired-log #[256 "\302!\211\203F \303 @\304\305\211\306#\211\204 \307\310!\210\203+ \311\235\204+ \211A\204+ \311B\262\312\313\314 \2063 \315C\316\317\")E #\266\202\202H \320 \207" [default-directory magit-log-buffer-file-locked magit-toplevel magit-log-arguments dired-get-marked-files nil magit-file-tracked-p user-error "No marked file is being tracked by Git" "--follow" magit-mode-setup-internal magit-log-mode magit-get-current-branch "HEAD" mapcar file-relative-name magit--not-inside-repository-error] 11 (#$ . 4136) "P"]) |
|
62 |
#@98 Open FILE with `dired-do-async-shell-command'. |
|
63 |
Interactively, open the file at point. |
|
64 |
|
|
65 |
(fn FILE) |
|
66 |
(defalias 'magit-do-async-shell-command #[257 "\301\302!\210\303\304\305C#\306C#\207" [current-prefix-arg require dired-aux dired-do-async-shell-command dired-read-shell-command "& on %s: " nil] 6 (#$ . 4776) (byte-code "\300 \206\n \301\302\303 \"C\207" [magit-file-at-point completing-read "Act on file: " magit-list-files] 3)]) |
|
67 |
(defalias 'magit--turn-on-shift-select-mode-p #[0 "\205 \205 \n?\205 \242\304=?\207" [shift-select-mode this-command-keys-shift-translated mark-active transient-mark-mode only] 2]) |
|
68 |
#@511 Like `previous-line' but with Magit-specific shift-selection. |
|
69 |
|
|
70 |
Magit's selection mechanism is based on the region but selects an |
|
71 |
area that is larger than the region. This causes `previous-line' |
|
72 |
when invoked while holding the shift key to move up one line and |
|
73 |
thereby select two lines. When invoked inside a hunk body this |
|
74 |
command does not move point on the first invocation and thereby |
|
75 |
it only selects a single line. Which inconsistency you prefer |
|
76 |
is a matter of preference. |
|
77 |
|
|
78 |
(fn &optional ARG TRY-VSCROLL) |
|
79 |
(defalias 'magit-previous-line #[512 "\204 \300\262\301 \206 \302 \211\203% \300U\203% \303 \203% \304\305\211\306#\2027 \307 \210\310\2034 S\300]\2025 \"\207" [1 magit-diff-inside-hunk-body-p magit-section-position-in-heading-p magit--turn-on-shift-select-mode-p push-mark nil t handle-shift-selection previous-line] 7 (#$ . 5401) "p\np"]) |
|
80 |
(byte-code "\300\301\302\303#\300\207" [function-put magit-previous-line interactive-only "use `forward-line' with negative argument instead."] 4) |
|
81 |
#@505 Like `next-line' but with Magit-specific shift-selection. |
|
82 |
|
|
83 |
Magit's selection mechanism is based on the region but selects |
|
84 |
an area that is larger than the region. This causes `next-line' |
|
85 |
when invoked while holding the shift key to move down one line |
|
86 |
and thereby select two lines. When invoked inside a hunk body |
|
87 |
this command does not move point on the first invocation and |
|
88 |
thereby it only selects a single line. Which inconsistency you |
|
89 |
prefer is a matter of preference. |
|
90 |
|
|
91 |
(fn &optional ARG TRY-VSCROLL) |
|
92 |
(defalias 'magit-next-line #[512 "\204 \300\262\301 \206 \302 \211\203% \300U\203% \303 \203% \304\305\211\306#\2027 \307 \210\310\2034 S\300]\2025 \"\207" [1 magit-diff-inside-hunk-body-p magit-section-position-in-heading-p magit--turn-on-shift-select-mode-p push-mark nil t handle-shift-selection next-line] 7 (#$ . 6415) "p\np"]) |
|
93 |
(byte-code "\300\301\302\303#\300\207" [function-put magit-next-line interactive-only forward-line] 4) |
|
94 |
#@197 Remove untracked files from the working tree. |
|
95 |
With a prefix argument also remove ignored files, |
|
96 |
with two prefix arguments remove ignored files only. |
|
97 |
|
|
98 |
(git clean -f -d [-x|-X]) |
|
99 |
|
|
100 |
(fn &optional ARG) |
|
101 |
(defalias 'magit-clean #[256 "\300\301\302\303\267\202 \304\202 \305\202 \306\"!\205. \307 \210\310\311\312\313\314\267\202, \315\202- \316\202- \317$\207" [yes-or-no-p format "Remove %s files? " #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (1 9 4 13)) "untracked" "untracked and ignored" "ignored" magit-wip-commit-before-change magit-run-git "clean" "-f" "-d" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (4 36 16 40)) "-x" "-X" nil] 7 (#$ . 7371) "p"]) |
|
102 |
(put 'magit-clean 'disabled t) |
|
103 |
#@275 Find change log file and add date entry and item for current change. |
|
104 |
This differs from `add-change-log-entry' (which see) in that |
|
105 |
it acts on the current hunk in a Magit buffer instead of on |
|
106 |
a position in a file-visiting buffer. |
|
107 |
|
|
108 |
(fn &optional WHOAMI FILE-NAME OTHER-WINDOW) |
|
109 |
(defalias 'magit-add-change-log-entry #[768 "\300\211\301 \302\303\304\305\306!\307\"\310$\216\311\312!\210p\262`\262)\210\212rq\210\211b\210\313#*\207" [nil current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 call-interactively magit-diff-visit-file add-change-log-entry] 12 (#$ . 8146) (byte-code "\301 D\207" [current-prefix-arg prompt-for-change-log-name] 2)]) |
|
110 |
#@267 Find change log file in other window and add entry and item. |
|
111 |
This differs from `add-change-log-entry-other-window' (which see) |
|
112 |
in that it acts on the current hunk in a Magit buffer instead of |
|
113 |
on a position in a file-visiting buffer. |
|
114 |
|
|
115 |
(fn &optional WHOAMI FILE-NAME) |
|
116 |
(defalias 'magit-add-change-log-entry-other-window #[512 "\300\301#\207" [magit-add-change-log-entry t] 6 (#$ . 8854) (byte-code "\205 \301 D\207" [current-prefix-arg prompt-for-change-log-name] 2)]) |
|
117 |
#@338 Edit the commit that added the current line. |
|
118 |
|
|
119 |
With a prefix argument edit the commit that removes the line, |
|
120 |
if any. The commit is determined using `git blame' and made |
|
121 |
editable using `git rebase --interactive' if it is reachable |
|
122 |
from `HEAD', or by checking out the commit (or a branch that |
|
123 |
points at it) otherwise. |
|
124 |
|
|
125 |
(fn &optional TYPE) |
|
126 |
(defalias 'magit-edit-line-commit #[256 "\305\206 \306!\307\310\"\211\311\232\203 \312\313!\202y \314\315\"\316\307\317\"\320 \"\2033 \321\322\323 \"\210)\202= \324\325!\206; !\210 \205E \326 \"?\205w \n\205N \203g \327\f\330\331\332\333\334\"\335\"\336\337%\"\202u \340!\210\211\205u \341!\210\342 \262\266\202\207" [magit--rebase-published-symbol buffer-file-name magit-blame-mode magit-blame-type magit-this-process magit-current-blame-chunk addition eieio-oref orig-rev "0000000000000000000000000000000000000000" message "This line has not been committed yet" magit-rev-ancestor-p "HEAD" expand-file-name orig-file magit-toplevel edit-published magit-rebase-edit-commit magit-rebase-arguments magit-checkout magit-rev-branch file-equal-p set-process-sentinel make-byte-code 514 "\302\"\210\303!\304=\205 \305\300!\210\301\205 \306\301!\210\307 \207" vconcat vector [magit-sequencer-process-sentinel process-status exit find-file magit-blame--pre-blame-setup magit-blame--run] 5 "\n\n(fn PROCESS EVENT)" find-file magit-blame--pre-blame-setup magit-blame--run] 15 (#$ . 9332) (byte-code "\205 \301C\207" [current-prefix-arg removal] 1)]) |
|
127 |
(put 'magit-edit-line-commit 'disabled t) |
|
128 |
#@767 From a hunk, edit the respective commit and visit the file. |
|
129 |
|
|
130 |
First visit the file being modified by the hunk at the correct |
|
131 |
location using `magit-diff-visit-file'. This actually visits a |
|
132 |
blob. When point is on a diff header, not within an individual |
|
133 |
hunk, then this visits the blob the first hunk is about. |
|
134 |
|
|
135 |
Then invoke `magit-edit-line-commit', which uses an interactive |
|
136 |
rebase to make the commit editable, or if that is not possible |
|
137 |
because the commit is not reachable from `HEAD' by checking out |
|
138 |
that commit directly. This also causes the actual worktree file |
|
139 |
to be visited. |
|
140 |
|
|
141 |
Neither the blob nor the file buffer are killed when finishing |
|
142 |
the rebase. If that is undesirable, then it might be better to |
|
143 |
use `magit-rebase-edit-command' instead of this command. |
|
144 |
(defalias 'magit-diff-edit-hunk-commit #[0 "\301\302\303 \211\203 \304!\202 \305\306!\262\301\307#\210)\310 \207" [magit-diff-visit-previous-blob nil magit-diff-visit-file magit-file-at-point expand-file-name user-error "No file at point" switch-to-buffer magit-edit-line-commit] 4 (#$ . 10887) nil]) |
|
145 |
(put 'magit-diff-edit-hunk-commit 'disabled t) |
|
146 |
#@455 Change the author and committer dates of the commits since REV. |
|
147 |
|
|
148 |
Ask the user for the first reachable commit whose dates should |
|
149 |
be changed. The read the new date for that commit. The initial |
|
150 |
minibuffer input and the previous history element offer good |
|
151 |
values. The next commit will be created one minute later and so |
|
152 |
on. |
|
153 |
|
|
154 |
This command is only intended for interactive use and should only |
|
155 |
be used on highly rearranged and unpublished history. |
|
156 |
|
|
157 |
(fn REV) |
|
158 |
(defalias 'magit-reshelve-since #[257 "\211\204 \303\304 P\305!\203 \306\307\"\204 \310\311!\210\210\312\313\314\"\207\315\316P\211\317\304 Q\320\321\322\323\"!!\324\"\320 \321\325\326\327#![\"B\330\320\331\332\333\300#!!!C\334 \211\203\204 \211\335\336\337\340\341\342\343\344\345\346\347\350
!\351\"\352\353%\354\326\355#\356#\" \357&\210\360\n\361\")\202\206 \362 \262\262\266\204\207" [magit--reshelve-history default-directory magit-this-process "refs/original/refs/heads/" magit-get-current-branch magit-ref-p magit-y-or-n-p "Backup ref %s already exists. Override? " user-error "Abort" magit-log-select magit-reshelve-since "Type %p on a commit to reshelve it and the commits above it," #[514 "\300\301\302\303!\304_\305!@[#\"\207" [format-time-string "%F %T %z" + floor 60 decode-time] 9 "\n\n(fn TIME OFFSET)"] "^" ".." float-time string-to-number magit-rev-format "%at" 1 magit-git-string "rev-list" "--count" floor date-to-time read-string "Date for first commit: " magit-toplevel magit-run-git-async "filter-branch" "--force" "--env-filter" format "case $GIT_COMMIT in %s\nesac" mapconcat make-byte-code 257 "\301\302\300\242\300\242$\300\211\242\303\\\240\210\207" vconcat vector [format "%s) export GIT_AUTHOR_DATE=\"%s\"; export GIT_COMMITTER_DATE=\"%s\";;" 60] 6 "\n\n(fn REV)" magit-git-lines "--reverse" " " "--" set-process-sentinel #[514 "\300!\301>\205( \302!\303V\203 \304\"\207\305\306\307#\210\304\"\210\310\311\312\313\314 P#\207" [process-status (exit signal) process-exit-status 0 magit-process-sentinel process-put inhibit-refresh t magit-run-git "update-ref" "-d" "refs/original/refs/heads/" magit-get-current-branch] 7 "\n\n(fn PROCESS EVENT)"] magit--not-inside-repository-error] 21 (#$ . 12013) (list nil)]) |
|
159 |
(defvar magit-revision-stack nil) |
|
160 |
(byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable magit-pop-revision-stack-format funcall function #[0 "\300\207" [("[%N: %h] " "%N: %H\n %s\n" "\\[\\([0-9]+\\)[]:]")] 1] "Control how `magit-pop-revision-stack' inserts a revision.\n\nThe command `magit-pop-revision-stack' inserts a representation\nof the revision last pushed to the `magit-revision-stack' into\nthe current buffer. It inserts text at point and/or near the end\nof the buffer, and removes the consumed revision from the stack.\n\nThe entries on the stack have the format (HASH TOPLEVEL) and this\noption has the format (POINT-FORMAT EOB-FORMAT INDEX-REGEXP), all\nof which may be nil or a string (though either one of EOB-FORMAT\nor POINT-FORMAT should be a string, and if INDEX-REGEXP is\nnon-nil, then the two formats should be too).\n\nFirst INDEX-REGEXP is used to find the previously inserted entry,\nby searching backward from point. The first submatch must match\nthe index number. That number is incremented by one, and becomes\nthe index number of the entry to be inserted. If you don't want\nto number the inserted revisions, then use nil for INDEX-REGEXP.\n\nIf INDEX-REGEXP is non-nil, then both POINT-FORMAT and EOB-FORMAT\nshould contain \"%N\", which is replaced with the number that was\ndetermined in the previous step.\n\nBoth formats, if non-nil and after removing %N, are then expanded\nusing `git show --format=FORMAT ...' inside TOPLEVEL.\n\nThe expansion of POINT-FORMAT is inserted at point, and the\nexpansion of EOB-FORMAT is inserted at the end of the buffer (if\nthe buffer ends with a comment, then it is inserted right before\nthat)." :package-version (magit . "2.3.0") :group magit-commands :type (list (choice (string :tag "Insert at point format") (cons (string :tag "Insert at point format") (repeat (string :tag "Argument to git show"))) (const :tag "Don't insert at point" nil)) (choice (string :tag "Insert at eob format") (cons (string :tag "Insert at eob format") (repeat (string :tag "Argument to git show"))) (const :tag "Don't insert at eob" nil)) (choice (regexp :tag "Find index regexp") (const :tag "Don't number entries" nil)))] 10) |
|
161 |
#@1112 Insert a representation of a revision into the current buffer. |
|
162 |
|
|
163 |
Pop a revision from the `magit-revision-stack' and insert it into |
|
164 |
the current buffer according to `magit-pop-revision-stack-format'. |
|
165 |
Revisions can be put on the stack using `magit-copy-section-value' |
|
166 |
and `magit-copy-buffer-revision'. |
|
167 |
|
|
168 |
If the stack is empty or with a prefix argument, instead read a |
|
169 |
revision in the minibuffer. By using the minibuffer history this |
|
170 |
allows selecting an item which was popped earlier or to insert an |
|
171 |
arbitrary reference or revision without first pushing it onto the |
|
172 |
stack. |
|
173 |
|
|
174 |
When reading the revision from the minibuffer, then it might not |
|
175 |
be possible to guess the correct repository. When this command |
|
176 |
is called inside a repository (e.g. while composing a commit |
|
177 |
message), then that repository is used. Otherwise (e.g. while |
|
178 |
composing an email) then the repository recorded for the top |
|
179 |
element of the stack is used (even though we insert another |
|
180 |
revision). If not called inside a repository and with an empty |
|
181 |
stack, or with two prefix arguments, then read the repository in |
|
182 |
the minibuffer too. |
|
183 |
|
|
184 |
(fn REV TOPLEVEL) |
|
185 |
(defalias 'magit-pop-revision-stack #[514 "\203\301 @A\211@A\211@A \2050 \212\303\304\305#\203. \306\307\310\311!!T!\202/ \312)\304\211<\203A A\262@\262<\203N A\262@\262\203l \203a \313\314\305\211%\262\315#\210\316\311!\210\205\273 \203 \313\314\305\211%\262\212db\210\317\320!\210\321 \210\n\203\240 \322\n!\203\240 \322\n!\203\254 \323y\210\202\224 \304y\210i\324U\204\254 \325c\210\325c\210\315#\210\316\311!))\266\204\266\203\207\326\327!\207" [magit-pop-revision-stack-format default-directory comment-start re-search-backward nil t number-to-string string-to-number match-string 1 "1" replace-regexp-in-string "%N" magit-rev-insert-format backward-delete-char skip-syntax-backward ">s-" beginning-of-line looking-at -1 0 10 user-error "Revision stack is empty"] 21 (#$ . 16484) (byte-code "\204 \204& |