From 6d257316480714cd0b1392ea56a90ea05859fea7 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 16:28:36 +0100 Subject: [PATCH] update magit --- elpa/magit-20190514.1814/magit.info | 191 ----------- .../AUTHORS.md | 10 + .../LICENSE | 0 .../dir | 0 .../git-rebase.el | 7 +- .../magit-apply.el | 54 ++- .../magit-autoloads.el | 315 ++++++++--------- .../magit-autorevert.el | 20 +- .../magit-bisect.el | 5 +- .../magit-blame.el | 67 ++-- .../magit-bookmark.el | 1 + .../magit-branch.el | 7 +- .../magit-clone.el | 0 .../magit-commit.el | 62 ++-- .../magit-core.el | 2 +- .../magit-diff.el | 262 +++++++++------ .../magit-ediff.el | 0 .../magit-extras.el | 22 +- .../magit-fetch.el | 10 +- .../magit-files.el | 107 +++--- .../magit-git.el | 102 +++--- .../magit-gitignore.el | 64 +++- .../magit-imenu.el | 0 .../magit-log.el | 317 +++++++++++------- .../magit-margin.el | 3 +- .../magit-merge.el | 13 +- .../magit-mode.el | 50 ++- .../magit-notes.el | 0 .../magit-obsolete.el | 3 + .../magit-patch.el | 0 .../magit-pkg.el | 4 +- .../magit-process.el | 35 +- .../magit-pull.el | 6 +- .../magit-push.el | 32 +- .../magit-reflog.el | 16 +- .../magit-refs.el | 71 ++-- .../magit-remote.el | 9 +- .../magit-repos.el | 50 ++- .../magit-reset.el | 6 +- .../magit-section.el | 54 +-- .../magit-sequence.el | 19 +- .../magit-stash.el | 50 ++- .../magit-status.el | 150 +++++++-- .../magit-submodule.el | 35 +- .../magit-subtree.el | 0 .../magit-tag.el | 0 .../magit-transient.el | 8 +- .../magit-utils.el | 70 ++-- .../magit-wip.el | 0 .../magit-worktree.el | 45 ++- .../magit.el | 0 elpa/magit-20191030.1315/magit.info | 189 +++++++++++ .../magit.info-1 | 297 ++++++++-------- .../magit.info-2 | 230 +++++++++---- .../magit-todos-pkg.el | 2 - .../magit-todos-autoloads.el | 11 +- .../magit-todos-pkg.el | 2 + .../magit-todos.el | 206 +++++++++--- 58 files changed, 1976 insertions(+), 1315 deletions(-) delete mode 100644 elpa/magit-20190514.1814/magit.info rename elpa/{magit-20190514.1814 => magit-20191030.1315}/AUTHORS.md (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/LICENSE (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/dir (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/git-rebase.el (99%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-apply.el (93%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-autoloads.el (89%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-autorevert.el (95%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-bisect.el (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-blame.el (95%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-bookmark.el (99%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-branch.el (99%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-clone.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-commit.el (92%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-core.el (99%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-diff.el (93%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-ediff.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-extras.el (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-fetch.el (95%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-files.el (89%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-git.el (96%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-gitignore.el (66%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-imenu.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-log.el (85%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-margin.el (98%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-merge.el (96%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-mode.el (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-notes.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-obsolete.el (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-patch.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-pkg.el (70%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-process.el (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-pull.el (96%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-push.el (92%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-reflog.el (93%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-refs.el (93%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-remote.el (98%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-repos.el (87%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-reset.el (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-section.el (98%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-sequence.el (98%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-stash.el (90%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-status.el (82%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-submodule.el (95%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-subtree.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-tag.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-transient.el (95%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-utils.el (96%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-wip.el (100%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit-worktree.el (77%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit.el (100%) create mode 100644 elpa/magit-20191030.1315/magit.info rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit.info-1 (97%) rename elpa/{magit-20190514.1814 => magit-20191030.1315}/magit.info-2 (96%) delete mode 100644 elpa/magit-todos-20190508.757/magit-todos-pkg.el rename elpa/{magit-todos-20190508.757 => magit-todos-20190907.1321}/magit-todos-autoloads.el (78%) create mode 100644 elpa/magit-todos-20190907.1321/magit-todos-pkg.el rename elpa/{magit-todos-20190508.757 => magit-todos-20190907.1321}/magit-todos.el (88%) diff --git a/elpa/magit-20190514.1814/magit.info b/elpa/magit-20190514.1814/magit.info deleted file mode 100644 index 828b23c9..00000000 --- a/elpa/magit-20190514.1814/magit.info +++ /dev/null @@ -1,191 +0,0 @@ -This is magit.info, produced by makeinfo version 6.5 from magit.texi. - - Copyright (C) 2015-2019 Jonas Bernoulli - - 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: (magit). Using Git from Emacs with Magit. -END-INFO-DIR-ENTRY - - -Indirect: -magit.info-1: 754 -magit.info-2: 303558 - -Tag Table: -(Indirect) -Node: Top754 -Node: Introduction6475 -Node: Installation11198 -Node: Installing from Melpa11528 -Node: Installing from the Git Repository12601 -Node: Post-Installation Tasks14949 -Node: Getting Started16234 -Node: Interface Concepts21683 -Node: Modes and Buffers22044 -Node: Switching Buffers23793 -Node: Naming Buffers28563 -Node: Quitting Windows31870 -Node: Automatic Refreshing of Magit Buffers33616 -Node: Automatic Saving of File-Visiting Buffers36468 -Node: Automatic Reverting of File-Visiting Buffers37653 -Node: Risk of Reverting Automatically42648 -Node: Sections45030 -Node: Section Movement45956 -Node: Section Visibility50053 -Node: Section Hooks56130 -Node: Section Types and Values58537 -Node: Section Options59840 -Node: Transient Commands60312 -Node: Transient Arguments and Buffer Variables61549 -Node: Completion Confirmation and the Selection68567 -Node: Action Confirmation69011 -Node: Completion and Confirmation76361 -Node: The Selection79547 -Node: The hunk-internal region82446 -Node: Support for Completion Frameworks83535 -Node: Additional Completion Options88351 -Node: Running Git88950 -Node: Viewing Git Output89223 -Node: Git Process Status90356 -Node: Running Git Manually91321 -Node: Git Executable93795 -Node: Global Git Arguments96077 -Node: Inspecting96883 -Node: Status Buffer98040 -Node: Status Sections102030 -Node: Status Header Sections106833 -Node: Status Module Sections109463 -Node: Status Options111968 -Node: Repository List113722 -Node: Logging115880 -Node: Refreshing Logs118443 -Node: Log Buffer119889 -Node: Log Margin123745 -Node: Select from Log126434 -Node: Reflog128538 -Node: Cherries130074 -Node: Diffing131801 -Node: Refreshing Diffs134882 -Node: Commands Available in Diffs138461 -Node: Diff Options140996 -Node: Revision Buffer146034 -Node: Ediffing149363 -Node: References Buffer153011 -Node: References Sections163172 -Node: Bisecting164033 -Node: Visiting Files and Blobs165846 -Node: General-Purpose Visit Commands166316 -Node: Visiting Files and Blobs from a Diff167272 -Node: Blaming170731 -Node: Manipulating177294 -Node: Creating Repository177636 -Node: Cloning Repository178191 -Node: Staging and Unstaging183434 -Node: Staging from File-Visiting Buffers187517 -Node: Applying188685 -Node: Committing190578 -Node: Initiating a Commit191161 -Node: Editing Commit Messages194546 -Node: Branching204938 -Node: The Two Remotes205164 -Node: Branch Commands207817 -Node: Branch Git Variables220201 -Node: Auxiliary Branch Commands225592 -Node: Merging226710 -Node: Resolving Conflicts230718 -Node: Rebasing235719 -Node: Editing Rebase Sequences240729 -Node: Information About In-Progress Rebase245057 -Ref: Information About In-Progress Rebase-Footnote-1253939 -Node: Cherry Picking254535 -Node: Reverting258866 -Node: Resetting260315 -Node: Stashing261969 -Node: Transferring266549 -Node: Remotes266771 -Node: Remote Commands266923 -Node: Remote Git Variables271004 -Node: Fetching273383 -Node: Pulling275737 -Node: Pushing276930 -Node: Plain Patches280538 -Node: Maildir Patches282035 -Node: Miscellaneous283549 -Node: Tagging283865 -Node: Notes285793 -Node: Submodules288165 -Node: Listing Submodules288383 -Node: Submodule Transient290311 -Node: Subtree292833 -Node: Worktree294809 -Node: Common Commands295824 -Node: Wip Modes297871 -Node: Wip Graph303558 -Node: Legacy Wip Modes305872 -Node: Minor Mode for Buffers Visiting Files308767 -Node: Minor Mode for Buffers Visiting Blobs315879 -Node: Customizing316692 -Node: Per-Repository Configuration318288 -Node: Essential Settings319937 -Node: Safety320261 -Node: Performance322026 -Node: Microsoft Windows Performance328874 -Node: MacOS Performance330065 -Ref: MacOS Performance-Footnote-1331301 -Ref: MacOS Performance-Footnote-2331383 -Ref: MacOS Performance-Footnote-3331443 -Node: Plumbing331609 -Node: Calling Git332438 -Node: Getting a Value from Git333963 -Node: Calling Git for Effect337049 -Node: Section Plumbing343569 -Node: Creating Sections343797 -Node: Section Selection347697 -Node: Matching Sections349496 -Node: Refreshing Buffers355469 -Node: Conventions358617 -Node: Theming Faces358809 -Node: FAQ366924 -Node: FAQ - How to ...?367366 -Node: How to show git's output?367726 -Node: How to install the gitman info manual?368480 -Node: How to show diffs for gpg-encrypted files?369450 -Node: How does branching and pushing work?370046 -Node: Can Magit be used as ediff-version-control-package?370409 -Node: FAQ - Issues and Errors372398 -Node: Magit is slow373330 -Node: I changed several thousand files at once and now Magit is unusable373544 -Node: I am having problems committing374273 -Node: I am using MS Windows and cannot push with Magit374754 -Node: I am using OS X and SOMETHING works in shell but not in Magit375371 -Node: Diffs contain control sequences376177 -Node: Expanding a file to show the diff causes it to disappear377290 -Node: Point is wrong in the COMMIT_EDITMSG buffer377841 -Node: The mode-line information isn't always up-to-date378887 -Node: A branch and tag sharing the same name breaks SOMETHING379969 -Node: My Git hooks work on the command-line but not inside Magit380857 -Node: git-commit-mode isn't used when committing from the command-line381694 -Node: Point ends up inside invisible text when jumping to a file-visiting buffer383961 -Node: Debugging Tools384759 -Node: Keystroke Index386646 -Node: Command Index420360 -Node: Function Index457115 -Node: Variable Index472677 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/magit-20190514.1814/AUTHORS.md b/elpa/magit-20191030.1315/AUTHORS.md similarity index 97% rename from elpa/magit-20190514.1814/AUTHORS.md rename to elpa/magit-20191030.1315/AUTHORS.md index 19187cf6..52a4e4da 100644 --- a/elpa/magit-20190514.1814/AUTHORS.md +++ b/elpa/magit-20191030.1315/AUTHORS.md @@ -161,16 +161,19 @@ Contributors - Jesse Alama - Jim Blandy - Joakim Jalap +- Johannes Altmanninger - Johann Klähn - John Mastro - John Morris - John Wiegley - Jonas Bernoulli +- Jonathan Arnett - Jonathan Leech-Pepin - Jonathan Roes - Jon Vanderwijk - Jordan Galby - Jordan Greenberg +- Josh Elsasser - Josiah Schwab - Julien Danjou - Justin Burkett @@ -181,6 +184,7 @@ Contributors - Kenny Ballou - Keshav Kini - Kevin Brubeck Unhammer +- Kevin J. Foley - Kévin Le Gouguec - Kimberly Wolk - Knut Olav Bøhmer @@ -224,6 +228,7 @@ Contributors - Miloš Mošić - Mitchel Humpherys - Moritz Bunkus +- Naoya Yamashita - Natalie Weizenbaum - Nguyễn Tuấn Anh - Nic Ferier @@ -298,6 +303,7 @@ Contributors - Sylvain Rousseau - Syohei Yoshida - Takafumi Arakaki +- Tassilo Horn - Teemu Likonen - Teruki Shigitani - Thierry Volpiatto @@ -312,6 +318,7 @@ Contributors - Tim Wraight - Ting-Yu Lin - Tom Feist +- Topi Miettinen - Troy Hinckley - Tunc Uzlu - Vineet Naik @@ -324,8 +331,11 @@ Contributors - Xavier Noria - Xu Chunyang - Yann Hodique +- Ynilu - York Zhao - Yuichi Higashi - Yuri Khan - Zach Latta - zakora +- Zhu Zihao +- zilongshanren diff --git a/elpa/magit-20190514.1814/LICENSE b/elpa/magit-20191030.1315/LICENSE similarity index 100% rename from elpa/magit-20190514.1814/LICENSE rename to elpa/magit-20191030.1315/LICENSE diff --git a/elpa/magit-20190514.1814/dir b/elpa/magit-20191030.1315/dir similarity index 100% rename from elpa/magit-20190514.1814/dir rename to elpa/magit-20191030.1315/dir diff --git a/elpa/magit-20190514.1814/git-rebase.el b/elpa/magit-20191030.1315/git-rebase.el similarity index 99% rename from elpa/magit-20190514.1814/git-rebase.el rename to elpa/magit-20191030.1315/git-rebase.el index 14bd9c42..af3824e3 100644 --- a/elpa/magit-20190514.1814/git-rebase.el +++ b/elpa/magit-20191030.1315/git-rebase.el @@ -81,7 +81,10 @@ (require 'magit) (and (require 'async-bytecomp nil t) - (memq 'magit (bound-and-true-p async-bytecomp-allowed-packages)) + (let ((pkgs (bound-and-true-p async-bytecomp-allowed-packages))) + (if (consp pkgs) + (cl-intersection '(all magit) pkgs) + (memq pkgs '(all t)))) (fboundp 'async-bytecomp-package-mode) (async-bytecomp-package-mode 1)) @@ -744,6 +747,8 @@ running 'man git-rebase' at the command line) for details." (git-rebase-match-comment-line 0 'font-lock-comment-face) ("\\[[^[]*\\]" 0 'magit-keyword t) + ("\\(?:fixup!\\|squash!\\)" + 0 'magit-keyword-squash t) (,(format "^%s Rebase \\([^ ]*\\) onto \\([^ ]*\\)" comment-start) (1 'git-rebase-comment-hash t) (2 'git-rebase-comment-hash t)) diff --git a/elpa/magit-20190514.1814/magit-apply.el b/elpa/magit-20191030.1315/magit-apply.el similarity index 93% rename from elpa/magit-20190514.1814/magit-apply.el rename to elpa/magit-20191030.1315/magit-apply.el index c1ba69a9..1a7ca97d 100644 --- a/elpa/magit-20190514.1814/magit-apply.el +++ b/elpa/magit-20191030.1315/magit-apply.el @@ -161,30 +161,64 @@ so causes the change to be applied to the index as well." (concat (magit-diff-file-header section) (magit-apply--section-content section)))) +(defun magit-apply--adjust-hunk-new-starts (hunks) + "Adjust new line numbers in headers of HUNKS for partial application. +HUNKS should be a list of ordered, contiguous hunks to be applied +from a file. For example, if there is a sequence of hunks with +the headers + + @@ -2,6 +2,7 @@ + @@ -10,6 +11,7 @@ + @@ -18,6 +20,7 @@ + +and only the second and third are to be applied, they would be +adjusted as \"@@ -10,6 +10,7 @@\" and \"@@ -18,6 +19,7 @@\"." + (let* ((first-hunk (car hunks)) + (offset (if (string-match diff-hunk-header-re-unified first-hunk) + (- (string-to-number (match-string 3 first-hunk)) + (string-to-number (match-string 1 first-hunk))) + (error "Hunk does not have expected header")))) + (if (= offset 0) + hunks + (mapcar (lambda (hunk) + (if (string-match diff-hunk-header-re-unified hunk) + (replace-match (number-to-string + (- (string-to-number (match-string 3 hunk)) + offset)) + t t hunk 3) + (error "Hunk does not have expected header"))) + hunks)))) + +(defun magit-apply--adjust-hunk-new-start (hunk) + (car (magit-apply--adjust-hunk-new-starts (list hunk)))) + (defun magit-apply-hunks (sections &rest args) (let ((section (oref (car sections) parent))) (when (string-match "^diff --cc" (oref section value)) (user-error "Cannot un-/stage resolution hunks. Stage the whole file")) - (magit-apply-patch section args - (concat (oref section header) - (mapconcat 'magit-apply--section-content - sections ""))))) + (magit-apply-patch + section args + (concat (oref section header) + (mapconcat #'identity + (magit-apply--adjust-hunk-new-starts + (mapcar #'magit-apply--section-content sections)) + ""))))) (defun magit-apply-hunk (section &rest args) (when (string-match "^diff --cc" (magit-section-parent-value section)) (user-error "Cannot un-/stage resolution hunks. Stage the whole file")) (magit-apply-patch (oref section parent) args (concat (magit-diff-file-header section) - (magit-apply--section-content section)))) + (magit-apply--adjust-hunk-new-start + (magit-apply--section-content section))))) (defun magit-apply-region (section &rest args) - (unless (magit-diff-context-p) - (user-error "Not enough context to apply region. Increase the context")) (when (string-match "^diff --cc" (magit-section-parent-value section)) (user-error "Cannot un-/stage resolution hunks. Stage the whole file")) (magit-apply-patch (oref section parent) args (concat (magit-diff-file-header section) - (magit-diff-hunk-region-patch section args)))) + (magit-apply--adjust-hunk-new-start + (magit-diff-hunk-region-patch section args))))) (defun magit-apply-patch (section:s args patch) (let* ((files (if (atom section:s) @@ -194,15 +228,15 @@ so causes the change to be applied to the index as well." (command (if (and command (string-match "^magit-\\([^-]+\\)" command)) (match-string 1 command) "apply")) - (no-context (not (magit-diff-context-p))) (ignore-context (magit-diff-ignore-any-space-p))) + (unless (magit-diff-context-p) + (user-error "Not enough context to apply patch. Increase the context")) (when (and magit-wip-before-change-mode (not inhibit-magit-refresh)) (magit-wip-commit-before-change files (concat " before " command))) (with-temp-buffer (insert patch) (magit-run-git-with-input "apply" args "-p0" - (and no-context "--unidiff-zero") (and ignore-context "-C0") "--ignore-space-change" "-")) (unless inhibit-magit-refresh diff --git a/elpa/magit-20190514.1814/magit-autoloads.el b/elpa/magit-20191030.1315/magit-autoloads.el similarity index 89% rename from elpa/magit-20190514.1814/magit-autoloads.el rename to elpa/magit-20191030.1315/magit-autoloads.el index cffcb18d..e6a30df9 100644 --- a/elpa/magit-20190514.1814/magit-autoloads.el +++ b/elpa/magit-20191030.1315/magit-autoloads.el @@ -1,12 +1,10 @@ ;;; magit-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "git-rebase" "git-rebase.el" (0 0 0 0)) +;;;### (autoloads nil "git-rebase" "git-rebase.el" (23994 42055 875058 +;;;;;; 195000)) ;;; Generated autoloads from git-rebase.el (autoload 'git-rebase-current-line "git-rebase" "\ @@ -30,11 +28,9 @@ running 'man git-rebase' at the command line) for details. (add-to-list 'auto-mode-alist (cons git-rebase-filename-regexp 'git-rebase-mode)) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "git-rebase" '("git-rebase-"))) - ;;;*** -;;;### (autoloads nil "magit" "magit.el" (0 0 0 0)) +;;;### (autoloads nil "magit" "magit.el" (23994 42055 938776 22000)) ;;; Generated autoloads from magit.el (autoload 'magit-dispatch "magit" nil t) (autoload 'magit-run "magit" nil t) @@ -87,11 +83,10 @@ and Emacs to it. \(fn &optional PRINT-DEST)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-apply" "magit-apply.el" (0 0 0 0)) +;;;### (autoloads nil "magit-apply" "magit-apply.el" (23994 42055 +;;;;;; 903978 135000)) ;;; Generated autoloads from magit-apply.el (autoload 'magit-stage-file "magit-apply" "\ @@ -124,12 +119,10 @@ Remove all changes from the staging area. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-apply" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (0 -;;;;;; 0 0 0)) +;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (23994 +;;;;;; 42055 902226 43000)) ;;; Generated autoloads from magit-autorevert.el (defvar magit-auto-revert-mode (not (or global-auto-revert-mode noninteractive)) "\ @@ -154,11 +147,10 @@ See `auto-revert-mode' for more information on Auto-Revert mode. \(fn &optional ARG)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-autorevert" '("auto-revert-buffer" "magit-"))) - ;;;*** -;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (0 0 0 0)) +;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (23994 42055 +;;;;;; 942592 357000)) ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect "magit-bisect" nil t) @@ -207,11 +199,10 @@ bisect run'. \(fn CMDLINE &optional BAD GOOD)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-bisect" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-blame" "magit-blame.el" (0 0 0 0)) +;;;### (autoloads nil "magit-blame" "magit-blame.el" (23994 42055 +;;;;;; 927164 119000)) ;;; Generated autoloads from magit-blame.el (autoload 'magit-blame-echo "magit-blame" nil t) (autoload 'magit-blame-addition "magit-blame" nil t) @@ -219,19 +210,24 @@ bisect run'. (autoload 'magit-blame-reverse "magit-blame" nil t) (autoload 'magit-blame "magit-blame" nil t) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-blame" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (0 0 0 -;;;;;; 0)) +;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (23994 +;;;;;; 42055 957116 341000)) ;;; Generated autoloads from magit-bookmark.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-bookmark" '("magit--"))) +(autoload 'magit--handle-bookmark "magit-bookmark" "\ +Open a bookmark created by `magit--make-bookmark'. +Call the `magit-*-setup-buffer' function of the the major-mode +with the variables' values as arguments, which were recorded by +`magit--make-bookmark'. Ignore `magit-display-buffer-function'. + +\(fn BOOKMARK)" nil nil) ;;;*** -;;;### (autoloads nil "magit-branch" "magit-branch.el" (0 0 0 0)) +;;;### (autoloads nil "magit-branch" "magit-branch.el" (23994 42055 +;;;;;; 914682 63000)) ;;; Generated autoloads from magit-branch.el (autoload 'magit-branch "magit" nil t) @@ -393,11 +389,10 @@ and also rename the respective reflog file. \(fn BRANCH)" t nil) (autoload 'magit-branch-configure "magit-branch" nil t) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-branch" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-clone" "magit-clone.el" (0 0 0 0)) +;;;### (autoloads nil "magit-clone" "magit-clone.el" (23994 42055 +;;;;;; 898547 337000)) ;;; Generated autoloads from magit-clone.el (autoload 'magit-clone "magit-clone" nil t) @@ -443,11 +438,10 @@ Then show the status buffer for the new repository. \(fn REPOSITORY DIRECTORY ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-clone" '("magit-clone"))) - ;;;*** -;;;### (autoloads nil "magit-commit" "magit-commit.el" (0 0 0 0)) +;;;### (autoloads nil "magit-commit" "magit-commit.el" (23994 42055 +;;;;;; 933603 364000)) ;;; Generated autoloads from magit-commit.el (autoload 'magit-commit "magit-commit" nil t) @@ -540,11 +534,10 @@ history element. \(fn DATE)" t nil) (autoload 'magit-commit-absorb "magit-commit" nil t) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-commit" '("magit"))) - ;;;*** -;;;### (autoloads nil "magit-diff" "magit-diff.el" (0 0 0 0)) +;;;### (autoloads nil "magit-diff" "magit-diff.el" (23994 42055 873815 +;;;;;; 93000)) ;;; Generated autoloads from magit-diff.el (autoload 'magit-diff "magit-diff" nil t) (autoload 'magit-diff-refresh "magit-diff" nil t) @@ -624,11 +617,10 @@ for a revision. \(fn REV &optional ARGS FILES MODULE)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-diff" '("magit"))) - ;;;*** -;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (0 0 0 0)) +;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (23994 42055 +;;;;;; 945124 412000)) ;;; Generated autoloads from magit-ediff.el (autoload 'magit-ediff "magit-ediff" nil) @@ -714,11 +706,10 @@ stash that were staged. \(fn STASH)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-ediff" '("magit-ediff"))) - ;;;*** -;;;### (autoloads nil "magit-extras" "magit-extras.el" (0 0 0 0)) +;;;### (autoloads nil "magit-extras" "magit-extras.el" (23994 42055 +;;;;;; 932313 407000)) ;;; Generated autoloads from magit-extras.el (autoload 'magit-run-git-gui "magit-extras" "\ @@ -753,9 +744,9 @@ Run `gitk --all' in the current repository. (autoload 'ido-enter-magit-status "magit-extras" "\ Drop into `magit-status' from file switching. -This command does not work in Emacs 26. It does work in Emacs 25 -and Emacs 27. See https://github.com/magit/magit/issues/3634 and -https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31707. +This command does not work in Emacs 26.1. +See https://github.com/magit/magit/issues/3634 +and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31707. To make this command available use something like: @@ -881,7 +872,7 @@ use `magit-rebase-edit-command' instead of this command. Change the author and committer dates of the commits since REV. Ask the user for the first reachable commit whose dates should -be changed. The read the new date for that commit. The initial +be changed. Then read the new date for that commit. The initial minibuffer input and the previous history element offer good values. The next commit will be created one minute later and so on. @@ -967,11 +958,10 @@ patch application, a cherry-pick, a revert, or a bisect. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-extras" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-fetch" "magit-fetch.el" (0 0 0 0)) +;;;### (autoloads nil "magit-fetch" "magit-fetch.el" (23994 42055 +;;;;;; 934847 34000)) ;;; Generated autoloads from magit-fetch.el (autoload 'magit-fetch "magit-fetch" nil t) (autoload 'magit-fetch-from-pushremote "magit-fetch" nil t) @@ -1019,11 +1009,10 @@ prefix argument fetch all remotes. \(fn &optional ALL)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-fetch" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-files" "magit-files.el" (0 0 0 0)) +;;;### (autoloads nil "magit-files" "magit-files.el" (23994 42055 +;;;;;; 946790 277000)) ;;; Generated autoloads from magit-files.el (autoload 'magit-find-file "magit-files" "\ @@ -1088,19 +1077,10 @@ Checkout FILE from REV. \(fn REV FILE)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-files" '("magit-"))) - -;;;*** - -;;;### (autoloads nil "magit-git" "magit-git.el" (0 0 0 0)) -;;; Generated autoloads from magit-git.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-git" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-gitignore" "magit-gitignore.el" (0 0 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-gitignore" "magit-gitignore.el" (23994 +;;;;;; 42055 910383 233000)) ;;; Generated autoloads from magit-gitignore.el (autoload 'magit-gitignore "magit-gitignore" nil t) @@ -1133,20 +1113,29 @@ Rules that are defined in that file affect all local repositories. \(fn RULE)" t nil) (autoload 'magit-skip-worktree "magit-gitignore" "\ -Call \"git update-index --skip-worktree FILE\". +Call \"git update-index --skip-worktree -- FILE\". \(fn FILE)" t nil) (autoload 'magit-no-skip-worktree "magit-gitignore" "\ -Call \"git update-index --no-skip-worktree FILE\". +Call \"git update-index --no-skip-worktree -- FILE\". \(fn FILE)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-gitignore" '("magit-"))) +(autoload 'magit-assume-unchanged "magit-gitignore" "\ +Call \"git update-index --assume-unchanged -- FILE\". + +\(fn FILE)" t nil) + +(autoload 'magit-no-assume-unchanged "magit-gitignore" "\ +Call \"git update-index --no-assume-unchanged -- FILE\". + +\(fn FILE)" t nil) ;;;*** -;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (0 0 0 0)) +;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (23994 42055 +;;;;;; 919576 194000)) ;;; Generated autoloads from magit-imenu.el (autoload 'magit-imenu--log-prev-index-position-function "magit-imenu" "\ @@ -1260,11 +1249,10 @@ beginning of the line. \(fn)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-imenu" '("magit-imenu--index-function"))) - ;;;*** -;;;### (autoloads nil "magit-log" "magit-log.el" (0 0 0 0)) +;;;### (autoloads nil "magit-log" "magit-log.el" (23994 42055 952976 +;;;;;; 752000)) ;;; Generated autoloads from magit-log.el (autoload 'magit-log "magit-log" nil t) (autoload 'magit-log-refresh "magit-log" nil t) @@ -1295,6 +1283,16 @@ Show log for all local branches and `HEAD'. \(fn &optional ARGS FILES)" t nil) +(autoload 'magit-log-matching-branches "magit-log" "\ +Show log for all branches matching PATTERN and `HEAD'. + +\(fn PATTERN &optional ARGS FILES)" t nil) + +(autoload 'magit-log-matching-tags "magit-log" "\ +Show log for all tags matching PATTERN and `HEAD'. + +\(fn PATTERN &optional ARGS FILES)" t nil) + (autoload 'magit-log-all-branches "magit-log" "\ Show log for all local and remote branches and `HEAD'. @@ -1307,9 +1305,9 @@ Show log for all references and `HEAD'. (autoload 'magit-log-buffer-file "magit-log" "\ Show log for the blob or file visited in the current buffer. -With a prefix argument or when `--follow' is part of -`magit-log-arguments', then follow renames. When the region is -active, restrict the log to the lines that the region touches. +With a prefix argument or when `--follow' is an active log +argument, then follow renames. When the region is active, +restrict the log to the lines that the region touches. \(fn &optional FOLLOW BEG END)" t nil) @@ -1341,18 +1339,10 @@ Show commits in a branch that are not merged in the upstream branch. \(fn HEAD UPSTREAM)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-log" '("magit"))) - -;;;*** - -;;;### (autoloads nil "magit-margin" "magit-margin.el" (0 0 0 0)) -;;; Generated autoloads from magit-margin.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-margin" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-merge" "magit-merge.el" (0 0 0 0)) +;;;### (autoloads nil "magit-merge" "magit-merge.el" (23994 42055 +;;;;;; 911653 486000)) ;;; Generated autoloads from magit-merge.el (autoload 'magit-merge "magit" nil t) @@ -1430,34 +1420,17 @@ Abort the current merge operation. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-merge" '("magit-"))) - -;;;*** - -;;;### (autoloads nil "magit-mode" "magit-mode.el" (0 0 0 0)) -;;; Generated autoloads from magit-mode.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-mode" '("magit-" "disable-magit-save-buffers" "inhibit-magit-refresh"))) - ;;;*** -;;;### (autoloads nil "magit-notes" "magit-notes.el" (0 0 0 0)) +;;;### (autoloads nil "magit-notes" "magit-notes.el" (23994 42055 +;;;;;; 871433 510000)) ;;; Generated autoloads from magit-notes.el (autoload 'magit-notes "magit" nil t) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-notes" '("magit-"))) - -;;;*** - -;;;### (autoloads nil "magit-obsolete" "magit-obsolete.el" (0 0 0 -;;;;;; 0)) -;;; Generated autoloads from magit-obsolete.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-obsolete" '("magit--magit-popup-warning"))) - ;;;*** -;;;### (autoloads nil "magit-patch" "magit-patch.el" (0 0 0 0)) +;;;### (autoloads nil "magit-patch" "magit-patch.el" (23994 42055 +;;;;;; 896352 339000)) ;;; Generated autoloads from magit-patch.el (autoload 'magit-patch "magit-patch" nil t) (autoload 'magit-patch-create "magit-patch" nil t) @@ -1498,18 +1471,10 @@ is asked to pull. START has to be reachable from that commit. \(fn URL START END)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-patch" '("magit-"))) - -;;;*** - -;;;### (autoloads nil "magit-process" "magit-process.el" (0 0 0 0)) -;;; Generated autoloads from magit-process.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-process" '("magit-" "tramp-sh-handle-"))) - ;;;*** -;;;### (autoloads nil "magit-pull" "magit-pull.el" (0 0 0 0)) +;;;### (autoloads nil "magit-pull" "magit-pull.el" (23994 42055 936098 +;;;;;; 926000)) ;;; Generated autoloads from magit-pull.el (autoload 'magit-pull "magit-pull" nil t) (autoload 'magit-pull-from-pushremote "magit-pull" nil t) @@ -1520,11 +1485,10 @@ Pull from a branch read in the minibuffer. \(fn SOURCE ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-pull" '("magit-pull"))) - ;;;*** -;;;### (autoloads nil "magit-push" "magit-push.el" (0 0 0 0)) +;;;### (autoloads nil "magit-push" "magit-push.el" (23994 42055 900951 +;;;;;; 174000)) ;;; Generated autoloads from magit-push.el (autoload 'magit-push "magit-push" nil t) (autoload 'magit-push-current-to-pushremote "magit-push" nil t) @@ -1599,11 +1563,10 @@ these Git variables: `push.default', `remote.pushDefault', \(fn REMOTE ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-push" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-reflog" "magit-reflog.el" (0 0 0 0)) +;;;### (autoloads nil "magit-reflog" "magit-reflog.el" (23994 42055 +;;;;;; 876131 412000)) ;;; Generated autoloads from magit-reflog.el (autoload 'magit-reflog-current "magit-reflog" "\ @@ -1622,11 +1585,10 @@ Display the `HEAD' reflog. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-reflog" '("magit-reflog-"))) - ;;;*** -;;;### (autoloads nil "magit-refs" "magit-refs.el" (0 0 0 0)) +;;;### (autoloads nil "magit-refs" "magit-refs.el" (23994 42055 948068 +;;;;;; 341000)) ;;; Generated autoloads from magit-refs.el (autoload 'magit-show-refs "magit-refs" nil t) @@ -1648,11 +1610,10 @@ Compared with a branch read from the user. \(fn &optional REF ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-refs" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-remote" "magit-remote.el" (0 0 0 0)) +;;;### (autoloads nil "magit-remote" "magit-remote.el" (23994 42055 +;;;;;; 943799 422000)) ;;; Generated autoloads from magit-remote.el (autoload 'magit-remote "magit-remote" nil t) @@ -1708,11 +1669,10 @@ Delete the symbolic-ref \"refs/remotes//HEAD\". \(fn REMOTE)" t nil) (autoload 'magit-remote-configure "magit-remote" nil t) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-remote" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-repos" "magit-repos.el" (0 0 0 0)) +;;;### (autoloads nil "magit-repos" "magit-repos.el" (23994 42055 +;;;;;; 909145 496000)) ;;; Generated autoloads from magit-repos.el (autoload 'magit-list-repositories "magit-repos" "\ @@ -1723,11 +1683,10 @@ repositories are displayed. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-repos" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-reset" "magit-reset.el" (0 0 0 0)) +;;;### (autoloads nil "magit-reset" "magit-reset.el" (23994 42055 +;;;;;; 929835 257000)) ;;; Generated autoloads from magit-reset.el (autoload 'magit-reset "magit" nil t) @@ -1775,19 +1734,10 @@ With a prefix argument reset the working tree otherwise don't. \(fn COMMIT &optional HARD)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-reset" '("magit-reset"))) - -;;;*** - -;;;### (autoloads nil "magit-section" "magit-section.el" (0 0 0 0)) -;;; Generated autoloads from magit-section.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-section" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (0 0 0 -;;;;;; 0)) +;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (23994 +;;;;;; 42055 924982 969000)) ;;; Generated autoloads from magit-sequence.el (autoload 'magit-sequencer-continue "magit-sequence" "\ @@ -1963,11 +1913,10 @@ Abort the current rebase operation, restoring the original branch. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-sequence" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-stash" "magit-stash.el" (0 0 0 0)) +;;;### (autoloads nil "magit-stash" "magit-stash.el" (23994 42055 +;;;;;; 916082 778000)) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash "magit-stash" nil t) @@ -2051,8 +2000,8 @@ Create and checkout a new BRANCH from STASH. (autoload 'magit-stash-branch-here "magit-stash" "\ Create and checkout a new BRANCH and apply STASH. -The branch is created using `magit-branch', using the current -branch or `HEAD' as the string-point. +The branch is created using `magit-branch-and-checkout', using the +current branch or `HEAD' as the start-point. \(fn STASH BRANCH)" t nil) @@ -2071,11 +2020,10 @@ Show all diffs of a stash in a buffer. \(fn STASH &optional ARGS FILES)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-stash" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-status" "magit-status.el" (0 0 0 0)) +;;;### (autoloads nil "magit-status" "magit-status.el" (23994 42055 +;;;;;; 906727 778000)) ;;; Generated autoloads from magit-status.el (autoload 'magit-init "magit-status" "\ @@ -2125,17 +2073,28 @@ prefix arguments: \(fn &optional DIRECTORY CACHE)" t nil) +(defalias 'magit 'magit-status "\ +An alias for `magit-status' for better discoverability. + +Instead of invoking this alias for `magit-status' using +\"M-x magit RET\", you should bind a key to `magit-status' +and read the info node `(magit)Getting Started', which +also contains other useful hints.") + +(autoload 'magit-status-here "magit-status" "\ +Like `magit-status' but with non-nil `magit-status-goto-file-position'. + +\(fn)" t nil) + (autoload 'magit-status-setup-buffer "magit-status" "\ \(fn &optional DIRECTORY)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-status" '("magit"))) - ;;;*** -;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (0 0 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (23994 +;;;;;; 42055 877342 320000)) ;;; Generated autoloads from magit-submodule.el (autoload 'magit-submodule "magit-submodule" nil t) (autoload 'magit-submodule-add "magit-submodule" nil t) @@ -2210,11 +2169,10 @@ Display a list of the current repository's submodules. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-submodule" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (0 0 0 0)) +;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (23994 42055 +;;;;;; 882016 538000)) ;;; Generated autoloads from magit-subtree.el (autoload 'magit-subtree "magit-subtree" nil t) (autoload 'magit-subtree-import "magit-subtree" nil t) @@ -2250,11 +2208,10 @@ Extract the history of the subtree PREFIX. \(fn PREFIX COMMIT ARGS)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-subtree" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-tag" "magit-tag.el" (0 0 0 0)) +;;;### (autoloads nil "magit-tag" "magit-tag.el" (23994 42055 899723 +;;;;;; 626000)) ;;; Generated autoloads from magit-tag.el (autoload 'magit-tag "magit" nil t) @@ -2304,19 +2261,10 @@ review the result. \(fn TAG MSG)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-tag" '("magit-"))) - -;;;*** - -;;;### (autoloads nil "magit-transient" "magit-transient.el" (0 0 -;;;;;; 0 0)) -;;; Generated autoloads from magit-transient.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-transient" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-utils" "magit-utils.el" (0 0 0 0)) +;;;### (autoloads nil "magit-utils" "magit-utils.el" (23994 42055 +;;;;;; 880689 9000)) ;;; Generated autoloads from magit-utils.el (autoload 'magit-emacs-Q-command "magit-utils" "\ @@ -2339,11 +2287,10 @@ See info node `(magit)Debugging Tools' for more information. (advice-add 'org-man-export :around 'org-man-export--magit-gitman) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-utils" '("magit-" "whitespace-dont-turn-on-in-magit-mode"))) - ;;;*** -;;;### (autoloads nil "magit-wip" "magit-wip.el" (0 0 0 0)) +;;;### (autoloads nil "magit-wip" "magit-wip.el" (23994 42055 939957 +;;;;;; 690000)) ;;; Generated autoloads from magit-wip.el (defvar magit-wip-after-save-mode nil "\ @@ -2427,12 +2374,10 @@ a Git repository. \(fn)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-wip" '("magit-"))) - ;;;*** -;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (0 0 0 -;;;;;; 0)) +;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (23994 +;;;;;; 42055 885627 612000)) ;;; Generated autoloads from magit-worktree.el (autoload 'magit-worktree "magit-worktree" nil t) @@ -2446,12 +2391,17 @@ Create a new BRANCH and check it out in a new worktree at PATH. \(fn PATH BRANCH START-POINT &optional FORCE)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-worktree" '("magit-"))) +(autoload 'magit-worktree-move "magit-worktree" "\ +Move WORKTREE to PATH. + +\(fn WORKTREE PATH)" t nil) ;;;*** -;;;### (autoloads nil nil ("magit-core.el" "magit-pkg.el") (0 0 0 -;;;;;; 0)) +;;;### (autoloads nil nil ("magit-core.el" "magit-git.el" "magit-margin.el" +;;;;;; "magit-mode.el" "magit-obsolete.el" "magit-pkg.el" "magit-process.el" +;;;;;; "magit-section.el" "magit-transient.el") (23994 42055 950443 +;;;;;; 799000)) ;;;*** @@ -2459,6 +2409,5 @@ Create a new BRANCH and check it out in a new worktree at PATH. ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; magit-autoloads.el ends here diff --git a/elpa/magit-20190514.1814/magit-autorevert.el b/elpa/magit-20191030.1315/magit-autorevert.el similarity index 95% rename from elpa/magit-20190514.1814/magit-autorevert.el rename to elpa/magit-20191030.1315/magit-autorevert.el index 3a437e86..215864c4 100644 --- a/elpa/magit-20190514.1814/magit-autorevert.el +++ b/elpa/magit-20191030.1315/magit-autorevert.el @@ -237,14 +237,20 @@ defaults to nil) for any BUFFER." ;; ^ `tramp-handle-file-in-directory-p' lacks this optimization. (file-in-directory-p dir top)))))) -(defun auto-revert-buffers--buffer-list-filter () +(defun auto-revert-buffers--buffer-list-filter (fn) (cl-incf magit-auto-revert-counter) - (when auto-revert-buffer-list-filter - (setq auto-revert-buffer-list - (-filter auto-revert-buffer-list-filter - auto-revert-buffer-list)))) - -(advice-add 'auto-revert-buffers :before + (if (or global-auto-revert-mode + (not auto-revert-buffer-list) + (not auto-revert-buffer-list-filter)) + (funcall fn) + (let ((auto-revert-buffer-list + (-filter auto-revert-buffer-list-filter + auto-revert-buffer-list))) + (funcall fn)) + (unless auto-revert-timer + (auto-revert-set-timer)))) + +(advice-add 'auto-revert-buffers :around 'auto-revert-buffers--buffer-list-filter) ;;; _ diff --git a/elpa/magit-20190514.1814/magit-bisect.el b/elpa/magit-20191030.1315/magit-bisect.el similarity index 97% rename from elpa/magit-20190514.1814/magit-bisect.el rename to elpa/magit-20191030.1315/magit-bisect.el index 3338f8f6..3e54c1c2 100644 --- a/elpa/magit-20190514.1814/magit-bisect.el +++ b/elpa/magit-20191030.1315/magit-bisect.el @@ -187,7 +187,7 @@ bisect run'." (and bad-line (match-string 1 bad-line))) (magit-insert-heading (propertize (or bad-line (pop lines)) - 'face 'magit-section-heading)) + 'font-lock-face 'magit-section-heading)) (dolist (line lines) (insert line "\n")))) (insert "\n"))) @@ -220,7 +220,8 @@ bisect run'." (narrow-to-region beg (point)) (goto-char (point-min)) (magit-insert-section (bisect-item heading t) - (insert (propertize heading 'face 'magit-section-secondary-heading)) + (insert (propertize heading 'font-lock-face + 'magit-section-secondary-heading)) (magit-insert-heading) (magit-wash-sequence (apply-partially 'magit-log-wash-rev 'bisect-log diff --git a/elpa/magit-20190514.1814/magit-blame.el b/elpa/magit-20191030.1315/magit-blame.el similarity index 95% rename from elpa/magit-20190514.1814/magit-blame.el rename to elpa/magit-20191030.1315/magit-blame.el index 3aacf1ef..cbc77653 100644 --- a/elpa/magit-20190514.1814/magit-blame.el +++ b/elpa/magit-20191030.1315/magit-blame.el @@ -400,7 +400,7 @@ modes is toggled, then this mode also gets toggled automatically. ;;; Process -(defun magit-blame--run () +(defun magit-blame--run (args) (magit-with-toplevel (unless magit-blame-mode (magit-blame-mode 1)) @@ -409,8 +409,8 @@ modes is toggled, then this mode also gets toggled automatically. (or magit-buffer-refname magit-buffer-revision) (magit-file-relative-name nil (not magit-buffer-file-name)) (if (memq magit-blame-type '(final removal)) - (cons "--reverse" (magit-blame-arguments)) - (magit-blame-arguments)) + (cons "--reverse" args) + args) (list (line-number-at-pos (window-start)) (line-number-at-pos (1- (window-end nil t))))) (set-process-sentinel magit-this-process @@ -622,7 +622,7 @@ modes is toggled, then this mode also gets toggled automatically. magit-blame-separator)))) (defun magit-blame--update-highlight-overlay (ov) - (overlay-put ov 'face (magit-blame--style-get 'highlight-face))) + (overlay-put ov 'font-lock-face (magit-blame--style-get 'highlight-face))) (defun magit-blame--format-string (ov format face) (let* ((chunk (overlay-get ov 'magit-blame-chunk)) @@ -643,15 +643,16 @@ modes is toggled, then this mode also gets toggled automatically. (propertize (concat (if (string-prefix-p "\s" format) "\s" "") "Not Yet Committed" (if (string-suffix-p "\n" format) "\n" "")) - 'face face) + 'font-lock-face face) (magit--format-spec - (propertize format 'face face) + (propertize format 'font-lock-face face) (cl-flet* ((p0 (s f) - (propertize s 'face (if face - (if (listp face) - face - (list f face)) - f))) + (propertize s 'font-lock-face + (if face + (if (listp face) + face + (list f face)) + f))) (p1 (k f) (p0 (cdr (assoc k revinfo)) f)) (p2 (k1 k2 f) @@ -670,21 +671,21 @@ modes is toggled, then this mode also gets toggled automatically. (magit-blame--style-get 'margin-width)))) (concat str (propertize (make-string (max 0 (- width (length str))) ?\s) - 'face face)) + 'font-lock-face face)) str))) (defun magit-blame--format-separator () (propertize (concat (propertize "\s" 'display '(space :height (2))) (propertize "\n" 'line-height t)) - 'face (list :background - (face-attribute 'magit-blame-heading :background nil t)))) + 'font-lock-face (list :background + (face-attribute 'magit-blame-heading + :background nil t)))) (defun magit-blame--format-time-string (time tz) (let* ((time-format (or (magit-blame--style-get 'time-format) magit-blame-time-format)) - (tz-in-second (and (not (version< emacs-version "25")) - (string-match "%z" time-format) + (tz-in-second (and (string-match "%z" time-format) (car (last (parse-time-string tz)))))) (format-time-string time-format (seconds-to-time (string-to-number time)) @@ -712,7 +713,7 @@ modes is toggled, then this mode also gets toggled automatically. ;;; Commands ;;;###autoload (autoload 'magit-blame-echo "magit-blame" nil t) -(define-suffix-command magit-blame-echo () +(define-suffix-command magit-blame-echo (args) "For each line show the revision in which it was added. Show the information about the chunk at point in the echo area when moving between chunks. Unlike other blaming commands, do @@ -721,7 +722,7 @@ not turn on `read-only-mode'." (and buffer-file-name (or (not magit-blame-mode) buffer-read-only))) - (interactive) + (interactive (list (magit-blame-arguments))) (when magit-buffer-file-name (user-error "Blob buffers aren't supported")) (setq-local magit-blame--style @@ -732,39 +733,39 @@ not turn on `read-only-mode'." (let ((magit-blame-read-only nil)) (magit-blame--pre-blame-assert 'addition) (magit-blame--pre-blame-setup 'addition) - (magit-blame--run)) + (magit-blame--run args)) (read-only-mode -1) (magit-blame--update-overlays))) ;;;###autoload (autoload 'magit-blame-addition "magit-blame" nil t) -(define-suffix-command magit-blame-addition () +(define-suffix-command magit-blame-addition (args) "For each line show the revision in which it was added." - (interactive) + (interactive (list (magit-blame-arguments))) (magit-blame--pre-blame-assert 'addition) (magit-blame--pre-blame-setup 'addition) - (magit-blame--run)) + (magit-blame--run args)) ;;;###autoload (autoload 'magit-blame-removal "magit-blame" nil t) -(define-suffix-command magit-blame-removal () +(define-suffix-command magit-blame-removal (args) "For each line show the revision in which it was removed." :if-nil 'buffer-file-name - (interactive) + (interactive (list (magit-blame-arguments))) (unless magit-buffer-file-name (user-error "Only blob buffers can be blamed in reverse")) (magit-blame--pre-blame-assert 'removal) (magit-blame--pre-blame-setup 'removal) - (magit-blame--run)) + (magit-blame--run args)) ;;;###autoload (autoload 'magit-blame-reverse "magit-blame" nil t) -(define-suffix-command magit-blame-reverse () +(define-suffix-command magit-blame-reverse (args) "For each line show the last revision in which it still exists." :if-nil 'buffer-file-name - (interactive) + (interactive (list (magit-blame-arguments))) (unless magit-buffer-file-name (user-error "Only blob buffers can be blamed in reverse")) (magit-blame--pre-blame-assert 'final) (magit-blame--pre-blame-setup 'final) - (magit-blame--run)) + (magit-blame--run args)) (defun magit-blame--pre-blame-assert (type) (unless (magit-toplevel) @@ -926,11 +927,11 @@ instead of the hash, like `kill-ring-save' would." ;;; Utilities (defun magit-blame-maybe-update-revision-buffer () - (unless magit--update-revision-buffer - (setq magit--update-revision-buffer nil) - (when-let ((chunk (magit-current-blame-chunk)) - (commit (oref chunk orig-rev)) - (buffer (magit-get-mode-buffer 'magit-revision-mode nil t))) + (when-let ((chunk (magit-current-blame-chunk)) + (commit (oref chunk orig-rev)) + (buffer (magit-get-mode-buffer 'magit-revision-mode nil t))) + (if magit--update-revision-buffer + (setq magit--update-revision-buffer (list commit buffer)) (setq magit--update-revision-buffer (list commit buffer)) (run-with-idle-timer magit-update-other-window-delay nil diff --git a/elpa/magit-20190514.1814/magit-bookmark.el b/elpa/magit-20191030.1315/magit-bookmark.el similarity index 99% rename from elpa/magit-20190514.1814/magit-bookmark.el rename to elpa/magit-20191030.1315/magit-bookmark.el index b5fef677..49ba9c70 100644 --- a/elpa/magit-20190514.1814/magit-bookmark.el +++ b/elpa/magit-20191030.1315/magit-bookmark.el @@ -64,6 +64,7 @@ and the buffer-local values of the variables referenced in its bookmark) (user-error "Bookmarking is not implemented for %s buffers" major-mode))) +;;;###autoload (defun magit--handle-bookmark (bookmark) "Open a bookmark created by `magit--make-bookmark'. Call the `magit-*-setup-buffer' function of the the major-mode diff --git a/elpa/magit-20190514.1814/magit-branch.el b/elpa/magit-20191030.1315/magit-branch.el similarity index 99% rename from elpa/magit-20190514.1814/magit-branch.el rename to elpa/magit-20191030.1315/magit-branch.el index 3385a129..9d7dc251 100644 --- a/elpa/magit-20190514.1814/magit-branch.el +++ b/elpa/magit-20191030.1315/magit-branch.el @@ -228,7 +228,10 @@ has to be used to view and change branch related variables." ("C" "configure..." magit-branch-configure) ("m" "rename" magit-branch-rename) ("x" "reset" magit-branch-reset) - ("k" "delete" magit-branch-delete)]] + ("k" "delete" magit-branch-delete)] + ["" + (7 "h" "shelve" magit-branch-shelve) + (7 "H" "unshelve" magit-branch-unshelve)]] (interactive (list (magit-get-current-branch))) (transient-setup 'magit-branch nil nil :scope branch)) @@ -776,7 +779,7 @@ and also rename the respective reflog file." (not (and magit-branch-direct-configure (eq current-transient-command 'magit-branch))) (magit-get-current-branch)) - (magit--read-remote-scope)))) + (magit--read-branch-scope)))) (transient-setup 'magit-branch-configure nil nil :scope branch)) (defun magit--read-branch-scope (&optional obj) diff --git a/elpa/magit-20190514.1814/magit-clone.el b/elpa/magit-20191030.1315/magit-clone.el similarity index 100% rename from elpa/magit-20190514.1814/magit-clone.el rename to elpa/magit-20191030.1315/magit-clone.el diff --git a/elpa/magit-20190514.1814/magit-commit.el b/elpa/magit-20191030.1315/magit-commit.el similarity index 92% rename from elpa/magit-20190514.1814/magit-commit.el rename to elpa/magit-20191030.1315/magit-commit.el index 34c3fc51..6a560560 100644 --- a/elpa/magit-20190514.1814/magit-commit.el +++ b/elpa/magit-20191030.1315/magit-commit.el @@ -42,8 +42,9 @@ "Whether to ask to stage all unstaged changes when committing and nothing is staged." :package-version '(magit . "2.3.0") :group 'magit-commands - :type '(choice (const :tag "Ask showing diff" verbose) - (const :tag "Ask" t) + :type '(choice (const :tag "Ask" t) + (const :tag "Ask showing diff" verbose) + (const :tag "Stage without confirmation" stage) (const :tag "Don't ask" nil))) (defcustom magit-commit-show-diff t @@ -147,20 +148,23 @@ Also see `git-commit-post-finish-hook'." (defvar magit-gpg-secret-key-hist nil) -(defun magit-read-gpg-secret-key (prompt &optional _initial-input history) +(defun magit-read-gpg-secret-key (prompt &optional initial-input history) (require 'epa) - (let ((keys (--map (concat (epg-sub-key-id (car (epg-key-sub-key-list it))) - " " - (when-let ((id-obj (car (epg-key-user-id-list it)))) - (let ((id-str (epg-user-id-string id-obj))) - (if (stringp id-str) - id-str - (epg-decode-dn id-obj))))) - (epg-list-keys (epg-make-context epa-protocol) nil t)))) - (car (split-string (magit-completing-read - prompt keys nil nil nil history - (car (or history keys))) - " ")))) + (let* ((keys (mapcar + (lambda (obj) + (let ((key (epg-sub-key-id (car (epg-key-sub-key-list obj)))) + (author + (when-let ((id-obj (car (epg-key-user-id-list obj)))) + (let ((id-str (epg-user-id-string id-obj))) + (if (stringp id-str) + id-str + (epg-decode-dn id-obj)))))) + (propertize key 'display (concat key " " author)))) + (epg-list-keys (epg-make-context epa-protocol) nil t))) + (choice (completing-read prompt keys nil nil nil + history nil initial-input))) + (set-text-properties 0 (length choice) nil choice) + choice)) (define-infix-argument magit-commit:--reuse-message () :description "Reuse commit message" @@ -369,7 +373,8 @@ depending on the value of option `magit-commit-squash-confirm'." (magit-commit-ask-to-stage (when (eq magit-commit-ask-to-stage 'verbose) (magit-diff-unstaged)) - (prog1 (when (y-or-n-p "Nothing staged. Stage and commit all unstaged changes? ") + (prog1 (when (or (eq magit-commit-ask-to-stage 'stage) + (y-or-n-p "Nothing staged. Stage and commit all unstaged changes? ")) (magit-run-git "add" "-u" ".") (or args (list "--"))) (when (and (eq magit-commit-ask-to-stage 'verbose) @@ -469,19 +474,18 @@ is available from https://github.com/torbiak/git-autofixup." (magit-display-buffer-noselect t) (inhibit-quit nil)) (message "Diffing changes to be committed (C-g to abort diffing)") - (if-let ((fn (cl-case last-command - (magit-commit - (apply-partially 'magit-diff-staged nil)) - (magit-commit-all - (apply-partially 'magit-diff-working-tree nil)) - ((magit-commit-amend - magit-commit-reword - magit-rebase-reword-commit) - 'magit-diff-while-amending)))) - (funcall fn args) - (if (magit-anything-staged-p) - (magit-diff-staged nil args) - (magit-diff-while-amending args)))) + (cl-case last-command + (magit-commit + (magit-diff-staged nil args)) + (magit-commit-all + (magit-diff-working-tree nil args)) + ((magit-commit-amend + magit-commit-reword + magit-rebase-reword-commit) + (magit-diff-while-amending args)) + (t (if (magit-anything-staged-p) + (magit-diff-staged nil args) + (magit-diff-while-amending args))))) (quit)))) ;; Mention `magit-diff-while-committing' because that's diff --git a/elpa/magit-20190514.1814/magit-core.el b/elpa/magit-20191030.1315/magit-core.el similarity index 99% rename from elpa/magit-20190514.1814/magit-core.el rename to elpa/magit-20191030.1315/magit-core.el index ccb48bf3..f790dce2 100644 --- a/elpa/magit-20190514.1814/magit-core.el +++ b/elpa/magit-20191030.1315/magit-core.el @@ -67,7 +67,7 @@ Each of these options falls into one or more of these categories: :group 'magit) (defgroup magit-miscellaneous nil - "Miscellanous Magit options." + "Miscellaneous Magit options." :group 'magit) (defgroup magit-commands nil diff --git a/elpa/magit-20190514.1814/magit-diff.el b/elpa/magit-20191030.1315/magit-diff.el similarity index 93% rename from elpa/magit-20190514.1814/magit-diff.el rename to elpa/magit-20191030.1315/magit-diff.el index f1898d8d..c45a9194 100644 --- a/elpa/magit-20190514.1814/magit-diff.el +++ b/elpa/magit-20191030.1315/magit-diff.el @@ -254,15 +254,14 @@ Used only when `magit-diff-paint-whitespace' is non-nil." "Highlight the \"wrong\" indentation style. Used only when `magit-diff-paint-whitespace' is non-nil. -The value is a list of cons cells. The car is a regular -expression, and the cdr is the value that applies to repositories -whose directory matches the regular expression. If more than one -element matches, then the *last* element in the list applies. -The default value should therefore come first in the list. - -If the value is `tabs', highlight indentation with tabs. If the -value is an integer, highlight indentation with at least that -many spaces. Otherwise, highlight neither." +The value is an alist of the form ((REGEXP . INDENT)...). The +path to the current repository is matched against each element +in reverse order. Therefore if a REGEXP matches, then earlier +elements are not tried. + +If the used INDENT is `tabs', highlight indentation with tabs. +If INDENT is an integer, highlight indentation with at least +that many spaces. Otherwise, highlight neither." :group 'magit-diff :type `(repeat (cons (string :tag "Directory regexp") (choice (const :tag "Tabs" tabs) @@ -471,12 +470,18 @@ visits the file in the working tree." "Whether `magit-diff-visit-file' avoids visiting a blob from `HEAD'. By default `magit-diff-visit-file' always visits the blob that -added the current line, while `magit-diff-visit-file-worktree' +added the current line, while `magit-diff-visit-worktree-file' visits the respective file in the working tree. For the `HEAD' commit, the former command used to visit the worktree file too, but that made it impossible to visit a blob from `HEAD'. -If you prefer the old behavior, then set this to t." +When point is on a removed line and that change has not been +committed yet, then `magit-diff-visit-file' now visits the last +blob that still had that line, which is a blob from `HEAD'. +Previously this function used to visit the worktree file not +only for added lines but also for such removed lines. + +If you prefer the old behaviors, then set this to t." :package-version '(magit . "2.91.0") :group 'magit-diff :type 'boolean) @@ -545,6 +550,16 @@ lose of information. Good properties to set here are `:weight' and `:slant'." :group 'magit-faces) +(defface magit-diff-revision-summary + '((t :inherit magit-diff-hunk-heading)) + "Face for commit message summaries." + :group 'magit-faces) + +(defface magit-diff-revision-summary-highlight + '((t :inherit magit-diff-hunk-heading-highlight)) + "Face for highlighted commit message summaries." + :group 'magit-faces) + (defface magit-diff-lines-heading '((((class color) (background light)) :inherit magit-diff-hunk-heading-highlight @@ -719,7 +734,7 @@ and `:slant'." "Return the current diff arguments." (if (memq current-transient-command '(magit-diff magit-diff-refresh)) (pcase-let ((`(,args ,alist) - (transient-args nil t))) + (-separate #'atom (transient-get-value)))) (list args (cdr (assoc "--" alist)))) (magit-diff--get-value (or mode 'magit-diff-mode)))) @@ -754,7 +769,7 @@ and `:slant'." (mode (or (oref obj major-mode) major-mode)) (key (intern (format "magit-diff:%s" mode))) (`(,args ,alist) - (-separate #'atom (transient-args))) + (-separate #'atom (transient-get-value))) (files (cdr (assoc "--" alist)))) (put mode 'magit-diff-current-arguments args) (when save @@ -787,6 +802,7 @@ and `:slant'." (magit-diff:-C) ("-x" "Disallow external diff drivers" "--no-ext-diff") ("-s" "Show stats" "--stat") + ("=g" "Show signature" "--show-signature") (5 magit-diff:--color-moved) (5 magit-diff:--color-moved-ws)] ["Actions" @@ -819,6 +835,8 @@ and `:slant'." ("-x" "Disallow external diff drivers" "--no-ext-diff") ("-s" "Show stats" "--stat" :if-derived magit-diff-mode) + ("=g" "Show signature" "--show-signature" + :if-derived magit-diff-mode) (5 magit-diff:--color-moved) (5 magit-diff:--color-moved-ws)] [["Refresh" @@ -1114,10 +1132,8 @@ be committed." (interactive (list (car (magit-diff-arguments)))) (unless (magit-commit-message-buffer) (user-error "No commit in progress")) - (let ((magit-display-buffer-noselect t) - (diff-buf (magit-get-mode-buffer 'magit-diff-mode))) - (if (and diff-buf - (get-buffer-window diff-buf)) + (let ((magit-display-buffer-noselect t)) + (if-let ((diff-buf (magit-get-mode-buffer 'magit-diff-mode 'selected))) (with-current-buffer diff-buf (cond ((and (equal magit-buffer-range "HEAD^") (equal magit-buffer-typearg "--cached")) @@ -1221,33 +1237,43 @@ for a revision." (with-current-buffer buf (magit-diff--goto-position file line col)))))))) -(defun magit-diff--goto-position (file line column) +(defun magit-diff--locate-hunk (file line &optional parent) (when-let ((diff (cl-find-if (lambda (section) (and (cl-typep section 'magit-file-section) (equal (oref section value) file))) - (oref magit-root-section children)))) - (goto-char (oref diff start)) + (oref (or parent magit-root-section) children)))) (let (hunk (hunks (oref diff children))) - (while (setq hunk (pop hunks)) - (pcase-let* ((`(,beg ,len) (oref hunk to-range)) - (end (+ beg len))) - (cond ((<= beg line end) - (goto-char (oref hunk content)) - (let ((pos beg)) - (while (or (< pos line) - (= (char-after) ?-)) - (unless (= (char-after) ?-) - (cl-incf pos)) - (forward-line))) - (move-to-column (1+ column)) - (setq hunks nil)) - ((> end line) - (goto-char (oref hunk start)) - (setq hunks nil)) - ;; ((not hunks) - ;; (goto-char (oref hunk end)) - ;; (forward-line -1)) - )))))) + (cl-block nil + (while (setq hunk (pop hunks)) + (pcase-let* ((`(,beg ,len) (oref hunk to-range)) + (end (+ beg len))) + (cond ((> beg line) (cl-return (list diff nil))) + ((<= beg line end) (cl-return (list hunk t))) + ((null hunks) (cl-return (list hunk nil)))))))))) + +(defun magit-diff--goto-position (file line column &optional parent) + (when-let ((pos (magit-diff--locate-hunk file line parent))) + (pcase-let ((`(,section ,exact) pos)) + (cond ((cl-typep section 'magit-file-section) + (goto-char (oref section start))) + (exact + (goto-char (oref section content)) + (let ((pos (car (oref section to-range)))) + (while (or (< pos line) + (= (char-after) ?-)) + (unless (= (char-after) ?-) + (cl-incf pos)) + (forward-line))) + (forward-char (1+ column))) + (t + (goto-char (oref section start)) + (setq section (oref section parent)))) + (while section + (when (oref section hidden) + (magit-section-show section)) + (setq section (oref section parent)))) + (magit-section-update-highlight) + t)) (cl-defmethod magit-buffer-value (&context (major-mode magit-revision-mode)) (cons magit-buffer-range magit-buffer-diff-files)) @@ -1265,7 +1291,7 @@ Change \"revA..revB\" to \"revA...revB\", or vice versa." (replace-match (if (string= (match-string 2 magit-buffer-range) "..") "..." "..") - t t magit-buffer-range)) + t t magit-buffer-range 2)) (user-error "No range to change")) (magit-refresh)) @@ -1471,7 +1497,7 @@ Like `magit-diff-visit-worktree-file' but use (defun magit-diff-visit-file--internal (file force-worktree fn) "From a diff visit the appropriate version of FILE. -If FORCE-WORKTREE is non-nil, the visit the worktree version of +If FORCE-WORKTREE is non-nil, then visit the worktree version of the file, even if the diff is about a committed change. USE FN to display the buffer in some window." (if (magit-file-accessible-directory-p file) @@ -1523,11 +1549,14 @@ the Magit-Status buffer for DIRECTORY." (rev (if goto-from (magit-diff-visit--range-from spec) (magit-diff-visit--range-to spec))) - (buf (if (and (not goto-worktree) - (stringp rev)) - (magit-find-file-noselect rev file) - (or (get-file-buffer file) - (find-file-noselect file))))) + (buf (if (or goto-worktree + (and (not (stringp rev)) + (or magit-diff-visit-avoid-head-blob + (not goto-from)))) + (or (get-file-buffer file) + (find-file-noselect file)) + (magit-find-file-noselect (if (stringp rev) rev "HEAD") + file)))) (if line (with-current-buffer buf (cond ((eq rev 'staged) @@ -1723,12 +1752,12 @@ commit or stash at point, then prompt for a commit." (defvar magit-diff-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map magit-mode-map) - (define-key map "\C-c\C-d" 'magit-diff-while-committing) - (define-key map "\C-c\C-b" 'magit-go-backward) - (define-key map "\C-c\C-f" 'magit-go-forward) - (define-key map "\s" 'scroll-up) - (define-key map "\d" 'scroll-down) - (define-key map "j" 'magit-jump-to-diffstat-or-diff) + (define-key map (kbd "C-c C-d") 'magit-diff-while-committing) + (define-key map (kbd "C-c C-b") 'magit-go-backward) + (define-key map (kbd "C-c C-f") 'magit-go-forward) + (define-key map (kbd "SPC") 'scroll-up) + (define-key map (kbd "DEL") 'scroll-down) + (define-key map (kbd "j") 'magit-jump-to-diffstat-or-diff) (define-key map [remap write-file] 'magit-patch-save) map) "Keymap for `magit-diff-mode'.") @@ -1807,8 +1836,8 @@ Staging and applying changes is documented in info node (defvar magit-file-section-map (let ((map (make-sparse-keymap))) (unless (featurep 'jkl) - (define-key map (kbd "C-j") 'magit-diff-visit-file-worktree)) - (define-key map [C-return] 'magit-diff-visit-file-worktree) + (define-key map (kbd "C-j") 'magit-diff-visit-worktree-file)) + (define-key map [C-return] 'magit-diff-visit-worktree-file) (define-key map [remap magit-visit-thing] 'magit-diff-visit-file) (define-key map [remap magit-delete-thing] 'magit-discard) (define-key map [remap magit-revert-no-commit] 'magit-reverse) @@ -1825,8 +1854,8 @@ Staging and applying changes is documented in info node (defvar magit-hunk-section-map (let ((map (make-sparse-keymap))) (unless (featurep 'jkl) - (define-key map (kbd "C-j") 'magit-diff-visit-file-worktree)) - (define-key map [C-return] 'magit-diff-visit-file-worktree) + (define-key map (kbd "C-j") 'magit-diff-visit-worktree-file)) + (define-key map [C-return] 'magit-diff-visit-worktree-file) (define-key map [remap magit-visit-thing] 'magit-diff-visit-file) (define-key map [remap magit-delete-thing] 'magit-discard) (define-key map [remap magit-revert-no-commit] 'magit-reverse) @@ -1891,6 +1920,8 @@ Staging and applying changes is documented in info node (magit-git-wash #'magit-diff-wash-diffs args))) (defun magit-diff-wash-diffs (args &optional limit) + (when (member "--show-signature" args) + (magit-diff-wash-signature)) (when (member "--stat" args) (magit-diff-wash-diffstat)) (when (re-search-forward magit-diff-headline-re limit t) @@ -1913,6 +1944,13 @@ section or a child thereof." (magit-section-goto it) (user-error "No diffstat in this buffer"))) +(defun magit-diff-wash-signature () + (when (looking-at "^gpg: ") + (magit-insert-section (signature) + (while (looking-at "^gpg: ") + (forward-line)) + (insert "\n")))) + (defun magit-diff-wash-diffstat () (let (heading (beg (point))) (when (re-search-forward "^ ?\\([0-9]+ +files? change[^\n]*\n\\)" nil t) @@ -1920,15 +1958,19 @@ section or a child thereof." (magit-delete-match) (goto-char beg) (magit-insert-section (diffstat) - (insert (propertize heading 'face 'magit-diff-file-heading)) + (insert (propertize heading 'font-lock-face 'magit-diff-file-heading)) (magit-insert-heading) (let (files) (while (looking-at "^[-0-9]+\t[-0-9]+\t\\(.+\\)$") (push (magit-decode-git-path (let ((f (match-string 1))) - (if (string-match " => " f) - (substring f (match-end 0)) - f))) + (cond + ((string-match "\\`\\([^{]+\\){\\(.+\\) => \\(.+\\)}\\'" f) + (concat (match-string 1 f) + (match-string 3 f))) + ((string-match " => " f) + (substring f (match-end 0))) + (t f)))) files) (magit-delete-line)) (setq files (nreverse files)) @@ -1944,11 +1986,14 @@ section or a child thereof." (when (> le ld) (setq sep (concat (make-string (- le ld) ?\s) sep)))) (magit-insert-section (file (pop files)) - (insert (propertize file 'face 'magit-filename) sep cnt " ") + (insert (propertize file 'font-lock-face 'magit-filename) + sep cnt " ") (when add - (insert (propertize add 'face 'magit-diffstat-added))) + (insert (propertize add 'font-lock-face + 'magit-diffstat-added))) (when del - (insert (propertize del 'face 'magit-diffstat-removed))) + (insert (propertize del 'font-lock-face + 'magit-diffstat-removed))) (insert "\n"))))) (if (looking-at "^$") (forward-line) (insert "\n")))))) @@ -1975,7 +2020,7 @@ section or a child thereof." (`(?A ?U) " (added by us)") (`(?U ?A) " (added by them)") (`(?U ?U) ""))) - 'face 'magit-diff-file-heading)) + 'font-lock-face 'magit-diff-file-heading)) (insert ?\n)))) t) ((looking-at (concat "^\\(merged\\|changed in both\\|" @@ -2050,7 +2095,7 @@ section or a child thereof." (if (or (not orig) (equal orig file)) file (format "%s -> %s" orig file))) - 'face 'magit-diff-file-heading)) + 'font-lock-face 'magit-diff-file-heading)) (magit-insert-heading) (unless (equal orig file) (oset section source orig)) @@ -2085,7 +2130,7 @@ section or a child thereof." (magit-insert-section (magit-module-section module t) (magit-insert-heading (propertize (concat "modified " module) - 'face 'magit-diff-file-heading) + 'font-lock-face 'magit-diff-file-heading) " (" (cond (rewind "rewind") ((string-match-p "\\.\\.\\." range) "non-ff") @@ -2110,13 +2155,13 @@ section or a child thereof." (magit-insert-section (magit-module-section module) (magit-insert-heading (propertize (concat "submodule " module) - 'face 'magit-diff-file-heading) + 'font-lock-face 'magit-diff-file-heading) " (" msg ")")))) (t (magit-insert-section (magit-module-section module) (magit-insert-heading (propertize (concat "modified " module) - 'face 'magit-diff-file-heading) + 'font-lock-face 'magit-diff-file-heading) " (" (and modified "modified") (and modified untracked " and ") @@ -2135,7 +2180,8 @@ section or a child thereof." (value (cons about ranges))) (magit-delete-line) (magit-insert-section section (hunk value) - (insert (propertize (concat heading "\n") 'face 'magit-diff-hunk-heading)) + (insert (propertize (concat heading "\n") + 'font-lock-face 'magit-diff-hunk-heading)) (magit-insert-heading) (while (not (or (eobp) (looking-at "^[^-+\s\\]"))) (forward-line)) @@ -2241,7 +2287,8 @@ or a ref which is not a branch, then it inserts nothing." (match-string 1) (match-string 2)))) (magit-delete-line) - (insert (propertize heading 'face 'magit-section-secondary-heading))) + (insert (propertize heading 'font-lock-face + 'magit-section-secondary-heading))) (magit-insert-heading) (if (re-search-forward "-----BEGIN PGP SIGNATURE-----" nil t) (progn @@ -2263,7 +2310,7 @@ or a ref which is not a branch, then it inserts nothing." (defun magit-insert-revision-message () "Insert the commit message into a revision buffer." (magit-insert-section section (commit-message) - (oset section heading-highlight-face 'magit-diff-hunk-heading-highlight) + (oset section heading-highlight-face 'magit-diff-revision-summary-highlight) (let ((beg (point)) (rev magit-buffer-revision)) (insert (with-temp-buffer @@ -2302,14 +2349,16 @@ or a ref which is not a branch, then it inserts nothing." (magit-commit-p text))) (`slow (magit-commit-p text))) - (put-text-property beg (point) 'face 'magit-hash) + (put-text-property beg (point) + 'font-lock-face 'magit-hash) (let ((end (point))) (goto-char beg) (magit-insert-section (commit text) (goto-char end)))))))))) (save-excursion (forward-line) - (add-face-text-property beg (point) 'magit-diff-hunk-heading) + (magit--add-face-text-property + beg (point) 'magit-diff-revision-summary) (magit-insert-heading)) (when magit-diff-highlight-keywords (save-excursion @@ -2317,8 +2366,8 @@ or a ref which is not a branch, then it inserts nothing." (let ((beg (match-beginning 0)) (end (match-end 0))) (put-text-property - beg end 'face - (if-let ((face (get-text-property beg 'face))) + beg end 'font-lock-face + (if-let ((face (get-text-property beg 'font-lock-face))) (list face 'magit-keyword) 'magit-keyword)))))) (goto-char (point-max)))))) @@ -2344,9 +2393,9 @@ or a ref which is not a branch, then it inserts nothing." (propertize (if (string-prefix-p "refs/notes/" ref) (substring ref 11) ref) - 'face 'magit-refname))) + 'font-lock-face 'magit-refname))) (forward-char) - (add-face-text-property beg (point) 'magit-diff-hunk-heading) + (magit--add-face-text-property beg (point) 'magit-diff-hunk-heading) (magit-insert-heading) (goto-char (point-max)) (insert ?\n))))))) @@ -2367,7 +2416,7 @@ or a ref which is not a branch, then it inserts nothing." (insert (magit-format-ref-labels it) ?\s)) (insert (propertize (magit-rev-parse (concat magit-buffer-revision "^{commit}")) - 'face 'magit-hash)) + 'font-lock-face 'magit-hash)) (magit-insert-heading) (let ((beg (point))) (magit-rev-insert-format magit-revision-headers-format @@ -2380,7 +2429,7 @@ or a ref which is not a branch, then it inserts nothing." (string-match "^\\([^ ]+\\) \\(.*\\)" line) (magit-bind-match-strings (hash msg) line (insert "Parent: ") - (insert (propertize hash 'face 'magit-hash)) + (insert (propertize hash 'font-lock-face 'magit-hash)) (insert " " msg "\n"))))) (magit--insert-related-refs magit-buffer-revision "--merged" "Merged" @@ -2392,18 +2441,19 @@ or a ref which is not a branch, then it inserts nothing." (let ((tag (car follows)) (cnt (cadr follows))) (magit-insert-section (tag tag) - (insert (format "Follows: %s (%s)\n" - (propertize tag 'face 'magit-tag) - (propertize (number-to-string cnt) - 'face 'magit-branch-local)))))) + (insert + (format "Follows: %s (%s)\n" + (propertize tag 'font-lock-face 'magit-tag) + (propertize (number-to-string cnt) + 'font-lock-face 'magit-branch-local)))))) (when-let ((precedes (magit-get-next-tag magit-buffer-revision t))) (let ((tag (car precedes)) (cnt (cadr precedes))) (magit-insert-section (tag tag) (insert (format "Precedes: %s (%s)\n" - (propertize tag 'face 'magit-tag) + (propertize tag 'font-lock-face 'magit-tag) (propertize (number-to-string cnt) - 'face 'magit-tag)))))) + 'font-lock-face 'magit-tag)))))) (insert ?\n)))) (defun magit--insert-related-refs (rev arg title remote) @@ -2415,7 +2465,7 @@ or a ref which is not a branch, then it inserts nothing." (insert ?\s) (insert ?\n (make-string 12 ?\s))) (magit-insert-section (branch branch) - (insert (propertize branch 'face + (insert (propertize branch 'font-lock-face (if (string-prefix-p "remotes/" branch) 'magit-branch-remote 'magit-branch-local))))) @@ -2664,16 +2714,14 @@ actually a `diff' but a `diffstat' section." (defun magit-diff-use-hunk-region-p () (and (region-active-p) - (not (and (if (version< emacs-version "25.1") - (eq this-command 'mouse-drag-region) - ;; TODO implement this from first principals - ;; currently it's trial-and-error - (or (eq this-command 'mouse-drag-region) - (eq last-command 'mouse-drag-region) - ;; When another window was previously - ;; selected then the last-command is - ;; some byte-code function. - (byte-code-function-p last-command))) + ;; TODO implement this from first principals + ;; currently it's trial-and-error + (not (and (or (eq this-command 'mouse-drag-region) + (eq last-command 'mouse-drag-region) + ;; When another window was previously + ;; selected then the last-command is + ;; some byte-code function. + (byte-code-function-p last-command)) (eq (region-end) (region-beginning)))))) ;;; Diff Highlight @@ -2795,7 +2843,7 @@ are highlighted." (put-text-property (1- (line-end-position)) (line-end-position) 'invisible t)) (put-text-property - (point) (1+ (line-end-position)) 'face + (point) (1+ (line-end-position)) 'font-lock-face (cond ((looking-at "^\\+\\+?\\([<=|>]\\)\\{7\\}") (setq stage (pcase (list (match-string 1) highlight) @@ -2881,7 +2929,7 @@ are highlighted." (when (and magit-diff-highlight-trailing (looking-at (concat prefix ".*?\\([ \t]+\\)$"))) (let ((ov (make-overlay (match-beginning 1) (match-end 1) nil t))) - (overlay-put ov 'face 'magit-diff-whitespace-warning) + (overlay-put ov 'font-lock-face 'magit-diff-whitespace-warning) (overlay-put ov 'priority 2) (overlay-put ov 'evaporate t))) (when (or (and (eq indent 'tabs) @@ -2890,7 +2938,7 @@ are highlighted." (looking-at (format "%s\\([ \t]* \\{%s,\\}[ \t]*\\)" prefix indent)))) (let ((ov (make-overlay (match-beginning 1) (match-end 1) nil t))) - (overlay-put ov 'face 'magit-diff-whitespace-warning) + (overlay-put ov 'font-lock-face 'magit-diff-whitespace-warning) (overlay-put ov 'priority 2) (overlay-put ov 'evaporate t)))))) @@ -2940,7 +2988,7 @@ are highlighted." (magit-diff--make-hunk-overlay (oref section start) (1- (oref section content)) - 'face 'magit-diff-lines-heading + 'font-lock-face 'magit-diff-lines-heading 'display (magit-diff-hunk-region-header section) 'after-string (magit-diff--hunk-after-string 'magit-diff-lines-heading)) (run-hook-with-args 'magit-diff-highlight-hunk-region-functions section) @@ -2957,11 +3005,11 @@ for added and removed lines as for context lines." (setq face (list :background (face-attribute face :background)))) (magit-diff--make-hunk-overlay (oref section content) (magit-diff-hunk-region-beginning) - 'face face + 'font-lock-face face 'priority 2) (magit-diff--make-hunk-overlay (1+ (magit-diff-hunk-region-end)) (oref section end) - 'face face + 'font-lock-face face 'priority 2))) (defun magit-diff-highlight-hunk-region-using-face (_section) @@ -2971,7 +3019,7 @@ changing only the `:weight' and/or `:slant' is recommended for that face." (magit-diff--make-hunk-overlay (magit-diff-hunk-region-beginning) (1+ (magit-diff-hunk-region-end)) - 'face 'magit-diff-hunk-region)) + 'font-lock-face 'magit-diff-hunk-region)) (defun magit-diff-highlight-hunk-region-using-overlays (section) "Emphasize the hunk-internal region using delimiting horizontal lines. @@ -2982,7 +3030,7 @@ This is implemented as single-pixel newlines places inside overlays." (str (propertize (concat (propertize "\s" 'display '(space :height (1))) (propertize "\n" 'line-height t)) - 'face 'magit-diff-lines-boundary))) + 'font-lock-face 'magit-diff-lines-boundary))) (magit-diff--make-hunk-overlay beg (1+ beg) 'before-string str) (magit-diff--make-hunk-overlay end (1+ end) 'after-string str)) (magit-diff-highlight-hunk-region-using-face section))) @@ -3003,7 +3051,7 @@ last (visual) lines of the region." (color (face-background 'magit-diff-lines-boundary nil t))) (cl-flet ((ln (b e &rest face) (magit-diff--make-hunk-overlay - b e 'face face 'after-string + b e 'font-lock-face face 'after-string (magit-diff--hunk-after-string face)))) (if (= beg end-bol) (ln beg beg-eol :overline color :underline color) @@ -3020,7 +3068,7 @@ last (visual) lines of the region." (defun magit-diff--hunk-after-string (face) (propertize "\s" - 'face face + 'font-lock-face face 'display (list 'space :align-to `(+ (0 . right) ,(min (window-hscroll) diff --git a/elpa/magit-20190514.1814/magit-ediff.el b/elpa/magit-20191030.1315/magit-ediff.el similarity index 100% rename from elpa/magit-20190514.1814/magit-ediff.el rename to elpa/magit-20191030.1315/magit-ediff.el diff --git a/elpa/magit-20190514.1814/magit-extras.el b/elpa/magit-20191030.1315/magit-extras.el similarity index 97% rename from elpa/magit-20190514.1814/magit-extras.el rename to elpa/magit-20191030.1315/magit-extras.el index 4ae8b19a..6414681e 100644 --- a/elpa/magit-20190514.1814/magit-extras.el +++ b/elpa/magit-20191030.1315/magit-extras.el @@ -31,6 +31,9 @@ (declare-function dired-read-shell-command "dired-aux" (prompt arg files)) +(defvar ido-exit) +(defvar ido-fallback) + (defgroup magit-extras nil "Additional functionality for Magit." :group 'magit-extensions) @@ -105,9 +108,9 @@ blame to center around the line point is on." (defun ido-enter-magit-status () "Drop into `magit-status' from file switching. -This command does not work in Emacs 26. It does work in Emacs 25 -and Emacs 27. See https://github.com/magit/magit/issues/3634 and -https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31707. +This command does not work in Emacs 26.1. +See https://github.com/magit/magit/issues/3634 +and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31707. To make this command available use something like: @@ -123,10 +126,9 @@ like pretty much every other keymap: (define-key ido-common-completion-map (kbd \"C-x g\") \\='ido-enter-magit-status)" (interactive) - (with-no-warnings ; FIXME these are internal variables - (setq ido-exit 'fallback) - (setq fallback 'magit-status) ; for Emacs 25 - (setq ido-fallback 'magit-status)) ; for Emacs 27 + (setq ido-exit 'fallback) + (setq ido-fallback 'magit-status) ; for Emacs >= 26.2 + (with-no-warnings (setq fallback 'magit-status)) ; for Emacs 25 (exit-minibuffer)) ;;;###autoload @@ -306,11 +308,11 @@ points at it) otherwise." (find-file file) (when blame-type (magit-blame--pre-blame-setup blame-type) - (magit-blame--run))))) + (magit-blame--run (magit-blame-arguments)))))) (find-file file) (when blame-type (magit-blame--pre-blame-setup blame-type) - (magit-blame--run))))))))) + (magit-blame--run (magit-blame-arguments)))))))))) (put 'magit-edit-line-commit 'disabled t) @@ -347,7 +349,7 @@ use `magit-rebase-edit-command' instead of this command." "Change the author and committer dates of the commits since REV. Ask the user for the first reachable commit whose dates should -be changed. The read the new date for that commit. The initial +be changed. Then read the new date for that commit. The initial minibuffer input and the previous history element offer good values. The next commit will be created one minute later and so on. diff --git a/elpa/magit-20190514.1814/magit-fetch.el b/elpa/magit-20191030.1315/magit-fetch.el similarity index 95% rename from elpa/magit-20190514.1814/magit-fetch.el rename to elpa/magit-20191030.1315/magit-fetch.el index 7557bb26..4a1676ec 100644 --- a/elpa/magit-20190514.1814/magit-fetch.el +++ b/elpa/magit-20191030.1315/magit-fetch.el @@ -45,7 +45,8 @@ Ignored for Git versions before v2.8.0." "Fetch from another repository." :man-page "git-fetch" ["Arguments" - ("-p" "Prune deleted branches" ("-p" "--prune"))] + ("-p" "Prune deleted branches" ("-p" "--prune")) + ("-t" "Fetch all tags" ("-t" "--tags"))] ["Fetch from" ("p" magit-fetch-from-pushremote) ("u" magit-fetch-from-upstream) @@ -144,11 +145,8 @@ results in an error." ;;;###autoload (defun magit-fetch-all (args) "Fetch from all remotes." - (interactive (list (cl-intersection (magit-fetch-arguments) - (list "--verbose" "--prune") - :test #'equal))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async "remote" "update" args)) + (interactive (list (magit-fetch-arguments))) + (magit-git-fetch nil (cons "--all" args))) ;;;###autoload (defun magit-fetch-all-prune () diff --git a/elpa/magit-20190514.1814/magit-files.el b/elpa/magit-20191030.1315/magit-files.el similarity index 89% rename from elpa/magit-20190514.1814/magit-files.el rename to elpa/magit-20191030.1315/magit-files.el index 7d515451..20ec596b 100644 --- a/elpa/magit-20190514.1814/magit-files.el +++ b/elpa/magit-20191030.1315/magit-files.el @@ -85,9 +85,7 @@ the line and column corresponding to that location." (user-error "Nothing selected")))) (defun magit-find-file--internal (rev file fn) - (let ((buf (if (equal rev "{worktree}") - (find-file-noselect (expand-file-name file (magit-toplevel))) - (magit-find-file-noselect rev file))) + (let ((buf (magit-find-file-noselect rev file)) line col) (when-let ((visited-file (magit-file-relative-name))) (setq line (line-number-at-pos)) @@ -124,31 +122,34 @@ FILE must be relative to the top directory of the repository." REV is a revision or one of \"{worktree}\" or \"{index}\". FILE must be relative to the top directory of the repository. Non-nil REVERT means to revert the buffer. If `ask-revert', -then only after asking." - (let ((topdir (magit-toplevel))) - (when (file-name-absolute-p file) - (setq file (file-relative-name file topdir))) - (with-current-buffer (magit-get-revision-buffer-create rev file) - (when (or (not magit-buffer-file-name) - (if (eq revert 'ask-revert) - (y-or-n-p (format "%s already exists; revert it? " - (buffer-name)))) - revert) - (setq magit-buffer-revision - (if (equal rev "{index}") - "{index}" - (magit-rev-format "%H" rev))) - (setq magit-buffer-refname rev) - (setq magit-buffer-file-name (expand-file-name file topdir)) - (setq default-directory - (let ((dir (file-name-directory magit-buffer-file-name))) - (if (file-exists-p dir) dir topdir))) - (setq-local revert-buffer-function #'magit-revert-rev-file-buffer) - (revert-buffer t t) - (run-hooks (if (equal rev "{index}") - 'magit-find-index-hook - 'magit-find-file-hook))) - (current-buffer)))) +then only after asking. A non-nil value for REVERT is ignored if REV is +\"{worktree}\"." + (if (equal rev "{worktree}") + (find-file-noselect (expand-file-name file (magit-toplevel))) + (let ((topdir (magit-toplevel))) + (when (file-name-absolute-p file) + (setq file (file-relative-name file topdir))) + (with-current-buffer (magit-get-revision-buffer-create rev file) + (when (or (not magit-buffer-file-name) + (if (eq revert 'ask-revert) + (y-or-n-p (format "%s already exists; revert it? " + (buffer-name)))) + revert) + (setq magit-buffer-revision + (if (equal rev "{index}") + "{index}" + (magit-rev-format "%H" rev))) + (setq magit-buffer-refname rev) + (setq magit-buffer-file-name (expand-file-name file topdir)) + (setq default-directory + (let ((dir (file-name-directory magit-buffer-file-name))) + (if (file-exists-p dir) dir topdir))) + (setq-local revert-buffer-function #'magit-revert-rev-file-buffer) + (revert-buffer t t) + (run-hooks (if (equal rev "{index}") + 'magit-find-index-hook + 'magit-find-file-hook))) + (current-buffer))))) (defun magit-get-revision-buffer-create (rev file) (magit-get-revision-buffer rev file t)) @@ -298,7 +299,8 @@ directory, while reading the FILENAME." ("c" "Commit" magit-commit) ("e" "Edit line" magit-edit-line-commit)] [("D" "Diff..." magit-diff) - ("d" "Diff" magit-diff-buffer-file)] + ("d" "Diff" magit-diff-buffer-file) + ("g" "Status" magit-status-here)] [("L" "Log..." magit-log) ("l" "Log" magit-log-buffer-file) ("t" "Trace" magit-log-trace-definition)] @@ -310,8 +312,8 @@ directory, while reading the FILENAME." ("q" "Quit blame" magit-blame-quit)] [("p" "Prev blob" magit-blob-previous) ("n" "Next blob" magit-blob-next) - ("g" "Goto blob" magit-find-file) - ("w" "Goto file" magit-blob-visit-file)] + ("v" "Goto blob" magit-find-file) + ("V" "Goto file" magit-blob-visit-file)] [(5 "C-c r" "Rename file" magit-file-rename) (5 "C-c d" "Delete file" magit-file-delete) (5 "C-c u" "Untrack file" magit-file-untrack) @@ -345,7 +347,7 @@ Currently this only adds the following key bindings. ;; variable but does not cause the mode function to be called, and we ;; cannot use `:initialize' to call that explicitly because the option ;; is defined before the functions, so we have to do it here. -(cl-eval-when (load) +(cl-eval-when (load eval) (when global-magit-file-mode (global-magit-file-mode 1))) @@ -444,25 +446,25 @@ If FILE isn't tracked in Git, fallback to using `rename-file'." (and dir (expand-file-name dir))))) (list (expand-file-name file (magit-toplevel)) (expand-file-name newname)))) - (if (magit-file-tracked-p (magit-convert-filename-for-git file)) - (let ((oldbuf (get-file-buffer file))) - (when (and oldbuf (buffer-modified-p oldbuf)) - (user-error "Save %s before moving it" file)) - (when (file-exists-p newname) - (user-error "%s already exists" newname)) - (magit-run-git "mv" - (magit-convert-filename-for-git file) - (magit-convert-filename-for-git newname)) - (when oldbuf - (with-current-buffer oldbuf - (let ((buffer-read-only buffer-read-only)) - (set-visited-file-name newname)) - (if (fboundp 'vc-refresh-state) - (vc-refresh-state) - (with-no-warnings - (vc-find-file-hook)))))) - (rename-file file newname current-prefix-arg) - (magit-refresh))) + (let ((oldbuf (get-file-buffer file))) + (when (and oldbuf (buffer-modified-p oldbuf)) + (user-error "Save %s before moving it" file)) + (when (file-exists-p newname) + (user-error "%s already exists" newname)) + (if (magit-file-tracked-p (magit-convert-filename-for-git file)) + (magit-call-git "mv" + (magit-convert-filename-for-git file) + (magit-convert-filename-for-git newname)) + (rename-file file newname current-prefix-arg)) + (when oldbuf + (with-current-buffer oldbuf + (let ((buffer-read-only buffer-read-only)) + (set-visited-file-name newname nil t)) + (if (fboundp 'vc-refresh-state) + (vc-refresh-state) + (with-no-warnings + (vc-find-file-hook)))))) + (magit-refresh)) (defun magit-file-untrack (files &optional force) "Untrack the selected FILES or one file read in the minibuffer. @@ -476,7 +478,8 @@ staged as well as unstaged changes." (magit-confirm-files 'untrack it "Untrack")) (list (magit-read-tracked-file "Untrack file")))) current-prefix-arg)) - (magit-run-git "rm" "--cached" (and force "--force") "--" files)) + (magit-with-toplevel + (magit-run-git "rm" "--cached" (and force "--force") "--" files))) (defun magit-file-delete (files &optional force) "Delete the selected FILES or one file read in the minibuffer. diff --git a/elpa/magit-20190514.1814/magit-git.el b/elpa/magit-20191030.1315/magit-git.el similarity index 96% rename from elpa/magit-20190514.1814/magit-git.el rename to elpa/magit-20191030.1315/magit-git.el index dc5e0f56..f1554376 100644 --- a/elpa/magit-20190514.1814/magit-git.el +++ b/elpa/magit-20191030.1315/magit-git.el @@ -66,6 +66,9 @@ ;; From later in `magit-git'. (defvar magit-tramp-process-environment nil) +(eval-when-compile + (cl-pushnew 'number eieio--known-slot-names)) + ;;; Git implementations (defvar magit-inhibit-libgit nil @@ -243,7 +246,7 @@ to `magit-completing-read' or, for commands that support reading multiple strings, `read-from-minibuffer'. The completion framework ultimately determines how the collection is displayed." :package-version '(magit . "2.11.0") - :group 'magit-miscellanous + :group 'magit-miscellaneous :type '(choice string (repeat string))) ;;; Git @@ -861,7 +864,12 @@ tracked file." (defun magit-skip-worktree-files () (--keep (and (and (= (aref it 0) ?S) (substring it 2))) - (magit-git-items "ls-files" "-z" "-t"))) + (magit-list-files "-t"))) + +(defun magit-assume-unchanged-files () + (--keep (and (and (memq (aref it 0) '(?h ?s ?m ?r ?c ?k)) + (substring it 2))) + (magit-list-files "-v"))) (defun magit-revision-files (rev) (magit-with-toplevel @@ -1231,13 +1239,13 @@ to, or to some other symbolic-ref that points to the same ref." (defun magit--painted-branch-at-point (&optional type) (or (and (not (eq type 'remote)) - (memq (get-text-property (point) 'face) + (memq (get-text-property (point) 'font-lock-face) (list 'magit-branch-local 'magit-branch-current)) (when-let ((branch (thing-at-point 'git-revision t))) (cdr (magit-split-branch-name branch)))) (and (not (eq type 'local)) - (memq (get-text-property (point) 'face) + (memq (get-text-property (point) 'font-lock-face) (list 'magit-branch-remote 'magit-branch-remote-head)) (thing-at-point 'git-revision t)))) @@ -1273,7 +1281,12 @@ to, or to some other symbolic-ref that points to the same ref." (commit (or (magit--painted-branch-at-point) (let ((rev (oref it value))) (or (magit-name-branch rev) rev)))) - (tag (magit-ref-maybe-qualify (oref it value) "tags/"))) + (tag (magit-ref-maybe-qualify (oref it value) "tags/")) + (pullreq (or (and (fboundp 'forge--pullreq-branch) + (magit-branch-p + (forge--pullreq-branch (oref it value)))) + (magit-ref-p (format "refs/pullreqs/%s" + (oref (oref it value) number)))))) (thing-at-point 'git-revision t) (and (derived-mode-p 'magit-stash-mode 'magit-merge-preview-mode @@ -1354,10 +1367,10 @@ remote-tracking branch. The returned string is colorized according to the branch type." (when-let ((branch (or branch (magit-get-current-branch))) (upstream (magit-ref-abbrev (concat branch "@{upstream}")))) - (propertize upstream 'face - (if (equal (magit-get "branch" branch "remote") ".") - 'magit-branch-local - 'magit-branch-remote)))) + (magit--propertize-face + upstream (if (equal (magit-get "branch" branch "remote") ".") + 'magit-branch-local + 'magit-branch-remote)))) (defun magit-get-indirect-upstream-branch (branch &optional force) (let ((remote (magit-get "branch" branch "remote"))) @@ -1383,18 +1396,18 @@ according to the branch type." (remote (magit-get "branch" branch "remote"))) (and (not (equal remote ".")) (cond ((member remote (magit-list-remotes)) - (propertize remote 'face 'magit-branch-remote)) + (magit--propertize-face remote 'magit-branch-remote)) ((and allow-unnamed (string-match-p "\\(\\`.\\{0,2\\}/\\|[:@]\\)" remote)) - (propertize remote 'face 'bold)))))) + (magit--propertize-face remote 'bold)))))) (defun magit-get-unnamed-upstream (&optional branch) (when-let ((branch (or branch (magit-get-current-branch))) (remote (magit-get "branch" branch "remote")) (merge (magit-get "branch" branch "merge"))) (and (magit--unnamed-upstream-p remote merge) - (list (propertize remote 'face 'bold) - (propertize merge 'face 'magit-branch-remote))))) + (list (magit--propertize-face remote 'bold) + (magit--propertize-face merge 'magit-branch-remote))))) (defun magit--unnamed-upstream-p (remote merge) (and remote (string-match-p "\\(\\`\\.\\{0,2\\}/\\|[:@]\\)" remote) @@ -1411,14 +1424,14 @@ according to the branch type." (remote (if (= (length remotes) 1) (car remotes) (car (member "origin" remotes))))) - (propertize remote 'face 'magit-branch-remote)))) + (magit--propertize-face remote 'magit-branch-remote)))) (defun magit-get-push-remote (&optional branch) (when-let ((remote (or (and (or branch (setq branch (magit-get-current-branch))) (magit-get "branch" branch "pushRemote")) (magit-get "remote.pushDefault")))) - (propertize remote 'face 'magit-branch-remote))) + (magit--propertize-face remote 'magit-branch-remote))) (defun magit-get-push-branch (&optional branch verify) (when-let ((branch (or branch (setq branch (magit-get-current-branch)))) @@ -1426,7 +1439,7 @@ according to the branch type." (target (concat remote "/" branch))) (and (or (not verify) (magit-rev-verify target)) - (propertize target 'face 'magit-branch-remote)))) + (magit--propertize-face target 'magit-branch-remote)))) (defun magit-get-@{push}-branch (&optional branch) (let ((ref (magit-rev-parse "--symbolic-full-name" @@ -1574,23 +1587,23 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (defun magit-list-remote-branches (&optional remote) (magit-list-refs (concat "refs/remotes/" remote))) -(defun magit-list-related-branches (relation &optional commit arg) +(defun magit-list-related-branches (relation &optional commit &rest args) (--remove (string-match-p "\\(\\`(HEAD\\|HEAD -> \\)" it) (--map (substring it 2) - (magit-git-lines "branch" arg relation commit)))) + (magit-git-lines "branch" args relation commit)))) -(defun magit-list-containing-branches (&optional commit arg) - (magit-list-related-branches "--contains" commit arg)) +(defun magit-list-containing-branches (&optional commit &rest args) + (magit-list-related-branches "--contains" commit args)) (defun magit-list-publishing-branches (&optional commit) (--filter (magit-rev-ancestor-p commit it) magit-published-branches)) -(defun magit-list-merged-branches (&optional commit arg) - (magit-list-related-branches "--merged" commit arg)) +(defun magit-list-merged-branches (&optional commit &rest args) + (magit-list-related-branches "--merged" commit args)) -(defun magit-list-unmerged-branches (&optional commit arg) - (magit-list-related-branches "--no-merged" commit arg)) +(defun magit-list-unmerged-branches (&optional commit &rest args) + (magit-list-related-branches "--no-merged" commit args)) (defun magit-list-unmerged-to-upstream-branches () (--filter (when-let ((upstream (magit-get-upstream-branch it))) @@ -1722,8 +1735,8 @@ PATH has to be relative to the super-repository." (magit-git-success "symbolic-ref" "--quiet" name)) (defun magit-ref-p (rev) - (or (car (member rev (magit-list-refs))) - (car (member rev (magit-list-refnames))))) + (or (car (member rev (magit-list-refs "refs/"))) + (car (member rev (magit-list-refnames "refs/"))))) (defun magit-branch-p (rev) (or (car (member rev (magit-list-branches))) @@ -1738,9 +1751,9 @@ PATH has to be relative to the super-repository." (car (member rev (magit-list-remote-branch-names))))) (defun magit-branch-set-face (branch) - (propertize branch 'face (if (magit-local-branch-p branch) - 'magit-branch-local - 'magit-branch-remote))) + (magit--propertize-face branch (if (magit-local-branch-p branch) + 'magit-branch-local + 'magit-branch-remote))) (defun magit-tag-p (rev) (car (member rev (magit-list-tags)))) @@ -1810,7 +1823,7 @@ Return a list of two integers: (A>B B>A)." (defun magit-format-rev-summary (rev) (--when-let (magit-rev-format "%h %s" rev) (string-match " " it) - (put-text-property 0 (match-beginning 0) 'face 'magit-hash it) + (magit--put-face 0 (match-beginning 0) 'magit-hash it) it)) (defvar magit-ref-namespaces @@ -1862,12 +1875,13 @@ and this option only controls what face is used.") (dolist (ref names) (let* ((face (cdr (--first (string-match (car it) ref) magit-ref-namespaces))) - (name (propertize (or (match-string 1 ref) ref) 'face face))) + (name (magit--propertize-face + (or (match-string 1 ref) ref) face))) (cl-case face ((magit-bisect-bad magit-bisect-skip magit-bisect-good) (setq state name)) (magit-head - (setq head (propertize "@" 'face 'magit-head))) + (setq head (magit--propertize-face "@" 'magit-head))) (magit-tag (push name tags)) (magit-branch-local (push name branches)) (magit-branch-remote (push name remotes)) @@ -1883,8 +1897,8 @@ and this option only controls what face is used.") (magit-git-string "symbolic-ref" (format "refs/remotes/%s/HEAD" r))) - (propertize name - 'face 'magit-branch-remote-head) + (magit--propertize-face + name 'magit-branch-remote-head) name))) name)) remotes)) @@ -1900,24 +1914,26 @@ and this option only controls what face is used.") ((equal name current) (setq head (concat push - (propertize name 'face 'magit-branch-current)))) + (magit--propertize-face + name 'magit-branch-current)))) ((equal name target) (setq upstream (concat push - (propertize name 'face '(magit-branch-upstream - magit-branch-local))))) + (magit--propertize-face + name '(magit-branch-upstream + magit-branch-local))))) (t (push (concat push name) combined))))) (when (and target (not upstream)) (if (member target remotes) (progn - (add-face-text-property 0 (length target) - 'magit-branch-upstream nil target) + (magit--add-face-text-property + 0 (length target) 'magit-branch-upstream nil target) (setq upstream target) (setq remotes (delete target remotes))) (when-let ((target (car (member target combined)))) - (add-face-text-property 0 (length target) - 'magit-branch-upstream nil target) + (magit--add-face-text-property + 0 (length target) 'magit-branch-upstream nil target) (setq upstream target) (setq combined (delete target combined)))))) (mapconcat #'identity @@ -2207,8 +2223,8 @@ out. Only existing branches can be selected." (if (bound-and-true-p ivy-mode) ;; Ivy-mode strips faces from prompt. (format " `%s'" branch) - (concat " " - (propertize branch 'face 'magit-branch-local)))) + (concat " " (magit--propertize-face + branch 'magit-branch-local)))) " starting at") (nconc (list "HEAD") (magit-list-refnames) diff --git a/elpa/magit-20190514.1814/magit-gitignore.el b/elpa/magit-20191030.1315/magit-gitignore.el similarity index 66% rename from elpa/magit-20190514.1814/magit-gitignore.el rename to elpa/magit-20191030.1315/magit-gitignore.el index 8578ae46..d54d56b7 100644 --- a/elpa/magit-20190514.1814/magit-gitignore.el +++ b/elpa/magit-20191030.1315/magit-gitignore.el @@ -52,7 +52,10 @@ (magit-get "core.excludesfile"))))] ["Skip worktree" (7 "w" "do skip worktree" magit-skip-worktree) - (7 "W" "do not skip worktree" magit-no-skip-worktree)]) + (7 "W" "do not skip worktree" magit-no-skip-worktree)] + ["Assume unchanged" + (7 "u" "do assume unchanged" magit-assume-unchanged) + (7 "U" "do not assume unchanged" magit-no-assume-unchanged)]) ;;; Gitignore Commands @@ -113,14 +116,25 @@ Rules that are defined in that file affect all local repositories." (defun magit-gitignore-read-pattern () (let* ((default (magit-current-file)) + (base (car magit-buffer-diff-files)) + (base (and base (file-directory-p base) base)) (choices (delete-dups (--mapcat (cons (concat "/" it) (when-let ((ext (file-name-extension it))) - (list (concat "/" (file-name-directory "foo") "*." ext) + (list (concat "/" (file-name-directory it) "*." ext) (concat "*." ext)))) - (magit-untracked-files))))) + (sort (nconc + (magit-untracked-files nil base) + ;; The untracked section of the status buffer lists + ;; directories containing only untracked files. + ;; Add those as candidates. + (-filter #'directory-name-p + (magit-list-files + "--other" "--exclude-standard" "--directory" + "--no-empty-directory" "--" base))) + #'string-lessp))))) (when default (setq default (concat "/" default)) (unless (member default choices) @@ -134,22 +148,50 @@ Rules that are defined in that file affect all local repositories." ;;;###autoload (defun magit-skip-worktree (file) - "Call \"git update-index --skip-worktree FILE\"." - (interactive (list (magit-read-file-choice "Skip worktree for: " - (cl-set-difference - (magit-list-files) - (magit-skip-worktree-files))))) + "Call \"git update-index --skip-worktree -- FILE\"." + (interactive + (list (magit-read-file-choice "Skip worktree for" + (magit-with-toplevel + (cl-set-difference + (magit-list-files) + (magit-skip-worktree-files)))))) (magit-with-toplevel (magit-run-git "update-index" "--skip-worktree" "--" file))) ;;;###autoload (defun magit-no-skip-worktree (file) - "Call \"git update-index --no-skip-worktree FILE\"." - (interactive (list (magit-read-file-choice "Do not skip worktree for: " - (magit-skip-worktree-files)))) + "Call \"git update-index --no-skip-worktree -- FILE\"." + (interactive + (list (magit-read-file-choice "Do not skip worktree for" + (magit-with-toplevel + (magit-skip-worktree-files))))) (magit-with-toplevel (magit-run-git "update-index" "--no-skip-worktree" "--" file))) +;;; Assume Unchanged Commands + +;;;###autoload +(defun magit-assume-unchanged (file) + "Call \"git update-index --assume-unchanged -- FILE\"." + (interactive + (list (magit-read-file-choice "Assume file to be unchanged" + (magit-with-toplevel + (cl-set-difference + (magit-list-files) + (magit-assume-unchanged-files)))))) + (magit-with-toplevel + (magit-run-git "update-index" "--assume-unchanged" "--" file))) + +;;;###autoload +(defun magit-no-assume-unchanged (file) + "Call \"git update-index --no-assume-unchanged -- FILE\"." + (interactive + (list (magit-read-file-choice "Do not assume file to be unchanged" + (magit-with-toplevel + (magit-assume-unchanged-files))))) + (magit-with-toplevel + (magit-run-git "update-index" "--no-assume-unchanged" "--" file))) + ;;; _ (provide 'magit-gitignore) ;;; magit-gitignore.el ends here diff --git a/elpa/magit-20190514.1814/magit-imenu.el b/elpa/magit-20191030.1315/magit-imenu.el similarity index 100% rename from elpa/magit-20190514.1814/magit-imenu.el rename to elpa/magit-20191030.1315/magit-imenu.el diff --git a/elpa/magit-20190514.1814/magit-log.el b/elpa/magit-20191030.1315/magit-log.el similarity index 85% rename from elpa/magit-20190514.1814/magit-log.el rename to elpa/magit-20191030.1315/magit-log.el index e19db93a..b6b0e858 100644 --- a/elpa/magit-20190514.1814/magit-log.el +++ b/elpa/magit-20191030.1315/magit-log.el @@ -98,10 +98,12 @@ Only considered when moving past the last entry with The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -115,6 +117,18 @@ AUTHOR-WIDTH has to be an integer. When the name of the author :initialize 'magit-custom-initialize-reset :set (apply-partially #'magit-margin-set-variable 'magit-log-mode)) +(defcustom magit-log-margin-show-committer-date nil + "Whether to show the committer date in the margin. + +This option only controls whether the committer date is displayed +instead of the author date. Whether some date is displayed in +the margin and whether the margin is displayed at all is +controlled by other options." + :package-version '(magit . "2.91.0") + :group 'magit-log + :group 'magit-margin + :type 'boolean) + (defcustom magit-log-show-refname-after-summary nil "Whether to show refnames after commit summaries. This is useful if you use really long branch names." @@ -155,14 +169,26 @@ because the latter may make use of Imenu's outdated cache." :group 'magit-faces) (defface magit-log-author - '((((class color) (background light)) :foreground "firebrick") - (((class color) (background dark)) :foreground "tomato")) + '((((class color) (background light)) + :foreground "firebrick" + :slant normal + :weight normal) + (((class color) (background dark)) + :foreground "tomato" + :slant normal + :weight normal)) "Face for the author part of the log output." :group 'magit-faces) (defface magit-log-date - '((((class color) (background light)) :foreground "grey30") - (((class color) (background dark)) :foreground "grey80")) + '((((class color) (background light)) + :foreground "grey30" + :slant normal + :weight normal) + (((class color) (background dark)) + :foreground "grey80" + :slant normal + :weight normal)) "Face for the date part of the log output." :group 'magit-faces) @@ -204,10 +230,12 @@ be nil, in which case no usage information is shown." The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -242,10 +270,12 @@ AUTHOR-WIDTH has to be an integer. When the name of the author The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -311,7 +341,7 @@ the upstream isn't ahead of the current branch) show." "Return the current log arguments." (if (memq current-transient-command '(magit-log magit-log-refresh)) (pcase-let ((`(,args ,alist) - (transient-args nil t))) + (-separate #'atom (transient-get-value)))) (list args (cdr (assoc "--" alist)))) (magit-log--get-value (or mode 'magit-log-mode)))) @@ -346,7 +376,7 @@ the upstream isn't ahead of the current branch) show." (mode (or (oref obj major-mode) major-mode)) (key (intern (format "magit-log:%s" mode))) (`(,args ,alist) - (-separate #'atom (transient-args))) + (-separate #'atom (transient-get-value))) (files (cdr (assoc "--" alist)))) (put mode 'magit-log-current-arguments args) (when save @@ -379,15 +409,21 @@ the upstream isn't ahead of the current branch) show." (7 "=s" "Limit to commits since" "--since=" transient-read-date) (7 "=u" "Limit to commits until" "--until=" transient-read-date) (magit-log:--grep) + (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 - ("-D" "Simplify by decoration" "--simplify-by-decoration")] + ( "-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")] @@ -405,6 +441,8 @@ the upstream isn't ahead of the current branch) show." ("h" "HEAD" magit-log-head)] ["" ("L" "local branches" magit-log-branches) + (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)] @@ -428,13 +466,19 @@ the upstream isn't ahead of the current branch) show." (magit-log:-n) (magit:--author) (magit-log:--grep) + (7 "-I" "Invert search pattern" "--invert-grep") (magit-log:-G) (magit-log:-S) (magit-log:-L)] ["History simplification" + ( "-D" "Simplify by decoration" "--simplify-by-decoration") (magit:--) - ("-f" "Follow renames when showing single-file log" "--follow") - ("-D" "Simplify by decoration" "--simplify-by-decoration")] + ( "-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")] @@ -488,9 +532,7 @@ the upstream isn't ahead of the current branch) show." :class 'transient-option ;; For historic reasons (and because it easy to guess what "-n" ;; stands for) this is the only argument where we do not use the - ;; long argument ("--max-count"). If we did switch to the long - ;; argument, then that would cause breakage for users who have - ;; customized `magit-log-arguments'. + ;; long argument ("--max-count"). :shortarg "-n" :argument "-n" :reader 'transient-read-number-N+) @@ -535,7 +577,7 @@ the upstream isn't ahead of the current branch) show." (defun magit-read-file-trace (&rest _ignored) (let ((file (magit-read-file-from-rev "HEAD" "File")) (trace (magit-read-string "Trace"))) - (concat trace (or (match-string 2 trace) ":") file))) + (concat trace ":" file))) ;;;; Setup Commands @@ -558,6 +600,10 @@ the upstream isn't ahead of the current branch) show." magit-log-read-revs-map) "[, ]" t)))) +(defun magit-log-read-pattern (option) + "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. @@ -593,6 +639,22 @@ completion candidates." (list "HEAD" "--branches")) args files)) +;;;###autoload +(defun magit-log-matching-branches (pattern &optional args files) + "Show log for all branches matching PATTERN and `HEAD'." + (interactive (cons (magit-log-read-pattern "--branches") (magit-log-arguments))) + (magit-log-setup-buffer + (list "HEAD" (format "--branches=%s" pattern)) + args files)) + +;;;###autoload +(defun magit-log-matching-tags (pattern &optional args files) + "Show log for all tags matching PATTERN and `HEAD'." + (interactive (cons (magit-log-read-pattern "--tags") (magit-log-arguments))) + (magit-log-setup-buffer + (list "HEAD" (format "--tags=%s" pattern)) + args files)) + ;;;###autoload (defun magit-log-all-branches (&optional args files) "Show log for all local and remote branches and `HEAD'." @@ -614,9 +676,9 @@ completion candidates." ;;;###autoload (defun magit-log-buffer-file (&optional follow beg end) "Show log for the blob or file visited in the current buffer. -With a prefix argument or when `--follow' is part of -`magit-log-arguments', then follow renames. When the region is -active, restrict the log to the lines that the region touches." +With a prefix argument or when `--follow' is an active log +argument, then follow renames. When the region is active, +restrict the log to the lines that the region touches." (interactive (cons current-prefix-arg (and (region-active-p) @@ -935,7 +997,7 @@ Do not add this to a hook variable." (remove "--literal-pathspecs" magit-git-global-arguments))) (magit-git-wash (apply-partially #'magit-log-wash-log 'log) "log" - (format "--format=%s%%h%%x00%s%%x00%s%%x00%%aN%%x00%%at%%x00%%s%s" + (format "--format=%s%%h%%x00%s%%x00%s%%x00%%aN%%x00%s%%x00%%s%s" (if (and (member "--left-right" args) (not (member "--graph" args))) "%m " @@ -944,6 +1006,7 @@ Do not add this to a hook variable." (if (member "--show-signature" args) (progn (setq args (remove "--show-signature" args)) "%G?") "") + (if magit-log-margin-show-committer-date "%ct" "%at") (if (member "++header" args) (if (member "--graph" (setq args (remove "++header" args))) (concat "\n" magit-log-revision-headers-format "\n") @@ -1098,21 +1161,23 @@ Do not add this to a hook variable." (when (and (derived-mode-p 'magit-refs-mode) magit-refs-show-commit-count) (insert (make-string (1- magit-refs-focus-column-width) ?\s))) - (insert (propertize cherry 'face (if (string= cherry "-") - 'magit-cherry-equivalent - 'magit-cherry-unmatched))) + (insert (propertize cherry 'font-lock-face + (if (string= cherry "-") + 'magit-cherry-equivalent + 'magit-cherry-unmatched))) (insert ?\s)) (when side - (insert (propertize side 'face (if (string= side "<") - 'magit-cherry-equivalent - 'magit-cherry-unmatched))) + (insert (propertize side 'font-lock-face + (if (string= side "<") + 'magit-cherry-equivalent + 'magit-cherry-unmatched))) (insert ?\s)) (when align - (insert (propertize hash 'face 'magit-hash) ?\s)) + (insert (propertize hash 'font-lock-face 'magit-hash) ?\s)) (when graph (insert graph)) (unless align - (insert (propertize hash 'face 'magit-hash) ?\s)) + (insert (propertize hash 'font-lock-face 'magit-hash) ?\s)) (when (and refs (not magit-log-show-refname-after-summary)) (insert (magit-format-ref-labels refs) ?\s)) (when (eq style 'reflog) @@ -1122,7 +1187,7 @@ Do not add this to a hook variable." (substring refsub 0 (if (string-match-p ":" refsub) -2 -1)))))) (when msg (when gpg - (setq msg (propertize msg 'face + (setq msg (propertize msg 'font-lock-face (pcase (aref gpg 0) (?G 'magit-signature-good) (?B 'magit-signature-bad) @@ -1199,15 +1264,13 @@ Do not add this to a hook variable." (let ((start 0)) (when (string-match "^\\(squash\\|fixup\\)! " msg start) (setq start (match-end 0)) - (put-text-property (match-beginning 0) - (match-end 0) - 'face 'magit-keyword-squash msg)) + (magit--put-face (match-beginning 0) (match-end 0) + 'magit-keyword-squash msg)) (while (string-match "\\[[^[]*\\]" msg start) (setq start (match-end 0)) (when magit-log-highlight-keywords - (put-text-property (match-beginning 0) - (match-end 0) - 'face 'magit-keyword msg)))) + (magit--put-face (match-beginning 0) (match-end 0) + 'magit-keyword msg)))) msg) (defun magit-log-maybe-show-more-commits (section) @@ -1232,12 +1295,13 @@ exists mostly for backward compatibility reasons." "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." (when (derived-mode-p 'magit-log-mode 'magit-cherry-mode 'magit-reflog-mode) - (magit-log-maybe-update-revision-buffer-1))) + (magit--maybe-update-revision-buffer))) -(defun magit-log-maybe-update-revision-buffer-1 () - (unless magit--update-revision-buffer - (when-let ((commit (magit-section-value-if 'commit)) - (buffer (magit-get-mode-buffer 'magit-revision-mode nil t))) +(defun magit--maybe-update-revision-buffer () + (when-let ((commit (magit-section-value-if 'commit)) + (buffer (magit-get-mode-buffer 'magit-revision-mode nil t))) + (if magit--update-revision-buffer + (setq magit--update-revision-buffer (list commit buffer)) (setq magit--update-revision-buffer (list commit buffer)) (run-with-idle-timer magit-update-other-window-delay nil @@ -1258,29 +1322,30 @@ If there is no revision buffer in the same frame, then do nothing." "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." (when (derived-mode-p 'magit-log-mode 'magit-cherry-mode 'magit-reflog-mode) - (magit-log-maybe-update-blob-buffer-1))) - -(defun magit-log-maybe-update-blob-buffer-1 () - (unless magit--update-revision-buffer - (when-let ((commit (magit-section-value-if 'commit)) - (buffer (--first (with-current-buffer it - (eq revert-buffer-function - 'magit-revert-rev-file-buffer)) - (mapcar #'window-buffer (window-list))))) + (magit--maybe-update-blob-buffer))) + +(defun magit--maybe-update-blob-buffer () + (when-let ((commit (magit-section-value-if 'commit)) + (buffer (--first (with-current-buffer it + (eq revert-buffer-function + 'magit-revert-rev-file-buffer)) + (mapcar #'window-buffer (window-list))))) + (if magit--update-blob-buffer (setq magit--update-blob-buffer (list commit buffer)) - (run-with-idle-timer - magit-update-other-window-delay nil - (lambda () - (pcase-let ((`(,rev ,buf) magit--update-blob-buffer)) - (setq magit--update-blob-buffer nil) - (when (buffer-live-p buf) - (with-selected-window (get-buffer-window buf) - (with-current-buffer buf - (save-excursion - (magit-blob-visit (list (magit-rev-parse rev) - (magit-file-relative-name - magit-buffer-file-name)) - (line-number-at-pos)))))))))))) + (setq magit--update-blob-buffer (list commit buffer)) + (run-with-idle-timer + magit-update-other-window-delay nil + (lambda () + (pcase-let ((`(,rev ,buf) magit--update-blob-buffer)) + (setq magit--update-blob-buffer nil) + (when (buffer-live-p buf) + (with-selected-window (get-buffer-window buf) + (with-current-buffer buf + (save-excursion + (magit-blob-visit (list (magit-rev-parse rev) + (magit-file-relative-name + magit-buffer-file-name)) + (line-number-at-pos)))))))))))) (defun magit-log-goto-commit-section (rev) (let ((abbrev (magit-rev-format "%h" rev))) @@ -1307,31 +1372,36 @@ The shortstat style is experimental and rather slow." (magit-set-buffer-margin nil t)) (defun magit-log-format-margin (rev author date) - (when-let ((option (magit-margin-option))) + (when (magit-margin-option) (if magit-log-margin-show-shortstat (magit-log-format-shortstat-margin rev) - (pcase-let ((`(,_ ,style ,width ,details ,details-width) - (or magit-buffer-margin - (symbol-value option)))) - (magit-make-margin-overlay - (concat (and details - (concat (propertize (truncate-string-to-width - (or author "") - details-width - nil ?\s (make-string 1 magit-ellipsis)) - 'face 'magit-log-author) - " ")) - (propertize - (if (stringp style) - (format-time-string - style - (seconds-to-time (string-to-number date))) - (pcase-let* ((abbr (eq style 'age-abbreviated)) - (`(,cnt ,unit) (magit--age date abbr))) - (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is") - (- width (if details (1+ details-width) 0))) - cnt unit))) - 'face 'magit-log-date))))))) + (magit-log-format-author-margin author date)))) + +(defun magit-log-format-author-margin (author date &optional previous-line) + (pcase-let ((`(,_ ,style ,width ,details ,details-width) + (or magit-buffer-margin + (symbol-value (magit-margin-option))))) + (magit-make-margin-overlay + (concat (and details + (concat (magit--propertize-face + (truncate-string-to-width + (or author "") + details-width + nil ?\s (make-string 1 magit-ellipsis)) + 'magit-log-author) + " ")) + (magit--propertize-face + (if (stringp style) + (format-time-string + style + (seconds-to-time (string-to-number date))) + (pcase-let* ((abbr (eq style 'age-abbreviated)) + (`(,cnt ,unit) (magit--age date abbr))) + (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is") + (- width (if details (1+ details-width) 0))) + cnt unit))) + 'magit-log-date)) + previous-line))) (defun magit-log-format-shortstat-margin (rev) (magit-make-margin-overlay @@ -1345,10 +1415,12 @@ The shortstat style is experimental and rather slow." (format "%5s %5s%4s" (if add - (propertize (format "%s+" add) 'face 'magit-diffstat-added) + (magit--propertize-face (format "%s+" add) + 'magit-diffstat-added) "") (if del - (propertize (format "%s-" del) 'face 'magit-diffstat-removed) + (magit--propertize-face (format "%s-" del) + 'magit-diffstat-removed) "") files)) "") @@ -1438,11 +1510,11 @@ Type \\[magit-log-select-quit] to abort without selecting a commit." (when magit-log-select-show-usage (let ((pick (propertize (substitute-command-keys "\\[magit-log-select-pick]") - 'face + 'font-lock-face 'magit-header-line-key)) (quit (propertize (substitute-command-keys "\\[magit-log-select-quit]") - 'face + 'font-lock-face 'magit-header-line-key))) (setq msg (format-spec (if msg @@ -1452,7 +1524,8 @@ Type \\[magit-log-select-quit] to abort without selecting a commit." "Type %p to select commit at point, or %q to abort") `((?p . ,pick) (?q . ,quit))))) - (add-face-text-property 0 (length msg) 'magit-header-line-log-select t msg) + (magit--add-face-text-property + 0 (length msg) 'magit-header-line-log-select t msg) (when (memq magit-log-select-show-usage '(both header-line)) (magit-set-header-line-format msg)) (when (memq magit-log-select-show-usage '(both echo-area)) @@ -1526,8 +1599,9 @@ Type \\[magit-cherry-pick] to apply the commit at point. (defun magit-insert-cherry-headers () "Insert headers appropriate for `magit-cherry-mode' buffers." - (let ((branch (propertize magit-buffer-refname 'face 'magit-branch-local)) - (upstream (propertize magit-buffer-upstream 'face + (let ((branch (propertize magit-buffer-refname + 'font-lock-face 'magit-branch-local)) + (upstream (propertize magit-buffer-upstream 'font-lock-face (if (magit-local-branch-p magit-buffer-upstream) 'magit-branch-local 'magit-branch-remote)))) @@ -1561,9 +1635,11 @@ Type \\[magit-cherry-pick] to apply the commit at point. (when-let ((upstream (magit-get-upstream-branch))) (magit-insert-section (unpulled "..@{upstream}" t) (magit-insert-heading - (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) + (format (propertize "Unpulled from %s." + 'font-lock-face 'magit-section-heading) upstream)) - (magit-insert-log "..@{upstream}" magit-buffer-log-args)))) + (magit-insert-log "..@{upstream}" magit-buffer-log-args) + (magit-log-insert-child-count)))) (magit-define-section-jumper magit-jump-to-unpulled-from-pushremote "Unpulled from " unpulled @@ -1580,9 +1656,11 @@ Type \\[magit-cherry-pick] to apply the commit at point. magit-status-sections-hook))) (magit-insert-section (unpulled (concat ".." it) t) (magit-insert-heading - (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) - (propertize it 'face 'magit-branch-remote))) - (magit-insert-log (concat ".." it) magit-buffer-log-args))))) + (format (propertize "Unpulled from %s." + 'font-lock-face 'magit-section-heading) + (propertize it 'font-lock-face 'magit-branch-remote))) + (magit-insert-log (concat ".." it) magit-buffer-log-args) + (magit-log-insert-child-count))))) (defvar magit-unpushed-section-map (let ((map (make-sparse-keymap))) @@ -1611,9 +1689,11 @@ then show the last `magit-log-section-commit-count' commits." (when (magit-git-success "rev-parse" "@{upstream}") (magit-insert-section (unpushed "@{upstream}..") (magit-insert-heading - (format (propertize "Unmerged into %s:" 'face 'magit-section-heading) + (format (propertize "Unmerged into %s." + 'font-lock-face 'magit-section-heading) (magit-get-upstream-branch))) - (magit-insert-log "@{upstream}.." magit-buffer-log-args)))) + (magit-insert-log "@{upstream}.." magit-buffer-log-args) + (magit-log-insert-child-count)))) (defun magit-insert-recent-commits (&optional type value) "Insert section showing recent commits. @@ -1645,9 +1725,22 @@ Show the last `magit-log-section-commit-count' commits." magit-status-sections-hook))) (magit-insert-section (unpushed (concat it "..") t) (magit-insert-heading - (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) - (propertize it 'face 'magit-branch-remote))) - (magit-insert-log (concat it "..") magit-buffer-log-args))))) + (format (propertize "Unpushed to %s." + 'font-lock-face 'magit-section-heading) + (propertize it 'font-lock-face 'magit-branch-remote))) + (magit-insert-log (concat it "..") magit-buffer-log-args) + (magit-log-insert-child-count))))) + +(defun magit-log-insert-child-count () + (when magit-section-show-child-count + (let ((count (length (oref magit-insert-section--current children)))) + (when (> count 0) + (when (= count (magit-log-get-commit-limit)) + (setq count (format "%s+" count))) + (save-excursion + (goto-char (- (oref magit-insert-section--current content) 2)) + (insert (format " (%s)" count)) + (delete-char 1)))))) ;;;; Auxiliary Log Sections diff --git a/elpa/magit-20190514.1814/magit-margin.el b/elpa/magit-20191030.1315/magit-margin.el similarity index 98% rename from elpa/magit-20190514.1814/magit-margin.el rename to elpa/magit-20191030.1315/magit-margin.el index 37c9e179..b3137c68 100644 --- a/elpa/magit-20190514.1814/magit-margin.el +++ b/elpa/magit-20191030.1315/magit-margin.el @@ -117,7 +117,8 @@ does not carry to other options." (`magit-reflog-mode 'magit-reflog-margin) (`magit-refs-mode 'magit-refs-margin) (`magit-stashes-mode 'magit-stashes-margin) - (`magit-status-mode 'magit-status-margin))) + (`magit-status-mode 'magit-status-margin) + (`forge-notifications-mode 'magit-status-margin))) (defun magit-set-buffer-margin (&optional reset refresh) (when-let ((option (magit-margin-option))) diff --git a/elpa/magit-20190514.1814/magit-merge.el b/elpa/magit-20191030.1315/magit-merge.el similarity index 96% rename from elpa/magit-20190514.1814/magit-merge.el rename to elpa/magit-20191030.1315/magit-merge.el index bedbb50f..5a8486ef 100644 --- a/elpa/magit-20190514.1814/magit-merge.el +++ b/elpa/magit-20191030.1315/magit-merge.el @@ -54,7 +54,7 @@ ("n" "Merge but don't commit" magit-merge-nocommit) ("a" "Absorb" magit-merge-absorb)] [("p" "Preview merge" magit-merge-preview) - ?\n + "" ("s" "Squash merge" magit-merge-squash) ("i" "Merge into" magit-merge-into)]] ["Actions" @@ -175,7 +175,16 @@ then also remove the respective remote branch." (magit--merge-absorb-1 branch args))) (defun magit--merge-absorb-1 (branch args) - (magit-run-git-async "merge" args "--no-edit" branch) + (if-let ((pr (magit-get "branch" branch "pullRequest"))) + (magit-run-git-async + "merge" args "-m" + (format "Merge branch '%s'%s [%s]" + branch + (let ((current (magit-get-current-branch))) + (if (equal current "master") "" (format " into %s" current))) + pr) + branch) + (magit-run-git-async "merge" args "--no-edit" branch)) (set-process-sentinel magit-this-process (lambda (process event) diff --git a/elpa/magit-20190514.1814/magit-mode.el b/elpa/magit-20191030.1315/magit-mode.el similarity index 97% rename from elpa/magit-20190514.1814/magit-mode.el rename to elpa/magit-20191030.1315/magit-mode.el index 9a31efde..b82ab50a 100644 --- a/elpa/magit-20190514.1814/magit-mode.el +++ b/elpa/magit-20191030.1315/magit-mode.el @@ -374,6 +374,19 @@ starts complicating other things, then it will be removed." :group 'magit-miscellaneous :type 'boolean) +(defcustom magit-disable-line-numbers t + "In Magit buffers, whether to disable modes that display line numbers. + +Some users who turn on `global-disable-line-numbers-mode' (or +`global-nlinum-mode' or `global-linum-mode') expect line numbers +to be displayed everywhere except in Magit buffers. Other users do +not expect Magit buffers to be treated differently. At least in +theory users in the first group should not use the global mode, +but that ship has sailed, thus this option." + :package-version '(magit . "2.91.0") + :group 'magit-miscellaneous + :type 'boolean) + ;;; Key Bindings (defvar magit-mode-map @@ -519,6 +532,11 @@ which visits the thing at point using `browse-url'." (interactive) (user-error "There is no thing at point that could be browsed")) +(defvar bug-reference-map) +(with-eval-after-load 'bug-reference + (define-key bug-reference-map [remap magit-visit-thing] + 'bug-reference-push-button)) + (easy-menu-define magit-mode-menu magit-mode-map "Magit menu" '("Magit" @@ -587,6 +605,10 @@ Magit is documented in info node `(magit)'." (setq truncate-lines t) (setq buffer-read-only t) (setq-local line-move-visual t) ; see #1771 + ;; Turn off syntactic font locking, but not by setting + ;; `font-lock-defaults' because that would enable font locking, and + ;; not all magit plugins may be ready for that (see #3950). + (setq-local font-lock-syntactic-face-function #'ignore) (setq show-trailing-whitespace nil) (setq list-buffers-directory (abbreviate-file-name default-directory)) (hack-dir-local-variables-non-file-buffer) @@ -597,14 +619,15 @@ Magit is documented in info node `(magit)'." (setq-local redisplay-highlight-region-function 'magit-highlight-region) (setq-local redisplay-unhighlight-region-function 'magit-unhighlight-region) (setq mode-line-process (magit-repository-local-get 'mode-line-process)) - (when (bound-and-true-p global-linum-mode) - (linum-mode -1)) - (when (and (fboundp 'nlinum-mode) - (bound-and-true-p global-nlinum-mode)) - (nlinum-mode -1)) - (when (and (fboundp 'display-line-numbers-mode) - (bound-and-true-p global-display-line-numbers-mode)) - (display-line-numbers-mode -1)) + (when magit-disable-line-numbers + (when (bound-and-true-p global-linum-mode) + (linum-mode -1)) + (when (and (fboundp 'nlinum-mode) + (bound-and-true-p global-nlinum-mode)) + (nlinum-mode -1)) + (when (and (fboundp 'display-line-numbers-mode) + (bound-and-true-p global-display-line-numbers-mode)) + (display-line-numbers-mode -1))) (add-hook 'kill-buffer-hook 'magit-preserve-section-visibility-cache) (setq-local bookmark-make-record-function 'magit--make-bookmark)) @@ -1126,8 +1149,10 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (when magit-refresh-verbose (message "Refreshing magit...")) (magit-run-hook-with-benchmark 'magit-pre-refresh-hook) - (when (derived-mode-p 'magit-mode) - (magit-refresh-buffer)) + (cond ((derived-mode-p 'magit-mode) + (magit-refresh-buffer)) + ((derived-mode-p 'tabulated-list-mode) + (revert-buffer))) (--when-let (and magit-refresh-status-buffer (not (derived-mode-p 'magit-status-mode)) (magit-get-mode-buffer 'magit-status-mode)) @@ -1312,10 +1337,13 @@ argument (the prefix) non-nil means save all with no questions." arg (lambda () (and (not magit-inhibit-refresh-save) buffer-file-name - (file-exists-p (file-name-directory buffer-file-name)) ;; Avoid needlessly connecting to unrelated remotes. (equal (file-remote-p buffer-file-name) remote) + ;; For remote files this makes network requests and + ;; therefore has to come after the above to avoid + ;; unnecessarily waiting for unrelated hosts. + (file-exists-p (file-name-directory buffer-file-name)) (string-prefix-p topdir (file-truename buffer-file-name)) (equal (magit-rev-parse-safe "--show-toplevel") topdir))))))) diff --git a/elpa/magit-20190514.1814/magit-notes.el b/elpa/magit-20191030.1315/magit-notes.el similarity index 100% rename from elpa/magit-20190514.1814/magit-notes.el rename to elpa/magit-20191030.1315/magit-notes.el diff --git a/elpa/magit-20190514.1814/magit-obsolete.el b/elpa/magit-20191030.1315/magit-obsolete.el similarity index 97% rename from elpa/magit-20190514.1814/magit-obsolete.el rename to elpa/magit-20191030.1315/magit-obsolete.el index 8f45e594..7fb2141c 100644 --- a/elpa/magit-20190514.1814/magit-obsolete.el +++ b/elpa/magit-20191030.1315/magit-obsolete.el @@ -46,6 +46,9 @@ (define-obsolete-function-alias 'magit-dispatch-popup 'magit-dispatch "Magit 2.91.0") +(define-obsolete-function-alias 'magit-repolist-column-dirty + 'magit-repolist-column-flag "Magit 2.91.0") + (defun magit--magit-popup-warning () (display-warning 'magit "\ Magit no longer uses Magit-Popup. diff --git a/elpa/magit-20190514.1814/magit-patch.el b/elpa/magit-20191030.1315/magit-patch.el similarity index 100% rename from elpa/magit-20190514.1814/magit-patch.el rename to elpa/magit-20191030.1315/magit-patch.el diff --git a/elpa/magit-20190514.1814/magit-pkg.el b/elpa/magit-20191030.1315/magit-pkg.el similarity index 70% rename from elpa/magit-20190514.1814/magit-pkg.el rename to elpa/magit-20191030.1315/magit-pkg.el index df498cb9..917b9ef3 100644 --- a/elpa/magit-20190514.1814/magit-pkg.el +++ b/elpa/magit-20191030.1315/magit-pkg.el @@ -1,9 +1,9 @@ -(define-package "magit" "20190514.1814" "A Git porcelain inside Emacs." +(define-package "magit" "20191030.1315" "A Git porcelain inside Emacs." '((emacs "25.1") (async "20180527") (dash "20180910") (git-commit "20181104") - (transient "0") + (transient "20190812") (with-editor "20181103")) :keywords '("git" "tools" "vc")) diff --git a/elpa/magit-20190514.1814/magit-process.el b/elpa/magit-20191030.1315/magit-process.el similarity index 97% rename from elpa/magit-20190514.1814/magit-process.el rename to elpa/magit-20191030.1315/magit-process.el index 863844dc..75fa9d1d 100644 --- a/elpa/magit-20190514.1814/magit-process.el +++ b/elpa/magit-20191030.1315/magit-process.el @@ -150,7 +150,13 @@ itself from the hook, to avoid further futile attempts." (const :tag "Don't start a cache daemon" nil))) (defcustom magit-process-yes-or-no-prompt-regexp - " [\[(]\\([Yy]\\(?:es\\)?\\)[/|]\\([Nn]o?\\)[\])] ?[?:] ?$" + (concat " [\[(]" + "\\([Yy]\\(?:es\\)?\\)" + "[/|]" + "\\([Nn]o?\\)" + ;; OpenSSH v8 prints this. See #3969. + "\\(?:/\\[fingerprint\\]\\)?" + "[\])] ?[?:] ?$") "Regexp matching Yes-or-No prompts of Git and its subprocesses." :package-version '(magit . "2.1.0") :group 'magit-process @@ -617,7 +623,7 @@ Magit status buffer." (magit-insert-section (process) (insert (if errcode (format "%3s " (propertize (number-to-string errcode) - 'face 'magit-process-ng)) + 'font-lock-face 'magit-process-ng)) "run ")) (unless (equal (expand-file-name pwd) (expand-file-name default-directory)) @@ -626,20 +632,21 @@ Magit status buffer." ((and args (equal program magit-git-executable)) (setq args (-split-at (length magit-git-global-arguments) args)) (insert (propertize (file-name-nondirectory program) - 'face 'magit-section-heading) " ") + 'font-lock-face 'magit-section-heading) " ") (insert (propertize (char-to-string magit-ellipsis) - 'face 'magit-section-heading + 'font-lock-face 'magit-section-heading 'help-echo (mapconcat #'identity (car args) " "))) (insert " ") (insert (propertize (mapconcat #'shell-quote-argument (cadr args) " ") - 'face 'magit-section-heading))) + 'font-lock-face 'magit-section-heading))) ((and args (equal program shell-file-name)) - (insert (propertize (cadr args) 'face 'magit-section-heading))) + (insert (propertize (cadr args) + 'font-lock-face 'magit-section-heading))) (t (insert (propertize (file-name-nondirectory program) - 'face 'magit-section-heading) " ") + 'font-lock-face 'magit-section-heading) " ") (insert (propertize (mapconcat #'shell-quote-argument args " ") - 'face 'magit-section-heading)))) + 'font-lock-face 'magit-section-heading)))) (magit-insert-heading) (when errlog (if (bufferp errlog) @@ -906,7 +913,7 @@ as argument." 'mouse-face 'highlight 'keymap magit-mode-line-process-map 'help-echo "mouse-1: Show process buffer" - 'face 'magit-mode-line-process)))) + 'font-lock-face 'magit-mode-line-process)))) (magit-repository-local-set 'mode-line-process str) (dolist (buf (magit-mode-get-buffers)) (with-current-buffer buf @@ -930,7 +937,7 @@ If STR is supplied, it replaces the `mode-line-process' text." 'mouse-face 'highlight 'keymap magit-mode-line-process-map 'help-echo error - 'face 'magit-mode-line-process-error))) + 'font-lock-face 'magit-mode-line-process-error))) (magit-repository-local-set 'mode-line-process str) (dolist (buf (magit-mode-get-buffers)) (with-current-buffer buf @@ -966,7 +973,7 @@ If STR is supplied, it replaces the `mode-line-process' text." (let ((status (or mode-line-process (magit-repository-local-get 'mode-line-process)))) (when (and status - (eq (get-text-property 1 'face status) + (eq (get-text-property 1 'font-lock-face status) 'magit-mode-line-process-error)) (magit-process-unset-mode-line)))) @@ -1053,9 +1060,9 @@ Limited by `magit-process-error-tooltip-max-lines'." (set-marker-insertion-type marker nil) (insert (propertize (format "%3s" arg) 'magit-section section - 'face (if (= arg 0) - 'magit-process-ok - 'magit-process-ng))) + 'font-lock-face (if (= arg 0) + 'magit-process-ok + 'magit-process-ng))) (set-marker-insertion-type marker t)) (when magit-process-finish-apply-ansi-colors (ansi-color-apply-on-region (oref section content) diff --git a/elpa/magit-20190514.1814/magit-pull.el b/elpa/magit-20191030.1315/magit-pull.el similarity index 96% rename from elpa/magit-20190514.1814/magit-pull.el rename to elpa/magit-20191030.1315/magit-pull.el index ba418313..6aff89f7 100644 --- a/elpa/magit-20190514.1814/magit-pull.el +++ b/elpa/magit-20191030.1315/magit-pull.el @@ -135,12 +135,12 @@ the upstream." (or (magit-get-upstream-branch branch) (let ((remote (magit-get "branch" branch "remote")) (merge (magit-get "branch" branch "merge")) - (u (propertize "@{upstream}" 'face 'bold))) + (u (magit--propertize-face "@{upstream}" 'bold))) (cond ((magit--unnamed-upstream-p remote merge) (format "%s of %s" - (propertize merge 'face 'magit-branch-remote) - (propertize remote 'face 'bold))) + (magit--propertize-face merge 'magit-branch-remote) + (magit--propertize-face remote 'bold))) ((magit--valid-upstream-p remote merge) (concat u ", replacing non-existent")) ((or remote merge) diff --git a/elpa/magit-20190514.1814/magit-push.el b/elpa/magit-20191030.1315/magit-push.el similarity index 92% rename from elpa/magit-20190514.1814/magit-push.el rename to elpa/magit-20191030.1315/magit-push.el index 25934145..3b5733c6 100644 --- a/elpa/magit-20190514.1814/magit-push.el +++ b/elpa/magit-20191030.1315/magit-push.el @@ -102,8 +102,8 @@ argument the push-remote can be changed before pushed to it." (target) ((member remote (magit-list-remotes)) (format "%s, creating it" - (propertize (concat remote "/" branch) - 'face 'magit-branch-remote))) + (magit--propertize-face (concat remote "/" branch) + 'magit-branch-remote))) (remote (format "%s, replacing invalid" v)) (t @@ -154,16 +154,16 @@ the upstream." (or (magit-get-upstream-branch branch) (let ((remote (magit-get "branch" branch "remote")) (merge (magit-get "branch" branch "merge")) - (u (propertize "@{upstream}" 'face 'bold))) + (u (magit--propertize-face "@{upstream}" 'bold))) (cond ((magit--unnamed-upstream-p remote merge) (format "%s as %s" - (propertize remote 'face 'bold) - (propertize merge 'face 'magit-branch-remote))) + (magit--propertize-face remote 'bold) + (magit--propertize-face merge 'magit-branch-remote))) ((magit--valid-upstream-p remote merge) (format "%s creating %s" - (propertize remote 'face 'magit-branch-remote) - (propertize merge 'face 'magit-branch-remote))) + (magit--propertize-face remote 'magit-branch-remote) + (magit--propertize-face merge 'magit-branch-remote))) ((or remote merge) (concat u ", creating it and replacing invalid")) (t @@ -275,25 +275,25 @@ the popup buffer." (magit-remote-p "origin"))) (refspec (magit-get "remote" remote "push"))) (format "%s using %s" - (propertize remote 'face 'magit-branch-remote) - (propertize refspec 'face 'bold))) + (magit--propertize-face remote 'magit-branch-remote) + (magit--propertize-face refspec 'bold))) (--when-let (and (not (magit-get-push-branch)) (magit-get-upstream-branch)) (format "%s aka %s\n" (magit-branch-set-face it) - (propertize "@{upstream}" 'face 'bold))) + (magit--propertize-face "@{upstream}" 'bold))) (--when-let (magit-get-push-branch) (format "%s aka %s\n" (magit-branch-set-face it) - (propertize "pushRemote" 'face 'bold))) + (magit--propertize-face "pushRemote" 'bold))) (--when-let (magit-get-@{push}-branch) (format "%s aka %s\n" (magit-branch-set-face it) - (propertize "@{push}" 'face 'bold))) + (magit--propertize-face "@{push}" 'bold))) (format "using %s (%s is %s)\n" - (propertize "git push" 'face 'bold) - (propertize "push.default" 'face 'bold) - (propertize default 'face 'bold)))))) + (magit--propertize-face "git push" 'bold) + (magit--propertize-face "push.default" 'bold) + (magit--propertize-face default 'bold)))))) ;;;###autoload (defun magit-push-to-remote (remote args) @@ -312,7 +312,7 @@ these Git variables: `push.default', `remote.pushDefault', (magit-run-git-async "push" "-v" args remote)) (defun magit-push-to-remote--desc () - (format "using %s\n" (propertize "git push " 'face 'bold))) + (format "using %s\n" (magit--propertize-face "git push " 'bold))) ;;; _ (provide 'magit-push) diff --git a/elpa/magit-20190514.1814/magit-reflog.el b/elpa/magit-20191030.1315/magit-reflog.el similarity index 93% rename from elpa/magit-20190514.1814/magit-reflog.el rename to elpa/magit-20191030.1315/magit-reflog.el index ea3516d4..1fc13aff 100644 --- a/elpa/magit-20190514.1814/magit-reflog.el +++ b/elpa/magit-20191030.1315/magit-reflog.el @@ -53,10 +53,12 @@ and \"-\"." The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -202,9 +204,9 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (delq nil (list command option type)) " ")))) (format "%-16s " - (propertize text 'face - (or (cdr (assoc label magit-reflog-labels)) - 'magit-reflog-other))))) + (magit--propertize-face + text (or (cdr (assoc label magit-reflog-labels)) + 'magit-reflog-other))))) ;;; _ (provide 'magit-reflog) diff --git a/elpa/magit-20190514.1814/magit-refs.el b/elpa/magit-20191030.1315/magit-refs.el similarity index 93% rename from elpa/magit-20190514.1814/magit-refs.el rename to elpa/magit-20191030.1315/magit-refs.el index 30c70dd4..ddb55fe9 100644 --- a/elpa/magit-20190514.1814/magit-refs.el +++ b/elpa/magit-20191030.1315/magit-refs.el @@ -114,10 +114,12 @@ in the heading preceeding the list of its branches." The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -182,16 +184,21 @@ change the verbosity of this column." (defcustom magit-refs-filter-alist nil "Alist controlling which refs are omitted from `magit-refs-mode' buffers. +The purpose of this option is to forgo displaying certain refs +based on their name. If you want to not display any refs of a +certain type, then you should remove the appropriate function +from `magit-refs-sections-hook' instead. + All keys are tried in order until one matches. Then its value is used and subsequent elements are ignored. If the value is non-nil, then the reference is displayed, otherwise it is not. If no element matches, then the reference is displayed. -A key can either be a regular expression that the refname has -to match, or a function that takes the refname as only argument -and returns a boolean. Contrary to how they are displayed in -the buffer, for comparison each tag begins with \"tags/\" and -each remote branch with \"/\"." +A key can either be a regular expression that the refname has to +match, or a function that takes the refname as only argument and +returns a boolean. A remote branch such as \"origin/master\" is +displayed as just \"master\", however for this comparison the +former is used." :package-version '(magit . "2.12.0") :group 'magit-refs :type '(alist :key-type (choice :tag "Key" regexp function) @@ -521,7 +528,7 @@ line is inserted at all." (magit-insert-section (tag tag t) (magit-insert-heading (magit-refs--format-focus-column tag 'tag) - (propertize tag 'face 'magit-tag) + (propertize tag 'font-lock-face 'magit-tag) (make-string (max 1 (- magit-refs-primary-column-width (length tag))) ?\s) @@ -539,8 +546,9 @@ line is inserted at all." (magit-insert-heading (let ((pull (magit-get "remote" remote "url")) (push (magit-get "remote" remote "pushurl"))) - (format (propertize "Remote %s (%s):" 'face 'magit-section-heading) - (propertize remote 'face 'magit-branch-remote) + (format (propertize "Remote %s (%s):" + 'font-lock-face 'magit-section-heading) + (propertize remote 'font-lock-face 'magit-branch-remote) (concat pull (and pull push ", ") push)))) (let (head) (dolist (line (magit-git-lines "for-each-ref" "--format=\ @@ -639,47 +647,49 @@ line is inserted at all." (if branch (magit-refs--propertize-branch branch ref (and headp 'magit-branch-current)) - (propertize "(detached)" 'face 'font-lock-warning-face))) + (magit--propertize-face "(detached)" + 'font-lock-warning-face))) (u:ahead (and u:track (string-match "ahead \\([0-9]+\\)" u:track) - (propertize + (magit--propertize-face (concat (and magit-refs-pad-commit-counts " ") (match-string 1 u:track) ">") - 'face 'magit-dimmed))) + 'magit-dimmed))) (u:behind (and u:track (string-match "behind \\([0-9]+\\)" u:track) - (propertize + (magit--propertize-face (concat "<" (match-string 1 u:track) (and magit-refs-pad-commit-counts " ")) - 'face 'magit-dimmed))) + 'magit-dimmed))) (p:ahead (and pushp p:track (string-match "ahead \\([0-9]+\\)" p:track) - (propertize + (magit--propertize-face (concat (match-string 1 p:track) ">" (and magit-refs-pad-commit-counts " ")) - 'face 'magit-branch-remote))) + 'magit-branch-remote))) (p:behind (and pushp p:track (string-match "behind \\([0-9]+\\)" p:track) - (propertize + (magit--propertize-face (concat "<" (match-string 1 p:track) (and magit-refs-pad-commit-counts " ")) - 'face 'magit-dimmed)))) + 'magit-dimmed)))) (list (1+ (length (concat branch-desc u:ahead p:ahead u:behind))) branch (magit-refs--format-focus-column branch headp) branch-desc u:ahead p:ahead u:behind (and upstream (concat (if (equal u:track "[gone]") - (propertize upstream 'face 'error) + (magit--propertize-face upstream 'error) (magit-refs--propertize-branch upstream u:ref)) " ")) (and pushp (concat p:behind - (propertize push 'face 'magit-branch-remote) + (magit--propertize-face + push 'magit-branch-remote) " ")) (and msg (magit-log-propertize-keywords nil msg))))))) @@ -692,27 +702,28 @@ line is inserted at all." (format "%%%ss " width) (cond ((or (equal ref focus) (and (eq type t) - (eq focus nil))) - (propertize (concat (if focus "@" "*") - (make-string (1- width) ?\s)) - 'face 'magit-section-heading)) + (equal focus "HEAD"))) + (magit--propertize-face (concat (if (equal focus "HEAD") "@" "*") + (make-string (1- width) ?\s)) + 'magit-section-heading)) ((if (eq type 'tag) (eq magit-refs-show-commit-count 'all) magit-refs-show-commit-count) (pcase-let ((`(,behind ,ahead) (magit-rev-diff-count magit-buffer-upstream ref))) - (propertize + (magit--propertize-face (cond ((> ahead 0) (concat "<" (number-to-string ahead))) ((> behind 0) (concat (number-to-string behind) ">")) (t "=")) - 'face 'magit-dimmed))) + 'magit-dimmed))) (t ""))))) (defun magit-refs--propertize-branch (branch ref &optional head-face) (let ((face (cdr (cl-find-if (pcase-lambda (`(,re . ,_)) (string-match-p re ref)) magit-ref-namespaces)))) - (propertize branch 'face (if head-face (list face head-face) face)))) + (magit--propertize-face + branch (if head-face (list face head-face) face)))) (defun magit-refs--insert-refname-p (refname) (--if-let (-first (pcase-lambda (`(,key . ,_)) diff --git a/elpa/magit-20190514.1814/magit-remote.el b/elpa/magit-20191030.1315/magit-remote.el similarity index 98% rename from elpa/magit-20190514.1814/magit-remote.el rename to elpa/magit-20191030.1315/magit-remote.el index 54a7983e..0e6a82fd 100644 --- a/elpa/magit-20190514.1814/magit-remote.el +++ b/elpa/magit-20191030.1315/magit-remote.el @@ -316,10 +316,11 @@ Delete the symbolic-ref \"refs/remotes//HEAD\"." (defun magit--push-remote-variable (&optional branch short) (unless branch (setq branch (magit-get-current-branch))) - (propertize (if (or (not branch) magit-prefer-push-default) - (if short "pushDefault" "remote.pushDefault") - (if short "pushRemote" (format "branch.%s.pushRemote" branch))) - 'face 'bold)) + (magit--propertize-face + (if (or (not branch) magit-prefer-push-default) + (if short "pushDefault" "remote.pushDefault") + (if short "pushRemote" (format "branch.%s.pushRemote" branch))) + 'bold)) (defun magit--select-push-remote (prompt-suffix) (let* ((branch (or (magit-get-current-branch) diff --git a/elpa/magit-20190514.1814/magit-repos.el b/elpa/magit-20191030.1315/magit-repos.el similarity index 87% rename from elpa/magit-20190514.1814/magit-repos.el rename to elpa/magit-20191030.1315/magit-repos.el index e4fdb4ee..c51a956d 100644 --- a/elpa/magit-20190514.1814/magit-repos.el +++ b/elpa/magit-20191030.1315/magit-repos.el @@ -103,6 +103,21 @@ actually support that yet." (symbol)) (sexp :tag "Value")))))) +(defcustom magit-repolist-column-flag-alist + '((magit-untracked-files . "N") + (magit-unstaged-files . "U") + (magit-staged-files . "S")) + "Association list of predicates and flags for `magit-repolist-column-flag'. + +Each element is of the form (FUNCTION . FLAG). Each FUNCTION is +called with no arguments, with `default-directory' bound to the +top level of a repository working tree, until one of them returns +a non-nil value. FLAG corresponding to that function is returned +as the value of `magit-repolist-column-flag'." + :package-version '(magit . "2.91.0") + :group 'magit-repolist + :type '(alist :key-type (function :tag "Predicate Function") + :value-type (string :tag "Flag"))) ;;; List Repositories ;;;; Command @@ -187,7 +202,7 @@ Usually this is just its basename." "--date=format:%Y%m%d.%H%M")))) (save-match-data (when (string-match "-dirty\\'" v) - (put-text-property (1+ (match-beginning 0)) (length v) 'face 'error v)) + (magit--put-face (1+ (match-beginning 0)) (length v) 'error v)) (if (and v (string-match "\\`[0-9]" v)) (concat " " v) v)))) @@ -200,50 +215,55 @@ Usually this is just its basename." "Insert the upstream branch of the current branch." (magit-get-upstream-branch)) -(defun magit-repolist-column-dirty (_id) - "Insert a letter if there are uncommitted changes. +(defun magit-repolist-column-flag (_id) + "Insert a flag as specified by `magit-repolist-column-flag-alist'. -Show N if there is at least one untracked file. -Show U if there is at least one unstaged file. -Show S if there is at least one staged file. +By default this indicates whether there are uncommitted changes. +- N if there is at least one untracked file. +- U if there is at least one unstaged file. +- S if there is at least one staged file. Only one letter is shown, the first that applies." - (cond ((magit-untracked-files) "N") - ((magit-unstaged-files) "U") - ((magit-staged-files) "S"))) + (-some (pcase-lambda (`(,fun . ,flag)) + (and (funcall fun) flag)) + magit-repolist-column-flag-alist)) (defun magit-repolist-column-unpulled-from-upstream (_id) "Insert number of upstream commits not in the current branch." (--when-let (magit-get-upstream-branch) (let ((n (cadr (magit-rev-diff-count "HEAD" it)))) - (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow))))) + (magit--propertize-face + (number-to-string n) (if (> n 0) 'bold 'shadow))))) (defun magit-repolist-column-unpulled-from-pushremote (_id) "Insert number of commits in the push branch but not the current branch." (--when-let (magit-get-push-branch nil t) (let ((n (cadr (magit-rev-diff-count "HEAD" it)))) - (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow))))) + (magit--propertize-face + (number-to-string n) (if (> n 0) 'bold 'shadow))))) (defun magit-repolist-column-unpushed-to-upstream (_id) "Insert number of commits in the current branch but not its upstream." (--when-let (magit-get-upstream-branch) (let ((n (car (magit-rev-diff-count "HEAD" it)))) - (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow))))) + (magit--propertize-face + (number-to-string n) (if (> n 0) 'bold 'shadow))))) (defun magit-repolist-column-unpushed-to-pushremote (_id) "Insert number of commits in the current branch but not its push branch." (--when-let (magit-get-push-branch nil t) (let ((n (car (magit-rev-diff-count "HEAD" it)))) - (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow))))) + (magit--propertize-face + (number-to-string n) (if (> n 0) 'bold 'shadow))))) (defun magit-repolist-column-branches (_id) "Insert number of branches." (let ((n (length (magit-list-local-branches)))) - (propertize (number-to-string n) 'face (if (> n 1) 'bold 'shadow)))) + (magit--propertize-face (number-to-string n) (if (> n 1) 'bold 'shadow)))) (defun magit-repolist-column-stashes (_id) "Insert number of stashes." (let ((n (length (magit-list-stashes)))) - (propertize (number-to-string n) 'face (if (> n 0) 'bold 'shadow)))) + (magit--propertize-face (number-to-string n) (if (> n 0) 'bold 'shadow)))) ;;; Read Repository diff --git a/elpa/magit-20190514.1814/magit-reset.el b/elpa/magit-20191030.1315/magit-reset.el similarity index 97% rename from elpa/magit-20190514.1814/magit-reset.el rename to elpa/magit-20191030.1315/magit-reset.el index 6a24ba15..e16e9b20 100644 --- a/elpa/magit-20190514.1814/magit-reset.el +++ b/elpa/magit-20191030.1315/magit-reset.el @@ -39,7 +39,7 @@ ("h" "hard (HEAD, index and files)" magit-reset-hard) ("i" "index (only)" magit-reset-index) ("w" "worktree (only)" magit-reset-worktree) - ?\n + "" ("f" "a file" magit-file-checkout)]) ;;;###autoload @@ -61,7 +61,7 @@ "Reset the `HEAD', index, and working tree to COMMIT. \n(git reset --hard REVISION)" (interactive (list (magit-reset-read-branch-or-commit - (concat (propertize "Hard" 'face 'bold) + (concat (magit--propertize-face "Hard" 'bold) " reset %s to")))) (magit-reset-internal "--hard" commit)) @@ -92,7 +92,7 @@ With a prefix argument reset the working tree otherwise don't. \n(git reset --mixed|--hard COMMIT)" (interactive (list (magit-reset-read-branch-or-commit (if current-prefix-arg - (concat (propertize "Hard" 'face 'bold) + (concat (magit--propertize-face "Hard" 'bold) " reset %s to") "Reset %s to")) current-prefix-arg)) diff --git a/elpa/magit-20190514.1814/magit-section.el b/elpa/magit-20191030.1315/magit-section.el similarity index 98% rename from elpa/magit-20190514.1814/magit-section.el rename to elpa/magit-20191030.1315/magit-section.el index f5491319..bc361b2a 100644 --- a/elpa/magit-20190514.1814/magit-section.el +++ b/elpa/magit-20191030.1315/magit-section.el @@ -34,6 +34,7 @@ (require 'eieio) (eval-when-compile + (require 'benchmark) (require 'subr-x)) (require 'magit-utils) @@ -44,6 +45,7 @@ (declare-function magit-repository-local-set "magit-mode" (key value &optional repository)) (defvar magit-keep-region-overlay) +(defvar magit-refresh-verbose) ;;; Options @@ -70,10 +72,12 @@ That function in turn is used by all section movement commands." :type 'hook :options '(magit-hunk-set-window-start magit-status-maybe-update-revision-buffer + magit-status-maybe-update-stash-buffer magit-status-maybe-update-blob-buffer magit-log-maybe-update-revision-buffer magit-log-maybe-update-blob-buffer - magit-log-maybe-show-more-commits)) + magit-log-maybe-show-more-commits + magit-stashes-maybe-update-stash-buffer)) (defcustom magit-section-highlight-hook '(magit-diff-highlight @@ -479,6 +483,17 @@ With a prefix argument also expand it." heading) "Show the body of the current section." (interactive (list (magit-current-section))) (oset section hidden nil) + (magit-section--maybe-wash section) + (when-let ((beg (oref section content))) + (remove-overlays beg (oref section end) 'invisible t)) + (magit-section-maybe-update-visibility-indicator section) + (magit-section-maybe-cache-visibility section) + (dolist (child (oref section children)) + (if (oref child hidden) + (magit-section-hide child) + (magit-section-show child)))) + +(defun magit-section--maybe-wash (section) (when-let ((washer (oref section washer))) (oset section washer nil) (let ((inhibit-read-only t) @@ -491,15 +506,7 @@ With a prefix argument also expand it." heading) (oset section content (point-marker)) (funcall washer) (oset section end (point-marker))))) - (magit-section-update-highlight)) - (when-let ((beg (oref section content))) - (remove-overlays beg (oref section end) 'invisible t)) - (magit-section-maybe-update-visibility-indicator section) - (magit-section-maybe-cache-visibility section) - (dolist (child (oref section children)) - (if (oref child hidden) - (magit-section-hide child) - (magit-section-show child)))) + (magit-section-update-highlight))) (defun magit-section-hide (section) "Hide the body of the current section." @@ -1076,9 +1083,12 @@ insert a newline character if necessary." (declare (indent defun)) (when args (let ((heading (apply #'concat args))) - (insert (if (text-property-not-all 0 (length heading) 'face nil heading) + (insert (if (or (text-property-not-all 0 (length heading) + 'font-lock-face nil heading) + (text-property-not-all 0 (length heading) + 'face nil heading)) heading - (propertize heading 'face 'magit-section-heading))))) + (propertize heading 'font-lock-face 'magit-section-heading))))) (unless (bolp) (insert ?\n)) (magit-maybe-make-margin-overlay) @@ -1182,9 +1192,7 @@ evaluated its BODY. Admittedly that's a bit of a hack." (unless (eq magit-section-highlighted-section section) (setq magit-section-highlighted-section (and (not (oref section hidden)) - section)))) - (when (version< emacs-version "25.1") - (setq deactivate-mark nil))) + section))))) (magit-section-maybe-paint-visibility-ellipses))) (defun magit-section-highlight (section selection) @@ -1241,7 +1249,7 @@ invisible." magit-diff-hunk-heading-selection))) (setq face (list :foreground (face-foreground face)))) (let ((ov (make-overlay start end nil t))) - (overlay-put ov 'face face) + (overlay-put ov 'font-lock-face face) (overlay-put ov 'evaporate t) (push ov magit-section-highlight-overlays) ov)) @@ -1365,7 +1373,7 @@ invisible." (if (oref section hidden) (car magit-section-visibility-indicator) (cdr magit-section-visibility-indicator)) - "#93a1a1"))))) + (face-foreground 'fringe)))))) ((stringp (car-safe magit-section-visibility-indicator)) (let ((ov (magit--overlay-at (1- eoh) 'magit-vis-indicator 'eoh))) (cond ((oref section hidden) @@ -1406,11 +1414,12 @@ invisible." (overlay-put ov 'after-string (propertize - (car magit-section-visibility-indicator) 'face + (car magit-section-visibility-indicator) 'font-lock-face (let ((pos (overlay-start ov))) - (delq nil (nconc (--map (overlay-get it 'face) + (delq nil (nconc (--map (overlay-get it 'font-lock-face) (overlays-at pos)) - (list (get-char-property pos 'face)))))))))))) + (list (get-char-property + pos 'font-lock-face)))))))))))) (defun magit-section-maybe-remove-visibility-indicator (section) (when (and magit-section-visibility-indicator @@ -1631,7 +1640,10 @@ again use `remove-hook'." (dolist (entry entries) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) - (apply entry args))))) + (if magit-refresh-verbose + (message " %-50s %s" entry + (benchmark-elapse (apply entry args))) + (apply entry args)))))) ;;; _ (provide 'magit-section) diff --git a/elpa/magit-20190514.1814/magit-sequence.el b/elpa/magit-20191030.1315/magit-sequence.el similarity index 98% rename from elpa/magit-20190514.1814/magit-sequence.el rename to elpa/magit-20191030.1315/magit-sequence.el index 25c7f6f7..fb7ff892 100644 --- a/elpa/magit-20190514.1814/magit-sequence.el +++ b/elpa/magit-20191030.1315/magit-sequence.el @@ -584,7 +584,7 @@ the upstream." (or (magit-get-upstream-branch branch) (let ((remote (magit-get "branch" branch "remote")) (merge (magit-get "branch" branch "merge")) - (u (propertize "@{upstream}" 'face 'bold))) + (u (magit--propertize-face "@{upstream}" 'bold))) (cond ((magit--unnamed-upstream-p remote merge) (concat u ", replacing unnamed")) @@ -831,8 +831,8 @@ If no such sequence is in progress, do nothing." "^\\(pick\\|revert\\) \\([^ ]+\\) \\(.*\\)$" line) (magit-bind-match-strings (cmd hash msg) line (magit-insert-section (commit hash) - (insert (propertize cmd 'face 'magit-sequence-pick) - " " (propertize hash 'face 'magit-hash) + (insert (propertize cmd 'font-lock-face 'magit-sequence-pick) + " " (propertize hash 'font-lock-face 'magit-hash) " " msg "\n")))))) (magit-sequence-insert-sequence (magit-file-line (magit-git-dir (if picking @@ -875,8 +875,9 @@ If no such sequence is in progress, do nothing." (unless (re-search-forward "^Subject: " nil t) (goto-char (point-min))) (buffer-substring (point) (line-end-position))))) - (insert (propertize type 'face face) - ?\s (propertize (file-name-nondirectory patch) 'face 'magit-hash) + (insert (propertize type 'font-lock-face face) + ?\s (propertize (file-name-nondirectory patch) + 'font-lock-face 'magit-hash) ?\s title ?\n)))) @@ -921,14 +922,14 @@ status buffer (i.e. the reverse of how they will be applied)." (magit-sequence-insert-commit action target 'magit-sequence-pick)) ((or (or `exec `label) (and `merge (guard (not action-options)))) - (insert (propertize action 'face 'magit-sequence-onto) "\s" - (propertize target 'face 'git-rebase-label) "\n")) + (insert (propertize action 'font-lock-face 'magit-sequence-onto) "\s" + (propertize target 'font-lock-face 'git-rebase-label) "\n")) (`merge (if-let ((hash (and (string-match "-[cC] \\([^ ]+\\)" action-options) (match-string 1 action-options)))) (magit-insert-section (commit hash) (magit-insert-heading - (propertize "merge" 'face 'magit-sequence-pick) + (propertize "merge" 'font-lock-face 'magit-sequence-pick) "\s" (magit-format-rev-summary hash) "\n")) (error "failed to parse merge message hash")))))) @@ -1020,7 +1021,7 @@ status buffer (i.e. the reverse of how they will be applied)." (defun magit-sequence-insert-commit (type hash face) (magit-insert-section (commit hash) (magit-insert-heading - (propertize type 'face face) "\s" + (propertize type 'font-lock-face face) "\s" (magit-format-rev-summary hash) "\n"))) ;;; _ diff --git a/elpa/magit-20190514.1814/magit-stash.el b/elpa/magit-20191030.1315/magit-stash.el similarity index 90% rename from elpa/magit-20190514.1814/magit-stash.el rename to elpa/magit-20191030.1315/magit-stash.el index 21c202f1..2f94de1b 100644 --- a/elpa/magit-20190514.1814/magit-stash.el +++ b/elpa/magit-20191030.1315/magit-stash.el @@ -63,10 +63,12 @@ The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -262,12 +264,12 @@ When the region is active offer to drop all contained stashes." ;;;###autoload (defun magit-stash-branch-here (stash branch) "Create and checkout a new BRANCH and apply STASH. -The branch is created using `magit-branch', using the current -branch or `HEAD' as the string-point." +The branch is created using `magit-branch-and-checkout', using the +current branch or `HEAD' as the start-point." (interactive (list (magit-read-stash "Branch stash") (magit-read-string-ns "Branch name"))) (let ((inhibit-magit-refresh t)) - (magit-branch-create branch (or (magit-get-current-branch) "HEAD"))) + (magit-branch-and-checkout branch (or (magit-get-current-branch) "HEAD"))) (magit-stash-apply stash)) ;;;###autoload @@ -388,7 +390,7 @@ instead of \"Stashes:\"." autostash)) "\0"))) (magit-insert-section (stash autostash) - (insert (propertize "AUTOSTASH" 'face 'magit-hash)) + (insert (propertize "AUTOSTASH" 'font-lock-face 'magit-hash)) (insert " " msg "\n") (save-excursion (backward-char) @@ -429,6 +431,33 @@ instead of \"Stashes:\"." (cl-defmethod magit-buffer-value (&context (major-mode magit-stashes-mode)) magit-buffer-refname) +(defvar magit--update-stash-buffer nil) + +(defun magit-stashes-maybe-update-stash-buffer (&optional _) + "When moving in the stashes buffer, update the stash buffer. +If there is no stash buffer in the same frame, then do nothing." + (when (derived-mode-p 'magit-stashes-mode) + (magit--maybe-update-stash-buffer))) + +(defun magit--maybe-update-stash-buffer () + (when-let ((stash (magit-section-value-if 'stash)) + (buffer (magit-get-mode-buffer 'magit-stash-mode nil t))) + (if magit--update-stash-buffer + (setq magit--update-stash-buffer (list stash buffer)) + (setq magit--update-stash-buffer (list stash buffer)) + (run-with-idle-timer + magit-update-other-window-delay nil + (let ((args (with-current-buffer buffer + (let ((magit-direct-use-buffer-arguments 'selected)) + (magit-show-commit--arguments))))) + (lambda () + (pcase-let ((`(,stash ,buf) magit--update-stash-buffer)) + (setq magit--update-stash-buffer nil) + (when (buffer-live-p buf) + (let ((magit-display-buffer-noselect t)) + (apply #'magit-stash-show stash args)))) + (setq magit--update-stash-buffer nil))))))) + ;;; Show Stash ;;;###autoload @@ -458,8 +487,9 @@ instead of \"Stashes:\"." (magit-set-header-line-format (concat (capitalize magit-buffer-revision) " " (propertize (magit-rev-format "%s" magit-buffer-revision) - 'face (list :weight 'normal :foreground - (face-attribute 'default :foreground))))) + 'font-lock-face + (list :weight 'normal :foreground + (face-attribute 'default :foreground))))) (setq magit-buffer-revision-hash (magit-rev-parse magit-buffer-revision)) (magit-insert-section (stash) (magit-run-section-hook 'magit-stash-sections-hook))) diff --git a/elpa/magit-20190514.1814/magit-status.el b/elpa/magit-20191030.1315/magit-status.el similarity index 82% rename from elpa/magit-20190514.1814/magit-status.el rename to elpa/magit-20191030.1315/magit-status.el index 9afa0fff..1b880dc1 100644 --- a/elpa/magit-20190514.1814/magit-status.el +++ b/elpa/magit-20191030.1315/magit-status.el @@ -117,6 +117,25 @@ control the initial visibility of the jumped to section." (repeat (choice (number :tag "nth top-level section") (sexp :tag "section identity"))))) +(defcustom magit-status-goto-file-position nil + "Whether to go to position corresponding to file position. + +If this is non-nil and the current buffer is visiting a file, +then `magit-status' tries to go to the position in the status +buffer that corresponds to the position in the file-visiting +buffer. This jumps into either the diff of unstaged changes +or the diff of staged changes. + +If the previously current buffer does not visit a file, or if +the file has neither unstaged nor staged changes then this has +no effect. + +The command `magit-status-here' tries to go to that position, +regardless of the value of this option." + :package-version '(magit . "2.91.0") + :group 'magit-status + :type 'boolean) + (defcustom magit-status-show-hashes-in-headers nil "Whether headers in the status buffer show hashes. The functions which respect this option are @@ -137,10 +156,12 @@ The functions which respect this option are The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). If INIT is non-nil, then the margin is shown initially. -STYLE controls how to format the committer date. It can be one - of `age' (to show the age of the commit), `age-abbreviated' (to - abbreviate the time unit to a character), or a string (suitable - for `format-time-string') to show the actual date. +STYLE controls how to format the author or committer date. + It can be one of `age' (to show the age of the commit), + `age-abbreviated' (to abbreviate the time unit to a character), + or a string (suitable for `format-time-string') to show the + actual date. Option `magit-log-margin-show-committer-date' + controls which date is being displayed. WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed. AUTHOR controls whether the name of the author is also shown by @@ -243,6 +264,7 @@ prefix arguments: (put 'magit-status 'interactive-only 'magit-status-setup-buffer) +;;;###autoload (defalias 'magit 'magit-status "An alias for `magit-status' for better discoverability. @@ -251,6 +273,15 @@ Instead of invoking this alias for `magit-status' using and read the info node `(magit)Getting Started', which also contains other useful hints.") +;;;###autoload +(defun magit-status-here () + "Like `magit-status' but with non-nil `magit-status-goto-file-position'." + (interactive) + (let ((magit-status-goto-file-position t)) + (call-interactively #'magit-status))) + +(put 'magit-status-here 'interactive-only 'magit-status-setup-buffer) + (defvar magit--remotes-using-recent-git nil) (defun magit--tramp-asserts (directory) @@ -300,6 +331,8 @@ doesn't find the executable, then consult the info node (define-key map "jfp" 'magit-jump-to-unpulled-from-pushremote) (define-key map "jpu" 'magit-jump-to-unpushed-to-upstream) (define-key map "jpp" 'magit-jump-to-unpushed-to-pushremote) + (define-key map "ja" 'magit-jump-to-assume-unchanged) + (define-key map "jw" 'magit-jump-to-skip-worktree) (define-key map [remap dired-jump] 'magit-dired-jump) map) "Keymap for `magit-status-mode'.") @@ -347,12 +380,28 @@ Type \\[magit-commit] to create a commit. (magit--tramp-asserts directory) (let* ((default-directory directory) (d (magit-diff--get-value 'magit-status-mode)) - (l (magit-log--get-value 'magit-status-mode))) - (magit-setup-buffer #'magit-status-mode nil - (magit-buffer-diff-args (nth 0 d)) - (magit-buffer-diff-files (nth 1 d)) - (magit-buffer-log-args (nth 0 l)) - (magit-buffer-log-files (nth 1 l))))) + (l (magit-log--get-value 'magit-status-mode)) + (file (and magit-status-goto-file-position + (magit-file-relative-name))) + (line (and file (line-number-at-pos))) + (col (and file (current-column))) + (buf (magit-setup-buffer #'magit-status-mode nil + (magit-buffer-diff-args (nth 0 d)) + (magit-buffer-diff-files (nth 1 d)) + (magit-buffer-log-args (nth 0 l)) + (magit-buffer-log-files (nth 1 l))))) + (when file + (with-current-buffer buf + (let ((staged (magit-get-section '((staged) (status))))) + (if (and staged + (cadr (magit-diff--locate-hunk file line staged))) + (magit-diff--goto-position file line col staged) + (let ((unstaged (magit-get-section '((unstaged) (status))))) + (unless (and unstaged + (magit-diff--goto-position file line col unstaged)) + (when staged + (magit-diff--goto-position file line col staged)))))))) + buf)) (defun magit-status-refresh-buffer () (magit-git-exit-code "update-index" "--refresh") @@ -393,13 +442,19 @@ This function removes itself from `magit-refresh-buffer-hook'." "When moving in the status buffer, update the revision buffer. If there is no revision buffer in the same frame, then do nothing." (when (derived-mode-p 'magit-status-mode) - (magit-log-maybe-update-revision-buffer-1))) + (magit--maybe-update-revision-buffer))) + +(defun magit-status-maybe-update-stash-buffer (&optional _) + "When moving in the status buffer, update the stash buffer. +If there is no stash buffer in the same frame, then do nothing." + (when (derived-mode-p 'magit-status-mode) + (magit--maybe-update-stash-buffer))) (defun magit-status-maybe-update-blob-buffer (&optional _) "When moving in the status buffer, update the blob buffer. If there is no blob buffer in the same frame, then do nothing." (when (derived-mode-p 'magit-status-mode) - (magit-log-maybe-update-blob-buffer-1))) + (magit--maybe-update-blob-buffer))) ;;; Sections ;;;; Special Headers @@ -428,8 +483,9 @@ the status buffer causes this section to disappear again." (when magit-this-error (magit-insert-section (error 'git) (insert (propertize (format "%-10s" "GitError! ") - 'face 'magit-section-heading)) - (insert (propertize magit-this-error 'face 'font-lock-warning-face)) + 'font-lock-face 'magit-section-heading)) + (insert (propertize magit-this-error + 'font-lock-face 'font-lock-warning-face)) (when-let ((key (car (where-is-internal 'magit-process-buffer)))) (insert (format " [Type `%s' for details]" (key-description key)))) (insert ?\n)) @@ -441,7 +497,7 @@ the status buffer causes this section to disappear again." (when (or ignore-modules magit-buffer-diff-files) (insert (propertize (format "%-10s" "Filter! ") - 'face 'magit-section-heading)) + 'font-lock-face 'magit-section-heading)) (when ignore-modules (insert ignore-modules) (when magit-buffer-diff-files @@ -466,14 +522,14 @@ instead. The optional BRANCH argument is for internal use only." (magit-insert-section (branch branch) (insert (format "%-10s" "Head: ")) (when magit-status-show-hashes-in-headers - (insert (propertize commit 'face 'magit-hash) ?\s)) - (insert (propertize branch 'face 'magit-branch-local)) + (insert (propertize commit 'font-lock-face 'magit-hash) ?\s)) + (insert (propertize branch 'font-lock-face 'magit-branch-local)) (insert ?\s) (insert (funcall magit-log-format-message-function branch summary)) (insert ?\n)) (magit-insert-section (commit commit) (insert (format "%-10s" "Head: ")) - (insert (propertize commit 'face 'magit-hash)) + (insert (propertize commit 'font-lock-face 'magit-hash)) (insert ?\s) (insert (funcall magit-log-format-message-function nil summary)) (insert ?\n)))))) @@ -499,7 +555,7 @@ arguments are for internal use only." (if upstream (concat (and magit-status-show-hashes-in-headers (concat (propertize (magit-rev-format "%h" upstream) - 'face 'magit-hash) + 'font-lock-face 'magit-hash) " ")) upstream " " (funcall magit-log-format-message-function upstream @@ -508,22 +564,23 @@ arguments are for internal use only." "(no commit message)")))) (cond ((magit--unnamed-upstream-p remote merge) - (concat (propertize merge 'face 'magit-branch-remote) " from " - (propertize remote 'face 'bold))) + (concat (propertize merge 'font-lock-face 'magit-branch-remote) + " from " + (propertize remote 'font-lock-face 'bold))) ((magit--valid-upstream-p remote merge) (if (equal remote ".") (concat - (propertize merge 'face 'magit-branch-local) + (propertize merge 'font-lock-face 'magit-branch-local) (propertize " does not exist" - 'face 'font-lock-warning-face)) + 'font-lock-face 'font-lock-warning-face)) (concat - (propertize merge 'face 'magit-branch-remote) + (propertize merge 'font-lock-face 'magit-branch-remote) (propertize " does not exist on " - 'face 'font-lock-warning-face) - (propertize remote 'face 'magit-branch-remote)))) + 'font-lock-face 'font-lock-warning-face) + (propertize remote 'font-lock-face 'magit-branch-remote)))) (t (propertize "invalid upstream configuration" - 'face 'font-lock-warning-face))))) + 'font-lock-face 'font-lock-warning-face))))) (insert ?\n)))))) (defun magit-insert-push-branch-header () @@ -537,7 +594,7 @@ arguments are for internal use only." (concat target " " (and magit-status-show-hashes-in-headers (concat (propertize (magit-rev-format "%h" target) - 'face 'magit-hash) + 'font-lock-face 'magit-hash) " ")) (funcall magit-log-format-message-function target (funcall magit-log-format-message-function nil @@ -547,10 +604,10 @@ arguments are for internal use only." (if (magit-remote-p remote) (concat target (propertize " does not exist" - 'face 'font-lock-warning-face)) + 'font-lock-face 'font-lock-warning-face)) (concat remote (propertize " remote does not exist" - 'face 'font-lock-warning-face)))))) + 'font-lock-face 'font-lock-warning-face)))))) (insert ?\n)))) (defun magit-insert-tags-header () @@ -567,11 +624,12 @@ arguments are for internal use only." (insert (format "%-10s" (if both-tags "Tags: " "Tag: "))) (cl-flet ((insert-count (tag count face) - (insert (concat (propertize tag 'face 'magit-tag) + (insert (concat (propertize tag 'font-lock-face 'magit-tag) (and (> count 0) (format " (%s)" - (propertize (format "%s" count) - 'face face))))))) + (propertize + (format "%s" count) + 'font-lock-face face))))))) (when this-tag (insert-count this-tag this-cnt 'magit-branch-local)) (when both-tags (insert ", ")) (when next-tag (insert-count next-tag next-cnt 'magit-tag))) @@ -586,7 +644,7 @@ arguments are for internal use only." (when (and name email) (magit-insert-section (user name) (insert (format "%-10s" "User: ")) - (insert (propertize name 'face 'magit-log-author)) + (insert (propertize name 'font-lock-face 'magit-log-author)) (insert " <" email ">\n"))))) (defun magit-insert-repo-header () @@ -607,7 +665,7 @@ remote in alphabetic order." (url (magit-get "remote" name "url"))) (magit-insert-section (remote name) (insert (format "%-10s" "Remote: ")) - (insert (propertize name 'face 'magit-branch-remote) ?\s) + (insert (propertize name 'font-lock-face 'magit-branch-remote) ?\s) (insert url ?\n)))) ;;;; File Sections @@ -652,7 +710,7 @@ value of that variable can be set using \"D -- DIRECTORY RET g\"." (magit-insert-heading "Untracked files:") (dolist (file files) (magit-insert-section (file file) - (insert (propertize file 'face 'magit-filename) ?\n))) + (insert (propertize file 'font-lock-face 'magit-filename) ?\n))) (insert ?\n))))))) (magit-define-section-jumper magit-jump-to-tracked "Tracked files" tracked) @@ -685,6 +743,8 @@ of that variable can be set using \"D -- DIRECTORY RET g\"." (magit-insert-files files base) (insert ?\n))))) +(magit-define-section-jumper magit-jump-to-skip-worktree "Skip-worktree files" skip-worktree) + (defun magit-insert-skip-worktree-files () "Insert a tree of skip-worktree files. @@ -699,13 +759,29 @@ of that variable can be set using \"D -- DIRECTORY RET g\"." (magit-insert-files files base) (insert ?\n))))) +(magit-define-section-jumper magit-jump-to-assume-unchanged "Assume-unchanged files" assume-unchanged) + +(defun magit-insert-assume-unchanged-files () + "Insert a tree of files that are assumed to be unchanged. + +If the first element of `magit-buffer-diff-files' is a +directory, then limit the list to files below that. The value +of that variable can be set using \"D -- DIRECTORY RET g\"." + (when-let ((files (magit-assume-unchanged-files))) + (let* ((base (car magit-buffer-diff-files)) + (base (and base (file-directory-p base) base))) + (magit-insert-section (assume-unchanged nil t) + (magit-insert-heading "Assume-unchanged files:") + (magit-insert-files files base) + (insert ?\n))))) + (defun magit-insert-files (files directory) (while (and files (string-prefix-p (or directory "") (car files))) (let ((dir (file-name-directory (car files)))) (if (equal dir directory) (let ((file (pop files))) (magit-insert-section (file file) - (insert (propertize file 'face 'magit-filename) ?\n))) + (insert (propertize file 'font-lock-face 'magit-filename) ?\n))) (magit-insert-section (file dir t) (insert (propertize dir 'file 'magit-filename) ?\n) (magit-insert-heading) diff --git a/elpa/magit-20190514.1814/magit-submodule.el b/elpa/magit-20191030.1315/magit-submodule.el similarity index 95% rename from elpa/magit-20190514.1814/magit-submodule.el rename to elpa/magit-20191030.1315/magit-submodule.el index d86e7521..8bc787bf 100644 --- a/elpa/magit-20190514.1814/magit-submodule.el +++ b/elpa/magit-20191030.1315/magit-submodule.el @@ -145,7 +145,7 @@ and also setting this variable to t will lead to tears." ()) (cl-defmethod transient-format-description ((obj magit--git-submodule-suffix)) - (let ((value (transient-args transient--prefix))) + (let ((value (delq nil (mapcar 'transient-infix-value transient--suffixes)))) (replace-regexp-in-string "\\[--[^]]+\\]" (lambda (match) @@ -411,7 +411,8 @@ whether they are wrapped in an additional section." (magit-insert-section (modules nil t) (magit-insert-heading (format "%s (%s)" - (propertize "Modules" 'face 'magit-section-heading) + (propertize "Modules" + 'font-lock-face 'magit-section-heading) (length modules))) (magit-insert-section-body (magit--insert-modules))) @@ -429,7 +430,8 @@ or, failing that, the abbreviated HEAD commit hash." (magit-insert-section (modules nil t) (magit-insert-heading (format "%s (%s)" - (propertize "Modules overview" 'face 'magit-section-heading) + (propertize "Modules overview" + 'font-lock-face 'magit-section-heading) (length modules))) (magit-insert-section-body (magit--insert-modules-overview))))) @@ -448,20 +450,21 @@ or, failing that, the abbreviated HEAD commit hash." (expand-file-name (file-name-as-directory module)))) (magit-insert-section (magit-module-section module t) (insert (propertize (format path-format module) - 'face 'magit-diff-file-heading)) + 'font-lock-face 'magit-diff-file-heading)) (if (not (file-exists-p ".git")) (insert "(unpopulated)") - (insert (format branch-format - (--if-let (magit-get-current-branch) - (propertize it 'face 'magit-branch-local) - (propertize "(detached)" 'face 'warning)))) + (insert (format + branch-format + (--if-let (magit-get-current-branch) + (propertize it 'font-lock-face 'magit-branch-local) + (propertize "(detached)" 'font-lock-face 'warning)))) (--if-let (magit-git-string "describe" "--tags") (progn (when (and magit-modules-overview-align-numbers (string-match-p "\\`[0-9]" it)) (insert ?\s)) - (insert (propertize it 'face 'magit-tag))) + (insert (propertize it 'font-lock-face 'magit-tag))) (--when-let (magit-rev-format "%h") - (insert (propertize it 'face 'magit-hash))))) + (insert (propertize it 'font-lock-face 'magit-hash))))) (insert ?\n)))))) (insert ?\n)) @@ -548,8 +551,12 @@ These sections can be expanded to show the respective commits." (magit-insert-section section ((eval type) nil t) (string-match "\\`\\(.+\\) \\([^ ]+\\)\\'" heading) (magit-insert-heading - (propertize (match-string 1 heading) 'face 'magit-section-heading) " " - (propertize (match-string 2 heading) 'face 'magit-branch-remote) ":") + (propertize (match-string 1 heading) + 'font-lock-face 'magit-section-heading) + " " + (propertize (match-string 2 heading) + 'font-lock-face 'magit-branch-remote) + ":") (magit-with-toplevel (dolist (module modules) (when (magit-module-worktree-p module) @@ -558,7 +565,9 @@ These sections can be expanded to show the respective commits." (when (magit-file-accessible-directory-p default-directory) (magit-insert-section sec (magit-module-section module t) (magit-insert-heading - (propertize module 'face 'magit-diff-file-heading) ":") + (propertize module + 'font-lock-face 'magit-diff-file-heading) + ":") (magit-git-wash (apply-partially 'magit-log-wash-log 'module) "-c" "push.default=current" "log" "--oneline" range) diff --git a/elpa/magit-20190514.1814/magit-subtree.el b/elpa/magit-20191030.1315/magit-subtree.el similarity index 100% rename from elpa/magit-20190514.1814/magit-subtree.el rename to elpa/magit-20191030.1315/magit-subtree.el diff --git a/elpa/magit-20190514.1814/magit-tag.el b/elpa/magit-20191030.1315/magit-tag.el similarity index 100% rename from elpa/magit-20190514.1814/magit-tag.el rename to elpa/magit-20191030.1315/magit-tag.el diff --git a/elpa/magit-20190514.1814/magit-transient.el b/elpa/magit-20191030.1315/magit-transient.el similarity index 95% rename from elpa/magit-20190514.1814/magit-transient.el rename to elpa/magit-20191030.1315/magit-transient.el index f877432a..5fa683fa 100644 --- a/elpa/magit-20190514.1814/magit-transient.el +++ b/elpa/magit-20191030.1315/magit-transient.el @@ -165,9 +165,13 @@ (propertize "[" 'face 'transient-inactive-value) (mapconcat (lambda (choice) (propertize choice 'face (if (equal choice local) - 'transient-value + (if (member choice choices) + 'transient-value + 'font-lock-warning-face) 'transient-inactive-value))) - choices + (if (and local (not (member local choices))) + (cons local choices) + choices) (propertize "|" 'face 'transient-inactive-value)) (and (or global fallback default) (concat diff --git a/elpa/magit-20190514.1814/magit-utils.el b/elpa/magit-20191030.1315/magit-utils.el similarity index 96% rename from elpa/magit-20190514.1814/magit-utils.el rename to elpa/magit-20191030.1315/magit-utils.el index 5ead657b..81b83b3b 100644 --- a/elpa/magit-20190514.1814/magit-utils.el +++ b/elpa/magit-20191030.1315/magit-utils.el @@ -69,7 +69,7 @@ If you have enabled `ivy-mode' or `helm-mode', then you don't have to customize this option; `magit-builtin-completing-read' will work just fine. However, if you use Ido completion, then -you do have to use `magit-ido-completion-read', because Ido is +you do have to use `magit-ido-completing-read', because Ido is less well behaved than the former, more modern alternatives. If you would like to use Ivy or Helm completion with Magit but @@ -101,7 +101,10 @@ alphabetical order, depending on your version of Ivy." (forge-edit-topic-title nil t) (forge-edit-topic-state nil t) (forge-edit-topic-labels nil t) + (forge-edit-topic-marks nil t) (forge-edit-topic-assignees nil t) + (forge-edit-topic-review-requests nil t) + (forge-pull-pullreq nil t) (forge-visit-issue nil t) (forge-visit-pullreq nil t)) "When not to offer alternatives and ask for confirmation. @@ -425,6 +428,9 @@ to t, otherwise nil. If it does read a value in the minibuffer, then this function acts similarly to `completing-read', except for the following: +- COLLECTION must be a list of choices. A function is not + supported. + - If REQUIRE-MATCH is nil and the user exits without a choice, then nil is returned instead of an empty string. @@ -570,7 +576,8 @@ drop-in replacement for `completing-read', instead we use same name." (if (require 'ido-completing-read+ nil t) (ido-completing-read+ prompt choices predicate require-match - initial-input hist def) + initial-input hist + (or def (and require-match (car choices)))) (display-warning 'magit "ido-completing-read+ is not installed To use Ido completion with Magit you need to install the @@ -819,20 +826,44 @@ it aligns with the text area." ,@(and (eq (car (window-current-scroll-bars)) 'left) '(scroll-bar))))))) - (add-face-text-property 0 (1- (length header-line-format)) - 'magit-header-line t header-line-format)) + (magit--add-face-text-property 0 (1- (length header-line-format)) + 'magit-header-line t header-line-format)) (defun magit-face-property-all (face string) "Return non-nil if FACE is present in all of STRING." - (cl-loop for pos = 0 then (next-single-property-change pos 'face string) + (cl-loop for pos = 0 then (next-single-property-change + pos 'font-lock-face string) unless pos return t - for current = (get-text-property pos 'face string) + for current = (get-text-property pos 'font-lock-face string) unless (if (consp current) (memq face current) (eq face current)) return nil)) +(defun magit--add-face-text-property (beg end face &optional append object) + "Like `add-face-text-property' but for `font-lock-face'." + (cl-loop for pos = (next-single-property-change + beg 'font-lock-face object end) + for current = (get-text-property beg 'font-lock-face object) + for newface = (if (listp current) + (if append + (append current (list face)) + (cons face current)) + (if append + (list current face) + (list face current))) + do (progn (put-text-property beg pos 'font-lock-face newface object) + (setq beg pos)) + while (< beg end))) + +(defun magit--propertize-face (string face) + (propertize string 'face face 'font-lock-face face)) + +(defun magit--put-face (beg end face string) + (put-text-property beg end 'face face string) + (put-text-property beg end 'font-lock-face face string)) + (defun magit--format-spec (format specification) "Like `format-spec' but preserve text properties in SPECIFICATION." (with-temp-buffer @@ -992,33 +1023,6 @@ setting `imenu--index-alist' to nil before calling that function." (setq imenu--index-alist nil) (which-function)) -;;; Kludges for Incompatible Modes - -(defvar whitespace-mode) - -(defun whitespace-dont-turn-on-in-magit-mode (fn) - "Prevent `whitespace-mode' from being turned on in Magit buffers. - -Because `whitespace-mode' uses font-lock and Magit does not, they -are not compatible. Therefore you cannot turn on that minor-mode -in Magit buffers. If you try to enable it anyway, then this -advice prevents that. - -If the reason the attempt is made is that `global-whitespace-mode' -is enabled, then that is done silently. However if you call the local -minor-mode interactively, then that results in an error. - -See `magit-diff-paint-whitespace' for an alternative." - (if (not (derived-mode-p 'magit-mode)) - (funcall fn) - (setq whitespace-mode nil) - (when (eq this-command 'whitespace-mode) - (user-error - "Whitespace mode NOT enabled because it is not compatible with Magit")))) - -(advice-add 'whitespace-turn-on :around - 'whitespace-dont-turn-on-in-magit-mode) - ;;; Kludges for Custom (defun magit-custom-initialize-reset (symbol exp) diff --git a/elpa/magit-20190514.1814/magit-wip.el b/elpa/magit-20191030.1315/magit-wip.el similarity index 100% rename from elpa/magit-20190514.1814/magit-wip.el rename to elpa/magit-20191030.1315/magit-wip.el diff --git a/elpa/magit-20190514.1814/magit-worktree.el b/elpa/magit-20191030.1315/magit-worktree.el similarity index 77% rename from elpa/magit-20190514.1814/magit-worktree.el rename to elpa/magit-20191030.1315/magit-worktree.el index fd40eb98..a8ea3c7b 100644 --- a/elpa/magit-20190514.1814/magit-worktree.el +++ b/elpa/magit-20191030.1315/magit-worktree.el @@ -50,6 +50,7 @@ Used by `magit-worktree-checkout' and `magit-worktree-branch'." ("b" "worktree" magit-worktree-checkout) ("c" "branch and worktree" magit-worktree-branch)] ["Commands" + ("m" "Move worktree" magit-worktree-move) ("k" "Delete worktree" magit-worktree-delete) ("g" "Visit worktree" magit-worktree-status)]]) @@ -76,6 +77,31 @@ Used by `magit-worktree-checkout' and `magit-worktree-branch'." branch (expand-file-name path) start-point) (magit-diff-visit-directory path)) +;;;###autoload +(defun magit-worktree-move (worktree path) + "Move WORKTREE to PATH." + (interactive + (list (magit-completing-read "Move worktree" + (cdr (magit-list-worktrees)) + nil t nil nil + (magit-section-value-if 'worktree)) + (funcall magit-worktree-read-directory-name-function + "Move worktree to: "))) + (if (file-directory-p (expand-file-name ".git" worktree)) + (user-error "You may not move the main working tree") + (let ((preexisting-directory (file-directory-p path))) + (when (and (zerop (magit-call-git "worktree" "move" worktree + (expand-file-name path))) + (not (file-exists-p default-directory)) + (derived-mode-p 'magit-status-mode)) + (kill-buffer) + (magit-diff-visit-directory + (if preexisting-directory + (concat (file-name-as-directory path) + (file-name-nondirectory worktree)) + path))) + (magit-refresh)))) + (defun magit-worktree-delete (worktree) "Delete a worktree, defaulting to the worktree at point. The primary worktree cannot be deleted." @@ -132,15 +158,16 @@ If there is only one worktree, then insert nothing." (magit-insert-section (worktrees) (magit-insert-heading "Worktrees:") (let* ((cols - (mapcar (pcase-lambda (`(,path ,barep ,commit ,branch)) - (cons (cond - (branch (propertize branch - 'face 'magit-branch-local)) - (commit (propertize (magit-rev-abbrev commit) - 'face 'magit-hash)) - (barep "(bare)")) - path)) - worktrees)) + (mapcar + (pcase-lambda (`(,path ,barep ,commit ,branch)) + (cons (cond + (branch (propertize + branch 'font-lock-face 'magit-branch-local)) + (commit (propertize (magit-rev-abbrev commit) + 'font-lock-face 'magit-hash)) + (barep "(bare)")) + path)) + worktrees)) (align (1+ (-max (--map (string-width (car it)) cols))))) (pcase-dolist (`(,head . ,path) cols) (magit-insert-section (worktree path) diff --git a/elpa/magit-20190514.1814/magit.el b/elpa/magit-20191030.1315/magit.el similarity index 100% rename from elpa/magit-20190514.1814/magit.el rename to elpa/magit-20191030.1315/magit.el diff --git a/elpa/magit-20191030.1315/magit.info b/elpa/magit-20191030.1315/magit.info new file mode 100644 index 00000000..2bfc779c --- /dev/null +++ b/elpa/magit-20191030.1315/magit.info @@ -0,0 +1,189 @@ +This is magit.info, produced by makeinfo version 6.5 from magit.texi. + + Copyright (C) 2015-2019 Jonas Bernoulli + + 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: (magit). Using Git from Emacs with Magit. +END-INFO-DIR-ENTRY + + +Indirect: +magit.info-1: 754 +magit.info-2: 302342 + +Tag Table: +(Indirect) +Node: Top754 +Node: Introduction6474 +Node: Installation11197 +Node: Installing from Melpa11527 +Node: Installing from the Git Repository12600 +Node: Post-Installation Tasks14948 +Node: Getting Started16233 +Node: Interface Concepts21682 +Node: Modes and Buffers22043 +Node: Switching Buffers23792 +Node: Naming Buffers28562 +Node: Quitting Windows31869 +Node: Automatic Refreshing of Magit Buffers33615 +Node: Automatic Saving of File-Visiting Buffers36467 +Node: Automatic Reverting of File-Visiting Buffers37652 +Node: Risk of Reverting Automatically42647 +Node: Sections45029 +Node: Section Movement45955 +Node: Section Visibility50516 +Node: Section Hooks56593 +Node: Section Types and Values59000 +Node: Section Options60303 +Node: Transient Commands60775 +Node: Transient Arguments and Buffer Variables62012 +Node: Completion Confirmation and the Selection69030 +Node: Action Confirmation69474 +Node: Completion and Confirmation76824 +Node: The Selection80010 +Node: The hunk-internal region82909 +Node: Support for Completion Frameworks83998 +Node: Additional Completion Options88905 +Node: Running Git89504 +Node: Viewing Git Output89777 +Node: Git Process Status90910 +Node: Running Git Manually91875 +Node: Git Executable94345 +Node: Global Git Arguments96627 +Node: Inspecting97433 +Node: Status Buffer98590 +Node: Status Sections102580 +Node: Status Header Sections108132 +Node: Status Module Sections110762 +Node: Status Options113267 +Node: Repository List115142 +Node: Logging118180 +Node: Refreshing Logs120743 +Node: Log Buffer122189 +Node: Log Margin126045 +Node: Select from Log129224 +Node: Reflog131449 +Node: Cherries133106 +Node: Diffing134954 +Node: Refreshing Diffs138035 +Node: Commands Available in Diffs141614 +Node: Diff Options144149 +Node: Revision Buffer149186 +Node: Ediffing152516 +Node: References Buffer156164 +Node: References Sections166684 +Node: Bisecting167545 +Node: Visiting Files and Blobs169358 +Node: General-Purpose Visit Commands169828 +Node: Visiting Files and Blobs from a Diff170784 +Node: Blaming174243 +Node: Manipulating180806 +Node: Creating Repository181148 +Node: Cloning Repository181703 +Node: Staging and Unstaging186946 +Node: Staging from File-Visiting Buffers191029 +Node: Applying192197 +Node: Committing194090 +Node: Initiating a Commit194673 +Node: Editing Commit Messages198058 +Node: Branching208450 +Node: The Two Remotes208676 +Node: Branch Commands211329 +Node: Branch Git Variables223713 +Node: Auxiliary Branch Commands229104 +Node: Merging230222 +Node: Resolving Conflicts234230 +Node: Rebasing239231 +Node: Editing Rebase Sequences244241 +Node: Information About In-Progress Rebase248569 +Ref: Information About In-Progress Rebase-Footnote-1257451 +Node: Cherry Picking258047 +Node: Reverting262378 +Node: Resetting263827 +Node: Stashing265481 +Node: Transferring270182 +Node: Remotes270404 +Node: Remote Commands270556 +Node: Remote Git Variables274637 +Node: Fetching277016 +Node: Pulling279370 +Node: Pushing280563 +Node: Plain Patches284171 +Node: Maildir Patches285662 +Node: Miscellaneous287176 +Node: Tagging287492 +Node: Notes289420 +Node: Submodules291792 +Node: Listing Submodules292010 +Node: Submodule Transient293938 +Node: Subtree296460 +Node: Worktree298436 +Node: Common Commands299541 +Node: Wip Modes302342 +Node: Wip Graph307275 +Node: Legacy Wip Modes309589 +Node: Minor Mode for Buffers Visiting Files312484 +Node: Minor Mode for Buffers Visiting Blobs319585 +Node: Customizing320398 +Node: Per-Repository Configuration321994 +Node: Essential Settings323643 +Node: Safety323967 +Node: Performance325732 +Node: Microsoft Windows Performance332449 +Node: MacOS Performance333640 +Ref: MacOS Performance-Footnote-1334345 +Node: Plumbing334427 +Node: Calling Git335256 +Node: Getting a Value from Git336781 +Node: Calling Git for Effect339867 +Node: Section Plumbing346387 +Node: Creating Sections346615 +Node: Section Selection350515 +Node: Matching Sections352314 +Node: Refreshing Buffers358287 +Node: Conventions361435 +Node: Theming Faces361627 +Node: FAQ369742 +Node: FAQ - How to ...?370184 +Node: How to show git's output?370544 +Node: How to install the gitman info manual?371298 +Node: How to show diffs for gpg-encrypted files?372268 +Node: How does branching and pushing work?372864 +Node: Can Magit be used as ediff-version-control-package?373227 +Node: FAQ - Issues and Errors375216 +Node: Magit is slow376148 +Node: I changed several thousand files at once and now Magit is unusable376362 +Node: I am having problems committing377091 +Node: I am using MS Windows and cannot push with Magit377572 +Node: I am using OS X and SOMETHING works in shell but not in Magit378189 +Node: Diffs contain control sequences378995 +Node: Expanding a file to show the diff causes it to disappear380108 +Node: Point is wrong in the COMMIT_EDITMSG buffer380659 +Node: The mode-line information isn't always up-to-date381705 +Node: A branch and tag sharing the same name breaks SOMETHING382787 +Node: My Git hooks work on the command-line but not inside Magit383675 +Node: git-commit-mode isn't used when committing from the command-line384521 +Node: Point ends up inside invisible text when jumping to a file-visiting buffer386788 +Node: Debugging Tools387586 +Node: Keystroke Index389473 +Node: Command Index423260 +Node: Function Index460088 +Node: Variable Index476307 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20190514.1814/magit.info-1 b/elpa/magit-20191030.1315/magit.info-1 similarity index 97% rename from elpa/magit-20190514.1814/magit.info-1 rename to elpa/magit-20191030.1315/magit.info-1 index f6040881..66b90f7f 100644 --- a/elpa/magit-20190514.1814/magit.info-1 +++ b/elpa/magit-20191030.1315/magit.info-1 @@ -31,7 +31,7 @@ to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains. -This manual is for Magit version 2.90.1 (v2.90.1-655-ge2308d9f4+1). +This manual is for Magit version 2.90.1 (v2.90.1-791-g62dad50a+1). Copyright (C) 2015-2019 Jonas Bernoulli @@ -1324,12 +1324,24 @@ Any of the functions listed below can be used as members of this hook. revision buffer, provided it is already being displayed in another window of the same frame. + -- Function: magit-status-maybe-update-stash-buffer + + When moving inside a status buffer, then this function updates the + stash buffer, provided it is already being displayed in another + window of the same frame. + -- Function: magit-status-maybe-update-blob-buffer When moving inside a status buffer and another window of the same frame displays a blob buffer, then this function instead displays the blob buffer for the commit at point in that window. + -- Function: magit-stashes-maybe-update-stash-buffer + + When moving inside a buffer listing stashes, then this function + updates the stash buffer, provided it is already being displayed in + another window of the same frame. + -- User Option: magit-update-other-window-delay Delay before automatically updating the other window. @@ -2123,7 +2135,7 @@ You will also have to install the ‘ido-completing-read+’ package and use predicate require-match initial-input hist def This function performs completion using the built-in - ‘completion-read’ and does some additional magit-specific work. + ‘completing-read’ and does some additional magit-specific work. -- Function: magit-ido-completing-read prompt choices &optional predicate require-match initial-input hist def @@ -2155,6 +2167,9 @@ You will also have to install the ‘ido-completing-read+’ package and use If it does read a value in the minibuffer, then this function acts similar to ‘completing-read’, except for the following: + • COLLECTION must be a list of choices. A function is not + supported. + • If REQUIRE-MATCH is ‘nil’ and the user exits without a choice, then ‘nil’ is returned instead of an empty string. @@ -2310,8 +2325,8 @@ to a shell. -- User Option: magit-shell-command-verbose-prompt - Whether the prompt, used by the the above commands when reading a - shell command, shows the directory in which it will be run. + Whether the prompt, used by the above commands when reading a shell + command, shows the directory in which it will be run. These suffix commands start external gui tools. @@ -2634,11 +2649,27 @@ default the following functions are also members of that hook: -- Function: magit-insert-ignored-files - Insert a tree of ignored files. + Insert a tree of ignored files. Its possible to limit the logs in + the current buffer to a certain directory using ‘D = f + RET g’. If you do that, then that that also affects this command. + + The log filter can be used to limit to multiple files. In that + case this function only respects the first of the files and only if + it is a directory. + + -- Function: magit-insert-skip-worktree-files - If the first element of ‘magit-diff-section-arguments’ is a - directory, then limit the list to files below that. The value of - that variable can be set using ‘D = f RET g’. + Insert a tree of skip-worktree files. If the first element of + ‘magit-buffer-diff-files’ is a directory, then limit the list to + files below that. The value of that variable can be set using ‘D + -- DIRECTORY RET g’. + + -- Function: magit-insert-assumed-unchanged-files + + Insert a tree of files that are assumed to be unchanged. If the + first element of ‘magit-buffer-diff-files’ is a directory, then + limit the list to files below that. The value of that variable can + be set using ‘D -- DIRECTORY RET g’. -- Function: magit-insert-unpulled-or-recent-commits @@ -2842,11 +2873,13 @@ File: magit.info, Node: Status Options, Prev: Status Module Sections, Up: Sta • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -2915,6 +2948,38 @@ File: magit.info, Node: Repository List, Next: Logging, Prev: Status Buffer, This function inserts a description of the repository’s ‘HEAD’ revision. + -- Function: magit-repolist-column-branch + + This function inserts the name of the current branch. + + -- Function: magit-repolist-column-upstream + + This function inserts the name of the upstream branch of the + current branch. + + -- Function: magit-repolist-column-branches + + This function inserts the number of branches. + + -- Function: magit-repolist-column-stashes + + This function inserts the number of stashes. + + -- Function: magit-repolist-column-flag + + This function inserts a flag as specified by + ‘magit-repolist-column-flag-alist’. + + By default this indicates whether there are uncommitted changes. + + • ‘N’ if there is at least one untracked file. + + • ‘U’ if there is at least one unstaged file. + + • ‘S’ if there is at least one staged file. + + Only the first one of these that applies is shown. + -- Function: magit-repolist-column-unpulled-from-upstream This function inserts the number of upstream commits not in the @@ -3183,11 +3248,13 @@ regular log buffers that would be ‘magit-log-margin’. • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -3209,6 +3276,14 @@ used in the default of all other options. But setting it to ‘t’, i.e. re-enforcing the default for that option, does not carry to other options. + -- User Option: magit-log-margin-show-committer-date + + This option specifies whether to show the committer date in the + margin. This option only controls whether the committer date is + displayed instead of the author date. Whether some date is + displayed in the margin and whether the margin is displayed at all + is controlled by other options. + ‘L’ (‘magit-margin-settings’) This transient prefix command binds the following suffix commands, @@ -3269,11 +3344,13 @@ buffers: • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -3318,11 +3395,13 @@ Also see *note (gitman)git-reflog::. • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -3366,11 +3445,13 @@ for multiple "upstreams" at once. • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -3623,7 +3704,7 @@ Files and Blobs from a Diff:: for more information and the key bindings. section. Otherwise, jump to the diffstat section or a child thereof. - The next two commands are not specific to Magit-Diff mdoe (or and + The next two commands are not specific to Magit-Diff mode (or and Magit buffer for that matter), but it might be worth pointing out that they are available here too. @@ -3712,17 +3793,17 @@ File: magit.info, Node: Diff Options, Next: Revision Buffer, Prev: Commands A -- User Option: magit-diff-highlight-indentation - Highlight the "wrong" indentation style. Used only when - ‘magit-diff-paint-whitespace’ is non-nil. + This option controls whether to highlight the indentaion in case it + used the "wrong" indentation style. Indentation is only + highlighted if ‘magit-diff-paint-whitespace’ is also non-nil. - The value is a list of cons cells. The car is a regular - expression, and the cdr is the value that applies to repositories - whose directory matches the regular expression. If more than one - element matches, then the *last* element in the list applies. The - default value should therefore come first in the list. + The value is an alist of the form ‘((REGEXP . INDENT)...)’. The + path to the current repository is matched against each element in + reverse order. Therefore if a REGEXP matches, then earlier + elements are not tried. - If the value is ‘tabs’, highlight indentation with tabs. If the - value is an integer, highlight indentation with at least that many + If the used INDENT is ‘tabs’, highlight indentation with tabs. If + INDENT is an integer, highlight indentation with at least that many spaces. Otherwise, highlight neither. -- User Option: magit-diff-hide-trailing-cr-characters @@ -3790,7 +3871,7 @@ File: magit.info, Node: Revision Buffer, Prev: Diff Options, Up: Diffing insert both images. If ‘author’ or ‘committer’, then insert only the respective image. - If you have customized the option ‘magit-revision-header-format’ + If you have customized the option ‘magit-revision-headers-format’ and want to insert the images then you might also have to specify where to do so. In that case the value has to be a cons-cell of two regular expressions. The car specifies where to insert the @@ -4050,11 +4131,13 @@ the other references are compared. • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -4103,6 +4186,11 @@ you should also change the others to keep things aligned. The following -- User Option: magit-refs-filter-alist + The purpose of this option is to forgo displaying certain refs + based on their name. If you want to not display any refs of a + certain type, then you should remove the appropriate function from + ‘magit-refs-sections-hook’ instead. + This alist controls which tags and branches are omitted from being displayed in ‘magit-refs-mode’ buffers. If it is ‘nil’, then all refs are displayed (subject to ‘magit-refs-sections-hook’). @@ -4114,9 +4202,9 @@ you should also change the others to keep things aligned. The following A key can either be a regular expression that the refname has to match, or a function that takes the refname as only argument and - returns a boolean. Contrary to how they are displayed in the - buffer, for comparison each tag begins with "tags/" and each remote - branch with "/". + returns a boolean. A remote branch such as "origin/master" is + displayed as just "master", however for this comparison the former + is used. ‘RET’ (‘magit-visit-ref’) @@ -6783,11 +6871,13 @@ Also see *note (gitman)git-stash::. • If INIT is non-nil, then the margin is shown initially. - • STYLE controls how to format the committer date. It can be - one of ‘age’ (to show the age of the commit), + • STYLE controls how to format the author or committer date. It + can be one of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to abbreviate the time unit to a character), or a string (suitable for ‘format-time-string’) to - show the actual date. + show the actual date. Option + ‘magit-log-margin-show-committer-date’ controls which date is + being displayed. • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be @@ -7226,8 +7316,8 @@ File: magit.info, Node: Plain Patches, Next: Maildir Patches, Prev: Pushing, Inside ‘magit-diff-mode’ or ‘magit-revision-mode’ buffers, ‘C-x C-w’ is also bound to this command. - FIXME It is also possible to save a plain patch file by using ‘C-x -C-w’ inside a ‘magit-diff-mode’ or ‘magit-revision-mode’ buffer. + It is also possible to save a plain patch file by using ‘C-x C-w’ +inside a ‘magit-diff-mode’ or ‘magit-revision-mode’ buffer.  File: magit.info, Node: Maildir Patches, Prev: Plain Patches, Up: Transferring @@ -7629,6 +7719,10 @@ Also see *note (gitman)git-worktree::. Create a new BRANCH and check it out in a new worktree at PATH. +‘% m’ (‘magit-worktree-move’) + + Move an existing worktree to a new PATH. + ‘% k’ (‘magit-worktree-delete’) Delete a worktree, defaulting to the worktree at point. The @@ -7688,116 +7782,3 @@ useful in Magit buffers. Therefore when the region is active, then both of these commands behave like ‘kill-ring-save’ instead of as described above. - -File: magit.info, Node: Wip Modes, Next: Minor Mode for Buffers Visiting Files, Prev: Common Commands, Up: Miscellaneous - -8.7 Wip Modes -============= - -Git keeps *committed* changes around long enough for users to recover -changes they have accidentally deleted. It does so by not garbage -collecting any committed but no longer referenced objects for a certain -period of time, by default 30 days. - - But Git does *not* keep track of *uncommitted* changes in the working -tree and not even the index (the staging area). Because Magit makes it -so convenient to modify uncommitted changes, it also makes it easy to -shoot yourself in the foot in the process. - - For that reason Magit provides a global mode that saves *tracked* -files to work-in-progress references after or before certain actions. -(At present untracked files are never saved and for technical reasons -nothing is saved before the first commit has been created). - - Two separate work-in-progress references are used to track the state -of the index and of the working tree: ‘refs/wip/index/’ and -‘refs/wip/wtree/’, where ‘’ is the full ref of the -current branch, e.g. ‘refs/heads/master’. When the ‘HEAD’ is detached -then ‘HEAD’ is used in place of ‘’. - - Checking out another branch (or detaching ‘HEAD’) causes the use of -different wip refs for subsequent changes. - - -- User Option: magit-wip-mode - - When this mode is enabled, then uncommitted changes are committed - to dedicated work-in-progress refs whenever appropriate (i.e. when - dataloss would be a possibility otherwise). - - Setting this variable directly does not take effect; either use the - Custom interface to do so or call the respective mode function. - - For historic reasons this mode is implemented on top of four other - ‘magit-wip-*’ modes, which can also be used individually, if you - want finer control over when the wip refs are updated; but that is - discouraged. See *note Legacy Wip Modes::. - - To view the log for a branch and its wip refs use the commands -‘magit-wip-log’ and ‘magit-wip-log-current’. You should use ‘--graph’ -when using these commands. - - -- Command: magit-wip-log - - This command shows the log for a branch and its wip refs. With a - negative prefix argument only the worktree wip ref is shown. - - The absolute numeric value of the prefix argument controls how many - "branches" of each wip ref are shown. This is only relevant if the - value of ‘magit-wip-merge-branch’ is ‘nil’. - - -- Command: magit-wip-log-current - - This command shows the log for the current branch and its wip refs. - With a negative prefix argument only the worktree wip ref is shown. - - The absolute numeric value of the prefix argument controls how many - "branches" of each wip ref are shown. This is only relevant if the - value of ‘magit-wip-merge-branch’ is ‘nil’. - -‘X w’ (‘magit-reset-worktree’) - - This command resets the working tree to some commit read from the - user and defaulting to the commit at point, while keeping the - ‘HEAD’ and index as-is. - - This can be used to restore files to the state committed to a wip - ref. Note that this will discard any unstaged changes that might - have existed before invoking this command (but of course only after - committing that to the working tree wip ref). - - Note that even if you enable ‘magit-wip-mode’ this won’t give you -perfect protection. The most likely scenario for losing changes despite -the use of ‘magit-wip-mode’ is making a change outside Emacs and then -destroying it also outside Emacs. In some such a scenario, Magit, being -an Emacs package, didn’t get the opportunity to keep you from shooting -yourself in the foot. - - When you are unsure whether Magit did commit a change to the wip -refs, then you can explicitly request that all changes to all tracked -files are being committed. - -‘M-x magit-wip-commit’ (‘magit-wip-commit’) - - This command commits all changes to all tracked files to the index - and working tree work-in-progress refs. Like the modes described - above, it does not commit untracked files, but it does check all - tracked files for changes. Use this command when you suspect that - the modes might have overlooked a change made outside Emacs/Magit. - - -- User Option: magit-wip-namespace - - The namespace used for work-in-progress refs. It has to end with a - slash. The wip refs are named ‘index/’ and - ‘wtree/’. When snapshots are created while - the ‘HEAD’ is detached then ‘HEAD’ is used in place of - ‘’. - - -- User Option: magit-wip-mode-lighter - - Mode-line lighter for ‘magit-wip--mode’. - -* Menu: - -* Wip Graph:: -* Legacy Wip Modes:: - diff --git a/elpa/magit-20190514.1814/magit.info-2 b/elpa/magit-20191030.1315/magit.info-2 similarity index 96% rename from elpa/magit-20190514.1814/magit.info-2 rename to elpa/magit-20191030.1315/magit.info-2 index ecffe62b..cbdd174a 100644 --- a/elpa/magit-20190514.1814/magit.info-2 +++ b/elpa/magit-20191030.1315/magit.info-2 @@ -17,6 +17,119 @@ START-INFO-DIR-ENTRY * Magit: (magit). Using Git from Emacs with Magit. END-INFO-DIR-ENTRY + +File: magit.info, Node: Wip Modes, Next: Minor Mode for Buffers Visiting Files, Prev: Common Commands, Up: Miscellaneous + +8.7 Wip Modes +============= + +Git keeps *committed* changes around long enough for users to recover +changes they have accidentally deleted. It does so by not garbage +collecting any committed but no longer referenced objects for a certain +period of time, by default 30 days. + + But Git does *not* keep track of *uncommitted* changes in the working +tree and not even the index (the staging area). Because Magit makes it +so convenient to modify uncommitted changes, it also makes it easy to +shoot yourself in the foot in the process. + + For that reason Magit provides a global mode that saves *tracked* +files to work-in-progress references after or before certain actions. +(At present untracked files are never saved and for technical reasons +nothing is saved before the first commit has been created). + + Two separate work-in-progress references are used to track the state +of the index and of the working tree: ‘refs/wip/index/’ and +‘refs/wip/wtree/’, where ‘’ is the full ref of the +current branch, e.g. ‘refs/heads/master’. When the ‘HEAD’ is detached +then ‘HEAD’ is used in place of ‘’. + + Checking out another branch (or detaching ‘HEAD’) causes the use of +different wip refs for subsequent changes. + + -- User Option: magit-wip-mode + + When this mode is enabled, then uncommitted changes are committed + to dedicated work-in-progress refs whenever appropriate (i.e. when + dataloss would be a possibility otherwise). + + Setting this variable directly does not take effect; either use the + Custom interface to do so or call the respective mode function. + + For historic reasons this mode is implemented on top of four other + ‘magit-wip-*’ modes, which can also be used individually, if you + want finer control over when the wip refs are updated; but that is + discouraged. See *note Legacy Wip Modes::. + + To view the log for a branch and its wip refs use the commands +‘magit-wip-log’ and ‘magit-wip-log-current’. You should use ‘--graph’ +when using these commands. + + -- Command: magit-wip-log + + This command shows the log for a branch and its wip refs. With a + negative prefix argument only the worktree wip ref is shown. + + The absolute numeric value of the prefix argument controls how many + "branches" of each wip ref are shown. This is only relevant if the + value of ‘magit-wip-merge-branch’ is ‘nil’. + + -- Command: magit-wip-log-current + + This command shows the log for the current branch and its wip refs. + With a negative prefix argument only the worktree wip ref is shown. + + The absolute numeric value of the prefix argument controls how many + "branches" of each wip ref are shown. This is only relevant if the + value of ‘magit-wip-merge-branch’ is ‘nil’. + +‘X w’ (‘magit-reset-worktree’) + + This command resets the working tree to some commit read from the + user and defaulting to the commit at point, while keeping the + ‘HEAD’ and index as-is. + + This can be used to restore files to the state committed to a wip + ref. Note that this will discard any unstaged changes that might + have existed before invoking this command (but of course only after + committing that to the working tree wip ref). + + Note that even if you enable ‘magit-wip-mode’ this won’t give you +perfect protection. The most likely scenario for losing changes despite +the use of ‘magit-wip-mode’ is making a change outside Emacs and then +destroying it also outside Emacs. In some such a scenario, Magit, being +an Emacs package, didn’t get the opportunity to keep you from shooting +yourself in the foot. + + When you are unsure whether Magit did commit a change to the wip +refs, then you can explicitly request that all changes to all tracked +files are being committed. + +‘M-x magit-wip-commit’ (‘magit-wip-commit’) + + This command commits all changes to all tracked files to the index + and working tree work-in-progress refs. Like the modes described + above, it does not commit untracked files, but it does check all + tracked files for changes. Use this command when you suspect that + the modes might have overlooked a change made outside Emacs/Magit. + + -- User Option: magit-wip-namespace + + The namespace used for work-in-progress refs. It has to end with a + slash. The wip refs are named ‘index/’ and + ‘wtree/’. When snapshots are created while + the ‘HEAD’ is detached then ‘HEAD’ is used in place of + ‘’. + + -- User Option: magit-wip-mode-lighter + + Mode-line lighter for ‘magit-wip--mode’. + +* Menu: + +* Wip Graph:: +* Legacy Wip Modes:: +  File: magit.info, Node: Wip Graph, Next: Legacy Wip Modes, Up: Wip Modes @@ -259,8 +372,8 @@ binding for ‘magit-file-dispatch’. This command shows the log for the file of blob that the current buffer visits. Renames are followed when a prefix argument is used - or when ‘--follow’ is part of ‘magit-log-arguments’. When the - region is active, the log is restricted to the selected line range. + or when ‘--follow’ is an active log argument. When the region is + active, the log is restricted to the selected line range. ‘C-c M-g t’ (‘magit-log-trace-definition’) @@ -565,10 +678,8 @@ is that Git first goes outside and has a smoke. not only by using ‘-’ but by also using a range. But unfortunately that’s not always possible. - In repositories with more than a few thousand commits ‘--graph’ -should never be a member of ‘magit-log-section-arguments’. That -variable is used in the status buffer which is refreshed every time you -run any Magit command. + When more than a few thousand commits are shown, then the use of +‘--graph’ can slow things down. Using ‘--color --graph’ is even slower. Magit uses code that is part of Emacs to turn control characters into faces. That code is pretty @@ -677,36 +788,22 @@ File: magit.info, Node: MacOS Performance, Prev: Microsoft Windows Performance MacOS Performance ................. -On macOS Emacs currently creates child processes using ‘fork’. It -appears that this also copies GUI resources. The result is that forking -takes about 30 times as long on Darwin than on Linux. And because Magit -starts many ‘git’ processes even when doing simple things, that makes -quite a difference. - - On the ‘master’ branch Emacs now uses ‘vfork’ when possible, like -this was already done on Linux, and now child creation only takes about -twice as long on Darwin. See (1) for more information. +Before Emacs 26.1 child processes were created using ‘fork’ on macOS. +That needlessly copied GUI resources, which is expensive. The result +was that forking took about 30 times as long on Darwin than on Linux, +and because Magit starts many ‘git’ processes that made quite a +difference. - Nobody knows when the changes on the ‘master’ branch will be released -as ‘26.1’, but it is still a long way off. You might want to get your -hands on this change before then. The easiest way to get a patched -Emacs is to install the ‘emacs-plus’ formula (2) using ‘homebrew’. The -change has been backported, so you get it not only when using ‘--HEAD’, -but also when using ‘--devel’ or when installing the latest release (by -not using a version argument). - - Alternatively you can apply the backport (3) manually. + So make sure that you are using at least Emacs 26.1, in which case +the faster ‘vfork’ will be used. (The creation of child processes still +takes about twice as long on Darwin compared to Linux.) See (1) for +more information. ---------- Footnotes ---------- (1) - (2) - - (3) - -  File: magit.info, Node: Plumbing, Next: FAQ, Prev: Customizing, Up: Top @@ -1823,8 +1920,9 @@ When Magit calls ‘git’ it adds a few global arguments including ‘--literal-pathspecs’ and the ‘git’ process started by Magit then passes that setting on to other ‘git’ process it starts itself. It does so by setting the environment variable ‘GIT_LITERAL_PATHSPECS’, not by calling -subprocesses with the ‘--literal-pathspecs’. You can therefore override -this setting in hook scripts using ‘unset GIT_LITERAL_PATHSPECS’. +subprocesses with the ‘--literal-pathspecs’ argument. You can therefore +override this setting in hook scripts using ‘unset +GIT_LITERAL_PATHSPECS’.  File: magit.info, Node: git-commit-mode isn't used when committing from the command-line, Next: Point ends up inside invisible text when jumping to a file-visiting buffer, Prev: My Git hooks work on the command-line but not inside Magit, Up: FAQ - Issues and Errors @@ -1974,8 +2072,9 @@ Appendix C Keystroke Index * %: Worktree. (line 8) * % b: Worktree. (line 13) * % c: Worktree. (line 17) -* % g: Worktree. (line 26) -* % k: Worktree. (line 21) +* % g: Worktree. (line 30) +* % k: Worktree. (line 25) +* % m: Worktree. (line 21) * +: Log Buffer. (line 61) * + <1>: Refreshing Diffs. (line 69) * -: Log Buffer. (line 65) @@ -2185,19 +2284,19 @@ Appendix C Keystroke Index * l: Logging. (line 29) * L: Refreshing Logs. (line 11) * L <1>: Log Buffer. (line 6) -* L <2>: Log Margin. (line 47) +* L <2>: Log Margin. (line 57) * l <1>: Editing Rebase Sequences. (line 115) * l a: Logging. (line 60) * l b: Logging. (line 56) -* L d: Log Margin. (line 64) +* L d: Log Margin. (line 74) * L g: Refreshing Logs. (line 17) * l h: Logging. (line 48) * l H: Reflog. (line 19) * l l: Logging. (line 35) * l L: Logging. (line 52) -* L L: Log Margin. (line 56) -* L l: Log Margin. (line 60) +* L L: Log Margin. (line 66) +* L l: Log Margin. (line 70) * l o: Logging. (line 41) * l O: Reflog. (line 15) * l r: Reflog. (line 11) @@ -2326,7 +2425,7 @@ Appendix C Keystroke Index * r s <1>: Rebasing. (line 114) * r u: Rebasing. (line 37) * r w: Rebasing. (line 95) -* RET: References Buffer. (line 174) +* RET: References Buffer. (line 181) * RET <1>: Visiting Files and Blobs from a Diff. (line 8) * RET <2>: Blaming. (line 78) @@ -2576,7 +2675,7 @@ Appendix D Command Index * magit-commit-squash: Initiating a Commit. (line 55) * magit-copy-buffer-revision: Common Commands. (line 27) * magit-copy-section-value: Common Commands. (line 10) -* magit-cycle-margin-style: Log Margin. (line 60) +* magit-cycle-margin-style: Log Margin. (line 70) * magit-debug-git-executable: Git Executable. (line 45) * magit-debug-git-executable <1>: Debugging Tools. (line 30) * magit-describe-section-briefly: Section Types and Values. @@ -2708,7 +2807,7 @@ Appendix D Command Index * magit-log-toggle-commit-limit: Log Buffer. (line 55) * magit-log-trace-definition: Minor Mode for Buffers Visiting Files. (line 114) -* magit-margin-settings: Log Margin. (line 47) +* magit-margin-settings: Log Margin. (line 57) * magit-merge: Merging. (line 9) * magit-merge <1>: Merging. (line 89) * magit-merge-abort: Merging. (line 95) @@ -2895,8 +2994,8 @@ Appendix D Command Index * magit-tag-release: Tagging. (line 19) * magit-toggle-buffer-lock: Modes and Buffers. (line 17) * magit-toggle-margin: Refreshing Logs. (line 37) -* magit-toggle-margin <1>: Log Margin. (line 56) -* magit-toggle-margin-details: Log Margin. (line 64) +* magit-toggle-margin <1>: Log Margin. (line 66) +* magit-toggle-margin-details: Log Margin. (line 74) * magit-unstage: Staging and Unstaging. (line 43) * magit-unstage-all: Staging and Unstaging. @@ -2907,15 +3006,16 @@ Appendix D Command Index (line 63) * magit-version: Git Executable. (line 17) * magit-version <1>: Debugging Tools. (line 10) -* magit-visit-ref: References Buffer. (line 174) +* magit-visit-ref: References Buffer. (line 181) * magit-wip-commit: Wip Modes. (line 88) * magit-wip-log: Wip Modes. (line 48) * magit-wip-log-current: Wip Modes. (line 57) * magit-worktree: Worktree. (line 8) * magit-worktree-branch: Worktree. (line 17) * magit-worktree-checkout: Worktree. (line 13) -* magit-worktree-delete: Worktree. (line 21) -* magit-worktree-status: Worktree. (line 26) +* magit-worktree-delete: Worktree. (line 25) +* magit-worktree-move: Worktree. (line 21) +* magit-worktree-status: Worktree. (line 30) * scroll-down: Commands Available in Diffs. (line 60) * scroll-up: Commands Available in Diffs. @@ -3036,6 +3136,7 @@ Appendix E Function Index * magit-ido-completing-read: Support for Completion Frameworks. (line 48) * magit-insert-am-sequence: Status Sections. (line 28) +* magit-insert-assumed-unchanged-files: Status Sections. (line 117) * magit-insert-bisect-log: Status Sections. (line 46) * magit-insert-bisect-output: Status Sections. (line 38) * magit-insert-bisect-rest: Status Sections. (line 42) @@ -3064,7 +3165,7 @@ Appendix E Function Index * magit-insert-push-branch-header: Status Header Sections. (line 51) * magit-insert-rebase-sequence: Status Sections. (line 23) -* magit-insert-recent-commits: Status Sections. (line 115) +* magit-insert-recent-commits: Status Sections. (line 131) * magit-insert-remote-branches: References Sections. (line 21) * magit-insert-remote-header: Status Header Sections. (line 67) @@ -3072,6 +3173,7 @@ Appendix E Function Index (line 63) * magit-insert-section: Creating Sections. (line 6) * magit-insert-sequencer-sequence: Status Sections. (line 33) +* magit-insert-skip-worktree-files: Status Sections. (line 110) * magit-insert-staged-changes: Status Sections. (line 63) * magit-insert-stashes: Status Sections. (line 67) * magit-insert-status-headers: Status Header Sections. @@ -3081,11 +3183,11 @@ Appendix E Function Index * magit-insert-tags-header: Status Header Sections. (line 56) * magit-insert-tracked-files: Status Sections. (line 96) -* magit-insert-unpulled-cherries: Status Sections. (line 126) +* magit-insert-unpulled-cherries: Status Sections. (line 142) * magit-insert-unpulled-from-pushremote: Status Sections. (line 79) * magit-insert-unpulled-from-upstream: Status Sections. (line 74) -* magit-insert-unpulled-or-recent-commits: Status Sections. (line 108) -* magit-insert-unpushed-cherries: Status Sections. (line 133) +* magit-insert-unpulled-or-recent-commits: Status Sections. (line 124) +* magit-insert-unpushed-cherries: Status Sections. (line 149) * magit-insert-unpushed-to-pushremote: Status Sections. (line 89) * magit-insert-unpushed-to-upstream: Status Sections. (line 84) * magit-insert-unstaged-changes: Status Sections. (line 59) @@ -3107,16 +3209,21 @@ Appendix E Function Index * magit-push-to-remote: Pushing. (line 85) * magit-region-sections: Section Selection. (line 10) * magit-region-values: Section Selection. (line 37) +* magit-repolist-column-branch: Repository List. (line 44) +* magit-repolist-column-branches: Repository List. (line 53) +* magit-repolist-column-flag: Repository List. (line 61) * magit-repolist-column-ident: Repository List. (line 30) * magit-repolist-column-path: Repository List. (line 35) +* magit-repolist-column-stashes: Repository List. (line 57) * magit-repolist-column-unpulled-from-pushremote: Repository List. - (line 49) + (line 81) * magit-repolist-column-unpulled-from-upstream: Repository List. - (line 44) + (line 76) * magit-repolist-column-unpushed-to-pushremote: Repository List. - (line 59) + (line 91) * magit-repolist-column-unpushed-to-upstream: Repository List. - (line 54) + (line 86) +* magit-repolist-column-upstream: Repository List. (line 48) * magit-repolist-column-version: Repository List. (line 39) * magit-restore-window-configuration: Quitting Windows. (line 23) * magit-revert-buffers: Editing Commit Messages. @@ -3147,9 +3254,11 @@ Appendix E Function Index (line 105) * magit-start-process: Calling Git for Effect. (line 124) -* magit-status-maybe-update-blob-buffer: Section Movement. (line 83) +* magit-stashes-maybe-update-stash-buffer: Section Movement. (line 95) +* magit-status-maybe-update-blob-buffer: Section Movement. (line 89) * magit-status-maybe-update-revision-buffer: Section Movement. (line 77) +* magit-status-maybe-update-stash-buffer: Section Movement. (line 83) * magit-wip-log: Wip Modes. (line 48) * magit-wip-log-current: Wip Modes. (line 57) * with-editor-usage-message: Editing Commit Messages. @@ -3284,8 +3393,9 @@ Appendix F Variable Index * magit-log-buffer-file-locked: Minor Mode for Buffers Visiting Files. (line 118) * magit-log-margin: Log Margin. (line 12) -* magit-log-section-args: Status Options. (line 36) -* magit-log-section-commit-count: Status Sections. (line 120) +* magit-log-margin-show-committer-date: Log Margin. (line 49) +* magit-log-section-args: Status Options. (line 38) +* magit-log-section-commit-count: Status Sections. (line 136) * magit-log-select-margin: Select from Log. (line 30) * magit-log-show-refname-after-summary: Log Buffer. (line 75) * magit-log-trace-definition-function: Commands Available in Diffs. @@ -3313,10 +3423,10 @@ Appendix F Variable Index * magit-refresh-function: Refreshing Buffers. (line 49) * magit-refresh-status-buffer: Automatic Refreshing of Magit Buffers. (line 48) -* magit-refs-filter-alist: References Buffer. (line 157) +* magit-refs-filter-alist: References Buffer. (line 159) * magit-refs-focus-column-width: References Buffer. (line 82) * magit-refs-margin: References Buffer. (line 97) -* magit-refs-margin-for-tags: References Buffer. (line 123) +* magit-refs-margin-for-tags: References Buffer. (line 125) * magit-refs-pad-commit-counts: References Buffer. (line 49) * magit-refs-primary-column-width: References Buffer. (line 69) * magit-refs-sections-hook: References Sections. (line 13) @@ -3355,8 +3465,8 @@ Appendix F Variable Index * magit-uniquify-buffer-names: Naming Buffers. (line 74) * magit-unstage-committed: Staging and Unstaging. (line 56) -* magit-update-other-window-delay: Section Movement. (line 89) -* magit-visit-ref-behavior: References Buffer. (line 185) +* magit-update-other-window-delay: Section Movement. (line 101) +* magit-visit-ref-behavior: References Buffer. (line 192) * magit-wip-after-apply-mode: Legacy Wip Modes. (line 19) * magit-wip-after-apply-mode-lighter: Legacy Wip Modes. (line 59) * magit-wip-after-save-local-mode-lighter: Legacy Wip Modes. (line 55) diff --git a/elpa/magit-todos-20190508.757/magit-todos-pkg.el b/elpa/magit-todos-20190508.757/magit-todos-pkg.el deleted file mode 100644 index e5dab75b..00000000 --- a/elpa/magit-todos-20190508.757/magit-todos-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "magit-todos" "20190508.757" "Show source file TODOs in Magit" '((emacs "25.2") (async "1.9.2") (dash "2.13.0") (f "0.17.2") (hl-todo "1.9.0") (magit "2.13.0") (pcre2el "1.8") (s "1.12.0")) :commit "3c59aa03b217b55b1baa0e88470e10996aaeea9b" :keywords '("magit" "vc") :authors '(("Adam Porter" . "adam@alphapapa.net")) :maintainer '("Adam Porter" . "adam@alphapapa.net") :url "http://github.com/alphapapa/magit-todos") diff --git a/elpa/magit-todos-20190508.757/magit-todos-autoloads.el b/elpa/magit-todos-20190907.1321/magit-todos-autoloads.el similarity index 78% rename from elpa/magit-todos-20190508.757/magit-todos-autoloads.el rename to elpa/magit-todos-20190907.1321/magit-todos-autoloads.el index ac45b3e8..98263093 100644 --- a/elpa/magit-todos-20190508.757/magit-todos-autoloads.el +++ b/elpa/magit-todos-20190907.1321/magit-todos-autoloads.el @@ -1,12 +1,10 @@ ;;; magit-todos-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "magit-todos" "magit-todos.el" (0 0 0 0)) +;;;### (autoloads nil "magit-todos" "magit-todos.el" (23994 46458 +;;;;;; 782116 843000)) ;;; Generated autoloads from magit-todos.el (defvar magit-todos-mode nil "\ @@ -35,14 +33,11 @@ Open buffer showing to-do list of repository at DIRECTORY. \(fn DIRECTORY)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-todos" '("magit-todos-"))) - ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; magit-todos-autoloads.el ends here diff --git a/elpa/magit-todos-20190907.1321/magit-todos-pkg.el b/elpa/magit-todos-20190907.1321/magit-todos-pkg.el new file mode 100644 index 00000000..6c12c3ef --- /dev/null +++ b/elpa/magit-todos-20190907.1321/magit-todos-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "magit-todos" "20190907.1321" "Show source file TODOs in Magit" '((emacs "25.2") (async "1.9.2") (dash "2.13.0") (f "0.17.2") (hl-todo "1.9.0") (magit "2.13.0") (pcre2el "1.8") (s "1.12.0")) :commit "a80dace2bf8bf3e697e3e8421189996adcecc900" :keywords '("magit" "vc") :authors '(("Adam Porter" . "adam@alphapapa.net")) :maintainer '("Adam Porter" . "adam@alphapapa.net") :url "http://github.com/alphapapa/magit-todos") diff --git a/elpa/magit-todos-20190508.757/magit-todos.el b/elpa/magit-todos-20190907.1321/magit-todos.el similarity index 88% rename from elpa/magit-todos-20190508.757/magit-todos.el rename to elpa/magit-todos-20190907.1321/magit-todos.el index 3128e792..0d99205e 100644 --- a/elpa/magit-todos-20190508.757/magit-todos.el +++ b/elpa/magit-todos-20190907.1321/magit-todos.el @@ -4,8 +4,8 @@ ;; Author: Adam Porter ;; URL: http://github.com/alphapapa/magit-todos -;; Package-Version: 20190508.757 -;; Version: 1.3-pre +;; Package-Version: 20190907.1321 +;; Version: 1.5-pre ;; Package-Requires: ((emacs "25.2") (async "1.9.2") (dash "2.13.0") (f "0.17.2") (hl-todo "1.9.0") (magit "2.13.0") (pcre2el "1.8") (s "1.12.0")) ;; Keywords: magit, vc @@ -122,7 +122,7 @@ magit-status buffer.") (let ((map (make-sparse-keymap))) (define-key map "jT" #'magit-todos-jump-to-todos) (define-key map "jl" #'magit-todos-list) - (define-key map "b" #'magit-todos-toggle-branch-list) + (define-key map "b" #'magit-todos-branch-list-toggle) (define-key map (kbd "RET") #'magit-todos-list) map) "Keymap for `magit-todos' top-level section.") @@ -326,17 +326,21 @@ used." "Glob patterns to exclude from searches." :type '(repeat string)) -(defcustom magit-todos-show-branch-list 'branch +(defcustom magit-todos-branch-list 'branch "Show branch diff to-do list. In the master branch, this shows whatever items are listed by -\"git diff HEAD^\". +\"git diff `magit-todos-branch-list-commit-ref'\". This can be toggled locally in Magit buffers with command -`magit-todos-toggle-branch-list'." +`magit-todos-branch-list-toggle'." :type '(choice (const :tag "Never" nil) (const :tag "In non-master branches" branch) (const :tag "Always" t))) +(defcustom magit-todos-branch-list-commit-ref '"HEAD^" + "Commit ref passed to \"git diff\" command used to make branch diff list." + :type 'string) + ;;;; Commands ;;;###autoload @@ -376,18 +380,17 @@ Only necessary when option `magit-todos-update' is nil." (setq magit-todos-updating t) (magit-todos--insert-todos))) -(defun magit-todos-toggle-branch-list () +(defun magit-todos-branch-list-toggle () "Toggle branch diff to-do list in current Magit buffer." (interactive) - (setq-local magit-todos-show-branch-list (not magit-todos-show-branch-list)) + (setq-local magit-todos-branch-list (not magit-todos-branch-list)) (magit-todos-update)) -(defun magit-todos-jump-to-item (&optional peek) +(cl-defun magit-todos-jump-to-item (&key peek (item (oref (magit-current-section) value))) "Show current item. If PEEK is non-nil, keep focus in status buffer window." (interactive) (let* ((status-window (selected-window)) - (item (oref (magit-current-section) value)) (buffer (magit-todos--item-buffer item))) (pop-to-buffer buffer) (magit-todos--goto-item item) @@ -399,7 +402,7 @@ If PEEK is non-nil, keep focus in status buffer window." (defun magit-todos-peek-at-item () "Peek at current item." (interactive) - (magit-todos-jump-to-item 'peek)) + (magit-todos-jump-to-item :peek t)) ;;;;; Jump to section @@ -443,7 +446,7 @@ With prefix, prompt for repository." "Open buffer showing to-do list of repository at DIRECTORY." (magit--tramp-asserts directory) (let ((default-directory directory)) - (magit-mode-setup #'magit-todos-list-mode))) + (magit-setup-buffer #'magit-todos-list-mode))) (define-derived-mode magit-todos-list-mode magit-status-mode "Magit" "Mode for looking at repository to-do list. @@ -506,16 +509,31 @@ Chooses automatically in order defined in `magit-todos-scanners'." when (eval (alist-get 'test scanner)) return (alist-get 'function scanner))) -(cl-defun magit-todos--scan-callback (&key magit-status-buffer results-regexp process &allow-other-keys) - "Callback for `magit-todos--git-grep-scan-async'." - ;; SOMEDAY: Perhaps move process buffer parsing into separate function. - (with-current-buffer (process-buffer process) - (goto-char (point-min)) - (magit-todos--insert-items magit-status-buffer - (cl-loop for item = (magit-todos--line-item results-regexp) - while item - collect item - do (forward-line 1))))) +(cl-defun magit-todos--scan-callback (&key callback magit-status-buffer results-regexp process &allow-other-keys) + "Call CALLBACK with arguments MAGIT-STATUS-BUFFER and match items. +Match items are a list of `magit-todos-item' found in PROCESS's buffer for RESULTS-REGEXP." + (funcall callback magit-status-buffer + (with-current-buffer (process-buffer process) + (magit-todos--buffer-items results-regexp)))) + +(defun magit-todos--buffer-items (results-regexp) + "Return list of `magit-todos-item' found in current buffer for RESULTS-REGEXP." + (let ((items)) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (--when-let (condition-case err + (magit-todos--line-item results-regexp) + ;; Files with very, very long lines may cause Emacs's regexp matcher to overflow. + ;; Rather than abort the whole scan and raise an error, try to handle it gracefully. + ;; FIXME: This may raise multiple warnings per file. + (error (if (string= "Stack overflow in regexp matcher" (error-message-string err)) + (let ((filename (buffer-substring (point) (1- (re-search-forward ":"))))) + (display-warning 'magit-todos (concat "File has lines too long for Emacs to search. Consider excluding it from scans: " filename))) + (signal (car err) (cdr err))))) + (push it items)) + (forward-line 1))) + (nreverse items))) (cl-defun magit-todos--git-diff-callback (&key magit-status-buffer results-regexp search-regexp-elisp process heading &allow-other-keys) @@ -580,8 +598,12 @@ See `magit-section-match'. Also delete it from root section's children." (object-remove-from-list magit-root-section 'children section) (with-slots (start end) section ;; NOTE: We delete 1 past the end because we insert a newline after the section. I'm not - ;; sure if this would generalize to all Magit sections. - (delete-region start (1+ end)))))) + ;; sure if this would generalize to all Magit sections. But if the end is the same as + ;; `point-max', which may be the case if todo items have not yet been inserted, we only + ;; delete up to `point-max'. + (delete-region start (if (= end (point-max)) + end + (1+ end))))))) (defun magit-todos--item-buffer (item) "Return buffer visiting ITEM." @@ -629,13 +651,14 @@ This function should be called from inside a ‘magit-status’ buffer." ;; special var should follow down the chain, but it isn't working, so we'll do this. (setq magit-todos-updating t) (setq magit-todos-active-scan (funcall magit-todos-scanner + :callback #'magit-todos--insert-items :magit-status-buffer (current-buffer) :directory default-directory :depth magit-todos-depth))) (_ ; Caching and cache not expired, or not automatic and not manually updating now (magit-todos--insert-items (current-buffer) magit-todos-item-cache))) - (when (or (eq magit-todos-show-branch-list t) - (and (eq magit-todos-show-branch-list 'branch) + (when (or (eq magit-todos-branch-list t) + (and (eq magit-todos-branch-list 'branch) (not (string= "master" (magit-get-current-branch))))) ;; Insert branch-local items. (magit-todos--scan-with-git-diff :magit-status-buffer (current-buffer) @@ -924,7 +947,7 @@ This is a copy of `async-start-process' that does not override (let* ((args (cdr command)) (command (car command)) (buf (generate-new-buffer (concat " *" name "*"))) - (proc (apply #'start-process name buf command args))) + (proc (apply #'start-file-process name buf command args))) (with-current-buffer buf (set-process-query-on-exit-flag proc nil) (set (make-local-variable 'async-callback) finish-func) @@ -949,11 +972,15 @@ if the process's buffer has already been deleted." ;; `rg' scanner buffer! It's as if Emacs is mixing up the process buffers. I really don't know ;; what's going on. But maybe I can work around it by copying this function and checking whether ;; the process's buffer is alive. - (when (and (eq 'exit (process-status proc)) + ;; NOTE: TRAMP processes seem to have the status `signal' instead of + ;; `exit'. I can't find documentation as to why. + (when (and (memq (process-status proc) '(exit signal)) (buffer-live-p (process-buffer proc))) (with-current-buffer (process-buffer proc) (let ((async-current-process proc)) - (if (= 0 (process-exit-status proc)) + ;; TRAMP processes seem to have the exit status 9 instead of + ;; 0. I can't find documentation or code about it. + (if (memq (process-exit-status proc) '(0 9)) (if async-callback-for-process (if async-callback (prog1 @@ -1072,10 +1099,10 @@ appropriate. Custom regexps may also match column numbers or byte offsets in the appropriate numbered groups; see `make-magit-todos-item'. -CALLBACK is a function which is called to parse the scanner -process's buffer. For grep-like scanners that output results in -a format suitable for RESULTS-REGEXP, the default callback, -`magit-todos--scan-callback', should be used. +CALLBACK is called to process the process's output buffer. +Normally the default should be used, which inserts items into the +Magit status buffer which is passed as an argument to the scanner +function. The macro defines the following: @@ -1103,9 +1130,19 @@ It also adds the scanner to the customization variable (defcustom ,extra-args-var nil ,(format "Extra arguments passed to %s." name) :type '(repeat string)) - (cl-defun ,scan-fn-symbol (&key magit-status-buffer directory depth heading) + + ;; NOTE: Both the macro and the macro-defined function have `callback' arguments. Pay attention to unquoting. + ;; FIXME: That is confusing. + + (cl-defun ,scan-fn-symbol (&key magit-status-buffer directory depth heading sync callback) ,(format "Scan for to-dos with %s, then call `%s'. -MAGIT-STATUS-BUFFER is what it says. DIRECTORY is the directory in which to run the scan. DEPTH should be an integer, typically the value of `magit-todos-depth'. HEADING is passed to `%s'." +MAGIT-STATUS-BUFFER is what it says. DIRECTORY is the directory in which to run the scan. DEPTH should be an integer, typically the value of `magit-todos-depth'. HEADING is passed to `%s'. + +When SYNC is nil, the scanner process is returned, and CALLBACK +is a function which is called by the process sentinel with one +argument, a list of match items. + +When SYNC is non-nil, match items are returned." name callback callback) (let* ((process-connection-type 'pipe) (directory (f-relative directory default-directory)) @@ -1157,13 +1194,25 @@ MAGIT-STATUS-BUFFER is what it says. DIRECTORY is the directory in which to run (cl-loop for elt in-ref command when (numberp elt) do (setf elt (number-to-string elt))) - (magit-todos--async-start-process ,scan-fn-name - :command command - :finish-func (apply-partially ,callback - :magit-status-buffer magit-status-buffer :results-regexp results-regexp - :search-regexp-elisp search-regexp-elisp - :heading heading - :process)))) ; Process is appended to the list. + ;; Run command. + (if sync + ;; Synchronous: return matching items. + (with-temp-buffer + (unless (= 0 (apply #'call-process (car command) nil (current-buffer) nil + (cdr command))) + (user-error (concat (car command) " failed"))) + (magit-todos--buffer-items results-regexp)) + ;; Async: return process. + (magit-todos--async-start-process ,scan-fn-name + :command command + ;; NOTE: This callback chain. + :finish-func (apply-partially ,callback + :callback callback + :magit-status-buffer magit-status-buffer + :results-regexp results-regexp + :search-regexp-elisp search-regexp-elisp + :heading heading + :process))))) ; Process is appended to the list. (magit-todos--add-to-custom-type 'magit-todos-scanner (list 'const :tag ,name #',scan-fn-symbol)) (add-to-list 'magit-todos-scanners @@ -1183,7 +1232,7 @@ MAGIT-STATUS-BUFFER is what it says. DIRECTORY is the directory in which to run (magit-todos-defscanner "rg" :test (executable-find "rg") - :command (list "rg" "--no-heading" + :command (list "rg" "--no-heading" "--line-number" (when depth (list "--maxdepth" (1+ depth))) (when magit-todos-ignore-case @@ -1212,8 +1261,11 @@ MAGIT-STATUS-BUFFER is what it says. DIRECTORY is the directory in which to run ;; NOTE: This scanner implements the regexp *searching* in elisp rather than in the ;; external process because, unlike "git grep", "git diff" does not support PCRE. :test t - :command (list "git" "--no-pager" "diff" "--no-color" "-U0" "HEAD^") - :callback #'magit-todos--git-diff-callback) + :command (progn + ;; Silence byte-compiler warnings about these vars we don't use in this scanner. + (ignore search-regexp-elisp search-regexp-pcre extra-args directory depth) + (list "git" "--no-pager" "diff" "--no-color" "-U0" magit-todos-branch-list-commit-ref)) + :callback 'magit-todos--git-diff-callback) (magit-todos-defscanner "find|grep" ;; NOTE: The filenames output by find|grep have a leading "./". I don't expect this scanner to be @@ -1279,6 +1331,70 @@ MAGIT-STATUS-BUFFER is what it says. DIRECTORY is the directory in which to run ;; Now that all the scanners have been defined, we can set the value. (custom-reevaluate-setting 'magit-todos-scanner) +;;;; Helm/Ivy + +;; These add optional support for Helm and Ivy. This code does not require +;; Helm or Ivy to be installed; it is only called after one of them is loaded. + +(declare-function helm-make-source "ext:helm-source") + +(with-eval-after-load 'helm + (defvar helm-magit-todos-source + ;; We use `helm-make-source' instead of `helm-make-sync-source', which is a + ;; macro, which won't be present if the user doesn't have Helm installed. + (helm-make-source "helm-magit-todos" 'helm-source-sync + :candidates #'magit-todos-candidates + :action (lambda (item) + (magit-todos-jump-to-item :item item)))) + + (defun helm-magit-todos () + "Display `magit-todos' items with Helm. +Note that this uses `magit-todos-items-cache' when a Magit status +buffer is available for the repository directory, in which case +the cache is not updated from this command." + (interactive) + (helm :sources '(helm-magit-todos-source)))) + +(with-eval-after-load 'ivy + (defun ivy-magit-todos () + "Display `magit-todos' items with Ivy. +Note that this uses `magit-todos-items-cache' when a Magit status +buffer is available for the repository directory, in which case +the cache is not updated from this command." + (interactive) + (ivy-read "TODOs: " (magit-todos-candidates) + :action (lambda (item) + (magit-todos-jump-to-item :item (cdr item)))))) + +;;;;; Support + +;; These functions are used by both Helm and Ivy. + +(defsubst magit-todos-item-cons (item) + "Return ITEM as a (DISPLAY . ITEM) pair. +Used for e.g. Helm and Ivy." + (cons (concat (magit-todos-item-filename item) " " + (funcall (if (s-suffix? ".org" (magit-todos-item-filename item)) + #'magit-todos--format-org + #'magit-todos--format-plain) + item)) + item)) + +(defun magit-todos-candidates () + "Return list of (DISPLAY . ITEM) candidates for e.g. Helm and Ivy." + ;; MAYBE: Update the cache appropriately from here. + (if-let* ((magit-status-buffer (magit-get-mode-buffer 'magit-status-mode)) + (items (buffer-local-value 'magit-todos-item-cache magit-status-buffer))) + ;; Use cached items. + (cl-loop for item in items + collect (magit-todos-item-cons item)) + ;; No cached items: run scan. + (when-let* ((items (funcall magit-todos-scanner :sync t + :directory default-directory + :depth magit-todos-depth))) + (cl-loop for item in items + collect (magit-todos-item-cons item))))) + ;;;; Footer (provide 'magit-todos) -- 2.47.3