update packages
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
(require 'magit-core)
|
||||
(require 'magit-diff)
|
||||
|
||||
(declare-function magit--any-wip-mode-enabled-p "magit-wip" ())
|
||||
(declare-function magit-blob-visit "magit-files" (blob-or-file))
|
||||
(declare-function magit-cherry-apply "magit-sequence" (commit &optional args))
|
||||
(declare-function magit-insert-head-branch-header "magit-status"
|
||||
@@ -77,7 +78,7 @@
|
||||
:group 'magit-log
|
||||
:type 'hook)
|
||||
|
||||
(defcustom magit-log-remove-graph-args '("--follow" "--grep" "-G" "-S" "-L")
|
||||
(defcustom magit-log-remove-graph-args '("--follow" "-G" "-S" "-L")
|
||||
"The log arguments that cause the `--graph' argument to be dropped.
|
||||
|
||||
The default value lists the arguments that are incompatible with
|
||||
@@ -86,10 +87,10 @@ can add additional arguments that are available in `magit-log',
|
||||
but I recommend that you don't do that. Nowadays I would define
|
||||
this as a constant, but I am preserving it as an option, in case
|
||||
someone actually customized it."
|
||||
:package-version '(magit . "2.3.0")
|
||||
:package-version '(magit . "4.3.7")
|
||||
:group 'magit-log
|
||||
:type '(repeat (string :tag "Argument"))
|
||||
:options '("--follow" "--grep" "-G" "-S" "-L"))
|
||||
:options '("--follow" "-G" "-S" "-L"))
|
||||
|
||||
(defcustom magit-log-revision-headers-format "\
|
||||
%+b%+N
|
||||
@@ -173,9 +174,9 @@ want to use the same functions for both hooks."
|
||||
"Function used to generate text shown in header line of log buffers."
|
||||
:package-version '(magit . "2.12.0")
|
||||
:group 'magit-log
|
||||
:type `(choice (function-item ,#'magit-log-header-line-arguments)
|
||||
(function-item ,#'magit-log-header-line-sentence)
|
||||
function))
|
||||
:type `(radio (function-item ,#'magit-log-header-line-arguments)
|
||||
(function-item ,#'magit-log-header-line-sentence)
|
||||
function))
|
||||
|
||||
(defcustom magit-log-trace-definition-function #'magit-which-function
|
||||
"Function used to determine the function at point.
|
||||
@@ -184,10 +185,10 @@ You should prefer `magit-which-function' over `which-function'
|
||||
because the latter may make use of Imenu's outdated cache."
|
||||
:package-version '(magit . "3.0.0")
|
||||
:group 'magit-log
|
||||
:type `(choice (function-item ,#'magit-which-function)
|
||||
(function-item ,#'which-function)
|
||||
(function-item ,#'add-log-current-defun)
|
||||
function))
|
||||
:type `(radio (function-item ,#'magit-which-function)
|
||||
(function-item ,#'which-function)
|
||||
(function-item ,#'add-log-current-defun)
|
||||
function))
|
||||
|
||||
(defcustom magit-log-color-graph-limit 256
|
||||
"Number of commits over which log graphs are not colored.
|
||||
@@ -442,89 +443,92 @@ commits before and half after."
|
||||
;;; Commands
|
||||
;;;; Prefix Commands
|
||||
|
||||
(eval-and-compile
|
||||
(defvar magit-log-infix-arguments
|
||||
;; The grouping in git-log(1) appears to be guided by implementation
|
||||
;; details, so our logical grouping only follows it to an extend.
|
||||
;; Arguments that are "misplaced" here:
|
||||
;; 1. From "Commit Formatting".
|
||||
;; 2. From "Common Diff Options".
|
||||
;; 3. From unnamed first group.
|
||||
;; 4. Implemented by Magit.
|
||||
[:class transient-subgroups
|
||||
["Commit limiting"
|
||||
(magit-log:-n)
|
||||
(magit:--author)
|
||||
(7 magit-log:--since)
|
||||
(7 magit-log:--until)
|
||||
(magit-log:--grep)
|
||||
(7 "-i" "Search case-insensitive" ("-i" "--regexp-ignore-case"))
|
||||
(7 "-I" "Invert search pattern" "--invert-grep")
|
||||
(magit-log:-G) ;2
|
||||
(magit-log:-S) ;2
|
||||
(magit-log:-L) ;2
|
||||
(7 "=m" "Omit merges" "--no-merges")
|
||||
(7 "=p" "First parent" "--first-parent")]
|
||||
["History simplification"
|
||||
( "-D" "Simplify by decoration" "--simplify-by-decoration")
|
||||
(magit:--)
|
||||
( "-f" "Follow renames when showing single-file log" "--follow") ;3
|
||||
(6 "/s" "Only commits changing given paths" "--sparse")
|
||||
(7 "/d" "Only selected commits plus meaningful history" "--dense")
|
||||
(7 "/a" "Only commits existing directly on ancestry path" "--ancestry-path")
|
||||
(6 "/f" "Do not prune history" "--full-history")
|
||||
(7 "/m" "Prune some history" "--simplify-merges")]
|
||||
["Commit ordering"
|
||||
(magit-log:--*-order)
|
||||
("-r" "Reverse order" "--reverse")]
|
||||
["Formatting"
|
||||
("-g" "Show graph" "--graph") ;1
|
||||
("-c" "Show graph in color" "--color") ;2
|
||||
("-d" "Show refnames" "--decorate") ;3
|
||||
("=S" "Show signatures" "--show-signature") ;1
|
||||
("-h" "Show header" "++header") ;4
|
||||
("-p" "Show diffs" ("-p" "--patch")) ;2
|
||||
("-s" "Show diffstats" "--stat")] ;2
|
||||
]))
|
||||
(transient-define-group magit-log-infix-arguments
|
||||
;; The grouping in git-log(1) appears to be guided by implementation
|
||||
;; details, so our logical grouping only follows it to an extend.
|
||||
;; Arguments that are "misplaced" here:
|
||||
;; 1. From "Commit Formatting".
|
||||
;; 2. From "Common Diff Options".
|
||||
;; 3. From unnamed first group.
|
||||
;; 4. Implemented by Magit.
|
||||
["Commit limiting"
|
||||
:if magit-log-infix-arguments--show-p
|
||||
(magit-log:-n)
|
||||
(magit:--author)
|
||||
(7 magit-log:--since)
|
||||
(7 magit-log:--until)
|
||||
(magit-log:--grep)
|
||||
(7 "-i" "Search case-insensitive" ("-i" "--regexp-ignore-case"))
|
||||
(7 "-I" "Invert search pattern" "--invert-grep")
|
||||
(magit-log:-G) ;2
|
||||
(magit-log:-S) ;2
|
||||
(magit-log:-L) ;2
|
||||
(7 "=m" "Omit merges" "--no-merges")
|
||||
(7 "=p" "First parent" "--first-parent")]
|
||||
["History simplification"
|
||||
:if magit-log-infix-arguments--show-p
|
||||
( "-D" "Simplify by decoration" "--simplify-by-decoration")
|
||||
(magit:--)
|
||||
( "-f" "Follow renames when showing single-file log" "--follow") ;3
|
||||
(6 "/s" "Only commits changing given paths" "--sparse")
|
||||
(7 "/d" "Only selected commits plus meaningful history" "--dense")
|
||||
(7 "/a" "Only commits existing directly on ancestry path" "--ancestry-path")
|
||||
(6 "/f" "Do not prune history" "--full-history")
|
||||
(7 "/m" "Prune some history" "--simplify-merges")]
|
||||
["Commit ordering"
|
||||
:if magit-log-infix-arguments--show-p
|
||||
(magit-log:--*-order)
|
||||
("-r" "Reverse order" "--reverse")]
|
||||
["Formatting"
|
||||
:if magit-log-infix-arguments--show-p
|
||||
("-g" "Show graph" "--graph") ;1
|
||||
("-c" "Show graph in color" "--color") ;2
|
||||
("-d" "Show refnames" "--decorate") ;3
|
||||
("=S" "Show signatures" "--show-signature") ;1
|
||||
("-h" "Show header" "++header") ;4
|
||||
("-p" "Show diffs" ("-p" "--patch")) ;2
|
||||
("-s" "Show diffstats" "--stat")]) ;2
|
||||
|
||||
(defun magit-log-infix-arguments--show-p ()
|
||||
(if (eq (oref (transient-prefix-object) command) 'magit-log-refresh)
|
||||
(eq major-mode 'magit-log-mode)
|
||||
t))
|
||||
|
||||
;;;###autoload (autoload 'magit-log "magit-log" nil t)
|
||||
(transient-define-prefix magit-log ()
|
||||
"Show a commit or reference log."
|
||||
:man-page "git-log"
|
||||
:class 'magit-log-prefix
|
||||
[magit-log-infix-arguments]
|
||||
'magit-log-infix-arguments
|
||||
[["Log"
|
||||
("l" "current" magit-log-current)
|
||||
("h" "HEAD" magit-log-head)
|
||||
("u" "related" magit-log-related)
|
||||
("o" "other" magit-log-other)]
|
||||
("l" magit-log-current)
|
||||
("o" "other" magit-log-other)
|
||||
("h" "HEAD" magit-log-head :level 0)
|
||||
("u" "related" magit-log-related)]
|
||||
[""
|
||||
("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)
|
||||
(7 "m" "merged" magit-log-merged)]
|
||||
("L" "local branches" magit-log-branches)
|
||||
("b" "all branches" magit-log-all-branches)
|
||||
("a" "all references" magit-log-all)
|
||||
("B" "matching branches" magit-log-matching-branches :level 7)
|
||||
("T" "matching tags" magit-log-matching-tags :level 7)
|
||||
("m" "merged" magit-log-merged :level 7)]
|
||||
["Reflog"
|
||||
("r" "current" magit-reflog-current)
|
||||
("H" "HEAD" magit-reflog-head)
|
||||
("O" "other" magit-reflog-other)]
|
||||
[:if (lambda ()
|
||||
(and (fboundp 'magit--any-wip-mode-enabled-p)
|
||||
(magit--any-wip-mode-enabled-p)))
|
||||
("r" "current" magit-reflog-current)
|
||||
("O" "other" magit-reflog-other)
|
||||
("H" "HEAD" magit-reflog-head)]
|
||||
[:if magit--any-wip-mode-enabled-p
|
||||
:description "Wiplog"
|
||||
("i" "index" magit-wip-log-index)
|
||||
("w" "worktree" magit-wip-log-worktree)]
|
||||
("i" "index" magit-wip-log-index)
|
||||
("w" "worktree" magit-wip-log-worktree)]
|
||||
["Other"
|
||||
(5 "s" "shortlog" magit-shortlog)]])
|
||||
("s" "shortlog" magit-shortlog)]])
|
||||
|
||||
;;;###autoload (autoload 'magit-log-refresh "magit-log" nil t)
|
||||
(transient-define-prefix magit-log-refresh ()
|
||||
"Change the arguments used for the log(s) in the current buffer."
|
||||
:man-page "git-log"
|
||||
:class 'magit-log-refresh-prefix
|
||||
[:if-mode magit-log-mode
|
||||
magit-log-infix-arguments]
|
||||
magit-log-infix-arguments
|
||||
[:if-not-mode magit-log-mode
|
||||
:description "Arguments"
|
||||
(magit-log:-n)
|
||||
@@ -652,14 +656,13 @@ commits before and half after."
|
||||
"Read a string from the user to pass as parameter to OPTION."
|
||||
(magit-read-string (format "Type a pattern to pass to %s" option)))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-current (revs &optional args files)
|
||||
"Show log for the current branch.
|
||||
When `HEAD' is detached or with a prefix argument show log for
|
||||
one or more revs read from the minibuffer."
|
||||
(interactive (cons (magit-log-read-revs t)
|
||||
(magit-log-arguments)))
|
||||
(magit-log-setup-buffer revs args files))
|
||||
;;;###autoload (autoload 'magit-log-current "magit-log" nil t)
|
||||
(transient-define-suffix magit-log-current (&optional args files)
|
||||
"Show log for the current branch, or `HEAD' if no branch is checked out."
|
||||
:description (##if (magit-get-current-branch) "current" "HEAD")
|
||||
(interactive (magit-log-arguments))
|
||||
(magit-log-setup-buffer (list (or (magit-get-current-branch) "HEAD"))
|
||||
args files))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-log-head (&optional args files)
|
||||
@@ -1147,8 +1150,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point.
|
||||
(setq revs (if (< (string-to-number count) limit)
|
||||
revs
|
||||
(format "%s~%s..%s" revs limit revs))))
|
||||
(let ((delay (cl-find-if (lambda (arg)
|
||||
(member arg '("++header" "--patch" "--stat")))
|
||||
(let ((delay (cl-find-if (##member % '("++header" "--patch" "--stat"))
|
||||
args)))
|
||||
(setq magit-section-inhibit-markers (if delay 'delay t))
|
||||
(setq magit-section-insert-in-reverse (not delay)))
|
||||
@@ -1181,10 +1183,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point.
|
||||
|
||||
(defun magit-log-header-line-arguments (revs args files)
|
||||
"Return string describing some of the used arguments."
|
||||
(mapconcat (lambda (arg)
|
||||
(if (string-search " " arg)
|
||||
(prin1 arg)
|
||||
arg))
|
||||
(mapconcat (##if (string-search " " %) (prin1 %) %)
|
||||
`("git" "log" ,@args ,@revs "--" ,@files)
|
||||
" "))
|
||||
|
||||
@@ -1454,15 +1453,11 @@ Do not add this to a hook variable."
|
||||
(setq date (+ (string-to-number (match-string 1 date))
|
||||
(* (string-to-number (match-string 2 date)) 60 60)
|
||||
(* (string-to-number (match-string 3 date)) 60))))
|
||||
(save-excursion
|
||||
(backward-char)
|
||||
(magit-log-format-margin hash author date)))
|
||||
(magit-log-format-margin hash author date))
|
||||
(when (and (eq style 'cherry)
|
||||
(magit-buffer-margin-p))
|
||||
(save-excursion
|
||||
(backward-char)
|
||||
(apply #'magit-log-format-margin hash
|
||||
(split-string (magit-rev-format "%aN%x00%ct" hash) "\0"))))
|
||||
(apply #'magit-log-format-margin hash
|
||||
(split-string (magit-rev-format "%aN%x00%ct" hash) "\0")))
|
||||
(when (and graph
|
||||
(not (eobp))
|
||||
(not (looking-at non-graph-re)))
|
||||
@@ -1493,8 +1488,8 @@ Do not add this to a hook variable."
|
||||
(while (and (not (eobp)) (not (looking-at non-graph-re)))
|
||||
(when align
|
||||
(save-excursion (insert align)))
|
||||
(magit-make-margin-overlay)
|
||||
(forward-line))
|
||||
(forward-line)
|
||||
(magit-make-margin-overlay))
|
||||
;; When `--format' is used and its value isn't one of the
|
||||
;; predefined formats, then `git-log' does not insert a
|
||||
;; separator line.
|
||||
@@ -1535,7 +1530,8 @@ exists mostly for backward compatibility reasons."
|
||||
|
||||
(defun magit-log-maybe-update-revision-buffer (&optional _)
|
||||
"When moving in a log or cherry buffer, update the revision buffer.
|
||||
If there is no revision buffer in the same frame, then do nothing."
|
||||
If there is no revision buffer in the same frame, then do nothing.
|
||||
See also info node `(magit)Section Movement'."
|
||||
(when (derived-mode-p 'magit-log-mode 'magit-cherry-mode 'magit-reflog-mode)
|
||||
(magit--maybe-update-revision-buffer)))
|
||||
|
||||
@@ -1563,7 +1559,8 @@ If there is no revision buffer in the same frame, then do nothing."
|
||||
|
||||
(defun magit-log-maybe-update-blob-buffer (&optional _)
|
||||
"When moving in a log or cherry buffer, update the blob buffer.
|
||||
If there is no blob buffer in the same frame, then do nothing."
|
||||
If there is no blob buffer in the same frame, then do nothing.
|
||||
See also info node `(magit)Section Movement'."
|
||||
(when (derived-mode-p 'magit-log-mode 'magit-cherry-mode 'magit-reflog-mode)
|
||||
(magit--maybe-update-blob-buffer)))
|
||||
|
||||
@@ -1622,7 +1619,7 @@ The shortstat style is experimental and rather slow."
|
||||
(magit-log-format-shortstat-margin rev)
|
||||
(magit-log-format-author-margin author date))))
|
||||
|
||||
(defun magit-log-format-author-margin (author date &optional previous-line)
|
||||
(defun magit-log-format-author-margin (author date)
|
||||
(pcase-let ((`(,_ ,style ,width ,details ,details-width)
|
||||
(or magit-buffer-margin
|
||||
(symbol-value (magit-margin-option))
|
||||
@@ -1647,8 +1644,7 @@ The shortstat style is experimental and rather slow."
|
||||
(format (format (if abbr "%%2d%%-%dc" "%%2d %%-%ds")
|
||||
(- width (if details (1+ details-width) 0)))
|
||||
cnt unit)))
|
||||
'magit-log-date))
|
||||
previous-line)))
|
||||
'magit-log-date)))))
|
||||
|
||||
(defun magit-log-format-shortstat-margin (rev)
|
||||
(magit-make-margin-overlay
|
||||
|
||||
Reference in New Issue
Block a user