Codebase list magit / 3925f5c
New upstream version 3.1.0 Matteo F. Vescovi 2 years ago
28 changed file(s) with 446 addition(s) and 215 deletion(s). Raw diff Collapse all Expand all
0 * It's Magit! A Git Porcelain inside Emacs
1
2 Magit is a text-based Git user interface that puts an unmatched focus
3 on streamlining workflows. Commands are invoked using short mnemonic
4 key sequences that take the cursor’s position in the highly actionable
5 interface into account to provide context-sensitive behavior.
6
7 With Magit you can do nearly everything that you can do when using Git
8 on the command-line, but at greater speed and while taking advantage
9 of advanced features that previously seemed too daunting to use on a
10 daily basis. Many users will find that by using Magit they can become
11 more effective Git user.
12
13 For more information about Magit, see https://magit.vc.
14
15 * Magit v3.1.0 Release Notes
16
17 Released 1st July 2021 by Jonas Bernoulli.
18
19 I am pleased to announce the release of Magit version 3.1.0,
20 representing 31 commits by 4 contributors over one month.
21
22 Also see https://emacsair.me/2021/07/01/magit-3.1.
23
24 ** Breaking changes
25
26 - The function signature of ~magit-completing-read-multiple~ was not
27 compatible with that of ~completing-read-multiple~, so we deprecate
28 it. Use the improved ~magit-completing-read-multiple*~ instead.
29 #4420
30
31 - The description of ~magit-merge-into~ in the merge menu was changed
32 to "dissolve" (from "merge into"). In the future we are going to
33 change the key binding from "i" to "d" as well, to keep it mnemonic.
34 We don't make both changes at once in the hope that this makes the
35 transition easier for existing users. 4c096921f
36
37 ** Changes since v3.0.0
38
39 - Adjusted to changes to Eieio in Emacs 28. a3626277c, 54a0019f3
40
41 - Added new command ~magit-log-move-to-revision~. #4418
42
43 - ~A m~ is now also bound to ~magit-merge-squash~. Despite the name it
44 fits better there. 51152fdec
45
46 ** Fixes since v3.0.0
47
48 - Fixed ~magit-emacs-Q-command~ and ~make build~ for ELPA users.
49 f50c3aa56
50
51 - Fixed reading choice in ~magit-process-git-credential-manager-core~.
52 #4396
53
54 - ~magit-blame~ didn't account for quoted file names when parsing
55 output from ~git blame~. #4400
56
57 - A regression in v3.0.0 prevented ~magit-bisect-run~ from executing
58 ~git bisect run~ unless ~magit-bisect-start~ was called beforehand.
59 f592e367d
60
61 - ~magit-log-select-quit~ failed to call ~magit-log-select-quit-function~.
62 #4423
63
64 - The entry for pull-requests in ~magit-list-refs-namespaces~ did not
65 match the ref names used by Forge for that purpose. 4c3373f9a
66
67 * Authors
68
69 24 Jonas Bernoulli
70 3 Kyle Meyer
71 1 Siavash Askari Nasr
72 1 TEC
77 #+TEXINFO_DIR_CATEGORY: Emacs
88 #+TEXINFO_DIR_TITLE: Magit-Section: (magit-section).
99 #+TEXINFO_DIR_DESC: Use Magit sections in your own packages.
10 #+SUBTITLE: for version 3.0.0
10 #+SUBTITLE: for version 3.1.0
1111
1212 #+TEXINFO_DEFFN: t
1313 #+OPTIONS: H:4 num:3 toc:2
2525 can use sections in your own packages.
2626
2727 #+TEXINFO: @noindent
28 This manual is for Magit-Section version 3.0.0.
28 This manual is for Magit-Section version 3.1.0.
2929
3030 #+BEGIN_QUOTE
3131 Copyright (C) 2015-2021 Jonas Bernoulli <jonas@bernoul.li>
3030 @finalout
3131 @titlepage
3232 @title Magit-Section Developer Manual
33 @subtitle for version 3.0.0
33 @subtitle for version 3.1.0
3434 @author Jonas Bernoulli
3535 @page
3636 @vskip 0pt plus 1filll
5353 can use sections in your own packages.
5454
5555 @noindent
56 This manual is for Magit-Section version 3.0.0.
56 This manual is for Magit-Section version 3.1.0.
5757
5858 @quotation
5959 Copyright (C) 2015-2021 Jonas Bernoulli <jonas@@bernoul.li>
77 #+TEXINFO_DIR_CATEGORY: Emacs
88 #+TEXINFO_DIR_TITLE: Magit: (magit).
99 #+TEXINFO_DIR_DESC: Using Git from Emacs with Magit.
10 #+SUBTITLE: for version 3.0.0
10 #+SUBTITLE: for version 3.1.0
1111
1212 #+TEXINFO_DEFFN: t
1313 #+OPTIONS: H:4 num:3 toc:2
2424 Magit and Git itself deserve to be called porcelains.
2525
2626 #+TEXINFO: @noindent
27 This manual is for Magit version 3.0.0.
27 This manual is for Magit version 3.1.0.
2828
2929 #+BEGIN_QUOTE
3030 Copyright (C) 2015-2021 Jonas Bernoulli <jonas@bernoul.li>
26152615 first parent, but a numeric prefix can be used to specify another
26162616 parent.
26172617
2618 - Key: j, magit-log-move-to-revision
2619
2620 Read a revision and move to it in current log buffer.
2621
2622 If the chosen reference or revision isn't being displayed in
2623 the current log buffer, then inform the user about that and do
2624 nothing else.
2625
2626 If invoked outside any log buffer, then display the log buffer
2627 of the current repository first; creating it if necessary.
2628
26182629 - Key: SPC, magit-diff-show-or-scroll-up
26192630
26202631 Update the commit or diff buffer for the thing at point.
43974408 always require confirmation because making an error while using
43984409 those is harder to recover from.
43994410
4400 - User Option magit-post-commit-hook
4411 - User Option: magit-post-commit-hook
44014412
44024413 Hook run after creating a commit without the user editing a message.
44034414
74917502
74927503 **** Log Performance
74937504 :PROPERTIES:
7494 :NONODE: t
7505 :UNNUMBERED: notoc
74957506 :END:
74967507
74977508 When showing logs, Magit limits the number of commits initially shown
75217532
75227533 **** Diff Performance
75237534 :PROPERTIES:
7524 :NONODE: t
7535 :UNNUMBERED: notoc
75257536 :END:
75267537
75277538 If diffs are slow, then consider turning off some optional diff
75487559
75497560 **** Refs Buffer Performance
75507561 :PROPERTIES:
7551 :NONODE: t
7562 :UNNUMBERED: notoc
75527563 :END:
75537564
75547565 When refreshing the "references buffer" is slow, then that's usually
75687579
75697580 **** Committing Performance
75707581 :PROPERTIES:
7571 :NONODE: t
7582 :UNNUMBERED: notoc
75727583 :END:
75737584
75747585 When you initiate a commit, then Magit by default automatically shows
78487859 filesystem, this function actually runs git asynchronously. But
78497860 then it waits for the process to return, so the function itself is
78507861 synchronous.
7851
7852 - Function: magit-run-git-with-logfile file &rest args
7853
7854 Calls git synchronously with ARGS. The process's output is saved in
7855 FILE. This is rarely useful and so this function might be removed
7856 in the future.
7857
7858 This function actually runs git asynchronously. But then it waits
7859 for the process to return, so the function itself is synchronous.
78607862
78617863 - Function: magit-git &rest args
78627864
87158717 always visible. If that is too drastic for your taste, then you may
87168718 instead use ~magit-diff-visit-file-hook~ to reveal the text, possibly
87178719 using ~reveal-post-command~ or for Org buffers ~org-reveal~.
8720
8721 *** I am unable to stage when using Tramp from MS Windows
8722
8723 Magit may be unable to stage (or otherwise apply) individual hunks
8724 when you are connected to remote machine using Tramp and the local
8725 machine uses MS Windows.
8726
8727 There appears to be a problem with ~process-send-eof~ in this scenario,
8728 as mentioned at the end of ~tramp-tests.el~. I have contacted the Tramp
8729 maintainer about this. For now this unfortunately means that it just
8730 doesn't work and we cannot do anything about it. If you have more
8731 information, then please comment on
8732 https://github.com/magit/magit/issues/3624.
8733
8734 *** I am no longer able to save popup defaults
8735
8736 Magit used to use Magit-Popup to implement the transient popup menus.
8737 Now it used Transient instead, which is Magit-Popup's successor.
8738
8739 In the older Magit-Popup menus, it was possible to save user settings
8740 (e.g. setting the gpg signing key for commits) by using ~C-c C-c~ in the
8741 popup buffer. This would dismiss the popup, but save the settings as
8742 the defaults for future popups.
8743
8744 When switching to Transient menus, this functionality is now available
8745 via ~C-x C-s~ instead; the ~C-x~ prefix has other options as well when
8746 using Transient, which will be displayed when it is typed. See
8747 https://magit.vc/manual/transient/Saving-Values.html#Saving-Values for
8748 more details.
87188749
87198750 * Debugging Tools
87208751
3030 @finalout
3131 @titlepage
3232 @title Magit User Manual
33 @subtitle for version 3.0.0
33 @subtitle for version 3.1.0
3434 @author Jonas Bernoulli
3535 @page
3636 @vskip 0pt plus 1filll
5252 Magit and Git itself deserve to be called porcelains.
5353
5454 @noindent
55 This manual is for Magit version 3.0.0.
55 This manual is for Magit version 3.1.0.
5656
5757 @quotation
5858 Copyright (C) 2015-2021 Jonas Bernoulli <jonas@@bernoul.li>
344344 * My Git hooks work on the command-line but not inside Magit::
345345 * @code{git-commit-mode} isn't used when committing from the command-line::
346346 * Point ends up inside invisible text when jumping to a file-visiting buffer::
347 * I am unable to stage when using Tramp from MS Windows::
348 * I am no longer able to save popup defaults::
347349
348350
349351 @end detailmenu
35123514 first parent, but a numeric prefix can be used to specify another
35133515 parent.
35143516
3517 @kindex j
3518 @cindex magit-log-move-to-revision
3519 @item @kbd{j} @tie{}@tie{}@tie{}@tie{}(@code{magit-log-move-to-revision})
3520
3521 Read a revision and move to it in current log buffer.
3522
3523 If the chosen reference or revision isn't being displayed in
3524 the current log buffer, then inform the user about that and do
3525 nothing else.
3526
3527 If invoked outside any log buffer, then display the log buffer
3528 of the current repository first; creating it if necessary.
3529
35153530 @kindex SPC
35163531 @cindex magit-diff-show-or-scroll-up
35173532 @item @kbd{SPC} @tie{}@tie{}@tie{}@tie{}(@code{magit-diff-show-or-scroll-up})
60006015 those is harder to recover from.
60016016 @end defopt
60026017
6003 @itemize
6004 @item
6005 User Option magit-post-commit-hook
6018 @defopt magit-post-commit-hook
60066019
60076020 Hook run after creating a commit without the user editing a message.
60086021
60126025 the commit message in a buffer.
60136026
60146027 Also see @code{git-commit-post-finish-hook}.
6015 @end itemize
6028 @end defopt
60166029
60176030 @node Editing Commit Messages
60186031 @subsection Editing Commit Messages
1017510188 * MacOS Performance::
1017610189 @end menu
1017710190
10178 @unnumberedsubsubsec Log Performance
10191 @anchor{Log Performance}
10192 @subsubheading Log Performance
1017910193
1018010194 When showing logs, Magit limits the number of commits initially shown
1018110195 in the hope that this avoids unnecessary work. When using @code{--graph} is
1020210216 merges. For that reason @code{--color} is not enabled by default anymore.
1020310217 Consider leaving it at that.
1020410218
10205 @unnumberedsubsubsec Diff Performance
10219 @anchor{Diff Performance}
10220 @subsubheading Diff Performance
1020610221
1020710222 If diffs are slow, then consider turning off some optional diff
1020810223 features by setting all or some of the following variables to @code{nil}:
1022510240 setting, see @ref{Saving Values,,,transient,}. You should do this in both
1022610241 the diff (@code{d}) and the diff refresh (@code{D}) transient popups.
1022710242
10228 @unnumberedsubsubsec Refs Buffer Performance
10243 @anchor{Refs Buffer Performance}
10244 @subsubheading Refs Buffer Performance
1022910245
1023010246 When refreshing the "references buffer" is slow, then that's usually
1023110247 because several hundred refs are being displayed. The best way to
1024210258 actually all exist. You can do so by pruning branches which no longer
1024310259 exist using @code{f-pa}.
1024410260
10245 @unnumberedsubsubsec Committing Performance
10261 @anchor{Committing Performance}
10262 @subsubheading Committing Performance
1024610263
1024710264 When you initiate a commit, then Magit by default automatically shows
1024810265 a diff of the changes you are about to commit. For large commits this
1055510572 filesystem, this function actually runs git asynchronously. But
1055610573 then it waits for the process to return, so the function itself is
1055710574 synchronous.
10558 @end defun
10559
10560 @defun magit-run-git-with-logfile file &rest args
10561
10562 Calls git synchronously with ARGS@. The process's output is saved in
10563 FILE@. This is rarely useful and so this function might be removed
10564 in the future.
10565
10566 This function actually runs git asynchronously. But then it waits
10567 for the process to return, so the function itself is synchronous.
1056810575 @end defun
1056910576
1057010577 @defun magit-git &rest args
1133511342 * My Git hooks work on the command-line but not inside Magit::
1133611343 * @code{git-commit-mode} isn't used when committing from the command-line::
1133711344 * Point ends up inside invisible text when jumping to a file-visiting buffer::
11345 * I am unable to stage when using Tramp from MS Windows::
11346 * I am no longer able to save popup defaults::
1133811347 @end menu
1133911348
1134011349 @node Magit is slow
1153311542 instead use @code{magit-diff-visit-file-hook} to reveal the text, possibly
1153411543 using @code{reveal-post-command} or for Org buffers @code{org-reveal}.
1153511544
11545 @node I am unable to stage when using Tramp from MS Windows
11546 @appendixsubsec I am unable to stage when using Tramp from MS Windows
11547
11548 Magit may be unable to stage (or otherwise apply) individual hunks
11549 when you are connected to remote machine using Tramp and the local
11550 machine uses MS Windows.
11551
11552 There appears to be a problem with @code{process-send-eof} in this scenario,
11553 as mentioned at the end of @code{tramp-tests.el}. I have contacted the Tramp
11554 maintainer about this. For now this unfortunately means that it just
11555 doesn't work and we cannot do anything about it. If you have more
11556 information, then please comment on
11557 @uref{https://github.com/magit/magit/issues/3624}.
11558
11559 @node I am no longer able to save popup defaults
11560 @appendixsubsec I am no longer able to save popup defaults
11561
11562 Magit used to use Magit-Popup to implement the transient popup menus.
11563 Now it used Transient instead, which is Magit-Popup's successor.
11564
11565 In the older Magit-Popup menus, it was possible to save user settings
11566 (e.g. setting the gpg signing key for commits) by using @code{C-c C-c} in the
11567 popup buffer. This would dismiss the popup, but save the settings as
11568 the defaults for future popups.
11569
11570 When switching to Transient menus, this functionality is now available
11571 via @code{C-x C-s} instead; the @code{C-x} prefix has other options as well when
11572 using Transient, which will be displayed when it is typed. See
11573 @uref{https://magit.vc/manual/transient/Saving-Values.html#Saving-Values} for
11574 more details.
11575
1153611576 @node Debugging Tools
1153711577 @chapter Debugging Tools
1153811578
222222 (with-editor ,with-editor-version))))
223223 (re-search-forward "^;; Package-Version: ")
224224 (delete-region (point) (line-end-position))
225 (insert git-commit-version))
226
225 (insert "$(GIT_COMMIT_VERSION)"))
227226 (with-temp-file "lisp/magit-libgit.el"
228227 (insert-file-contents "lisp/magit-libgit.el")
229228 (re-search-forward "^;; Package-Requires: ")
234233 (libgit ,libgit-version))))
235234 (re-search-forward "^;; Package-Version: ")
236235 (delete-region (point) (line-end-position))
237 (insert magit-libgit-version))
236 (insert "$(MAGIT_LIBGIT_VERSION)"))
238237 (with-temp-file "lisp/magit-section.el"
239238 (insert-file-contents "lisp/magit-section.el")
240239 (re-search-forward "^;; Package-Requires: ")
244243 (dash ,dash-version))))
245244 (re-search-forward "^;; Package-Version: ")
246245 (delete-region (point) (line-end-position))
247 (insert magit-section-version))
246 (insert "$(MAGIT_SECTION_VERSION)"))
248247 (with-temp-file "lisp/magit-pkg.el"
249248 (insert (format
250249 "(define-package \"magit\" \"$(VERSION)\"\
294293 (transient-version \"$(TRANSIENT_MELPA_SNAPSHOT)\")\
295294 (with-editor-version \"$(WITH_EDITOR_MELPA_SNAPSHOT)\"))\
296295 $$set_package_requires)"
297 @git commit -a -m "Reset Package-Requires for Melpa"
296 @git commit -a --gpg-sign -m "Reset Package-Requires for Melpa"
0 Documentation/RelNotes/3.0.0.org
0 Documentation/RelNotes/3.1.0.org
106106 git describe --tags --abbrev=0 --always | cut -c2-)
107107
108108 DASH_VERSION = 2.18.1
109 GIT_COMMIT_VERSION = $(VERSION)
109 GIT_COMMIT_VERSION = 3.1.0
110110 LIBGIT_VERSION = 0
111111 MAGIT_LIBGIT_VERSION = 0
112 MAGIT_SECTION_VERSION = $(VERSION)
113 TRANSIENT_VERSION = 0.3.3
112 MAGIT_SECTION_VERSION = 3.1.0
113 TRANSIENT_VERSION = 0.3.6
114114 WITH_EDITOR_VERSION = 3.0.4
115115
116116 DASH_MELPA_SNAPSHOT = 20210330
117 GIT_COMMIT_MELPA_SNAPSHOT = 20210524
117 GIT_COMMIT_MELPA_SNAPSHOT = 20210701
118118 LIBGIT_MELPA_SNAPSHOT = 0
119119 MAGIT_LIBGIT_MELPA_SNAPSHOT = 0
120 MAGIT_SECTION_MELPA_SNAPSHOT = 20210524
121 TRANSIENT_MELPA_SNAPSHOT = 20210524
120 MAGIT_SECTION_MELPA_SNAPSHOT = 20210701
121 TRANSIENT_MELPA_SNAPSHOT = 20210701
122122 WITH_EDITOR_MELPA_SNAPSHOT = 20210524
123123
124124 EMACS_VERSION = 25.1
174174 WITH_EDITOR_DIR = $(TOP)../with-editor
175175 endif
176176
177 MAGIT_SECTION_DIR ?= $(shell \
178 find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/magit-section-[.0-9]*' 2> /dev/null | \
179 sort | tail -n 1)
180
177181 SYSTYPE := $(shell $(EMACSBIN) -Q --batch --eval "(princ system-type)")
178182 ifeq ($(SYSTYPE), windows-nt)
179183 CYGPATH := $(shell cygpath --version 2>/dev/null)
191195 LOAD_PATH += -L $(shell cygpath --mixed $(LIBGIT_DIR))
192196 LOAD_PATH += -L $(shell cygpath --mixed $(TRANSIENT_DIR))
193197 LOAD_PATH += -L $(shell cygpath --mixed $(WITH_EDITOR_DIR))
198 ifneq "$(MAGIT_SECTION_DIR)" ""
199 LOAD_PATH += -L $(shell cygpath --mixed $(MAGIT_SECTION_DIR))
200 endif
194201 else
195202 LOAD_PATH += -L $(DASH_DIR)
196203 LOAD_PATH += -L $(LIBGIT_DIR)
197204 LOAD_PATH += -L $(TRANSIENT_DIR)
198205 LOAD_PATH += -L $(WITH_EDITOR_DIR)
206 ifneq "$(MAGIT_SECTION_DIR)" ""
207 LOAD_PATH += -L $(MAGIT_SECTION_DIR)
208 endif
199209 endif
200210
201211 endif # ifndef LOAD_PATH
1212
1313 ;; Keywords: git tools vc
1414 ;; Homepage: https://github.com/magit/magit
15 ;; Package-Requires: ((emacs "25.1") (dash "2.18.1") (transient "0.3.3") (with-editor "3.0.4"))
16 ;; Package-Version: 3.0.0
15 ;; Package-Requires: ((emacs "25.1") (dash "2.18.1") (transient "0.3.6") (with-editor "3.0.4"))
16 ;; Package-Version: 3.1.0
1717 ;; SPDX-License-Identifier: GPL-3.0-or-later
1818
1919 ;; This file is free software; you can redistribute it and/or modify
6666 ("-p" "Follow only first parent of a merge" "--first-parent"
6767 :if (lambda () (version<= "2.29" (magit-git-version))))
6868 (6 magit-bisect:--term-old
69 :if (lambda () (version<= "2.7" (magit-git-version))))
69 :if (lambda () (version<= "2.7" (magit-git-version))))
7070 (6 magit-bisect:--term-new
71 :if (lambda () (version<= "2.7" (magit-git-version))))]
71 :if (lambda () (version<= "2.7" (magit-git-version))))]
7272 ["Actions"
7373 ("B" "Start" magit-bisect-start)
7474 ("s" "Start script" magit-bisect-run)]]
7777 ("B" "Bad" magit-bisect-bad)
7878 ("g" "Good" magit-bisect-good)
7979 (6 "m" "Mark" magit-bisect-mark
80 :if (lambda () (version<= "2.7" (magit-git-version))))
80 :if (lambda () (version<= "2.7" (magit-git-version))))
8181 ("k" "Skip" magit-bisect-skip)
8282 ("r" "Reset" magit-bisect-reset)
8383 ("s" "Run script" magit-bisect-run)])
195195 (magit-bisect-start-read-args))))
196196 (cons (read-shell-command "Bisect shell command: ") args)))
197197 (when (and bad good)
198 (magit-bisect-start bad good args))
198 ;; Avoid `magit-git-bisect' because it's asynchronous, but the
199 ;; next `git bisect run' call requires the bisect to be started.
200 (magit-with-toplevel
201 (apply #'magit-process-file magit-git-executable
202 nil (list :file (magit-git-dir "BISECT_CMD_OUTPUT")) nil
203 (magit-process-git-arguments
204 (list "bisect" "start" bad good args)))
205 (magit-refresh)))
199206 (magit-git-bisect "run" (list shell-file-name shell-command-switch cmdline)))
200207
201208 (defun magit-git-bisect (subcommand &optional args no-assert)
487487 (while (not done)
488488 (cond ((looking-at "^filename \\(.+\\)")
489489 (setq done t)
490 (setf orig-file (match-string 1)))
490 (setf orig-file (magit-decode-git-path (match-string 1))))
491491 ((looking-at "^previous \\(.\\{40\\}\\) \\(.+\\)")
492492 (setf prev-rev (match-string 1))
493 (setf prev-file (match-string 2)))
493 (setf prev-file (magit-decode-git-path (match-string 2))))
494494 ((looking-at "^\\([^ ]+\\) \\(.+\\)")
495495 (push (cons (match-string 1)
496496 (match-string 2)) revinfo)))
700700 (when (magit-blame--style-get 'show-message)
701701 (let ((message-log-max 0))
702702 (if-let ((msg (cdr (assoc "summary"
703 (gethash (oref (magit-current-blame-chunk)
704 orig-rev)
705 magit-blame-cache)))))
703 (gethash (oref (magit-current-blame-chunk)
704 orig-rev)
705 magit-blame-cache)))))
706706 (progn (set-text-properties 0 (length msg) nil msg)
707707 (message msg))
708708 (message "Commit data not available yet. Still blaming.")))))
282282
283283 With a prefix argument the target COMMIT has to be confirmed.
284284 Otherwise the commit at point may be used without confirmation
285 depending on the value of option `magit-commit-squash-confirm'."
285 depending on the value of option `magit-commit-squash-confirm'.
286
287 If you want to immediately add a message to the squash commit,
288 then use `magit-commit-augment' instead of this command."
286289 (interactive (list (magit-commit-at-point)
287290 (magit-commit-arguments)))
288291 (magit-commit-squash-internal "--squash" commit args))
833833 ;;; Section Classes
834834
835835 (defclass magit-file-section (magit-section)
836 ((keymap :initform magit-file-section-map)
836 ((keymap :initform 'magit-file-section-map)
837837 (source :initform nil)
838838 (header :initform nil)))
839839
840840 (defclass magit-module-section (magit-file-section)
841 ((keymap :initform magit-hunk-section-map)))
841 ((keymap :initform 'magit-hunk-section-map)))
842842
843843 (defclass magit-hunk-section (magit-section)
844 ((keymap :initform magit-hunk-section-map)
844 ((keymap :initform 'magit-hunk-section-map)
845845 (refined :initform nil)
846846 (combined :initform nil)
847847 (from-range :initform nil)
877877 ("-x" "Disallow external diff drivers" "--no-ext-diff")
878878 ("-s" "Show stats" "--stat")
879879 ("=g" "Show signature" "--show-signature")
880 (5 "-R" "Reverse sides" "-R")
880881 (5 magit-diff:--color-moved)
881882 (5 magit-diff:--color-moved-ws)]
882883 ["Actions"
911912 ("-s" "Show stats" "--stat"
912913 :if-derived magit-diff-mode)
913914 ("=g" "Show signature" "--show-signature"
915 :if-derived magit-diff-mode)
916 (5 "-R" "Reverse sides" "-R"
914917 :if-derived magit-diff-mode)
915918 (5 magit-diff:--color-moved)
916919 (5 magit-diff:--color-moved-ws)]
19081911 (if (equal magit-buffer-typearg "--no-index")
19091912 (apply #'format "Differences between %s and %s" magit-buffer-diff-files)
19101913 (concat (if magit-buffer-range
1911 (if (string-match-p "\\(\\.\\.\\|\\^-\\)"
1912 magit-buffer-range)
1913 (format "Changes in %s" magit-buffer-range)
1914 (format "Changes from %s to working tree" magit-buffer-range))
1914 (cond
1915 ((string-match-p "\\(\\.\\.\\|\\^-\\)"
1916 magit-buffer-range)
1917 (format "Changes in %s" magit-buffer-range))
1918 ((member "-R" magit-buffer-diff-args)
1919 (format "Changes from working tree to %s" magit-buffer-range))
1920 (t
1921 (format "Changes from %s to working tree" magit-buffer-range)))
19151922 (if (equal magit-buffer-typearg "--cached")
19161923 "Staged changes"
19171924 "Unstaged changes"))
20232030 (pcase-let ((`(,cmd . ,args)
20242031 (-flatten args))
20252032 (magit-git-global-arguments
2026 (remove "--literal-pathspecs" magit-git-global-arguments)))
2033 (remove "--literal-pathspecs" magit-git-global-arguments)))
20272034 ;; As of Git 2.19.0, we need to generate diffs with
20282035 ;; --ita-visible-in-index so that `magit-stage' can work with
20292036 ;; intent-to-add files (see #4026). Cache the result for each
28512858 (oref section children))
28522859 (magit-section-match [* file commit] section))
28532860 'committed
2854 'undefined))
2861 'undefined))
28552862 (t 'undefined))))
28562863
28572864 (cl-defun magit-diff-scope (&optional (section nil ssection) strict)
6969 (defvar magit-inhibit-libgit nil
7070 "Whether to inhibit the use of libgit.")
7171
72 (defvar magit--libgit-available-p eieio-unbound
72 (defvar magit--libgit-available-p 'unknown
7373 "Whether libgit is available.
7474 Use the function by the same name instead of this variable.")
7575
7676 (defun magit--libgit-available-p ()
77 (if (eq magit--libgit-available-p eieio-unbound)
77 (if (eq magit--libgit-available-p 'unknown)
7878 (setq magit--libgit-available-p
7979 (and module-file-suffix
8080 (let ((libgit (locate-library "libgit")))
222222 :group 'magit-commands
223223 :type 'boolean)
224224
225 (defcustom magit-list-refs-namespaces
226 '("refs/heads"
227 "refs/remotes"
228 "refs/tags"
229 "refs/pullreqs")
230 "List of ref namespaces considered when reading a ref.
231
232 This controls the order of refs returned by `magit-list-refs',
233 which is called by functions like `magit-list-branch-names' to
234 generate the collection of refs."
235 :package-version '(magit . "3.1.0")
236 :group 'magit-commands
237 :type '(repeat string))
238
225239 (defcustom magit-list-refs-sortby nil
226240 "How to sort the ref collection in the prompt.
227241
537551 (gethash
538552 ;; `git config --list' downcases first and last components of the key.
539553 (--> key
540 (replace-regexp-in-string "\\`[^.]+" #'downcase it t t)
541 (replace-regexp-in-string "[^.]+\\'" #'downcase it t t))
554 (replace-regexp-in-string "\\`[^.]+" #'downcase it t t)
555 (replace-regexp-in-string "[^.]+\\'" #'downcase it t t))
542556 (magit--with-refresh-cache (cons (magit-toplevel) 'config)
543557 (let ((configs (make-hash-table :test 'equal)))
544558 (dolist (conf (magit-git-items "config" "--list" "-z"))
16081622 (list it (car (magit-rev-diff-count it rev)))
16091623 it))))))
16101624
1611 (defvar magit-list-refs-namespaces
1612 '("refs/heads" "refs/remotes" "refs/tags" "refs/pull"))
1613
16141625 (defun magit-list-refs (&optional namespaces format sortby)
16151626 "Return list of references.
16161627
16701681
16711682 (defun magit-list-branches-pointing-at (commit)
16721683 (let ((re (format "\\`%s refs/\\(heads\\|remotes\\)/\\(.*\\)\\'"
1673 (magit-rev-verify commit))))
1684 (magit-rev-verify commit))))
16741685 (--keep (and (string-match re it)
16751686 (let ((name (match-string 2 it)))
16761687 (and (not (string-suffix-p "HEAD" name))
21822193 (magit-get-current-branch))))
21832194
21842195 (defun magit-read-range (prompt &optional default)
2185 (magit-completing-read-multiple prompt
2186 (magit-list-refnames)
2187 "\\.\\.\\.?"
2188 default 'magit-revision-history))
2196 (let ((crm-separator "\\.\\.\\.?"))
2197 (magit-completing-read-multiple*
2198 (concat prompt ": ")
2199 (magit-list-refnames)
2200 nil nil nil 'magit-revision-history default nil t)))
21892201
21902202 (defun magit-read-remote-branch
21912203 (prompt &optional remote default local-branch require-match)
22242236 (or (magit-completing-read prompt choices
22252237 nil nil nil 'magit-revision-history
22262238 (or (magit-local-branch-at-point) commit))
2227 (user-error "Nothing selected"))))
2239 (user-error "Nothing selected"))))
22282240
22292241 (defun magit-read-local-branch-or-ref (prompt &optional secondary-default)
22302242 (magit-completing-read prompt (nconc (magit-list-local-branch-names)
99 ;; Keywords: git tools vc
1010 ;; Homepage: https://github.com/magit/magit
1111
12 ;; Package-Requires: ((emacs "26.1") (magit "3.0.0") (libgit "0"))
12 ;; Package-Requires: ((emacs "26.1") (magit "3.1.0") (libgit "0"))
1313 ;; Package-Version: 0
1414 ;; SPDX-License-Identifier: GPL-3.0-or-later
1515
594594
595595 (defun magit-log-read-revs (&optional use-current)
596596 (or (and use-current (--when-let (magit-get-current-branch) (list it)))
597 (let ((collection (magit-list-refnames nil t)))
598 (split-string
599 (magit-completing-read-multiple "Log rev,s" collection
600 "\\(\\.\\.\\.?\\|[, ]\\)"
601 (or (magit-branch-or-commit-at-point)
602 (unless use-current
603 (magit-get-previous-branch)))
604 'magit-revision-history
605 magit-log-read-revs-map)
606 "[, ]" t))))
597 (let ((crm-separator "\\(\\.\\.\\.?\\|[, ]\\)")
598 (crm-local-completion-map magit-log-read-revs-map))
599 (split-string (magit-completing-read-multiple*
600 "Log rev,s: "
601 (magit-list-refnames nil t)
602 nil nil nil 'magit-revision-history
603 (or (magit-branch-or-commit-at-point)
604 (unless use-current
605 (magit-get-previous-branch)))
606 nil t)
607 "[, ]" t))))
607608
608609 (defun magit-log-read-pattern (option)
609610 "Read a string from the user to pass as parameter to OPTION."
876877 "\\[magit-log-double-commit-limit] first"))))
877878 (user-error "Parent %s does not exist" parent-rev))))))
878879
880 (defun magit-log-move-to-revision (rev)
881 "Read a revision and move to it in current log buffer.
882
883 If the chosen reference or revision isn't being displayed in
884 the current log buffer, then inform the user about that and do
885 nothing else.
886
887 If invoked outside any log buffer, then display the log buffer
888 of the current repository first; creating it if necessary."
889 (interactive (list (magit-read-branch-or-commit "In log, jump to")))
890 (with-current-buffer
891 (cond ((derived-mode-p 'magit-log-mode)
892 (current-buffer))
893 ((when-let ((buf (magit-get-mode-buffer 'magit-log-mode)))
894 (pop-to-buffer-same-window buf)))
895 (t
896 (apply #'magit-log-all-branches (magit-log-arguments))))
897 (unless (magit-log-goto-commit-section (magit-rev-abbrev rev))
898 (user-error "%s isn't visible in the current log buffer" rev))))
899
879900 ;;;; Shortlog Commands
880901
881902 ;;;###autoload (autoload 'magit-shortlog "magit-log" nil t)
930951 (define-key map "\C-c\C-b" 'magit-go-backward)
931952 (define-key map "\C-c\C-f" 'magit-go-forward)
932953 (define-key map "\C-c\C-n" 'magit-log-move-to-parent)
954 (define-key map "j" 'magit-log-move-to-revision)
933955 (define-key map "=" 'magit-log-toggle-commit-limit)
934956 (define-key map "+" 'magit-log-double-commit-limit)
935957 (define-key map "-" 'magit-log-half-commit-limit)
16021624 (funcall fun rev)))
16031625
16041626 (defun magit-log-select-quit ()
1605 "Abort selecting a commit, don't act on any commit."
1627 "Abort selecting a commit, don't act on any commit.
1628 Call `magit-log-select-quit-function' if set."
16061629 (interactive)
1607 (magit-mode-bury-buffer 'kill)
1608 (when magit-log-select-quit-function
1609 (funcall magit-log-select-quit-function)))
1630 (let ((fun magit-log-select-quit-function))
1631 (magit-mode-bury-buffer 'kill)
1632 (when fun (funcall fun))))
16101633
16111634 ;;; Cherry Mode
16121635
5757 [("p" "Preview merge" magit-merge-preview)
5858 ""
5959 ("s" "Squash merge" magit-merge-squash)
60 ("i" "Merge into" magit-merge-into)]]
60 ("i" "Dissolve" magit-merge-into)]]
6161 ["Actions"
6262 :if magit-merge-in-progress-p
6363 ("m" "Commit merge" magit-commit-create)
14181418 (dolist (buffer (magit-mode-get-buffers))
14191419 (with-current-buffer buffer
14201420 (setq magit-section-visibility-cache nil)))
1421 (setq magit--libgit-available-p eieio-unbound))
1421 (setq magit--libgit-available-p 'unknown))
14221422
14231423 ;;; Utilities
14241424
191191 ","))))
192192
193193 (defun magit-notes-read-args (prompt)
194 (list (magit-read-branch-or-commit prompt (magit-stash-at-point))
195 (--when-let (--first (string-match "^--ref=\\(.+\\)" it)
196 (transient-args 'magit-notes))
197 (match-string 1 it))))
194 (list (magit-read-branch-or-commit prompt (magit-stash-at-point))
195 (--when-let (--first (string-match "^--ref=\\(.+\\)" it)
196 (transient-args 'magit-notes))
197 (match-string 1 it))))
198198
199199 ;;; _
200200 (provide 'magit-notes)
0 (define-package "magit" "3.0.0"
0 (define-package "magit" "3.1.0"
11 "A Git porcelain inside Emacs."
22 '((emacs "25.1")
33 (dash "2.18.1")
4 (git-commit "3.0.0")
5 (magit-section "3.0.0")
6 (transient "0.3.3")
4 (git-commit "3.1.0")
5 (magit-section "3.1.0")
6 (transient "0.3.6")
77 (with-editor "3.0.4"))
88 :homepage "https://magit.vc"
99 :keywords '("git" "tools" "vc"))
845845 (and (string-match "^option (enter for default): $" string)
846846 (progn
847847 (magit-process-buffer)
848 (process-send-string
849 process
850 (format "%c" (read-char-choice "Option: " '(?\r ?\j ?1 ?2)))))))
848 (let ((option (format "%c\n"
849 (read-char-choice "Option: " '(?\r ?\j ?1 ?2)))))
850 (insert-before-markers-and-inherit option)
851 (process-send-string process option)))))
851852
852853 (defun magit-process-password-prompt (process string)
853854 "Find a password based on prompt STRING and send it to git.
216216 is used."
217217 (interactive
218218 (list (magit-read-remote "Push to remote")
219 (split-string (magit-completing-read-multiple
220 "Push refspec,s"
221 (cons "HEAD" (magit-list-local-branch-names))
222 nil nil 'magit-push-refspecs-history)
223 crm-default-separator t)
219 (magit-completing-read-multiple*
220 "Push refspec,s: "
221 (cons "HEAD" (magit-list-local-branch-names))
222 nil nil nil 'magit-push-refspecs-history)
224223 (magit-push-arguments)))
225224 (run-hooks 'magit-credential-hook)
226225 (magit-run-git-async "push" "-v" args remote refspecs))
128128 (interactive)
129129 (if magit-repository-directories
130130 (with-current-buffer (get-buffer-create "*Magit Repositories*")
131 (message "Listing repositories...")
131132 (magit-repolist-mode)
132133 (magit-repolist-refresh)
133134 (tabulated-list-print)
134 (switch-to-buffer (current-buffer)))
135 (switch-to-buffer (current-buffer))
136 (message "Listing repositories...done"))
135137 (message "You need to customize `magit-repository-directories' %s"
136138 "before you can list repositories")))
137139
1010 ;; Keywords: tools
1111 ;; Homepage: https://github.com/magit/magit
1212 ;; Package-Requires: ((emacs "25.1") (dash "2.18.1"))
13 ;; Package-Version: 3.0.0
13 ;; Package-Version: 3.1.0
1414 ;; SPDX-License-Identifier: GPL-3.0-or-later
1515
1616 ;; Magit-Section is free software; you can redistribute it and/or modify
562562 `(defun ,name (&optional expand) ,(format "\
563563 Jump to the section \"%s\".
564564 With a prefix argument also expand it." heading)
565 (interactive "P")
566 (--if-let (magit-get-section
567 (cons (cons ',type ,value)
568 (magit-section-ident magit-root-section)))
569 (progn (goto-char (oref it start))
570 (when expand
571 (with-local-quit (magit-section-show it))
572 (recenter 0)))
573 (message ,(format "Section \"%s\" wasn't found" heading)))))
565 (interactive "P")
566 (--if-let (magit-get-section
567 (cons (cons ',type ,value)
568 (magit-section-ident magit-root-section)))
569 (progn (goto-char (oref it start))
570 (when expand
571 (with-local-quit (magit-section-show it))
572 (recenter 0)))
573 (message ,(format "Section \"%s\" wasn't found" heading)))))
574574
575575 ;;;; Visibility
576576
147147 ["Apply here"
148148 ("A" "Pick" magit-cherry-copy)
149149 ("a" "Apply" magit-cherry-apply)
150 ("h" "Harvest" magit-cherry-harvest)]
150 ("h" "Harvest" magit-cherry-harvest)
151 ("m" "Squash" magit-merge-squash)]
151152 ["Apply elsewhere"
152153 ("d" "Donate" magit-cherry-donate)
153154 ("n" "Spinout" magit-cherry-spinout)
172173
173174 (defun magit--cherry-move-read-args (verb away fn)
174175 (declare (indent defun))
175 (let ((commits (or (nreverse (magit-region-values 'commit))
176 (list (funcall (if away
177 'magit-read-branch-or-commit
178 'magit-read-other-branch-or-commit)
179 (format "%s cherry" (capitalize verb))))))
180 (current (magit-get-current-branch)))
181 (unless current
182 (user-error "Cannot %s cherries while HEAD is detached" verb))
183 (let ((reachable (magit-rev-ancestor-p (car commits) current))
184 (msg "Cannot %s cherries that %s reachable from HEAD"))
185 (pcase (list away reachable)
186 (`(nil t) (user-error msg verb "are"))
187 (`(t nil) (user-error msg verb "are not"))))
188 `(,commits
189 ,@(funcall fn commits)
190 ,(transient-args 'magit-cherry-pick))))
176 (let ((commits (or (nreverse (magit-region-values 'commit))
177 (list (funcall (if away
178 'magit-read-branch-or-commit
179 'magit-read-other-branch-or-commit)
180 (format "%s cherry" (capitalize verb))))))
181 (current (magit-get-current-branch)))
182 (unless current
183 (user-error "Cannot %s cherries while HEAD is detached" verb))
184 (let ((reachable (magit-rev-ancestor-p (car commits) current))
185 (msg "Cannot %s cherries that %s reachable from HEAD"))
186 (pcase (list away reachable)
187 (`(nil t) (user-error msg verb "are"))
188 (`(t nil) (user-error msg verb "are not"))))
189 `(,commits
190 ,@(funcall fn commits)
191 ,(transient-args 'magit-cherry-pick))))
191192
192193 (defun magit--cherry-spinoff-read-args (verb)
193194 (magit--cherry-move-read-args verb t
10401041 (t
10411042 (list "done" rev 'magit-sequence-done)))))
10421043 (magit-sequence-insert-commit "onto" onto
1043 (if (equal onto head)
1044 'magit-sequence-head
1045 'magit-sequence-onto))))
1044 (if (equal onto head)
1045 'magit-sequence-head
1046 'magit-sequence-onto))))
10461047
10471048 (defun magit-sequence-insert-commit (type hash face)
1048 (magit-insert-section (commit hash)
1049 (magit-insert-section (commit hash)
10491050 (magit-insert-heading
10501051 (propertize type 'font-lock-face face) "\s"
10511052 (magit-format-rev-summary hash) "\n")))
583583 (defun magit-list-submodules ()
584584 "Display a list of the current repository's submodules."
585585 (interactive)
586 (message "Listing submodules...")
586587 (magit-display-buffer
587588 (or (magit-get-mode-buffer 'magit-submodule-list-mode)
588589 (magit-with-toplevel
589590 (magit-generate-new-buffer 'magit-submodule-list-mode))))
590591 (magit-submodule-list-mode)
591592 (magit-submodule-list-refresh)
592 (tabulated-list-print))
593 (tabulated-list-print)
594 (message "Listing submodules...done"))
593595
594596 (defvar magit-submodule-list-mode-map
595597 (let ((map (make-sparse-keymap)))
197197 ;;; _
198198 (provide 'magit-transient)
199199 ;;; magit-transient.el ends here
200
533533 (complete-with-action action collection string pred))))
534534
535535 (defun magit-builtin-completing-read
536 (prompt choices &optional predicate require-match initial-input hist def)
536 (prompt choices &optional predicate require-match initial-input hist def)
537537 "Magit wrapper for standard `completing-read' function."
538538 (unless (or (bound-and-true-p helm-mode)
539 (bound-and-true-p ivy-mode)
540 (bound-and-true-p vertico-mode)
541 (bound-and-true-p selectrum-mode))
542 (setq prompt (magit-prompt-with-default prompt def)))
543 (unless (or (bound-and-true-p helm-mode)
539544 (bound-and-true-p ivy-mode))
540 (setq prompt (magit-prompt-with-default prompt def))
541545 (setq choices (magit--completion-table choices)))
542 (cl-letf (((symbol-function 'completion-pcm--all-completions)
543 #'magit-completion-pcm--all-completions))
546 (cl-letf (((symbol-function 'completion-pcm--all-completions)))
547 (when (< emacs-major-version 26)
548 (fset 'completion-pcm--all-completions
549 'magit-completion-pcm--all-completions))
544550 (let ((ivy-sort-functions-alist nil))
545551 (completing-read prompt choices
546552 predicate require-match
547553 initial-input hist def))))
548554
549555 (defun magit-completing-read-multiple
550 (prompt choices &optional sep default hist keymap)
556 (prompt choices &optional sep default hist keymap)
551557 "Read multiple items from CHOICES, separated by SEP.
552558
553559 Set up the `crm' variables needed to read multiple values with
560566
561567 Unlike `completing-read-multiple', the return value is not split
562568 into a list."
569 (declare (obsolete magit-completing-read-multiple* "Magit 3.1.0"))
563570 (let* ((crm-separator (or sep crm-default-separator))
564571 (crm-completion-table (magit--completion-table choices))
565572 (choose-completion-string-functions
570577 (helm-crm-default-separator nil)
571578 (ivy-sort-matches-functions-alist nil)
572579 (input
573 (cl-letf (((symbol-function 'completion-pcm--all-completions)
574 #'magit-completion-pcm--all-completions))
580 (cl-letf (((symbol-function 'completion-pcm--all-completions)))
581 (when (< emacs-major-version 26)
582 (fset 'completion-pcm--all-completions
583 'magit-completion-pcm--all-completions))
575584 (read-from-minibuffer
576585 (concat prompt (and default (format " (%s)" default)) ": ")
577586 nil (or keymap crm-local-completion-map)
583592
584593 (defun magit-completing-read-multiple*
585594 (prompt table &optional predicate require-match initial-input
586 hist def inherit-input-method)
595 hist def inherit-input-method
596 no-split)
587597 "Read multiple strings in the minibuffer, with completion.
588598 Like `completing-read-multiple' but don't mess with order of
589 TABLE. Also bind `helm-completion-in-region-default-sort-fn'
590 to nil."
591 (unwind-protect
592 (cl-letf (((symbol-function 'completion-pcm--all-completions)
593 #'magit-completion-pcm--all-completions))
594 (add-hook 'choose-completion-string-functions
595 'crm--choose-completion-string)
596 (let* ((minibuffer-completion-table #'crm--collection-fn)
597 (minibuffer-completion-predicate predicate)
598 ;; see completing_read in src/minibuf.c
599 (minibuffer-completion-confirm
600 (unless (eq require-match t) require-match))
601 (crm-completion-table (magit--completion-table table))
602 (map (if require-match
603 crm-local-must-match-map
604 crm-local-completion-map))
605 (helm-completion-in-region-default-sort-fn nil)
606 (ivy-sort-matches-functions-alist nil)
607 ;; If the user enters empty input, `read-from-minibuffer'
608 ;; returns the empty string, not DEF.
609 (input (read-from-minibuffer
610 prompt initial-input map
611 nil hist def inherit-input-method)))
612 (and def (string-equal input "") (setq input def))
613 ;; Remove empty strings in the list of read strings.
614 (split-string input crm-separator t)))
615 (remove-hook 'choose-completion-string-functions
616 'crm--choose-completion-string)))
599 TABLE and take an additional argument NO-SPLIT, which causes
600 the user input to be returned as a single unmodified string.
601 Also work around various misfeatures of various third-party
602 completion frameworks."
603 (cl-letf*
604 (;; To implement NO-SPLIT we have to manipulate the respective
605 ;; `split-string' invocation. We cannot simply advice it to
606 ;; return the input string because `SELECTRUM' would choke on
607 ;; it that string. Use a variable to pass along the raw user
608 ;; input string. aa5f098ab
609 (input nil)
610 (split-string (symbol-function 'split-string))
611 ((symbol-function 'split-string)
612 (lambda (string &optional separators omit-nulls trim)
613 (when (and no-split
614 (equal separators crm-separator)
615 (equal omit-nulls t))
616 (setq input string))
617 (funcall split-string string separators omit-nulls trim)))
618 ;; In Emacs 25 this function has a bug, so we use a copy of the
619 ;; version from Emacs 26. bef9c7aa3
620 ((symbol-function 'completion-pcm--all-completions)
621 (if (< emacs-major-version 26)
622 'magit-completion-pcm--all-completions
623 (symbol-function 'completion-pcm--all-completions)))
624 ;; Prevent `BUILT-IN' completion from messing up our existing
625 ;; order of the completion candidates. aa5f098ab
626 (table (magit--completion-table table))
627 ;; Prevent `IVY' from messing up our existing order. c7af78726
628 (ivy-sort-matches-functions-alist nil)
629 ;; Prevent `HELM' from messing up our existing order. 6fcf994bd
630 (helm-completion-in-region-default-sort-fn nil)
631 ;; Prevent `HELM' from automatically appending the separator,
632 ;; which is counterproductive when NO-SPLIT is non-nil and/or
633 ;; when reading commit ranges. 798aff564
634 (helm-crm-default-separator
635 (if no-split nil helm-crm-default-separator))
636 ;; And now, the moment we have all been waiting for...
637 (values (completing-read-multiple
638 prompt table predicate require-match initial-input
639 hist def inherit-input-method)))
640 (if no-split input values)))
617641
618642 (defun magit-ido-completing-read
619 (prompt choices &optional predicate require-match initial-input hist def)
643 (prompt choices &optional predicate require-match initial-input hist def)
620644 "Ido-based `completing-read' almost-replacement.
621645
622646 Unfortunately `ido-completing-read' is not suitable as a
805829 "with-editor"
806830 ;; Obviously `magit' itself is needed too.
807831 "magit"
808 ;; While this is part of the Magit repository,
809 ;; it is distributed as a separate package.
832 ;; While these are part of the Magit repository,
833 ;; they are distributed as separate packages.
834 "magit-section"
810835 "git-commit"
811 ;; Even though `async' is a dependency of the
812 ;; `magit' package, it is not required here.
813836 ))))
814837 ;; Avoid Emacs bug#16406 by using full path.
815838 "-l" ,(file-name-sans-extension (locate-library "magit")))
10241047 (advice-add 'auto-revert-handler :around 'auto-revert-handler@bug21559)
10251048 )
10261049
1027 ;; `completion-pcm--all-completions' reverses the completion list. To
1028 ;; preserve the order of our pre-sorted completions, we'll temporarily
1029 ;; override it with the function below. bug#24676
1030 (defun magit-completion-pcm--all-completions (prefix pattern table pred)
1031 (if (completion-pcm--pattern-trivial-p pattern)
1032 (all-completions (concat prefix (car pattern)) table pred)
1033 (let* ((regex (completion-pcm--pattern->regex pattern))
1034 (case-fold-search completion-ignore-case)
1035 (completion-regexp-list (cons regex completion-regexp-list))
1036 (compl (all-completions
1037 (concat prefix
1038 (if (stringp (car pattern)) (car pattern) ""))
1039 table pred)))
1040 (if (not (functionp table))
1041 compl
1042 (let ((poss ()))
1043 (dolist (c compl)
1044 (when (string-match-p regex c) (push c poss)))
1045 ;; This `nreverse' call is the only code change made to the
1046 ;; `completion-pcm--all-completions' that shipped with Emacs 25.1.
1047 (nreverse poss))))))
1050 (when (< emacs-major-version 26)
1051 ;; In Emacs 25 `completion-pcm--all-completions' reverses the
1052 ;; completion list. This is the version from Emacs 26, which
1053 ;; fixes that issue. bug#24676
1054 (defun magit-completion-pcm--all-completions (prefix pattern table pred)
1055 (if (completion-pcm--pattern-trivial-p pattern)
1056 (all-completions (concat prefix (car pattern)) table pred)
1057 (let* ((regex (completion-pcm--pattern->regex pattern))
1058 (case-fold-search completion-ignore-case)
1059 (completion-regexp-list (cons regex completion-regexp-list))
1060 (compl (all-completions
1061 (concat prefix
1062 (if (stringp (car pattern)) (car pattern) ""))
1063 table pred)))
1064 (if (not (functionp table))
1065 compl
1066 (let ((poss ()))
1067 (dolist (c compl)
1068 (when (string-match-p regex c) (push c poss)))
1069 (nreverse poss)))))))
10481070
10491071 (defun magit-which-function ()
10501072 "Return current function name based on point.