fix magit update
This commit is contained in:
19
lisp/magit-section/dir
Normal file
19
lisp/magit-section/dir
Normal file
@@ -0,0 +1,19 @@
|
||||
This is the file .../info/dir, which contains the
|
||||
topmost node of the Info hierarchy, called (dir)Top.
|
||||
The first time you invoke Info you start off looking at this node.
|
||||
|
||||
File: dir, Node: Top This is the top of the INFO tree
|
||||
|
||||
This (the Directory node) gives a menu of major topics.
|
||||
Typing "q" exits, "H" lists all Info commands, "d" returns here,
|
||||
"h" gives a primer for first-timers,
|
||||
"mEmacs<Return>" visits the Emacs manual, etc.
|
||||
|
||||
In Emacs, you can click mouse button 2 on a menu item or cross reference
|
||||
to select it.
|
||||
|
||||
* Menu:
|
||||
|
||||
Emacs
|
||||
* Magit-Section: (magit-section).
|
||||
Use Magit sections in your own packages.
|
||||
13
lisp/magit-section/magit-section-pkg.el
Normal file
13
lisp/magit-section/magit-section-pkg.el
Normal file
@@ -0,0 +1,13 @@
|
||||
(define-package "magit-section" "20220101.841" "Sections for read-only buffers"
|
||||
'((emacs "25.1")
|
||||
(dash "20210826"))
|
||||
:commit "6ba3b50373fffa89ae99fc0ad5135e3d574f6df4" :authors
|
||||
'(("Jonas Bernoulli" . "jonas@bernoul.li"))
|
||||
:maintainer
|
||||
'("Jonas Bernoulli" . "jonas@bernoul.li")
|
||||
:keywords
|
||||
'("tools")
|
||||
:url "https://github.com/magit/magit")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
1851
lisp/magit-section/magit-section.el
Normal file
1851
lisp/magit-section/magit-section.el
Normal file
File diff suppressed because it is too large
Load Diff
274
lisp/magit-section/magit-section.info
Normal file
274
lisp/magit-section/magit-section.info
Normal file
@@ -0,0 +1,274 @@
|
||||
This is magit-section.info, produced by makeinfo version 6.7 from
|
||||
magit-section.texi.
|
||||
|
||||
Copyright (C) 2015-2022 Jonas Bernoulli <jonas@bernoul.li>
|
||||
|
||||
You can redistribute this document and/or modify it under the terms
|
||||
of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This document is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
INFO-DIR-SECTION Emacs
|
||||
START-INFO-DIR-ENTRY
|
||||
* Magit-Section: (magit-section). Use Magit sections in your own packages.
|
||||
END-INFO-DIR-ENTRY
|
||||
|
||||
|
||||
File: magit-section.info, Node: Top, Next: Introduction, Up: (dir)
|
||||
|
||||
Magit-Section Developer Manual
|
||||
******************************
|
||||
|
||||
This package implements the main user interface of Magit — the
|
||||
collapsible sections that make up its buffers. This package used to be
|
||||
distributed as part of Magit but how it can also be used by other
|
||||
packages that have nothing to do with Magit or Git.
|
||||
|
||||
To learn more about the section abstraction and available commands
|
||||
and user options see *note (magit)Sections::. This manual documents how
|
||||
you can use sections in your own packages.
|
||||
|
||||
This manual is for Magit-Section version v3.3.0-73-g03f495f35+1.
|
||||
|
||||
Copyright (C) 2015-2022 Jonas Bernoulli <jonas@bernoul.li>
|
||||
|
||||
You can redistribute this document and/or modify it under the terms
|
||||
of the GNU General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This document is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
* Menu:
|
||||
|
||||
* Introduction::
|
||||
* Creating Sections::
|
||||
* Core Functions::
|
||||
* Matching Functions::
|
||||
|
||||
|
||||
File: magit-section.info, Node: Introduction, Next: Creating Sections, Prev: Top, Up: Top
|
||||
|
||||
1 Introduction
|
||||
**************
|
||||
|
||||
This package implements the main user interface of Magit — the
|
||||
collapsible sections that make up its buffers. This package used to be
|
||||
distributed as part of Magit but how it can also be used by other
|
||||
packages that have nothing to do with Magit or Git.
|
||||
|
||||
To learn more about the section abstraction and available commands
|
||||
and user options see *note (magit)Sections::. This manual documents how
|
||||
you can use sections in your own packages.
|
||||
|
||||
When the documentation leaves something unaddressed, then please
|
||||
consider that Magit uses this library extensively and search its source
|
||||
for suitable examples before asking me for help. Thanks!
|
||||
|
||||
|
||||
File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev: Introduction, Up: Top
|
||||
|
||||
2 Creating Sections
|
||||
*******************
|
||||
|
||||
-- Macro: magit-insert-section [name] (type &optional value hide) &rest
|
||||
body
|
||||
Create a section object of type CLASS, storing VALUE in its ‘value’
|
||||
slot, and insert the section at point. CLASS is a subclass of
|
||||
‘magit-section’ or has the form ‘(eval FORM)’, in which case FORM
|
||||
is evaluated at runtime and should return a subclass. In other
|
||||
places a sections class is oftern referred to as its "type".
|
||||
|
||||
Many commands behave differently depending on the class of the
|
||||
current section and sections of a certain class can have their own
|
||||
keymap, which is specified using the ‘keymap’ class slot. The
|
||||
value of that slot should be a variable whose value is a keymap.
|
||||
|
||||
For historic reasons Magit and Forge in most cases use symbols as
|
||||
CLASS that don’t actually identify a class and that lack the
|
||||
appropriate package prefix. This works due to some undocumented
|
||||
kludges, which are not available to other packages.
|
||||
|
||||
When optional HIDE is non-nil collapse the section body by default,
|
||||
i.e. when first creating the section, but not when refreshing the
|
||||
buffer. Else expand it by default. This can be overwritten using
|
||||
‘magit-section-set-visibility-hook’. When a section is recreated
|
||||
during a refresh, then the visibility of predecessor is inherited
|
||||
and HIDE is ignored (but the hook is still honored).
|
||||
|
||||
BODY is any number of forms that actually insert the section’s
|
||||
heading and body. Optional NAME, if specified, has to be a symbol,
|
||||
which is then bound to the object of the section being inserted.
|
||||
|
||||
Before BODY is evaluated the ‘start’ of the section object is set
|
||||
to the value of ‘point’ and after BODY was evaluated its ‘end’ is
|
||||
set to the new value of ‘point’; BODY is responsible for moving
|
||||
‘point’ forward.
|
||||
|
||||
If it turns out inside BODY that the section is empty, then
|
||||
‘magit-cancel-section’ can be used to abort and remove all traces
|
||||
of the partially inserted section. This can happen when creating a
|
||||
section by washing Git’s output and Git didn’t actually output
|
||||
anything this time around.
|
||||
|
||||
-- Function: magit-insert-heading &rest args
|
||||
Insert the heading for the section currently being inserted.
|
||||
|
||||
This function should only be used inside ‘magit-insert-section’.
|
||||
|
||||
When called without any arguments, then just set the ‘content’ slot
|
||||
of the object representing the section being inserted to a marker
|
||||
at ‘point’. The section should only contain a single line when
|
||||
this function is used like this.
|
||||
|
||||
When called with arguments ARGS, which have to be strings, or nil,
|
||||
then insert those strings at point. The section should not contain
|
||||
any text before this happens and afterwards it should again only
|
||||
contain a single line. If the ‘face’ property is set anywhere
|
||||
inside any of these strings, then insert all of them unchanged.
|
||||
Otherwise use the ‘magit-section-heading’ face for all inserted
|
||||
text.
|
||||
|
||||
The ‘content’ property of the section object is the end of the
|
||||
heading (which lasts from ‘start’ to ‘content’) and the beginning
|
||||
of the the body (which lasts from ‘content’ to ‘end’). If the
|
||||
value of ‘content’ is nil, then the section has no heading and its
|
||||
body cannot be collapsed. If a section does have a heading, then
|
||||
its height must be exactly one line, including a trailing newline
|
||||
character. This isn’t enforced, you are responsible for getting it
|
||||
right. The only exception is that this function does insert a
|
||||
newline character if necessary.
|
||||
|
||||
-- Macro: magit-insert-section-body &rest body
|
||||
Use BODY to insert the section body, once the section is expanded.
|
||||
If the section is expanded when it is created, then this is like
|
||||
‘progn’. Otherwise BODY isn’t evaluated until the section is
|
||||
explicitly expanded.
|
||||
|
||||
-- Function: magit-cancel-section
|
||||
Cancel inserting the section that is currently being inserted.
|
||||
Remove all traces of that section.
|
||||
|
||||
-- Function: magit-wash-sequence function
|
||||
Repeatedly call FUNCTION until it returns ‘nil’ or the end of the
|
||||
buffer is reached. FUNCTION has to move point forward or return
|
||||
‘nil’.
|
||||
|
||||
|
||||
File: magit-section.info, Node: Core Functions, Next: Matching Functions, Prev: Creating Sections, Up: Top
|
||||
|
||||
3 Core Functions
|
||||
****************
|
||||
|
||||
-- Function: magit-current-section
|
||||
Return the section at point.
|
||||
|
||||
-- Function: magit-section-ident section
|
||||
Return an unique identifier for SECTION. The return value has the
|
||||
form ‘((TYPE . VALUE)...)’.
|
||||
|
||||
-- Function: magit-section-ident-value value
|
||||
Return a constant representation of VALUE.
|
||||
|
||||
VALUE is the value of a ‘magit-section’ object. If that is an
|
||||
object itself, then that is not suitable to be used to identify the
|
||||
section because two objects may represent the same thing but not be
|
||||
equal. If possible a method should be added for such objects,
|
||||
which returns a value that is equal. Otherwise the catch-all
|
||||
method is used, which just returns the argument itself.
|
||||
|
||||
-- Function: magit-get-section ident &optional root
|
||||
Return the section identified by IDENT. IDENT has to be a list as
|
||||
returned by ‘magit-section-ident’. If optional ROOT is non-nil,
|
||||
then search in that section tree instead of in the one whose root
|
||||
‘magit-root-section’ is.
|
||||
|
||||
-- Function: magit-section-lineage section
|
||||
Return the lineage of SECTION. The return value has the form
|
||||
‘(TYPE...)’.
|
||||
|
||||
|
||||
File: magit-section.info, Node: Matching Functions, Prev: Core Functions, Up: Top
|
||||
|
||||
4 Matching Functions
|
||||
********************
|
||||
|
||||
-- Function: magit-section-match condition &optional (section
|
||||
(magit-current-section))
|
||||
Return t if SECTION matches CONDITION.
|
||||
|
||||
SECTION defaults to the section at point. If SECTION is not
|
||||
specified and there also is no section at point, then return nil.
|
||||
|
||||
CONDITION can take the following forms:
|
||||
|
||||
• ‘(CONDITION...)’ matches if any of the CONDITIONs matches.
|
||||
• ‘[CLASS...]’ matches if the section’s class is the same as the
|
||||
first CLASS or a subclass of that; the section’s parent class
|
||||
matches the second CLASS; and so on.
|
||||
|
||||
• ‘[* CLASS...]’ matches sections that match [CLASS...] and also
|
||||
recursively all their child sections.
|
||||
• ‘CLASS’ matches if the section’s class is the same as CLASS or
|
||||
a subclass of that; regardless of the classes of the parent
|
||||
sections.
|
||||
|
||||
Each CLASS should be a class symbol, identifying a class that
|
||||
derives from ‘magit-section’. For backward compatibility CLASS can
|
||||
also be a "type symbol". A section matches such a symbol if the
|
||||
value of its ‘type’ slot is ‘eq’. If a type symbol has an entry in
|
||||
‘magit--section-type-alist’, then a section also matches that type
|
||||
if its class is a subclass of the class that corresponds to the
|
||||
type as per that alist.
|
||||
|
||||
Note that it is not necessary to specify the complete section
|
||||
lineage as printed by ‘magit-describe-section-briefly’, unless of
|
||||
course you want to be that precise.
|
||||
|
||||
-- Function: magit-section-value-if condition &optional section
|
||||
If the section at point matches CONDITION, then return its value.
|
||||
|
||||
If optional SECTION is non-nil then test whether that matches
|
||||
instead. If there is no section at point and SECTION is nil, then
|
||||
return nil. If the section does not match, then return nil.
|
||||
|
||||
See ‘magit-section-match’ for the forms CONDITION can take.
|
||||
|
||||
-- Macro: magit-section-case &rest clauses
|
||||
Choose among clauses on the type of the section at point.
|
||||
|
||||
Each clause looks like ‘(CONDITION BODY...)’. The type of the
|
||||
section is compared against each CONDITION; the BODY forms of the
|
||||
first match are evaluated sequentially and the value of the last
|
||||
form is returned. Inside BODY the symbol ‘it’ is bound to the
|
||||
section at point. If no clause succeeds or if there is no section
|
||||
at point, return nil.
|
||||
|
||||
See ‘magit-section-match’ for the forms CONDITION can take.
|
||||
Additionally a CONDITION of t is allowed in the final clause, and
|
||||
matches if no other CONDITION match, even if there is no section at
|
||||
point.
|
||||
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top788
|
||||
Node: Introduction2086
|
||||
Node: Creating Sections2856
|
||||
Node: Core Functions7365
|
||||
Node: Matching Functions8686
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Local Variables:
|
||||
coding: utf-8
|
||||
End:
|
||||
@@ -65,11 +65,11 @@
|
||||
["Arguments"
|
||||
("-n" "Don't checkout commits" "--no-checkout")
|
||||
("-p" "Follow only first parent of a merge" "--first-parent"
|
||||
:if (lambda () (version<= "2.29" (magit-git-version))))
|
||||
:if (lambda () (magit-git-version>= "2.29")))
|
||||
(6 magit-bisect:--term-old
|
||||
:if (lambda () (version<= "2.7" (magit-git-version))))
|
||||
:if (lambda () (magit-git-version>= "2.7")))
|
||||
(6 magit-bisect:--term-new
|
||||
:if (lambda () (version<= "2.7" (magit-git-version))))]
|
||||
:if (lambda () (magit-git-version>= "2.7")))]
|
||||
["Actions"
|
||||
("B" "Start" magit-bisect-start)
|
||||
("s" "Start script" magit-bisect-run)]]
|
||||
@@ -78,7 +78,7 @@
|
||||
("B" "Bad" magit-bisect-bad)
|
||||
("g" "Good" magit-bisect-good)
|
||||
(6 "m" "Mark" magit-bisect-mark
|
||||
:if (lambda () (version<= "2.7" (magit-git-version))))
|
||||
:if (lambda () (magit-git-version>= "2.7")))
|
||||
("k" "Skip" magit-bisect-skip)
|
||||
("r" "Reset" magit-bisect-reset)
|
||||
("s" "Run script" magit-bisect-run)])
|
||||
@@ -204,7 +204,9 @@ bisect run'."
|
||||
(magit-process-git-arguments
|
||||
(list "bisect" "start" bad good args)))
|
||||
(magit-refresh)))
|
||||
(magit-git-bisect "run" (list shell-file-name shell-command-switch cmdline)))
|
||||
(magit--with-connection-local-variables
|
||||
(magit-git-bisect "run" (list shell-file-name
|
||||
shell-command-switch cmdline))))
|
||||
|
||||
(defun magit-git-bisect (subcommand &optional args no-assert)
|
||||
(unless (or no-assert (magit-bisect-in-progress-p))
|
||||
|
||||
@@ -217,7 +217,7 @@ has to be used to view and change branch related variables."
|
||||
["Arguments"
|
||||
(7 "-r" "Recurse submodules when checking out an existing branch"
|
||||
"--recurse-submodules"
|
||||
:if (lambda () (version<= "2.13" (magit-git-version))))]
|
||||
:if (lambda () (magit-git-version>= "2.13")))]
|
||||
["Variables"
|
||||
:if (lambda ()
|
||||
(and magit-branch-direct-configure
|
||||
|
||||
@@ -117,6 +117,9 @@ the name of the owner. Also see `magit-clone-name-alist'."
|
||||
["Setup arguments"
|
||||
("-o" "Set name of remote" ("-o" "--origin="))
|
||||
("-b" "Set HEAD branch" ("-b" "--branch="))
|
||||
(magit-clone:--filter
|
||||
:if (lambda () (magit-git-version>= "2.17.0"))
|
||||
:level 7)
|
||||
("-g" "Separate git directory" "--separate-git-dir="
|
||||
transient-read-directory :level 7)
|
||||
("-t" "Use template directory" "--template="
|
||||
@@ -129,6 +132,9 @@ the name of the owner. Also see `magit-clone-name-alist'."
|
||||
("s" "shallow" magit-clone-shallow)
|
||||
("d" "shallow since date" magit-clone-shallow-since :level 7)
|
||||
("e" "shallow excluding" magit-clone-shallow-exclude :level 7)
|
||||
(">" "sparse checkout" magit-clone-sparse
|
||||
:if (lambda () (magit-git-version>= "2.25.0"))
|
||||
:level 6)
|
||||
("b" "bare" magit-clone-bare)
|
||||
("m" "mirror" magit-clone-mirror)]
|
||||
(interactive (list (or magit-clone-always-transient current-prefix-arg)))
|
||||
@@ -136,6 +142,18 @@ the name of the owner. Also see `magit-clone-name-alist'."
|
||||
(transient-setup #'magit-clone)
|
||||
(call-interactively #'magit-clone-regular)))
|
||||
|
||||
(transient-define-argument magit-clone:--filter ()
|
||||
:description "Filter some objects"
|
||||
:class 'transient-option
|
||||
:key "-f"
|
||||
:argument "--filter="
|
||||
:reader 'magit-clone-read-filter)
|
||||
|
||||
(defun magit-clone-read-filter (prompt initial-input history)
|
||||
(magit-completing-read prompt
|
||||
(list "blob:none" "tree:0")
|
||||
nil nil initial-input history))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-clone-regular (repository directory args)
|
||||
"Create a clone of REPOSITORY in DIRECTORY.
|
||||
@@ -193,7 +211,14 @@ Then show the status buffer for the new repository."
|
||||
(interactive (magit-clone-read-args))
|
||||
(magit-clone-internal repository directory (cons "--mirror" args)))
|
||||
|
||||
(defun magit-clone-internal (repository directory args)
|
||||
;;;###autoload
|
||||
(defun magit-clone-sparse (repository directory args)
|
||||
"Clone REPOSITORY into DIRECTORY and create a sparse checkout."
|
||||
(interactive (magit-clone-read-args))
|
||||
(magit-clone-internal repository directory (cons "--no-checkout" args)
|
||||
'sparse))
|
||||
|
||||
(defun magit-clone-internal (repository directory args &optional sparse)
|
||||
(let* ((checkout (not (memq (car args) '("--bare" "--mirror"))))
|
||||
(remote (or (transient-arg-value "--origin" args)
|
||||
(magit-get "clone.defaultRemote")
|
||||
@@ -234,6 +259,13 @@ Then show the status buffer for the new repository."
|
||||
(setf (magit-get "remote.pushDefault") remote))
|
||||
(unless magit-clone-set-remote-head
|
||||
(magit-remote-unset-head remote))))
|
||||
(when (and sparse checkout)
|
||||
(when (magit-git-version< "2.25.0")
|
||||
(user-error
|
||||
"`git sparse-checkout' not available until Git v2.25"))
|
||||
(let ((default-directory directory))
|
||||
(magit-call-git "sparse-checkout" "init" "--cone")
|
||||
(magit-call-git "checkout" (magit-get-current-branch))))
|
||||
(with-current-buffer (process-get process 'command-buf)
|
||||
(magit-status-setup-buffer directory)))))))
|
||||
|
||||
|
||||
@@ -952,9 +952,9 @@ and `:slant'."
|
||||
:reader 'magit-read-files
|
||||
:multi-value t)
|
||||
|
||||
(defun magit-read-files (prompt initial-input history)
|
||||
(defun magit-read-files (prompt initial-input history &optional list-fn)
|
||||
(magit-completing-read-multiple* prompt
|
||||
(magit-list-files)
|
||||
(funcall (or list-fn #'magit-list-files))
|
||||
nil nil
|
||||
(or initial-input (magit-file-at-point))
|
||||
history))
|
||||
@@ -2058,7 +2058,7 @@ Staging and applying changes is documented in info node
|
||||
(when (and (not (equal cmd "merge-tree"))
|
||||
(pcase (magit-repository-local-get 'diff-ita-kludge-p 'unset)
|
||||
(`unset
|
||||
(let ((val (version<= "2.19.0" (magit-git-version))))
|
||||
(let ((val (magit-git-version>= "2.19.0")))
|
||||
(magit-repository-local-set 'diff-ita-kludge-p val)
|
||||
val))
|
||||
(val val)))
|
||||
|
||||
@@ -297,6 +297,7 @@ with two prefix arguments remove ignored files only.
|
||||
|
||||
;;; ChangeLog
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-generate-changelog (&optional amending)
|
||||
"Insert ChangeLog entries into the current buffer.
|
||||
|
||||
|
||||
@@ -190,11 +190,11 @@ with a prefix argument."
|
||||
(list nil (transient-args 'magit-fetch-modules))))
|
||||
(if transient
|
||||
(transient-setup 'magit-fetch-modules)
|
||||
(let ((git-version (magit-git-version)))
|
||||
(when (version< git-version "2.8.0")
|
||||
(when-let ((value (transient-arg-value "--jobs=" args)))
|
||||
(message "Dropping --jobs; not supported by Git v%s" git-version)
|
||||
(setq args (remove (format "--jobs=%s" value) args)))))
|
||||
(when (magit-git-version< "2.8.0")
|
||||
(when-let ((value (transient-arg-value "--jobs=" args)))
|
||||
(message "Dropping --jobs; not supported by Git v%s"
|
||||
(magit-git-version))
|
||||
(setq args (remove (format "--jobs=%s" value) args))))
|
||||
(magit-with-toplevel
|
||||
(magit-run-git-async "fetch" "--recurse-submodules" args))))
|
||||
|
||||
|
||||
@@ -575,11 +575,20 @@ call function WASHER with ARGS as its sole argument."
|
||||
(magit-maybe-make-margin-overlay))))
|
||||
|
||||
(defun magit-git-version (&optional raw)
|
||||
"Return the installed Git version."
|
||||
(--when-let (let (magit-git-global-arguments)
|
||||
(ignore-errors (substring (magit-git-string "version") 12)))
|
||||
(if raw it (and (string-match "\\`\\([0-9]+\\(\\.[0-9]+\\)\\{1,2\\}\\)" it)
|
||||
(match-string 1 it)))))
|
||||
|
||||
(defun magit-git-version>= (n)
|
||||
"Return t if `magit-git-version's value is greater than or equal to N."
|
||||
(magit--version>= (magit-git-version) n))
|
||||
|
||||
(defun magit-git-version< (n)
|
||||
"Return t if `magit-git-version's value is smaller than N."
|
||||
(version< (magit-git-version) n))
|
||||
|
||||
;;; Variables
|
||||
|
||||
(defun magit-config-get-from-cached-list (key)
|
||||
@@ -914,6 +923,12 @@ tracked file."
|
||||
(defun magit-untracked-files (&optional all files)
|
||||
(magit-list-files "--other" (unless all "--exclude-standard") "--" files))
|
||||
|
||||
(defun magit-modified-files (&optional nomodules files)
|
||||
(delete-consecutive-dups
|
||||
(sort (nconc (magit-staged-files nomodules files)
|
||||
(magit-unstaged-files nomodules files))
|
||||
#'string<)))
|
||||
|
||||
(defun magit-unstaged-files (&optional nomodules files)
|
||||
(magit-git-items "diff-files" "-z" "--name-only"
|
||||
(and nomodules "--ignore-submodules")
|
||||
@@ -952,6 +967,12 @@ tracked file."
|
||||
(magit-with-toplevel
|
||||
(magit-git-items "ls-tree" "-z" "-r" "--name-only" rev)))
|
||||
|
||||
(defun magit-revision-directories (rev)
|
||||
"List directories that contain a tracked file in revision REV."
|
||||
(magit-with-toplevel
|
||||
(mapcar #'file-name-as-directory
|
||||
(magit-git-items "ls-tree" "-z" "-r" "-d" "--name-only" rev))))
|
||||
|
||||
(defun magit-changed-files (rev-or-range &optional other-rev)
|
||||
"Return list of files the have changed between two revisions.
|
||||
If OTHER-REV is non-nil, REV-OR-RANGE should be a revision, not a
|
||||
@@ -1199,7 +1220,7 @@ ref that should have been excluded, then that is discarded and
|
||||
this function returns nil instead. This is unfortunate because
|
||||
there might be other refs that do match. To fix that, update
|
||||
Git."
|
||||
(if (version< (magit-git-version) "2.13")
|
||||
(if (magit-git-version< "2.13")
|
||||
(when-let
|
||||
((ref (magit-git-string "name-rev" "--name-only" "--no-undefined"
|
||||
(and pattern (concat "--refs=" pattern))
|
||||
@@ -1691,7 +1712,9 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of
|
||||
((and val (pred listp)) val)))
|
||||
(or namespaces magit-list-refs-namespaces))))
|
||||
(if (member format '("%(refname)" "%(refname:short)"))
|
||||
(--remove (string-match-p "\\(\\`\\|/\\)HEAD\\'" it) refs)
|
||||
(let ((case-fold-search nil))
|
||||
(--remove (string-match-p "\\(\\`\\|/\\)HEAD\\'" it)
|
||||
refs))
|
||||
refs)))
|
||||
|
||||
(defun magit-list-branches ()
|
||||
@@ -1959,12 +1982,13 @@ Return a list of two integers: (A>B B>A)."
|
||||
(cdr (split-string it))))
|
||||
|
||||
(defun magit-patch-id (rev)
|
||||
(magit--with-temp-process-buffer
|
||||
(magit-process-file
|
||||
shell-file-name nil '(t nil) nil shell-command-switch
|
||||
(let ((exec (shell-quote-argument (magit-git-executable))))
|
||||
(format "%s diff-tree -u %s | %s patch-id" exec rev exec)))
|
||||
(car (split-string (buffer-string)))))
|
||||
(magit--with-connection-local-variables
|
||||
(magit--with-temp-process-buffer
|
||||
(magit-process-file
|
||||
shell-file-name nil '(t nil) nil shell-command-switch
|
||||
(let ((exec (shell-quote-argument (magit-git-executable))))
|
||||
(format "%s diff-tree -u %s | %s patch-id" exec rev exec)))
|
||||
(car (split-string (buffer-string))))))
|
||||
|
||||
(defun magit-rev-format (format &optional rev args)
|
||||
(let ((str (magit-git-string "show" "--no-patch"
|
||||
@@ -2160,7 +2184,7 @@ and this option only controls what face is used.")
|
||||
|
||||
(defun magit-update-ref (ref message rev &optional stashish)
|
||||
(let ((magit--refresh-cache nil))
|
||||
(or (if (not (version< (magit-git-version) "2.6.0"))
|
||||
(or (if (magit-git-version>= "2.6.0")
|
||||
(zerop (magit-call-git "update-ref" "--create-reflog"
|
||||
"-m" message ref rev
|
||||
(or (magit-rev-verify ref) "")))
|
||||
|
||||
@@ -153,7 +153,8 @@ Rules that are defined in that file affect all local repositories."
|
||||
(magit-with-toplevel
|
||||
(cl-set-difference
|
||||
(magit-list-files)
|
||||
(magit-skip-worktree-files))))))
|
||||
(magit-skip-worktree-files)
|
||||
:test #'equal)))))
|
||||
(magit-with-toplevel
|
||||
(magit-run-git "update-index" "--skip-worktree" "--" file)))
|
||||
|
||||
@@ -177,7 +178,8 @@ Rules that are defined in that file affect all local repositories."
|
||||
(magit-with-toplevel
|
||||
(cl-set-difference
|
||||
(magit-list-files)
|
||||
(magit-assume-unchanged-files))))))
|
||||
(magit-assume-unchanged-files)
|
||||
:test #'equal)))))
|
||||
(magit-with-toplevel
|
||||
(magit-run-git "update-index" "--assume-unchanged" "--" file)))
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
(&optional branch pull keyword))
|
||||
(declare-function magit-read-file-from-rev "magit-files"
|
||||
(rev prompt &optional default))
|
||||
(declare-function magit-rebase--get-state-lines "magit-sequence"
|
||||
(file))
|
||||
(declare-function magit-show-commit "magit-diff"
|
||||
(arg1 &optional arg2 arg3 arg4))
|
||||
(declare-function magit-reflog-format-subject "magit-reflog" (subject))
|
||||
@@ -437,20 +439,21 @@ the upstream isn't ahead of the current branch) show."
|
||||
("-p" "Show diffs" ("-p" "--patch")) ;2
|
||||
("-s" "Show diffstats" "--stat")] ;2
|
||||
[["Log"
|
||||
("l" "current" magit-log-current)
|
||||
("o" "other" magit-log-other)
|
||||
("h" "HEAD" magit-log-head)]
|
||||
("l" "current" magit-log-current)
|
||||
("h" "HEAD" magit-log-head)
|
||||
("u" "related" magit-log-related)
|
||||
("o" "other" magit-log-other)]
|
||||
[""
|
||||
("L" "local branches" magit-log-branches)
|
||||
("L" "local branches" magit-log-branches)
|
||||
("b" "all branches" magit-log-all-branches)
|
||||
("a" "all references" magit-log-all)
|
||||
(7 "B" "matching branches" magit-log-matching-branches)
|
||||
(7 "T" "matching tags" magit-log-matching-tags)
|
||||
("b" "all branches" magit-log-all-branches)
|
||||
("a" "all references" magit-log-all)
|
||||
(7 "m" "merged" magit-log-merged)]
|
||||
(7 "T" "matching tags" magit-log-matching-tags)
|
||||
(7 "m" "merged" magit-log-merged)]
|
||||
["Reflog"
|
||||
("r" "current" magit-reflog-current)
|
||||
("O" "other" magit-reflog-other)
|
||||
("H" "HEAD" magit-reflog-head)]
|
||||
("r" "current" magit-reflog-current)
|
||||
("H" "HEAD" magit-reflog-head)
|
||||
("O" "other" magit-reflog-other)]
|
||||
[:if (lambda ()
|
||||
(require 'magit-wip)
|
||||
(magit--any-wip-mode-enabled-p))
|
||||
@@ -634,6 +637,41 @@ one or more revs read from the minibuffer."
|
||||
(magit-log-arguments)))
|
||||
(magit-log-setup-buffer revs args files))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-head (&optional args files)
|
||||
"Show log for `HEAD'."
|
||||
(interactive (magit-log-arguments))
|
||||
(magit-log-setup-buffer (list "HEAD") args files))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-related (revs &optional args files)
|
||||
"Show log for the current branch, its upstream and its push target.
|
||||
When the upstream is a local branch, then also show its own
|
||||
upstream. When `HEAD' is detached, then show log for that, the
|
||||
previously checked out branch and its upstream and push-target."
|
||||
(interactive
|
||||
(cons (let ((current (magit-get-current-branch))
|
||||
head rebase target upstream upup)
|
||||
(unless current
|
||||
(setq rebase (magit-rebase--get-state-lines "head-name"))
|
||||
(cond (rebase
|
||||
(setq rebase (magit-ref-abbrev rebase))
|
||||
(setq current rebase)
|
||||
(setq head "HEAD"))
|
||||
(t (setq current (magit-get-previous-branch)))))
|
||||
(cond (current
|
||||
(setq current
|
||||
(magit--propertize-face current'magit-branch-local))
|
||||
(setq target (magit-get-push-branch current t))
|
||||
(setq upstream (magit-get-upstream-branch current))
|
||||
(when upstream
|
||||
(setq upup (and (magit-local-branch-p upstream)
|
||||
(magit-get-upstream-branch upstream)))))
|
||||
(t (setq head "HEAD")))
|
||||
(delq nil (list current head target upstream upup)))
|
||||
(magit-log-arguments)))
|
||||
(magit-log-setup-buffer revs args files))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-other (revs &optional args files)
|
||||
"Show log for one or more revs read from the minibuffer.
|
||||
@@ -645,12 +683,6 @@ completion candidates."
|
||||
(magit-log-arguments)))
|
||||
(magit-log-setup-buffer revs args files))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-head (&optional args files)
|
||||
"Show log for `HEAD'."
|
||||
(interactive (magit-log-arguments))
|
||||
(magit-log-setup-buffer (list "HEAD") args files))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-branches (&optional args files)
|
||||
"Show log for all local branches and `HEAD'."
|
||||
|
||||
@@ -403,6 +403,7 @@ recommended value."
|
||||
(define-key map "%" 'magit-worktree)
|
||||
(define-key map "$" 'magit-process-buffer)
|
||||
(define-key map "!" 'magit-run)
|
||||
(define-key map ">" 'magit-sparse-checkout)
|
||||
(define-key map (kbd "C-c C-c") 'magit-dispatch)
|
||||
(define-key map (kbd "C-c C-e") 'magit-edit-thing)
|
||||
(define-key map (kbd "C-c C-o") 'magit-browse-thing)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
(define-package "magit" "20220102.1825" "A Git porcelain inside Emacs."
|
||||
(define-package "magit" "20220126.1645" "A Git porcelain inside Emacs."
|
||||
'((emacs "25.1")
|
||||
(dash "20210826")
|
||||
(git-commit "20211004")
|
||||
(magit-section "20211004")
|
||||
(transient "20210920")
|
||||
(with-editor "20211001"))
|
||||
:commit "2e73b66c2980abb9211d9881a8710c8ac5a33184" :authors
|
||||
:commit "6ba3b50373fffa89ae99fc0ad5135e3d574f6df4" :authors
|
||||
'(("Marius Vollmer" . "marius.vollmer@gmail.com")
|
||||
("Jonas Bernoulli" . "jonas@bernoul.li"))
|
||||
:maintainer
|
||||
|
||||
@@ -426,7 +426,7 @@ without prompting."
|
||||
("-k" "Inhibit removal of email cruft" ("-k" "--keep"))
|
||||
("-b" "Limit removal of email cruft" "--keep-non-patch")
|
||||
("-d" "Use author date as committer date" "--committer-date-is-author-date")
|
||||
("-D" "Use committer date as author date" "--ignore-date")
|
||||
("-t" "Use current time as author date" "--ignore-date")
|
||||
("-s" "Add Signed-off-by lines" ("-s" "--signoff"))
|
||||
(5 magit:--gpg-sign)]
|
||||
["Apply"
|
||||
@@ -514,18 +514,22 @@ This discards all changes made since the sequence started."
|
||||
["Arguments"
|
||||
:if-not magit-rebase-in-progress-p
|
||||
("-k" "Keep empty commits" "--keep-empty")
|
||||
("-p" "Preserve merges" ("-p" "--preserve-merges"))
|
||||
("-p" "Preserve merges" ("-p" "--preserve-merges")
|
||||
:if (lambda () (magit-git-version< "2.33.0")))
|
||||
("-r" "Rebase merges" ("-r" "--rebase-merges=")
|
||||
magit-rebase-merges-select-mode
|
||||
:if (lambda () (magit-git-version>= "2.18.0")))
|
||||
(7 magit-merge:--strategy)
|
||||
(7 magit-merge:--strategy-option)
|
||||
(7 "=X" magit-diff:--diff-algorithm :argument "-Xdiff-algorithm=")
|
||||
("-d" "Lie about committer date" "--committer-date-is-author-date")
|
||||
("-d" "Use author date as committer date" "--committer-date-is-author-date")
|
||||
("-t" "Use current time as author date" "--ignore-date")
|
||||
("-a" "Autosquash" "--autosquash")
|
||||
("-A" "Autostash" "--autostash")
|
||||
("-i" "Interactive" ("-i" "--interactive"))
|
||||
("-h" "Disable hooks" "--no-verify")
|
||||
(7 magit-rebase:--exec)
|
||||
(5 magit:--gpg-sign)
|
||||
(5 "-r" "Rebase merges" "--rebase-merges=" magit-rebase-merges-select-mode)]
|
||||
(5 magit:--gpg-sign)]
|
||||
[:if-not magit-rebase-in-progress-p
|
||||
:description (lambda ()
|
||||
(format (propertize "Rebase %s onto" 'face 'transient-heading)
|
||||
@@ -852,6 +856,15 @@ edit. With a prefix argument the old message is reused as-is."
|
||||
(defun magit--rebase-resume-command ()
|
||||
(if (file-exists-p (magit-git-dir "rebase-recursive")) "rbr" "rebase"))
|
||||
|
||||
(defun magit-rebase--get-state-lines (file)
|
||||
(and (magit-rebase-in-progress-p)
|
||||
(magit-file-line
|
||||
(magit-git-dir
|
||||
(concat (if (file-directory-p (magit-git-dir "rebase-merge"))
|
||||
"rebase-merge/"
|
||||
"rebase-apply/")
|
||||
file)))))
|
||||
|
||||
;;; Sections
|
||||
|
||||
(defun magit-insert-sequencer-sequence ()
|
||||
|
||||
173
lisp/magit/magit-sparse-checkout.el
Normal file
173
lisp/magit/magit-sparse-checkout.el
Normal file
@@ -0,0 +1,173 @@
|
||||
;;; magit-sparse-checkout.el --- sparse checkout support for Magit -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2022 The Magit Project Contributors
|
||||
;;
|
||||
;; You should have received a copy of the AUTHORS.md file which
|
||||
;; lists all contributors. If not, see http://magit.vc/authors.
|
||||
|
||||
;; Author: Kyle Meyer <kyle@kyleam.com>
|
||||
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
|
||||
|
||||
;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
;; Magit is free software; you can redistribute it and/or modify it
|
||||
;; under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; Magit is distributed in the hope that it will be useful, but WITHOUT
|
||||
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
;; License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with Magit. If not, see http://www.gnu.org/licenses.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This library provides an interface to the `git sparse-checkout'
|
||||
;; command. It's been possible to define sparse checkouts since Git
|
||||
;; v1.7.0 by adding patterns to $GIT_DIR/info/sparse-checkout and
|
||||
;; calling `git read-tree -mu HEAD' to update the index and working
|
||||
;; tree. However, Git v2.25 introduced the `git sparse-checkout'
|
||||
;; command along with "cone mode", which restricts the possible
|
||||
;; patterns to directories to provide better performance.
|
||||
;;
|
||||
;; The goal of this library is to support the `git sparse-checkout'
|
||||
;; command operating in cone mode.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'magit)
|
||||
|
||||
;;; Utilities
|
||||
|
||||
(defun magit-sparse-checkout-enabled-p ()
|
||||
"Return non-nil if working tree is a sparse checkout."
|
||||
(magit-get-boolean "core.sparsecheckout"))
|
||||
|
||||
(defun magit-sparse-checkout--assert-version ()
|
||||
;; Older versions of Git have the ability to define sparse checkout
|
||||
;; patterns in .git/info/sparse-checkout, but the sparse-checkout
|
||||
;; command isn't available until 2.25.0.
|
||||
(when (magit-git-version< "2.25.0")
|
||||
(user-error "`git sparse-checkout' not available until Git v2.25")))
|
||||
|
||||
(defun magit-sparse-checkout--auto-enable ()
|
||||
(if (magit-sparse-checkout-enabled-p)
|
||||
(unless (magit-get-boolean "core.sparsecheckoutcone")
|
||||
(user-error
|
||||
"Magit's sparse checkout functionality requires cone mode"))
|
||||
;; Note: Don't use `magit-sparse-checkout-enable' because it's
|
||||
;; asynchronous.
|
||||
(magit-run-git "sparse-checkout" "init" "--cone")))
|
||||
|
||||
(defun magit-sparse-checkout-directories ()
|
||||
"Return directories that are recursively included in the sparse checkout.
|
||||
See the `git sparse-checkout' manpage for details about
|
||||
\"recursive\" versus \"parent\" directories in cone mode."
|
||||
(and (magit-get-boolean "core.sparsecheckoutcone")
|
||||
(mapcar #'file-name-as-directory
|
||||
(magit-git-lines "sparse-checkout" "list"))))
|
||||
|
||||
;;; Commands
|
||||
|
||||
;;;###autoload (autoload 'magit-sparse-checkout "magit-sparse-checkout" nil t)
|
||||
(transient-define-prefix magit-sparse-checkout ()
|
||||
"Create and manage sparse checkouts."
|
||||
:man-page "git-sparse-checkout"
|
||||
["Arguments for enabling"
|
||||
:if-not magit-sparse-checkout-enabled-p
|
||||
("-i" "Use sparse index" "--sparse-index")]
|
||||
["Actions"
|
||||
[:if-not magit-sparse-checkout-enabled-p
|
||||
("e" "Enable sparse checkout" magit-sparse-checkout-enable)]
|
||||
[:if magit-sparse-checkout-enabled-p
|
||||
("d" "Disable sparse checkout" magit-sparse-checkout-disable)
|
||||
("r" "Reapply rules" magit-sparse-checkout-reapply)]
|
||||
[("s" "Set directories" magit-sparse-checkout-set)
|
||||
("a" "Add directories" magit-sparse-checkout-add)]])
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-sparse-checkout-enable (&optional args)
|
||||
"Convert the working tree to a sparse checkout."
|
||||
(interactive (list (transient-args 'magit-sparse-checkout)))
|
||||
(magit-sparse-checkout--assert-version)
|
||||
(magit-run-git-async "sparse-checkout" "init" "--cone" args))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-sparse-checkout-set (directories)
|
||||
"Restrict working tree to DIRECTORIES.
|
||||
To extend rather than override the currently configured
|
||||
directories, call `magit-sparse-checkout-add' instead."
|
||||
(interactive
|
||||
(list (magit-completing-read-multiple*
|
||||
"Include these directories: "
|
||||
;; Note: Given that the appeal of sparse checkouts is
|
||||
;; dealing with very large trees, listing all subdirectories
|
||||
;; may need to be reconsidered.
|
||||
(magit-revision-directories "HEAD"))))
|
||||
(magit-sparse-checkout--assert-version)
|
||||
(magit-sparse-checkout--auto-enable)
|
||||
(magit-run-git-async "sparse-checkout" "set" directories))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-sparse-checkout-add (directories)
|
||||
"Add DIRECTORIES to the working tree.
|
||||
To override rather than extend the currently configured
|
||||
directories, call `magit-sparse-checkout-set' instead."
|
||||
(interactive
|
||||
(list (magit-completing-read-multiple*
|
||||
"Add these directories: "
|
||||
;; Same performance note as in `magit-sparse-checkout-set',
|
||||
;; but even more so given the additional processing.
|
||||
(seq-remove
|
||||
(let ((re (concat
|
||||
"\\`"
|
||||
(regexp-opt (magit-sparse-checkout-directories)))))
|
||||
(lambda (d) (string-match-p re d)))
|
||||
(magit-revision-directories "HEAD")))))
|
||||
(magit-sparse-checkout--assert-version)
|
||||
(magit-sparse-checkout--auto-enable)
|
||||
(magit-run-git-async "sparse-checkout" "add" directories))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-sparse-checkout-reapply ()
|
||||
"Reapply the sparse checkout rules to the working tree.
|
||||
Some operations such as merging or rebasing may need to check out
|
||||
files that aren't included in the sparse checkout. Call this
|
||||
command to reset to the sparse checkout state."
|
||||
(interactive)
|
||||
(magit-sparse-checkout--assert-version)
|
||||
(magit-run-git-async "sparse-checkout" "reapply"))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-sparse-checkout-disable ()
|
||||
"Convert sparse checkout to full checkout.
|
||||
Note that disabling the sparse checkout does not clear the
|
||||
configured directories. Call `magit-sparse-checkout-enable' to
|
||||
restore the previous sparse checkout."
|
||||
(interactive)
|
||||
(magit-sparse-checkout--assert-version)
|
||||
(magit-run-git-async "sparse-checkout" "disable"))
|
||||
|
||||
;;; Miscellaneous
|
||||
|
||||
(defun magit-sparse-checkout-insert-header ()
|
||||
"Insert header line with sparse checkout information.
|
||||
This header is not inserted by default. To enable it, add it to
|
||||
`magit-status-headers-hook'."
|
||||
(when (magit-sparse-checkout-enabled-p)
|
||||
(insert (propertize (format "%-10s" "Sparse! ")
|
||||
'font-lock-face 'magit-section-heading))
|
||||
(insert
|
||||
(let ((dirs (magit-sparse-checkout-directories)))
|
||||
(pcase (length dirs)
|
||||
(0 "top-level directory")
|
||||
(1 (car dirs))
|
||||
(n (format "%d directories" n)))))
|
||||
(insert ?\n)))
|
||||
|
||||
;;; _
|
||||
(provide 'magit-sparse-checkout)
|
||||
;;; magit-sparse-checkout.el ends here
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
(require 'magit)
|
||||
(require 'magit-reflog)
|
||||
(require 'magit-sequence)
|
||||
|
||||
;;; Options
|
||||
|
||||
@@ -95,7 +96,8 @@ AUTHOR-WIDTH has to be an integer. When the name of the author
|
||||
("z" "both" magit-stash-both)
|
||||
("i" "index" magit-stash-index)
|
||||
("w" "worktree" magit-stash-worktree)
|
||||
("x" "keeping index" magit-stash-keep-index)]
|
||||
("x" "keeping index" magit-stash-keep-index)
|
||||
("P" "push" magit-stash-push :level 5)]
|
||||
["Snapshot"
|
||||
("Z" "both" magit-snapshot-both)
|
||||
("I" "index" magit-snapshot-index)
|
||||
@@ -210,6 +212,30 @@ while two prefix arguments are equivalent to `--all'."
|
||||
(magit-stash-save (concat "WIP on " (magit-stash-summary))
|
||||
index worktree untracked refresh t))
|
||||
|
||||
;;;###autoload (autoload 'magit-stash-push "magit-stash" nil t)
|
||||
(transient-define-prefix magit-stash-push (&optional transient args)
|
||||
"Create stash using \"git stash push\".
|
||||
|
||||
This differs from Magit's other stashing commands, which don't
|
||||
use \"git stash\" and are generally more flexible but don't allow
|
||||
specifying a list of files to be stashed."
|
||||
:man-page "git-stash"
|
||||
["Arguments"
|
||||
(magit:-- :reader ,(-rpartial #'magit-read-files
|
||||
#'magit-modified-files))
|
||||
("-u" "Also save untracked files" ("-u" "--include-untracked"))
|
||||
("-a" "Also save untracked and ignored files" ("-a" "--all"))
|
||||
("-k" "Keep index" ("-k" "--keep-index"))
|
||||
("-K" "Don't keep index" "--no-keep-index")]
|
||||
["Actions"
|
||||
("P" "push" magit-stash-push)]
|
||||
(interactive (if (eq transient-current-command 'magit-stash-push)
|
||||
(list nil (transient-args 'magit-stash-push))
|
||||
(list t)))
|
||||
(if transient
|
||||
(transient-setup 'magit-stash-push)
|
||||
(magit-run-git "stash" "push" args)))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-stash-apply (stash)
|
||||
"Apply a stash to the working tree.
|
||||
@@ -374,14 +400,7 @@ If optional REF is non-nil, show reflog for that instead.
|
||||
If optional HEADING is non-nil, use that as section heading
|
||||
instead of \"Stashes:\"."
|
||||
(let ((verified (magit-rev-verify ref))
|
||||
(autostash
|
||||
(and (magit-rebase-in-progress-p)
|
||||
(thread-first
|
||||
(if (file-directory-p (magit-git-dir "rebase-merge"))
|
||||
"rebase-merge/autostash"
|
||||
"rebase-apply/autostash")
|
||||
magit-git-dir
|
||||
magit-file-line))))
|
||||
(autostash (magit-rebase--get-state-lines "autostash")))
|
||||
(when (or autostash verified)
|
||||
(magit-insert-section (stashes ref)
|
||||
(magit-insert-heading heading)
|
||||
|
||||
@@ -340,7 +340,7 @@ init file: (global-set-key (kbd \"C-x g\") 'magit-status-quick)."
|
||||
(unless (member remote magit--remotes-using-recent-git)
|
||||
(if-let ((version (let ((default-directory directory))
|
||||
(magit-git-version))))
|
||||
(if (version<= magit--minimal-git version)
|
||||
(if (magit--version>= version magit--minimal-git)
|
||||
(push remote magit--remotes-using-recent-git)
|
||||
(display-warning 'magit (format "\
|
||||
Magit requires Git >= %s, but on %s the version is %s.
|
||||
|
||||
@@ -225,7 +225,7 @@ it is nil, then PATH also becomes the name."
|
||||
(magit-process-sentinel process event)
|
||||
(process-put process 'inhibit-refresh t)
|
||||
(magit-process-sentinel process event)
|
||||
(unless (version< (magit-git-version) "2.12.0")
|
||||
(when (magit-git-version>= "2.12.0")
|
||||
(magit-call-git "submodule" "absorbgitdirs" path))
|
||||
(magit-refresh)))))))
|
||||
|
||||
@@ -360,7 +360,7 @@ to recover from making a mistake here, but don't count on it."
|
||||
(list (magit-read-module-path "Remove module")))
|
||||
(magit-submodule-arguments "--force")
|
||||
current-prefix-arg))
|
||||
(when (version< (magit-git-version) "2.12.0")
|
||||
(when (magit-git-version< "2.12.0")
|
||||
(error "This command requires Git v2.12.0"))
|
||||
(when magit-submodule-remove-trash-gitdirs
|
||||
(setq trash-gitdirs t))
|
||||
@@ -383,14 +383,14 @@ to recover from making a mistake here, but don't count on it."
|
||||
(expand-file-name module))))
|
||||
(magit-git "stash" "push"
|
||||
"-m" "backup before removal of this module")))
|
||||
(setq modules (cl-set-difference modules modified)))
|
||||
(setq modules (cl-set-difference modules modified :test #'equal)))
|
||||
(if (cdr modified)
|
||||
(message "Omitting %s modules with uncommitted changes: %s"
|
||||
(length modified)
|
||||
(mapconcat #'identity modified ", "))
|
||||
(message "Omitting module %s, it has uncommitted changes"
|
||||
(car modified)))
|
||||
(setq modules (cl-set-difference modules modified))))
|
||||
(setq modules (cl-set-difference modules modified :test #'equal))))
|
||||
(when modules
|
||||
(let ((alist
|
||||
(and trash-gitdirs
|
||||
|
||||
@@ -1010,6 +1010,16 @@ one trailing newline is added."
|
||||
(and (eq trim ?\n) "\n"))
|
||||
str)))
|
||||
|
||||
(defun magit--version> (v1 v2)
|
||||
"Return t if version V1 is higher (younger) than V2.
|
||||
This function should be named `version>' and be part of Emacs."
|
||||
(version-list-< (version-to-list v2) (version-to-list v1)))
|
||||
|
||||
(defun magit--version>= (v1 v2)
|
||||
"Return t if version V1 is higher (younger) than or equal to V2.
|
||||
This function should be named `version>=' and be part of Emacs."
|
||||
(version-list-<= (version-to-list v2) (version-to-list v1)))
|
||||
|
||||
;;; Kludges for Emacs Bugs
|
||||
|
||||
(defun magit-file-accessible-directory-p (filename)
|
||||
@@ -1019,7 +1029,7 @@ and https://github.com/magit/magit/issues/2295."
|
||||
(and (file-directory-p filename)
|
||||
(file-accessible-directory-p filename)))
|
||||
|
||||
(when (version<= "25.1" emacs-version)
|
||||
(when (magit--version>= emacs-version "25.1")
|
||||
(with-eval-after-load 'vc-git
|
||||
(defun vc-git-conflicted-files (directory)
|
||||
"Return the list of files with conflicts in DIRECTORY."
|
||||
@@ -1158,6 +1168,9 @@ or (last of all) the value of EXP."
|
||||
(advice-add 'Info-follow-nearest-node :around
|
||||
'Info-follow-nearest-node--magit-gitman)
|
||||
|
||||
;; When making changes here, then also adjust the copy in docs/Makefile.
|
||||
;;;###autoload
|
||||
(advice-add 'org-man-export :around 'org-man-export--magit-gitman)
|
||||
;;;###autoload
|
||||
(defun org-man-export--magit-gitman (fn link description format)
|
||||
(if (and (eq format 'texinfo)
|
||||
@@ -1177,10 +1190,6 @@ the %s(1) manpage.
|
||||
")
|
||||
(funcall fn link description format)))
|
||||
|
||||
;;;###autoload
|
||||
(advice-add 'org-man-export :around
|
||||
'org-man-export--magit-gitman)
|
||||
|
||||
;;; Kludges for Package Managers
|
||||
|
||||
(defun magit--straight-chase-links (filename)
|
||||
@@ -1198,6 +1207,32 @@ See <https://github.com/raxod502/straight.el/issues/520>."
|
||||
(setq filename target))))
|
||||
(file-chase-links filename))
|
||||
|
||||
;;; Kludges for older Emacs versions
|
||||
|
||||
(if (fboundp 'with-connection-local-variables)
|
||||
(defalias 'magit--with-connection-local-variables
|
||||
'with-connection-local-variables)
|
||||
(defmacro magit--with-connection-local-variables (&rest body)
|
||||
"Abridged `with-connection-local-variables' for pre Emacs 27 compatibility.
|
||||
Bind shell file name and switch for remote execution.
|
||||
`with-connection-local-variables' isn't available until Emacs 27.
|
||||
This kludge provides the minimal functionality required by
|
||||
Magit."
|
||||
`(if (file-remote-p default-directory)
|
||||
(pcase-let ((`(,shell-file-name ,shell-command-switch)
|
||||
(with-no-warnings ; about unknown tramp functions
|
||||
(require 'tramp)
|
||||
(let ((vec (tramp-dissect-file-name
|
||||
default-directory)))
|
||||
(list (tramp-get-method-parameter
|
||||
vec 'tramp-remote-shell)
|
||||
(mapconcat #'identity
|
||||
(tramp-get-method-parameter
|
||||
vec 'tramp-remote-shell-args)
|
||||
" "))))))
|
||||
,@body)
|
||||
,@body)))
|
||||
|
||||
;;; Miscellaneous
|
||||
|
||||
(defun magit-message (format-string &rest args)
|
||||
|
||||
@@ -304,8 +304,7 @@ commit message."
|
||||
(and (pcase (magit-repository-local-get
|
||||
'update-index-has-ignore-sw-p 'unset)
|
||||
(`unset
|
||||
(let ((val (version<= "2.25.0"
|
||||
(magit-git-version))))
|
||||
(let ((val (magit-git-version>= "2.25.0")))
|
||||
(magit-repository-local-set
|
||||
'update-index-has-ignore-sw-p val)
|
||||
val))
|
||||
|
||||
@@ -447,8 +447,9 @@ is run in the top-level directory of the current working tree."
|
||||
(let ((default-directory (or directory default-directory))
|
||||
(process-environment process-environment))
|
||||
(push "GIT_PAGER=cat" process-environment)
|
||||
(magit-start-process shell-file-name nil
|
||||
shell-command-switch command))
|
||||
(magit--with-connection-local-variables
|
||||
(magit-start-process shell-file-name nil
|
||||
shell-command-switch command)))
|
||||
(magit-process-buffer))
|
||||
|
||||
(defun magit-read-shell-command (&optional toplevel initial-input)
|
||||
@@ -566,7 +567,8 @@ and Emacs to it."
|
||||
(when print-dest
|
||||
(princ (format "Magit %s%s, Git %s, Emacs %s, %s"
|
||||
(or magit-version "(unknown)")
|
||||
(or (and (ignore-errors (version< "2008" magit-version))
|
||||
(or (and (ignore-errors
|
||||
(magit--version>= magit-version "2008"))
|
||||
(ignore-errors
|
||||
(require 'lisp-mnt)
|
||||
(and (fboundp 'lm-header)
|
||||
@@ -710,6 +712,7 @@ For X11 something like ~/.xinitrc should work.\n"
|
||||
(require 'magit-subtree)
|
||||
(require 'magit-ediff)
|
||||
(require 'magit-gitignore)
|
||||
(require 'magit-sparse-checkout)
|
||||
(require 'magit-extras)
|
||||
(require 'git-rebase)
|
||||
(require 'magit-imenu)
|
||||
|
||||
11228
lisp/magit/magit.info
11228
lisp/magit/magit.info
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -59,7 +59,8 @@
|
||||
| langtool | [[https://melpa.org/#/langtool][melpa]] | 2.2.1 | 20200529.230 | | | |
|
||||
| ledger-mode | [[https://melpa.org/#/ledger-mode][melpa]] | 4.0.0 | 20211214.1449 | 4.0.0 | 20210106.227 | |
|
||||
| lv | [[https://melpa.org/#/lv][melpa]] | - | 20200507.1518 | | | required by hydra |
|
||||
| magit | [[https://melpa.org/#/magit][melpa]] | 3.3.0 | 20220102.1825 | 3.0.0 | 20210105.1030 | IMPORTANT do not delete and change in magit-version.el the version, see also below |
|
||||
| magit | [[https://melpa.org/#/magit][melpa]] | 3.3.0 | 20220126.1645 | 3.0.0 | 20210105.1030 | IMPORTANT do not delete and change in magit-version.el the version, see also below |
|
||||
| magit-section | [[https://melpa.org/#/magit-section][melpa]] | 3.3.0 | 20220101.841 | | | required by magit |
|
||||
| markdown-mode.el | [[https://melpa.org/#/markdown-mode][melpa]] | 2.5-dev | 20211022.55 | 2.5-dev | 20210107.101 | |
|
||||
| memoize.el | [[https://melpa.org/#/memoize][melpa]] | 1.1 | 20200103.2036 | | | required by all-the-icons |
|
||||
| mu4e-maildirs-extension.el | [[https://melpa.org/#/mu4e-maildirs-extension][melpa]] | 0.1 | 20201028.921 | 0.1 | 20200508.712 | |
|
||||
@@ -173,6 +174,21 @@ du -h -s ~/repos/emacs-conf/lisp/emacs-application-framework/app/*
|
||||
version:
|
||||
git describe --tags --abbrev=0 --always \| cut -c2-
|
||||
magit-version.el template in git repo lisp/Makefile
|
||||
#+begin_src elisp
|
||||
;;; magit-version.el --- the Magit version you are using
|
||||
|
||||
(setq magit-version "3.3.0")
|
||||
|
||||
(provide 'migit-version)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; coding: utf-8
|
||||
;; End:
|
||||
;;; magit-version.el ends here
|
||||
#+end_src
|
||||
- yasnippet-snippets
|
||||
cd yasnippet-snippets/snippets/
|
||||
rm -r antlr-mode applescript-mode apples-mode bazel-mode chef-mode cider-repl-mode clojure-mode coq-mode cpp-omnet-mode crystal-modedart-mode dix-mode d-mode elixir-mode enh-ruby-mode ensime-mode erc-mode erlang-mode faust-mode fish-mode go-mode groovy-mode haskell-mode hy-mode java-mode julia-mode kotlin-mode lua-mode m4-mode makefile-automake-mode makefile-bsdmake-mode makefile-gmake-mode makefile-mode malabar-mode nasm-mode ned-mode nesc-mode nix-mode nsis-mode protobuf-mode racket-mode raku-mode reason-mode rjsx-mode ruby-mode rustic-mode rust-mode scala-mode swift-mode terraform-mode tuareg-mode typerex-mode typescript-mode udev-mode vhdl-mode
|
||||
|
||||
Reference in New Issue
Block a user