From 835f632a7c499a0e3ab4da8b2d1a62299eb04b30 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 2 Feb 2021 14:56:23 +0100 Subject: [PATCH] update magit --- elpa/magit-20210102.1019/magit-pkg.el | 17 - elpa/magit-20210102.1019/magit.info | 195 --- .../AUTHORS.md | 2 + .../LICENSE | 0 .../dir | 0 .../git-rebase.el | 16 +- .../magit-apply.el | 5 +- .../magit-autoloads.el | 13 +- .../magit-autorevert.el | 5 +- .../magit-bisect.el | 75 +- .../magit-blame.el | 5 +- .../magit-bookmark.el | 5 +- .../magit-branch.el | 24 +- .../magit-clone.el | 2 +- .../magit-commit.el | 5 +- .../magit-core.el | 2 +- .../magit-diff.el | 70 +- .../magit-ediff.el | 2 +- .../magit-extras.el | 7 +- .../magit-fetch.el | 2 +- .../magit-files.el | 5 +- .../magit-git.el | 40 +- .../magit-gitignore.el | 5 +- .../magit-imenu.el | 5 +- .../magit-log.el | 8 +- .../magit-margin.el | 7 +- .../magit-merge.el | 14 +- .../magit-mode.el | 17 +- .../magit-notes.el | 2 +- .../magit-obsolete.el | 2 +- .../magit-patch.el | 5 +- elpa/magit-20210128.1702/magit-pkg.el | 16 + .../magit-process.el | 16 +- .../magit-pull.el | 2 +- .../magit-push.el | 5 +- .../magit-reflog.el | 5 +- .../magit-refs.el | 5 +- .../magit-remote.el | 2 +- .../magit-repos.el | 10 +- .../magit-reset.el | 2 +- .../magit-section.el | 13 +- .../magit-sequence.el | 26 +- .../magit-stash.el | 5 +- .../magit-status.el | 5 +- .../magit-submodule.el | 6 +- .../magit-subtree.el | 2 +- .../magit-tag.el | 2 +- .../magit-transient.el | 9 +- .../magit-utils.el | 16 +- .../magit-wip.el | 5 +- .../magit-worktree.el | 2 +- .../magit.el | 15 +- elpa/magit-20210128.1702/magit.info | 195 +++ .../magit.info-1 | 65 +- .../magit.info-2 | 103 +- .../magit-todos-autoloads.el | 48 - .../magit-todos-pkg.el | 2 - elpa/magit-todos-20200128.828/magit-todos.el | 1438 ----------------- 58 files changed, 574 insertions(+), 2008 deletions(-) delete mode 100644 elpa/magit-20210102.1019/magit-pkg.el delete mode 100644 elpa/magit-20210102.1019/magit.info rename elpa/{magit-20210102.1019 => magit-20210128.1702}/AUTHORS.md (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/LICENSE (100%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/dir (100%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/git-rebase.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-apply.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-autoloads.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-autorevert.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-bisect.el (76%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-blame.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-bookmark.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-branch.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-clone.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-commit.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-core.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-diff.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-ediff.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-extras.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-fetch.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-files.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-git.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-gitignore.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-imenu.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-log.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-margin.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-merge.el (97%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-mode.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-notes.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-obsolete.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-patch.el (99%) create mode 100644 elpa/magit-20210128.1702/magit-pkg.el rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-process.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-pull.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-push.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-reflog.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-refs.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-remote.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-repos.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-reset.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-section.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-sequence.el (97%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-stash.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-status.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-submodule.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-subtree.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-tag.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-transient.el (98%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-utils.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-wip.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit-worktree.el (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit.el (99%) create mode 100644 elpa/magit-20210128.1702/magit.info rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit.info-1 (99%) rename elpa/{magit-20210102.1019 => magit-20210128.1702}/magit.info-2 (99%) delete mode 100644 elpa/magit-todos-20200128.828/magit-todos-autoloads.el delete mode 100644 elpa/magit-todos-20200128.828/magit-todos-pkg.el delete mode 100644 elpa/magit-todos-20200128.828/magit-todos.el diff --git a/elpa/magit-20210102.1019/magit-pkg.el b/elpa/magit-20210102.1019/magit-pkg.el deleted file mode 100644 index 2816bf57..00000000 --- a/elpa/magit-20210102.1019/magit-pkg.el +++ /dev/null @@ -1,17 +0,0 @@ -(define-package "magit" "20210102.1019" "A Git porcelain inside Emacs." - '((emacs "25.1") - (async "20200113") - (dash "20200524") - (git-commit "20200516") - (transient "20200601") - (with-editor "20200522")) - :commit "f3602d5f98ffdb548a629e171095cbc835faba73" :authors - (("Marius Vollmer" . "marius.vollmer@gmail.com")) - :maintainer - ("Jonas Bernoulli" . "jonas@bernoul.li") - :keywords - ("git" "tools" "vc") - :url "https://github.com/magit/magit") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/magit-20210102.1019/magit.info b/elpa/magit-20210102.1019/magit.info deleted file mode 100644 index c6efd81c..00000000 --- a/elpa/magit-20210102.1019/magit.info +++ /dev/null @@ -1,195 +0,0 @@ -This is magit.info, produced by makeinfo version 6.5 from magit.texi. - - Copyright (C) 2015-2021 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: 301254 - -Tag Table: -(Indirect) -Node: Top754 -Node: Introduction6512 -Node: Installation11235 -Node: Installing from Melpa11565 -Node: Installing from the Git Repository12638 -Node: Post-Installation Tasks15370 -Node: Getting Started16655 -Node: Interface Concepts21895 -Node: Modes and Buffers22256 -Node: Switching Buffers24005 -Node: Naming Buffers28756 -Node: Quitting Windows32063 -Node: Automatic Refreshing of Magit Buffers33809 -Node: Automatic Saving of File-Visiting Buffers36661 -Node: Automatic Reverting of File-Visiting Buffers37846 -Node: Risk of Reverting Automatically42841 -Node: Sections45223 -Node: Section Movement46149 -Node: Section Visibility51059 -Node: Section Hooks57136 -Node: Section Types and Values59543 -Node: Section Options60846 -Node: Transient Commands61318 -Node: Transient Arguments and Buffer Variables62555 -Node: Completion Confirmation and the Selection69573 -Node: Action Confirmation70017 -Node: Completion and Confirmation77833 -Node: The Selection81019 -Node: The hunk-internal region83918 -Node: Support for Completion Frameworks85007 -Node: Additional Completion Options89914 -Node: Running Git90513 -Node: Viewing Git Output90786 -Node: Git Process Status91919 -Node: Running Git Manually92884 -Node: Git Executable95354 -Node: Global Git Arguments97636 -Node: Inspecting98442 -Node: Status Buffer99599 -Node: Status Sections103589 -Node: Status Header Sections109141 -Node: Status Module Sections111771 -Node: Status Options114276 -Node: Repository List115745 -Node: Logging118783 -Node: Refreshing Logs121344 -Node: Log Buffer122790 -Node: Log Margin126646 -Node: Select from Log129825 -Node: Reflog132050 -Node: Cherries133707 -Node: Diffing135555 -Node: Refreshing Diffs138634 -Node: Commands Available in Diffs142213 -Node: Diff Options144749 -Node: Revision Buffer149787 -Node: Ediffing153117 -Node: References Buffer156765 -Node: References Sections167285 -Node: Bisecting168146 -Node: Visiting Files and Blobs169959 -Node: General-Purpose Visit Commands170429 -Node: Visiting Files and Blobs from a Diff171385 -Node: Blaming174844 -Node: Manipulating181185 -Node: Creating Repository181527 -Node: Cloning Repository182082 -Node: Staging and Unstaging187487 -Node: Staging from File-Visiting Buffers191570 -Node: Applying192738 -Node: Committing194631 -Node: Initiating a Commit195214 -Node: Editing Commit Messages198599 -Node: Using the Revision Stack201402 -Node: Commit Pseudo Headers204453 -Node: Commit Mode and Hooks205789 -Node: Commit Message Conventions208727 -Node: Branching210855 -Node: The Two Remotes211081 -Node: Branch Commands213734 -Node: Branch Git Variables226115 -Node: Auxiliary Branch Commands231506 -Node: Merging232624 -Node: Resolving Conflicts236632 -Node: Rebasing241633 -Node: Editing Rebase Sequences246492 -Node: Information About In-Progress Rebase250820 -Ref: Information About In-Progress Rebase-Footnote-1259702 -Node: Cherry Picking260298 -Node: Reverting264629 -Node: Resetting266078 -Node: Stashing267944 -Node: Transferring272645 -Node: Remotes272867 -Node: Remote Commands273019 -Node: Remote Git Variables277100 -Node: Fetching278379 -Node: Pulling280866 -Node: Pushing281912 -Node: Plain Patches285665 -Node: Maildir Patches287156 -Node: Miscellaneous288670 -Node: Tagging288984 -Node: Notes290901 -Node: Submodules293273 -Node: Listing Submodules293491 -Node: Submodule Transient294897 -Node: Subtree297419 -Node: Worktree299395 -Node: Common Commands301254 -Node: Wip Modes303377 -Node: Wip Graph308308 -Node: Legacy Wip Modes310622 -Node: Commands for Buffers Visiting Files313517 -Node: Minor Mode for Buffers Visiting Blobs319139 -Node: Customizing319950 -Node: Per-Repository Configuration321546 -Node: Essential Settings323801 -Node: Safety324146 -Node: Performance325907 -Node: Microsoft Windows Performance333075 -Node: MacOS Performance334266 -Ref: MacOS Performance-Footnote-1335443 -Node: Default Bindings335525 -Node: Plumbing337380 -Node: Calling Git338209 -Node: Getting a Value from Git339734 -Node: Calling Git for Effect342820 -Node: Section Plumbing349342 -Node: Creating Sections349570 -Node: Section Selection353470 -Node: Matching Sections355269 -Node: Refreshing Buffers361242 -Node: Conventions364390 -Node: Theming Faces364582 -Node: FAQ372697 -Node: FAQ - How to ...?373139 -Node: How to pronounce Magit?373552 -Node: How to show git's output?374354 -Node: How to install the gitman info manual?375140 -Node: How to show diffs for gpg-encrypted files?376110 -Node: How does branching and pushing work?376706 -Node: Can Magit be used as ediff-version-control-package?377069 -Node: Should I disable VC?379087 -Node: FAQ - Issues and Errors379705 -Node: Magit is slow380601 -Node: I changed several thousand files at once and now Magit is unusable380815 -Node: I am having problems committing381544 -Node: I am using MS Windows and cannot push with Magit382025 -Node: I am using OS X and SOMETHING works in shell but not in Magit382642 -Node: Expanding a file to show the diff causes it to disappear383473 -Node: Point is wrong in the COMMIT_EDITMSG buffer384054 -Node: The mode-line information isn't always up-to-date385100 -Node: A branch and tag sharing the same name breaks SOMETHING386163 -Node: My Git hooks work on the command-line but not inside Magit387049 -Node: git-commit-mode isn't used when committing from the command-line387895 -Node: Point ends up inside invisible text when jumping to a file-visiting buffer390166 -Node: Debugging Tools390964 -Node: Keystroke Index393143 -Node: Command Index427176 -Node: Function Index464242 -Node: Variable Index480513 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/magit-20210102.1019/AUTHORS.md b/elpa/magit-20210128.1702/AUTHORS.md similarity index 99% rename from elpa/magit-20210102.1019/AUTHORS.md rename to elpa/magit-20210128.1702/AUTHORS.md index 6cde4d85..f80e262f 100644 --- a/elpa/magit-20210102.1019/AUTHORS.md +++ b/elpa/magit-20210128.1702/AUTHORS.md @@ -229,6 +229,7 @@ Contributors - Mark Karpov - Mark Oteiza - Matthew Fluet +- Matthew Kraai - Matthieu Hauglustaine - Matus Goljer - Maxim Cournoyer @@ -318,6 +319,7 @@ Contributors - Suhail Shergill - Sylvain Rousseau - Syohei Yoshida +- Szunti - Takafumi Arakaki - Tassilo Horn - Teemu Likonen diff --git a/elpa/magit-20210102.1019/LICENSE b/elpa/magit-20210128.1702/LICENSE similarity index 100% rename from elpa/magit-20210102.1019/LICENSE rename to elpa/magit-20210128.1702/LICENSE diff --git a/elpa/magit-20210102.1019/dir b/elpa/magit-20210128.1702/dir similarity index 100% rename from elpa/magit-20210102.1019/dir rename to elpa/magit-20210128.1702/dir diff --git a/elpa/magit-20210102.1019/git-rebase.el b/elpa/magit-20210128.1702/git-rebase.el similarity index 98% rename from elpa/magit-20210102.1019/git-rebase.el rename to elpa/magit-20210128.1702/git-rebase.el index f4999501..2268084e 100644 --- a/elpa/magit-20210102.1019/git-rebase.el +++ b/elpa/magit-20210128.1702/git-rebase.el @@ -1,6 +1,6 @@ ;;; git-rebase.el --- Edit Git rebase files -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -74,21 +74,13 @@ ;;; Code: -(require 'dash) +(require 'magit) + (require 'easymenu) (require 'server) (require 'with-editor) -(require 'magit) - -(and (require 'async-bytecomp nil t) - (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)) -(eval-when-compile (require 'recentf)) +(defvar recentf-exclude) ;;; Options ;;;; Variables diff --git a/elpa/magit-20210102.1019/magit-apply.el b/elpa/magit-20210128.1702/magit-apply.el similarity index 99% rename from elpa/magit-20210102.1019/magit-apply.el rename to elpa/magit-20210128.1702/magit-apply.el index 79e997a3..127b5839 100644 --- a/elpa/magit-20210102.1019/magit-apply.el +++ b/elpa/magit-20210128.1702/magit-apply.el @@ -1,6 +1,6 @@ ;;; magit-apply.el --- apply Git diffs -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -30,9 +30,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit-core) (require 'magit-diff) (require 'magit-wip) diff --git a/elpa/magit-20210102.1019/magit-autoloads.el b/elpa/magit-20210128.1702/magit-autoloads.el similarity index 99% rename from elpa/magit-20210102.1019/magit-autoloads.el rename to elpa/magit-20210128.1702/magit-autoloads.el index 82811026..9588946d 100644 --- a/elpa/magit-20210102.1019/magit-autoloads.el +++ b/elpa/magit-20210128.1702/magit-autoloads.el @@ -208,8 +208,8 @@ See `auto-revert-mode' for more information on Auto-Revert mode. Start a bisect session. Bisecting a bug means to find the commit that introduced it. -This command starts such a bisect session by asking for a know -good and a bad commit. To move the session forward use the +This command starts such a bisect session by asking for a known +good and a known bad commit. To move the session forward use the other actions from the bisect transient command (\\\\[magit-bisect]). \(fn BAD GOOD ARGS)" t nil) @@ -227,6 +227,15 @@ While bisecting, mark the current commit as bad. Use this after you have asserted that the commit does contain the bug in question." t nil) +(autoload 'magit-bisect-mark "magit-bisect" "\ +While bisecting, mark the current commit with a bisect term. +During a bisect using alternate terms, commits can still be +marked with `magit-bisect-good' and `magit-bisect-bad', as those +commands map to the correct term (\"good\" to --term-old's value +and \"bad\" to --term-new's). However, in some cases, it can be +difficult to keep that mapping straight in your head; this +command provides an interface that exposes the underlying terms." t nil) + (autoload 'magit-bisect-skip "magit-bisect" "\ While bisecting, skip the current commit. Use this if for some reason the current commit is not a good one diff --git a/elpa/magit-20210102.1019/magit-autorevert.el b/elpa/magit-20210128.1702/magit-autorevert.el similarity index 99% rename from elpa/magit-20210102.1019/magit-autorevert.el rename to elpa/magit-20210128.1702/magit-autorevert.el index 74c07210..0c99d5f4 100644 --- a/elpa/magit-20210102.1019/magit-autorevert.el +++ b/elpa/magit-20210128.1702/magit-autorevert.el @@ -1,6 +1,6 @@ ;;; magit-autorevert.el --- revert buffers when files in repository change -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -23,9 +23,6 @@ ;;; Code: -(require 'cl-lib) -(require 'dash) - (require 'magit-git) (require 'autorevert) diff --git a/elpa/magit-20210102.1019/magit-bisect.el b/elpa/magit-20210128.1702/magit-bisect.el similarity index 76% rename from elpa/magit-20210102.1019/magit-bisect.el rename to elpa/magit-20210128.1702/magit-bisect.el index 3c807f20..8bb263c7 100644 --- a/elpa/magit-20210102.1019/magit-bisect.el +++ b/elpa/magit-20210128.1702/magit-bisect.el @@ -1,6 +1,6 @@ ;;; magit-bisect.el --- bisect support for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2011-2020 The Magit Project Contributors +;; Copyright (C) 2011-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -63,7 +63,11 @@ ["Arguments" ("-n" "Don't checkout commits" "--no-checkout") ("-p" "Follow only first parent of a merge" "--first-parent" - :if (lambda () (version<= "2.29" (magit-git-version))))] + :if (lambda () (version<= "2.29" (magit-git-version)))) + (6 magit-bisect:--term-old + :if (lambda () (version<= "2.7" (magit-git-version)))) + (6 magit-bisect:--term-new + :if (lambda () (version<= "2.7" (magit-git-version))))] ["Actions" ("B" "Start" magit-bisect-start) ("s" "Start script" magit-bisect-run)]] @@ -71,17 +75,31 @@ :if magit-bisect-in-progress-p ("B" "Bad" magit-bisect-bad) ("g" "Good" magit-bisect-good) + (6 "m" "Mark" magit-bisect-mark + :if (lambda () (version<= "2.7" (magit-git-version)))) ("k" "Skip" magit-bisect-skip) ("r" "Reset" magit-bisect-reset) ("s" "Run script" magit-bisect-run)]) +(transient-define-argument magit-bisect:--term-old () + :description "Old/good term" + :class 'transient-option + :key "=o" + :argument "--term-old=") + +(transient-define-argument magit-bisect:--term-new () + :description "New/bad term" + :class 'transient-option + :key "=n" + :argument "--term-new=") + ;;;###autoload (defun magit-bisect-start (bad good args) "Start a bisect session. Bisecting a bug means to find the commit that introduced it. -This command starts such a bisect session by asking for a know -good and a bad commit. To move the session forward use the +This command starts such a bisect session by asking for a known +good and a known bad commit. To move the session forward use the other actions from the bisect transient command (\ \\\\[magit-bisect])." (interactive (if (magit-bisect-in-progress-p) @@ -89,17 +107,27 @@ other actions from the bisect transient command (\ (magit-bisect-start-read-args))) (unless (magit-rev-ancestor-p good bad) (user-error - "The good revision (%s) has to be an ancestor of the bad one (%s)" - good bad)) + "The %s revision (%s) has to be an ancestor of the %s one (%s)" + (or (transient-arg-value "--term-old=" args) "good") + good + (or (transient-arg-value "--term-new=" args) "bad") + bad)) (when (magit-anything-modified-p) (user-error "Cannot bisect with uncommitted changes")) (magit-git-bisect "start" (list args bad good) t)) (defun magit-bisect-start-read-args () - (let ((bad (magit-read-branch-or-commit "Start bisect with bad revision"))) + (let* ((args (transient-args 'magit-bisect)) + (bad (magit-read-branch-or-commit + (format "Start bisect with %s revision" + (or (transient-arg-value "--term-new=" args) + "bad"))))) (list bad - (magit-read-other-branch-or-commit "Good revision" bad) - (transient-args 'magit-bisect)))) + (magit-read-other-branch-or-commit + (format "%s revision" (or (transient-arg-value "--term-old=" args) + "Good")) + bad) + args))) ;;;###autoload (defun magit-bisect-reset () @@ -115,7 +143,8 @@ other actions from the bisect transient command (\ Use this after you have asserted that the commit does not contain the bug in question." (interactive) - (magit-git-bisect "good")) + (magit-git-bisect (or (cadr (magit-bisect-terms)) + (user-error "Not bisecting")))) ;;;###autoload (defun magit-bisect-bad () @@ -123,7 +152,28 @@ the bug in question." Use this after you have asserted that the commit does contain the bug in question." (interactive) - (magit-git-bisect "bad")) + (magit-git-bisect (or (car (magit-bisect-terms)) + (user-error "Not bisecting")))) + +;;;###autoload +(defun magit-bisect-mark () + "While bisecting, mark the current commit with a bisect term. +During a bisect using alternate terms, commits can still be +marked with `magit-bisect-good' and `magit-bisect-bad', as those +commands map to the correct term (\"good\" to --term-old's value +and \"bad\" to --term-new's). However, in some cases, it can be +difficult to keep that mapping straight in your head; this +command provides an interface that exposes the underlying terms." + (interactive) + (magit-git-bisect + (pcase-let ((`(,term-new ,term-old) (or (magit-bisect-terms) + (user-error "Not bisecting")))) + (pcase (read-char-choice + (format "Mark HEAD as %s ([n]ew) or %s ([o]ld)" + term-new term-old) + (list ?n ?o)) + (?n term-new) + (?o term-old))))) ;;;###autoload (defun magit-bisect-skip () @@ -177,6 +227,9 @@ bisect run'." (defun magit-bisect-in-progress-p () (file-exists-p (magit-git-dir "BISECT_LOG"))) +(defun magit-bisect-terms () + (magit-file-lines (magit-git-dir "BISECT_TERMS"))) + (defun magit-insert-bisect-output () "While bisecting, insert section with output from `git bisect'." (when (magit-bisect-in-progress-p) diff --git a/elpa/magit-20210102.1019/magit-blame.el b/elpa/magit-20210128.1702/magit-blame.el similarity index 99% rename from elpa/magit-20210102.1019/magit-blame.el rename to elpa/magit-20210128.1702/magit-blame.el index 651d5701..e30c4b26 100644 --- a/elpa/magit-20210102.1019/magit-blame.el +++ b/elpa/magit-20210128.1702/magit-blame.el @@ -1,6 +1,6 @@ ;;; magit-blame.el --- blame support for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2012-2020 The Magit Project Contributors +;; Copyright (C) 2012-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -28,9 +28,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Options diff --git a/elpa/magit-20210102.1019/magit-bookmark.el b/elpa/magit-20210128.1702/magit-bookmark.el similarity index 98% rename from elpa/magit-20210102.1019/magit-bookmark.el rename to elpa/magit-20210128.1702/magit-bookmark.el index bd6c6838..91380a7e 100644 --- a/elpa/magit-20210102.1019/magit-bookmark.el +++ b/elpa/magit-20210128.1702/magit-bookmark.el @@ -1,6 +1,6 @@ ;;; magit-bookmark.el --- bookmark support for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -29,9 +29,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) (require 'bookmark) diff --git a/elpa/magit-20210102.1019/magit-branch.el b/elpa/magit-20210128.1702/magit-branch.el similarity index 98% rename from elpa/magit-20210102.1019/magit-branch.el rename to elpa/magit-20210128.1702/magit-branch.el index e50c8100..c6603248 100644 --- a/elpa/magit-20210102.1019/magit-branch.el +++ b/elpa/magit-20210128.1702/magit-branch.el @@ -1,6 +1,6 @@ ;;; magit-branch.el --- branch support -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -31,9 +31,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) (require 'magit-reset) @@ -579,17 +576,18 @@ defaulting to the branch at point." (magit-run-git "branch" (if force "-D" "-d") branches)) (t ; And now for something completely different. (let* ((branch (car branches)) - (prompt (format "Branch %s is checked out. " branch))) + (prompt (format "Branch %s is checked out. " branch)) + (main (magit-main-branch))) (when (equal branch (magit-get-current-branch)) - (pcase (if (or (equal branch "master") - (not (magit-rev-verify "master"))) + (pcase (if (or (equal branch main) + (not main)) (magit-read-char-case prompt nil (?d "[d]etach HEAD & delete" 'detach) (?a "[a]bort" 'abort)) (magit-read-char-case prompt nil - (?d "[d]etach HEAD & delete" 'detach) - (?c "[c]heckout master & delete" 'master) - (?a "[a]bort" 'abort))) + (?d "[d]etach HEAD & delete" 'detach) + (?c (format "[c]heckout %s & delete" main) 'main) + (?a "[a]bort" 'abort))) (`detach (unless (or (equal force '(4)) (member branch force) (magit-branch-merged-p branch t)) @@ -597,13 +595,13 @@ defaulting to the branch at point." "Delete unmerged branch %s" "" nil (list branch))) (magit-call-git "checkout" "--detach")) - (`master (unless (or (equal force '(4)) + (`main (unless (or (equal force '(4)) (member branch force) - (magit-branch-merged-p branch "master")) + (magit-branch-merged-p branch main)) (magit-confirm 'delete-unmerged-branch "Delete unmerged branch %s" "" nil (list branch))) - (magit-call-git "checkout" "master")) + (magit-call-git "checkout" main)) (`abort (user-error "Abort"))) (setq force t)) (magit-branch-maybe-delete-pr-remote branch) diff --git a/elpa/magit-20210102.1019/magit-clone.el b/elpa/magit-20210128.1702/magit-clone.el similarity index 99% rename from elpa/magit-20210102.1019/magit-clone.el rename to elpa/magit-20210128.1702/magit-clone.el index 2417e543..3aee1a85 100644 --- a/elpa/magit-20210102.1019/magit-clone.el +++ b/elpa/magit-20210128.1702/magit-clone.el @@ -1,6 +1,6 @@ ;;; magit-clone.el --- clone a repository -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-commit.el b/elpa/magit-20210128.1702/magit-commit.el similarity index 99% rename from elpa/magit-20210102.1019/magit-commit.el rename to elpa/magit-20210128.1702/magit-commit.el index fea4928a..5e50aec2 100644 --- a/elpa/magit-20210102.1019/magit-commit.el +++ b/elpa/magit-20210128.1702/magit-commit.el @@ -1,6 +1,6 @@ ;;; magit-commit.el --- create Git commits -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -34,12 +34,11 @@ (eval-when-compile (require 'epa)) ; for `epa-protocol' (eval-when-compile (require 'epg)) -(eval-when-compile (require 'subr-x)) ;;; Options (defcustom magit-commit-ask-to-stage 'verbose - "Whether to ask to stage all unstaged changes when committing and nothing is staged." + "Whether to ask to stage everything when committing and nothing is staged." :package-version '(magit . "2.3.0") :group 'magit-commands :type '(choice (const :tag "Ask" t) diff --git a/elpa/magit-20210102.1019/magit-core.el b/elpa/magit-20210128.1702/magit-core.el similarity index 98% rename from elpa/magit-20210102.1019/magit-core.el rename to elpa/magit-20210128.1702/magit-core.el index 900f2c54..aac74643 100644 --- a/elpa/magit-20210102.1019/magit-core.el +++ b/elpa/magit-20210128.1702/magit-core.el @@ -1,6 +1,6 @@ ;;; magit-core.el --- core functionality -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-diff.el b/elpa/magit-20210128.1702/magit-diff.el similarity index 98% rename from elpa/magit-20210102.1019/magit-diff.el rename to elpa/magit-20210128.1702/magit-diff.el index f8d7849d..88f2effb 100644 --- a/elpa/magit-20210102.1019/magit-diff.el +++ b/elpa/magit-20210128.1702/magit-diff.el @@ -1,6 +1,6 @@ ;;; magit-diff.el --- inspect Git diffs -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -28,12 +28,12 @@ ;;; Code: -(eval-when-compile - (require 'ansi-color) - (require 'subr-x)) - -(require 'git-commit) (require 'magit-core) +(require 'git-commit) + +(eval-when-compile (require 'ansi-color)) +(require 'diff-mode) +(require 'smerge-mode) ;; For `magit-diff-popup' (declare-function magit-stash-show "magit-stash" (stash &optional args files)) @@ -66,9 +66,6 @@ (cl-pushnew 'action-type eieio--known-slot-names) (cl-pushnew 'target eieio--known-slot-names)) -(require 'diff-mode) -(require 'smerge-mode) - ;;; Options ;;;; Diff Mode @@ -283,6 +280,20 @@ that many spaces. Otherwise, highlight neither." :group 'magit-diff :type 'boolean) +(defcustom magit-diff-extra-stat-arguments nil + "Additional arguments to be used alongside `--stat'. + +A list of zero or more arguments or a function that takes no +argument and returns such a list. These arguments are allowed +here: `--stat-width', `--stat-name-width', `--stat-graph-width' +and `--compact-summary'. See the git-diff(1) manpage." + :package-version '(magit . "3.0.0") + :group 'magit-diff + :type '(radio (function-item magit-diff-use-window-width-as-stat-width) + function + (list string) + (const :tag "None" nil))) + ;;;; File Diff (defcustom magit-diff-buffer-file-locked t @@ -1399,12 +1410,12 @@ instead." (defun magit-diff-less-context (&optional count) "Decrease the context for diff hunks by COUNT lines." (interactive "p") - (magit-diff-set-context `(lambda (cur) (max 0 (- (or cur 0) ,count))))) + (magit-diff-set-context (lambda (cur) (max 0 (- (or cur 0) count))))) (defun magit-diff-more-context (&optional count) "Increase the context for diff hunks by COUNT lines." (interactive "p") - (magit-diff-set-context `(lambda (cur) (+ (or cur 0) ,count)))) + (magit-diff-set-context (lambda (cur) (+ (or cur 0) count)))) (defun magit-diff-default-context () "Reset context for diff hunks to the default height." @@ -1924,8 +1935,10 @@ Staging and applying changes is documented in info node (defvar magit-diff-section-base-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-j") 'magit-diff-visit-worktree-file) - (define-key map [C-return] 'magit-diff-visit-worktree-file) + (define-key map (kbd "C-j") 'magit-diff-visit-worktree-file) + (define-key map (kbd "C-") 'magit-diff-visit-worktree-file) + (define-key map (kbd "C-x 4 ") 'magit-diff-visit-file-other-window) + (define-key map (kbd "C-x 5 ") 'magit-diff-visit-file-other-frame) (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) @@ -2006,27 +2019,42 @@ Staging and applying changes is documented in info node (defun magit--insert-diff (&rest args) (declare (indent 0)) - (let ((magit-git-global-arguments - (remove "--literal-pathspecs" magit-git-global-arguments))) - (setq args (-flatten args)) + (pcase-let ((`(,cmd . ,args) + (-flatten args)) + (magit-git-global-arguments + (remove "--literal-pathspecs" magit-git-global-arguments))) ;; As of Git 2.19.0, we need to generate diffs with ;; --ita-visible-in-index so that `magit-stage' can work with ;; intent-to-add files (see #4026). Cache the result for each ;; repo to avoid a `git version' call for every diff insertion. - (when (and (not (equal (car args) "merge-tree")) + (when (and (not (equal cmd "merge-tree")) (pcase (magit-repository-local-get 'diff-ita-kludge-p 'unset) (`unset (let ((val (version<= "2.19.0" (magit-git-version)))) (magit-repository-local-set 'diff-ita-kludge-p val) val)) (val val))) - (push "--ita-visible-in-index" (cdr args))) + (push "--ita-visible-in-index" args)) + (setq args (magit-diff--maybe-add-stat-arguments args)) (when (cl-member-if (lambda (arg) (string-prefix-p "--color-moved" arg)) args) - (push "--color=always" (cdr args)) + (push "--color=always" args) (setq magit-git-global-arguments (append magit-diff--reset-non-color-moved magit-git-global-arguments))) - (magit-git-wash #'magit-diff-wash-diffs args))) + (magit-git-wash #'magit-diff-wash-diffs cmd args))) + +(defun magit-diff--maybe-add-stat-arguments (args) + (if (member "--stat" args) + (append (if (functionp magit-diff-extra-stat-arguments) + (funcall magit-diff-extra-stat-arguments) + magit-diff-extra-stat-arguments) + args) + args)) + +(defun magit-diff-use-window-width-as-stat-width () + "Use the `window-width' as the value of `--stat-width'." + (when-let ((window (get-buffer-window (current-buffer) 'visible))) + (list (format "--stat-width=%d" (window-width window))))) (defun magit-diff-wash-diffs (args &optional limit) (run-hooks 'magit-diff-wash-diffs-hook) @@ -2293,7 +2321,7 @@ section or a child thereof." (when (looking-at "^@\\{2,\\} \\(.+?\\) @\\{2,\\}\\(?: \\(.*\\)\\)?") (let* ((heading (match-string 0)) (ranges (mapcar (lambda (str) - (mapcar (lambda (n) (string-to-number n)) + (mapcar #'string-to-number (split-string (substring str 1) ","))) (split-string (match-string 1)))) (about (match-string 2)) diff --git a/elpa/magit-20210102.1019/magit-ediff.el b/elpa/magit-20210128.1702/magit-ediff.el similarity index 99% rename from elpa/magit-20210102.1019/magit-ediff.el rename to elpa/magit-20210128.1702/magit-ediff.el index f7e21932..208ac843 100644 --- a/elpa/magit-20210102.1019/magit-ediff.el +++ b/elpa/magit-20210128.1702/magit-ediff.el @@ -1,6 +1,6 @@ ;;; magit-ediff.el --- Ediff extension for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-extras.el b/elpa/magit-20210128.1702/magit-extras.el similarity index 99% rename from elpa/magit-20210102.1019/magit-extras.el rename to elpa/magit-20210128.1702/magit-extras.el index dca43c27..1204e151 100644 --- a/elpa/magit-20210102.1019/magit-extras.el +++ b/elpa/magit-20210128.1702/magit-extras.el @@ -1,6 +1,6 @@ ;;; magit-extras.el --- additional functionality for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -24,11 +24,10 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) +(declare-function change-log-insert-entries "add-log" (changelogs)) +(declare-function diff-add-log-current-defuns "diff-mode" ()) (declare-function dired-read-shell-command "dired-aux" (prompt arg files)) ;; For `magit-project-status'. (declare-function project-root "project" (project)) diff --git a/elpa/magit-20210102.1019/magit-fetch.el b/elpa/magit-20210128.1702/magit-fetch.el similarity index 99% rename from elpa/magit-20210102.1019/magit-fetch.el rename to elpa/magit-20210128.1702/magit-fetch.el index 58cbac58..557749ee 100644 --- a/elpa/magit-20210102.1019/magit-fetch.el +++ b/elpa/magit-20210128.1702/magit-fetch.el @@ -1,6 +1,6 @@ ;;; magit-fetch.el --- download objects and refs -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-files.el b/elpa/magit-20210128.1702/magit-files.el similarity index 99% rename from elpa/magit-20210102.1019/magit-files.el rename to elpa/magit-20210128.1702/magit-files.el index 0a0a7623..70b8e95c 100644 --- a/elpa/magit-20210102.1019/magit-files.el +++ b/elpa/magit-20210128.1702/magit-files.el @@ -1,6 +1,6 @@ ;;; magit-files.el --- finding files -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -30,9 +30,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Find Blob diff --git a/elpa/magit-20210102.1019/magit-git.el b/elpa/magit-20210128.1702/magit-git.el similarity index 98% rename from elpa/magit-20210102.1019/magit-git.el rename to elpa/magit-20210128.1702/magit-git.el index a5a254d8..a6d68aeb 100644 --- a/elpa/magit-20210102.1019/magit-git.el +++ b/elpa/magit-20210128.1702/magit-git.el @@ -1,6 +1,6 @@ ;;; magit-git.el --- Git functionality -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,12 +27,6 @@ ;;; Code: -(require 'cl-lib) -(require 'dash) - -(eval-when-compile - (require 'subr-x)) - (require 'magit-utils) (require 'magit-section) @@ -1478,8 +1472,8 @@ according to the branch type." (defun magit-get-some-remote (&optional branch) (or (magit-get-remote branch) - (and (magit-branch-p "master") - (magit-get-remote "master")) + (when-let ((main (magit-main-branch))) + (magit-get-remote main)) (let ((remotes (magit-list-remotes))) (or (car (member "origin" remotes)) (car remotes))))) @@ -1786,6 +1780,27 @@ PATH has to be relative to the super-repository." (defun magit-remote-p (string) (car (member string (magit-list-remotes)))) +(defvar magit-main-branch-names + ;; These are the names that Git suggests + ;; if `init.defaultBranch' is undefined. + '("main" "master" "trunk" "development")) + +(defun magit-main-branch () + "Return the main branch. + +If a branch exists whose name that matches `init.defaultBranch' +then that is considered the main branch. If no branch by that +name exists, then the branch names in `magit-main-branch-names' +are tried in order. The first matching branch that actually +exists in the current repository is considered its main branch." + (let ((branches (magit-list-local-branch-names))) + (seq-find (lambda (name) + (member name branches)) + (delete-dups + (delq nil + (cons (magit-get "init.defaultBranch") + magit-main-branch-names)))))) + (defun magit-rev-diff-count (a b) "Return the commits in A but not B and vice versa. Return a list of two integers: (A>B B>A)." @@ -2248,9 +2263,10 @@ out. Only existing branches can be selected." (or (let ((r (car (member (magit-remote-branch-at-point) branches))) (l (car (member (magit-local-branch-at-point) branches)))) (if magit-prefer-remote-upstream (or r l) (or l r))) - (let ((r (car (member "origin/master" branches))) - (l (car (member "master" branches)))) - (if magit-prefer-remote-upstream (or r l) (or l r))) + (when-let ((main (magit-main-branch))) + (let ((r (car (member (concat "origin/" main) branches))) + (l (car (member main branches)))) + (if magit-prefer-remote-upstream (or r l) (or l r)))) (car (member (magit-get-previous-branch) branches)))))) (defun magit-read-starting-point (prompt &optional branch default) diff --git a/elpa/magit-20210102.1019/magit-gitignore.el b/elpa/magit-20210128.1702/magit-gitignore.el similarity index 98% rename from elpa/magit-20210102.1019/magit-gitignore.el rename to elpa/magit-20210128.1702/magit-gitignore.el index 6004413d..adbacb0c 100644 --- a/elpa/magit-20210102.1019/magit-gitignore.el +++ b/elpa/magit-20210128.1702/magit-gitignore.el @@ -1,6 +1,6 @@ ;;; magit-gitignore.el --- intentionally untracked files -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Transient diff --git a/elpa/magit-20210102.1019/magit-imenu.el b/elpa/magit-20210128.1702/magit-imenu.el similarity index 98% rename from elpa/magit-20210102.1019/magit-imenu.el rename to elpa/magit-20210128.1702/magit-imenu.el index bba7eed5..2eddf3cf 100644 --- a/elpa/magit-20210102.1019/magit-imenu.el +++ b/elpa/magit-20210128.1702/magit-imenu.el @@ -1,6 +1,6 @@ ;;; magit-imenu.el --- Integrate Imenu in magit major modes -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -33,9 +33,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) (require 'git-rebase) diff --git a/elpa/magit-20210102.1019/magit-log.el b/elpa/magit-20210128.1702/magit-log.el similarity index 99% rename from elpa/magit-20210102.1019/magit-log.el rename to elpa/magit-20210128.1702/magit-log.el index e166eb20..42820926 100644 --- a/elpa/magit-20210102.1019/magit-log.el +++ b/elpa/magit-20210128.1702/magit-log.el @@ -1,6 +1,6 @@ ;;; magit-log.el --- inspect Git history -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -53,9 +53,6 @@ (require 'crm) (require 'which-func) -(eval-when-compile - (require 'subr-x)) - ;;; Options ;;;; Log Mode @@ -1069,6 +1066,7 @@ Do not add this to a hook variable." (setq args (cons "--decorate=full" (remove "--decorate" args)))) (when (member "--reverse" args) (setq args (remove "--graph" args))) + (setq args (magit-diff--maybe-add-stat-arguments args)) args) "--use-mailmap" "--no-prefix" revs "--" files))) @@ -1121,7 +1119,7 @@ Do not add this to a hook variable." (defconst magit-log-bisect-log-re (concat "^# " - "\\(?3:bad:\\|skip:\\|good:\\) " ; "refs" + "\\(?3:[^: \n]+:\\) " ; "refs" "\\[\\(?1:[^]\n]+\\)\\] " ; sha1 "\\(?2:.*\\)$")) ; msg diff --git a/elpa/magit-20210102.1019/magit-margin.el b/elpa/magit-20210128.1702/magit-margin.el similarity index 98% rename from elpa/magit-20210102.1019/magit-margin.el rename to elpa/magit-20210128.1702/magit-margin.el index bd411b71..f01d63e0 100644 --- a/elpa/magit-20210102.1019/magit-margin.el +++ b/elpa/magit-20210128.1702/magit-margin.el @@ -1,6 +1,6 @@ ;;; magit-margin.el --- margins in Magit buffers -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -30,11 +30,6 @@ ;;; Code: -(require 'dash) - -(eval-when-compile - (require 'subr-x)) - (require 'magit-section) (require 'magit-transient) (require 'magit-mode) diff --git a/elpa/magit-20210102.1019/magit-merge.el b/elpa/magit-20210128.1702/magit-merge.el similarity index 97% rename from elpa/magit-20210102.1019/magit-merge.el rename to elpa/magit-20210128.1702/magit-merge.el index 4213d605..90c3a300 100644 --- a/elpa/magit-20210102.1019/magit-merge.el +++ b/elpa/magit-20210128.1702/magit-merge.el @@ -1,6 +1,6 @@ ;;; magit-merge.el --- merge functionality -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) (require 'magit-diff) @@ -171,9 +168,10 @@ then also remove the respective remote branch." (magit--merge-absorb branch args)) (defun magit--merge-absorb (branch args) - (when (equal branch "master") + (when (equal branch (magit-main-branch)) (unless (yes-or-no-p - "Do you really want to merge `master' into another branch? ") + (format "Do you really want to merge `%s' into another branch? " + branch)) (user-error "Abort"))) (if-let ((target (magit-get-push-branch branch t))) (progn @@ -196,7 +194,9 @@ then also remove the respective remote branch." (format "Merge branch '%s'%s [#%s]" branch (let ((current (magit-get-current-branch))) - (if (equal current "master") "" (format " into %s" current))) + (if (equal current (magit-main-branch)) + "" + (format " into %s" current))) pr) branch) (magit-run-git-async "merge" args "--no-edit" branch)) diff --git a/elpa/magit-20210102.1019/magit-mode.el b/elpa/magit-20210128.1702/magit-mode.el similarity index 99% rename from elpa/magit-20210102.1019/magit-mode.el rename to elpa/magit-20210128.1702/magit-mode.el index c7897b3d..96ec6321 100644 --- a/elpa/magit-20210102.1019/magit-mode.el +++ b/elpa/magit-20210128.1702/magit-mode.el @@ -1,6 +1,6 @@ ;;; magit-mode.el --- create and refresh Magit buffers -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -29,17 +29,13 @@ ;;; Code: -(require 'cl-lib) -(require 'dash) - -(eval-when-compile - (require 'subr-x)) - -(require 'transient) - (require 'magit-section) (require 'magit-git) +(require 'format-spec) +(require 'help-mode) +(require 'transient) + ;; For `magit-display-buffer-fullcolumn-most-v1' from `git-commit' (defvar git-commit-mode) ;; For `magit-refresh' @@ -57,9 +53,6 @@ ;; For `magit-mode' from `bookmark' (defvar bookmark-make-record-function) -(require 'format-spec) -(require 'help-mode) - ;;; Options (defcustom magit-mode-hook diff --git a/elpa/magit-20210102.1019/magit-notes.el b/elpa/magit-20210128.1702/magit-notes.el similarity index 99% rename from elpa/magit-20210102.1019/magit-notes.el rename to elpa/magit-20210128.1702/magit-notes.el index 99566254..aaddf7a7 100644 --- a/elpa/magit-20210102.1019/magit-notes.el +++ b/elpa/magit-20210128.1702/magit-notes.el @@ -1,6 +1,6 @@ ;;; magit-notes.el --- notes support -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-obsolete.el b/elpa/magit-20210128.1702/magit-obsolete.el similarity index 98% rename from elpa/magit-20210102.1019/magit-obsolete.el rename to elpa/magit-20210128.1702/magit-obsolete.el index d7c2f1b9..de73c4aa 100644 --- a/elpa/magit-20210102.1019/magit-obsolete.el +++ b/elpa/magit-20210128.1702/magit-obsolete.el @@ -1,6 +1,6 @@ ;;; magit-obsolete.el --- obsolete definitions -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-patch.el b/elpa/magit-20210128.1702/magit-patch.el similarity index 99% rename from elpa/magit-20210102.1019/magit-patch.el rename to elpa/magit-20210128.1702/magit-patch.el index 7b25dda5..105dec7e 100644 --- a/elpa/magit-20210102.1019/magit-patch.el +++ b/elpa/magit-20210128.1702/magit-patch.el @@ -1,6 +1,6 @@ ;;; magit-patch.el --- creating and applying patches -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Options diff --git a/elpa/magit-20210128.1702/magit-pkg.el b/elpa/magit-20210128.1702/magit-pkg.el new file mode 100644 index 00000000..f0ce4c77 --- /dev/null +++ b/elpa/magit-20210128.1702/magit-pkg.el @@ -0,0 +1,16 @@ +(define-package "magit" "20210128.1702" "A Git porcelain inside Emacs." + '((emacs "25.1") + (dash "20200524") + (git-commit "20200516") + (transient "20200601") + (with-editor "20200522")) + :commit "e80eff30d24337a75e07f6d2c154f7d82f140d28" :authors + '(("Marius Vollmer" . "marius.vollmer@gmail.com")) + :maintainer + '("Jonas Bernoulli" . "jonas@bernoul.li") + :keywords + '("git" "tools" "vc") + :url "https://github.com/magit/magit") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/magit-20210102.1019/magit-process.el b/elpa/magit-20210128.1702/magit-process.el similarity index 99% rename from elpa/magit-20210102.1019/magit-process.el rename to elpa/magit-20210128.1702/magit-process.el index 9b7030e2..034d82ec 100644 --- a/elpa/magit-20210102.1019/magit-process.el +++ b/elpa/magit-20210128.1702/magit-process.el @@ -1,6 +1,6 @@ ;;; magit-process.el --- process functionality -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -31,19 +31,14 @@ ;;; Code: -(require 'ansi-color) -(require 'cl-lib) -(require 'dash) - -(eval-when-compile - (require 'subr-x)) - -(require 'with-editor) (require 'magit-utils) (require 'magit-section) (require 'magit-git) (require 'magit-mode) +(require 'ansi-color) +(require 'with-editor) + (declare-function auth-source-search "auth-source" (&rest spec &key max require create delete &allow-other-keys)) @@ -437,7 +432,8 @@ conversion." ARGS is flattened and then used as arguments to Git. The current buffer's content is used as the process's standard -input. +input. The buffer is assumed to be temporary and thus OK to +modify. Option `magit-git-executable' specifies the Git executable and option `magit-git-global-arguments' specifies constant arguments. diff --git a/elpa/magit-20210102.1019/magit-pull.el b/elpa/magit-20210128.1702/magit-pull.el similarity index 99% rename from elpa/magit-20210102.1019/magit-pull.el rename to elpa/magit-20210128.1702/magit-pull.el index 91939d7c..ad530724 100644 --- a/elpa/magit-20210102.1019/magit-pull.el +++ b/elpa/magit-20210128.1702/magit-pull.el @@ -1,6 +1,6 @@ ;;; magit-pull.el --- update local objects and refs -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-push.el b/elpa/magit-20210128.1702/magit-push.el similarity index 99% rename from elpa/magit-20210102.1019/magit-push.el rename to elpa/magit-20210128.1702/magit-push.el index 68ca3120..ae1ec4b7 100644 --- a/elpa/magit-20210102.1019/magit-push.el +++ b/elpa/magit-20210128.1702/magit-push.el @@ -1,6 +1,6 @@ ;;; magit-push.el --- update remote objects and refs -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Commands diff --git a/elpa/magit-20210102.1019/magit-reflog.el b/elpa/magit-20210128.1702/magit-reflog.el similarity index 98% rename from elpa/magit-20210102.1019/magit-reflog.el rename to elpa/magit-20210128.1702/magit-reflog.el index 5576cdc9..427322c4 100644 --- a/elpa/magit-20210102.1019/magit-reflog.el +++ b/elpa/magit-20210128.1702/magit-reflog.el @@ -1,6 +1,6 @@ ;;; magit-reflog.el --- inspect ref history -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -30,9 +30,6 @@ (require 'magit-core) (require 'magit-log) -(eval-when-compile - (require 'subr-x)) - ;;; Options (defcustom magit-reflog-limit 256 diff --git a/elpa/magit-20210102.1019/magit-refs.el b/elpa/magit-20210128.1702/magit-refs.el similarity index 99% rename from elpa/magit-20210102.1019/magit-refs.el rename to elpa/magit-20210128.1702/magit-refs.el index d37c909f..90b08a6e 100644 --- a/elpa/magit-20210102.1019/magit-refs.el +++ b/elpa/magit-20210128.1702/magit-refs.el @@ -1,6 +1,6 @@ ;;; magit-refs.el --- listing references -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Options diff --git a/elpa/magit-20210102.1019/magit-remote.el b/elpa/magit-20210128.1702/magit-remote.el similarity index 99% rename from elpa/magit-20210102.1019/magit-remote.el rename to elpa/magit-20210128.1702/magit-remote.el index 1bc5e0e1..057c904b 100644 --- a/elpa/magit-20210102.1019/magit-remote.el +++ b/elpa/magit-20210128.1702/magit-remote.el @@ -1,6 +1,6 @@ ;;; magit-remote.el --- transfer Git commits -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-repos.el b/elpa/magit-20210128.1702/magit-repos.el similarity index 98% rename from elpa/magit-20210102.1019/magit-repos.el rename to elpa/magit-20210128.1702/magit-repos.el index b23d86a6..db438084 100644 --- a/elpa/magit-20210102.1019/magit-repos.el +++ b/elpa/magit-20210128.1702/magit-repos.el @@ -1,6 +1,6 @@ ;;; magit-repos.el --- listing repositories -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -29,9 +29,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit-core) (declare-function magit-status-setup-buffer "magit-status" (directory)) @@ -157,7 +154,10 @@ repositories are displayed." "Major mode for browsing a list of Git repositories." (setq-local x-stretch-cursor nil) (setq tabulated-list-padding 0) - (setq tabulated-list-sort-key (cons "Path" nil)) + (setq tabulated-list-sort-key + (cons (or (car (assoc "Path" magit-repolist-columns)) + (caar magit-repolist-columns)) + nil)) (setq tabulated-list-format (vconcat (mapcar (pcase-lambda (`(,title ,width ,_fn ,props)) (nconc (list title width t) diff --git a/elpa/magit-20210102.1019/magit-reset.el b/elpa/magit-20210128.1702/magit-reset.el similarity index 98% rename from elpa/magit-20210102.1019/magit-reset.el rename to elpa/magit-20210128.1702/magit-reset.el index 82d0e9a6..5a6e5389 100644 --- a/elpa/magit-20210102.1019/magit-reset.el +++ b/elpa/magit-20210128.1702/magit-reset.el @@ -1,6 +1,6 @@ ;;; magit-reset.el --- reset fuctionality -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-section.el b/elpa/magit-20210128.1702/magit-section.el similarity index 99% rename from elpa/magit-20210102.1019/magit-section.el rename to elpa/magit-20210128.1702/magit-section.el index 98f225bb..fc278359 100644 --- a/elpa/magit-20210102.1019/magit-section.el +++ b/elpa/magit-20210128.1702/magit-section.el @@ -1,6 +1,6 @@ ;;; magit-section.el --- Sections for read-only buffers -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -37,10 +37,10 @@ (require 'cl-lib) (require 'dash) (require 'eieio) +(require 'seq) +(require 'subr-x) -(eval-when-compile - (require 'benchmark) - (require 'subr-x)) +(eval-when-compile (require 'benchmark)) ;;; Hooks @@ -781,7 +781,7 @@ Sections at higher levels are hidden." With a prefix argument show the section identity instead of the section lineage. This command is intended for debugging purposes." (interactive (list (magit-current-section) current-prefix-arg)) - (let ((str (format "#<%s %S %S %s-%s>" + (let ((str (format "#<%s %S %S %s-%s%s>" (eieio-object-class section) (let ((val (oref section value))) (cond ((stringp val) @@ -796,6 +796,9 @@ section lineage. This command is intended for debugging purposes." (apply #'vector (magit-section-lineage section))) (when-let ((m (oref section start))) (marker-position m)) + (if-let ((m (oref section content))) + (format "[%s-]" (marker-position m)) + "") (when-let ((m (oref section end))) (marker-position m))))) (if (called-interactively-p 'any) diff --git a/elpa/magit-20210102.1019/magit-sequence.el b/elpa/magit-20210128.1702/magit-sequence.el similarity index 97% rename from elpa/magit-20210102.1019/magit-sequence.el rename to elpa/magit-20210128.1702/magit-sequence.el index 6ca0e9de..e96a15c6 100644 --- a/elpa/magit-20210102.1019/magit-sequence.el +++ b/elpa/magit-20210128.1702/magit-sequence.el @@ -1,6 +1,6 @@ ;;; magit-sequence.el --- history manipulation in Magit -*- lexical-binding: t -*- -;; Copyright (C) 2011-2020 The Magit Project Contributors +;; Copyright (C) 2011-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -29,9 +29,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;; For `magit-rebase--todo'. @@ -669,8 +666,13 @@ START has to be selected from a list of recent commits." (unless (member "--root" args) commit))) (magit-log-select `(lambda (commit) - (magit-rebase-interactive-1 commit (list ,@args) - ,message ,editor ,delay-edit-confirm ,noassert)) + ;; In some cases (currently just magit-rebase-remove-commit), "-c + ;; commentChar=#" is added to the global arguments for git. Ensure + ;; that the same happens when we chose the commit via + ;; magit-log-select, below. + (let ((magit-git-global-arguments (list ,@magit-git-global-arguments))) + (magit-rebase-interactive-1 commit (list ,@args) + ,message ,editor ,delay-edit-confirm ,noassert))) message))) (defvar magit--rebase-published-symbol nil) @@ -755,10 +757,14 @@ START has to be selected from a list of recent commits." "Remove a single older commit using rebase." (interactive (list (magit-commit-at-point) (magit-rebase-arguments))) - (magit-rebase-interactive-1 commit args - "Type %p on a commit to remove it," - (apply-partially #'magit-rebase--perl-editor 'remove) - nil nil t)) + ;; magit-rebase--perl-editor assumes that the comment character is "#". + (let ((magit-git-global-arguments + (nconc (list "-c" "core.commentChar=#") + magit-git-global-arguments))) + (magit-rebase-interactive-1 commit args + "Type %p on a commit to remove it," + (apply-partially #'magit-rebase--perl-editor 'remove) + nil nil t))) (defun magit-rebase--perl-editor (action since) (let ((commit (magit-rev-abbrev (magit-rebase--target-commit since)))) diff --git a/elpa/magit-20210102.1019/magit-stash.el b/elpa/magit-20210128.1702/magit-stash.el similarity index 99% rename from elpa/magit-20210102.1019/magit-stash.el rename to elpa/magit-20210128.1702/magit-stash.el index c5583fd6..2bba0e38 100644 --- a/elpa/magit-20210102.1019/magit-stash.el +++ b/elpa/magit-20210128.1702/magit-stash.el @@ -1,6 +1,6 @@ ;;; magit-stash.el --- stash support for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) (require 'magit-reflog) diff --git a/elpa/magit-20210102.1019/magit-status.el b/elpa/magit-20210128.1702/magit-status.el similarity index 99% rename from elpa/magit-20210102.1019/magit-status.el rename to elpa/magit-20210128.1702/magit-status.el index dcdab56b..99ab8f68 100644 --- a/elpa/magit-20210102.1019/magit-status.el +++ b/elpa/magit-20210128.1702/magit-status.el @@ -1,6 +1,6 @@ ;;; magit-status.el --- the grand overview -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) ;;; Options diff --git a/elpa/magit-20210102.1019/magit-submodule.el b/elpa/magit-20210128.1702/magit-submodule.el similarity index 99% rename from elpa/magit-20210102.1019/magit-submodule.el rename to elpa/magit-20210128.1702/magit-submodule.el index ca154177..832011f1 100644 --- a/elpa/magit-20210102.1019/magit-submodule.el +++ b/elpa/magit-20210128.1702/magit-submodule.el @@ -1,6 +1,6 @@ ;;; magit-submodule.el --- submodule support for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2011-2020 The Magit Project Contributors +;; Copyright (C) 2011-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -23,12 +23,10 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit) (defvar x-stretch-cursor) + ;;; Options (defcustom magit-module-sections-hook diff --git a/elpa/magit-20210102.1019/magit-subtree.el b/elpa/magit-20210128.1702/magit-subtree.el similarity index 99% rename from elpa/magit-20210102.1019/magit-subtree.el rename to elpa/magit-20210128.1702/magit-subtree.el index 005e07ed..05f44672 100644 --- a/elpa/magit-20210102.1019/magit-subtree.el +++ b/elpa/magit-20210128.1702/magit-subtree.el @@ -1,6 +1,6 @@ ;;; magit-subtree.el --- subtree support for Magit -*- lexical-binding: t -*- -;; Copyright (C) 2011-2020 The Magit Project Contributors +;; Copyright (C) 2011-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-tag.el b/elpa/magit-20210128.1702/magit-tag.el similarity index 99% rename from elpa/magit-20210102.1019/magit-tag.el rename to elpa/magit-20210128.1702/magit-tag.el index 8706981b..dbec9393 100644 --- a/elpa/magit-20210102.1019/magit-tag.el +++ b/elpa/magit-20210128.1702/magit-tag.el @@ -1,6 +1,6 @@ ;;; magit-tag.el --- tag functionality -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit-transient.el b/elpa/magit-20210128.1702/magit-transient.el similarity index 98% rename from elpa/magit-20210102.1019/magit-transient.el rename to elpa/magit-20210128.1702/magit-transient.el index 830eb507..8016182b 100644 --- a/elpa/magit-20210102.1019/magit-transient.el +++ b/elpa/magit-20210128.1702/magit-transient.el @@ -1,6 +1,6 @@ ;;; magit-transient.el --- support for transients -*- lexical-binding: t -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -28,15 +28,12 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - -(require 'transient) - (require 'magit-git) (require 'magit-mode) (require 'magit-process) +(require 'transient) + ;;; Classes (defclass magit--git-variable (transient-variable) diff --git a/elpa/magit-20210102.1019/magit-utils.el b/elpa/magit-20210128.1702/magit-utils.el similarity index 99% rename from elpa/magit-20210102.1019/magit-utils.el rename to elpa/magit-20210128.1702/magit-utils.el index 11d0bcfa..3b5dac45 100644 --- a/elpa/magit-20210102.1019/magit-utils.el +++ b/elpa/magit-20210128.1702/magit-utils.el @@ -1,6 +1,6 @@ ;;; magit-utils.el --- various utilities -*- lexical-binding: t; coding: utf-8 -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -40,9 +40,9 @@ (require 'cl-lib) (require 'dash) - -(eval-when-compile - (require 'subr-x)) +(require 'eieio) +(require 'seq) +(require 'subr-x) (require 'crm) @@ -687,9 +687,11 @@ This is similar to `read-string', but (debug (form form &rest (characterp form body)))) `(prog1 (pcase (read-char-choice (concat ,prompt - ,(concat (mapconcat 'cadr clauses ", ") - (and verbose ", or [C-g] to abort") " ")) - ',(mapcar 'car clauses)) + (mapconcat #'identity + (list ,@(mapcar #'cadr clauses)) + ", ") + ,(if verbose ", or [C-g] to abort " " ")) + ',(mapcar #'car clauses)) ,@(--map `(,(car it) ,@(cddr it)) clauses)) (message ""))) diff --git a/elpa/magit-20210102.1019/magit-wip.el b/elpa/magit-20210128.1702/magit-wip.el similarity index 99% rename from elpa/magit-20210102.1019/magit-wip.el rename to elpa/magit-20210128.1702/magit-wip.el index 3bc9dff7..8eb26caa 100644 --- a/elpa/magit-20210102.1019/magit-wip.el +++ b/elpa/magit-20210128.1702/magit-wip.el @@ -1,6 +1,6 @@ ;;; magit-wip.el --- commit snapshots to work-in-progress refs -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -30,9 +30,6 @@ ;;; Code: -(eval-when-compile - (require 'subr-x)) - (require 'magit-core) (require 'magit-log) diff --git a/elpa/magit-20210102.1019/magit-worktree.el b/elpa/magit-20210128.1702/magit-worktree.el similarity index 99% rename from elpa/magit-20210102.1019/magit-worktree.el rename to elpa/magit-20210128.1702/magit-worktree.el index 73295d63..0d95e5d3 100644 --- a/elpa/magit-20210102.1019/magit-worktree.el +++ b/elpa/magit-20210128.1702/magit-worktree.el @@ -1,6 +1,6 @@ ;;; magit-worktree.el --- worktree support -*- lexical-binding: t -*- -;; Copyright (C) 2010-2020 The Magit Project Contributors +;; Copyright (C) 2010-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. diff --git a/elpa/magit-20210102.1019/magit.el b/elpa/magit-20210128.1702/magit.el similarity index 99% rename from elpa/magit-20210102.1019/magit.el rename to elpa/magit-20210128.1702/magit.el index 720d7376..e00678f8 100644 --- a/elpa/magit-20210102.1019/magit.el +++ b/elpa/magit-20210128.1702/magit.el @@ -1,6 +1,6 @@ ;;; magit.el --- A Git porcelain inside Emacs -*- lexical-binding: t; coding: utf-8 -*- -;; Copyright (C) 2008-2020 The Magit Project Contributors +;; Copyright (C) 2008-2021 The Magit Project Contributors ;; ;; You should have received a copy of the AUTHORS.md file which ;; lists all contributors. If not, see http://magit.vc/authors. @@ -47,22 +47,17 @@ ;;; Code: -(require 'cl-lib) -(require 'dash) - -(require 'subr-x) - -(require 'with-editor) -(require 'git-commit) (require 'magit-core) (require 'magit-diff) (require 'magit-log) (require 'magit-wip) (require 'magit-apply) (require 'magit-repos) +(require 'git-commit) (require 'format-spec) (require 'package nil t) ; used in `magit-version' +(require 'with-editor) (defconst magit--minimal-git "2.2.0") (defconst magit--minimal-emacs "25.1") @@ -541,7 +536,7 @@ and Emacs to it." (setq magit-version 'error) (when magit-version (push magit-version debug)) - (unless (equal (getenv "TRAVIS") "true") + (unless (equal (getenv "CI") "true") ;; The repository is a sparse clone. (message "Cannot determine Magit's version %S" debug))) magit-version)) @@ -596,7 +591,7 @@ https://github.com/magit/magit/wiki/Don't-set-$GIT_DIR-and-alike" val)) (let ((version (magit-git-version))) (when (and version (version< version magit--minimal-git) - (not (equal (getenv "TRAVIS") "true"))) + (not (equal (getenv "CI") "true"))) (display-warning 'magit (format "\ Magit requires Git >= %s, you are using %s. diff --git a/elpa/magit-20210128.1702/magit.info b/elpa/magit-20210128.1702/magit.info new file mode 100644 index 00000000..3477bfd8 --- /dev/null +++ b/elpa/magit-20210128.1702/magit.info @@ -0,0 +1,195 @@ +This is magit.info, produced by makeinfo version 6.5 from magit.texi. + + Copyright (C) 2015-2021 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: 301131 + +Tag Table: +(Indirect) +Node: Top754 +Node: Introduction6512 +Node: Installation11235 +Node: Installing from Melpa11565 +Node: Installing from the Git Repository12638 +Node: Post-Installation Tasks15370 +Node: Getting Started16655 +Node: Interface Concepts21895 +Node: Modes and Buffers22256 +Node: Switching Buffers24005 +Node: Naming Buffers28756 +Node: Quitting Windows32063 +Node: Automatic Refreshing of Magit Buffers33809 +Node: Automatic Saving of File-Visiting Buffers36661 +Node: Automatic Reverting of File-Visiting Buffers37846 +Node: Risk of Reverting Automatically42841 +Node: Sections45223 +Node: Section Movement46149 +Node: Section Visibility51059 +Node: Section Hooks57136 +Node: Section Types and Values59543 +Node: Section Options60846 +Node: Transient Commands61318 +Node: Transient Arguments and Buffer Variables62555 +Node: Completion Confirmation and the Selection69573 +Node: Action Confirmation70017 +Node: Completion and Confirmation77833 +Node: The Selection81019 +Node: The hunk-internal region83918 +Node: Support for Completion Frameworks85007 +Node: Additional Completion Options89914 +Node: Running Git90513 +Node: Viewing Git Output90786 +Node: Git Process Status91919 +Node: Running Git Manually92884 +Node: Git Executable95354 +Node: Global Git Arguments97636 +Node: Inspecting98442 +Node: Status Buffer99599 +Node: Status Sections103589 +Node: Status Header Sections109141 +Node: Status Module Sections111771 +Node: Status Options114276 +Node: Repository List115745 +Node: Logging118783 +Node: Refreshing Logs121344 +Node: Log Buffer122790 +Node: Log Margin126646 +Node: Select from Log129825 +Node: Reflog132050 +Node: Cherries133707 +Node: Diffing135555 +Node: Refreshing Diffs138634 +Node: Commands Available in Diffs142213 +Node: Diff Options144749 +Node: Revision Buffer150230 +Node: Ediffing153560 +Node: References Buffer157208 +Node: References Sections167728 +Node: Bisecting168589 +Node: Visiting Files and Blobs170941 +Node: General-Purpose Visit Commands171411 +Node: Visiting Files and Blobs from a Diff172367 +Node: Blaming175826 +Node: Manipulating182167 +Node: Creating Repository182509 +Node: Cloning Repository183064 +Node: Staging and Unstaging188469 +Node: Staging from File-Visiting Buffers192552 +Node: Applying193720 +Node: Committing195613 +Node: Initiating a Commit196196 +Node: Editing Commit Messages199581 +Node: Using the Revision Stack202384 +Node: Commit Pseudo Headers205435 +Node: Commit Mode and Hooks206771 +Node: Commit Message Conventions209709 +Node: Branching211837 +Node: The Two Remotes212063 +Node: Branch Commands214716 +Node: Branch Git Variables227097 +Node: Auxiliary Branch Commands232488 +Node: Merging233606 +Node: Resolving Conflicts237614 +Node: Rebasing242615 +Node: Editing Rebase Sequences247474 +Node: Information About In-Progress Rebase251802 +Ref: Information About In-Progress Rebase-Footnote-1260684 +Node: Cherry Picking261280 +Node: Reverting265611 +Node: Resetting267060 +Node: Stashing268926 +Node: Transferring273627 +Node: Remotes273849 +Node: Remote Commands274001 +Node: Remote Git Variables278082 +Node: Fetching279361 +Node: Pulling281848 +Node: Pushing282894 +Node: Plain Patches286647 +Node: Maildir Patches288138 +Node: Miscellaneous289652 +Node: Tagging289966 +Node: Notes291883 +Node: Submodules294255 +Node: Listing Submodules294473 +Node: Submodule Transient295879 +Node: Subtree298401 +Node: Worktree301131 +Node: Common Commands302236 +Node: Wip Modes304359 +Node: Wip Graph309290 +Node: Legacy Wip Modes311604 +Node: Commands for Buffers Visiting Files314499 +Node: Minor Mode for Buffers Visiting Blobs320121 +Node: Customizing320932 +Node: Per-Repository Configuration322528 +Node: Essential Settings324783 +Node: Safety325128 +Node: Performance326889 +Node: Microsoft Windows Performance334057 +Node: MacOS Performance335248 +Ref: MacOS Performance-Footnote-1336425 +Node: Default Bindings336507 +Node: Plumbing338362 +Node: Calling Git339191 +Node: Getting a Value from Git340716 +Node: Calling Git for Effect343802 +Node: Section Plumbing350079 +Node: Creating Sections350307 +Node: Section Selection354207 +Node: Matching Sections356006 +Node: Refreshing Buffers361979 +Node: Conventions365127 +Node: Theming Faces365319 +Node: FAQ373434 +Node: FAQ - How to ...?373876 +Node: How to pronounce Magit?374289 +Node: How to show git's output?375091 +Node: How to install the gitman info manual?375877 +Node: How to show diffs for gpg-encrypted files?376847 +Node: How does branching and pushing work?377443 +Node: Can Magit be used as ediff-version-control-package?377806 +Node: Should I disable VC?379824 +Node: FAQ - Issues and Errors380442 +Node: Magit is slow381338 +Node: I changed several thousand files at once and now Magit is unusable381552 +Node: I am having problems committing382281 +Node: I am using MS Windows and cannot push with Magit382762 +Node: I am using OS X and SOMETHING works in shell but not in Magit383379 +Node: Expanding a file to show the diff causes it to disappear384210 +Node: Point is wrong in the COMMIT_EDITMSG buffer384791 +Node: The mode-line information isn't always up-to-date385837 +Node: A branch and tag sharing the same name breaks SOMETHING386900 +Node: My Git hooks work on the command-line but not inside Magit387786 +Node: git-commit-mode isn't used when committing from the command-line388632 +Node: Point ends up inside invisible text when jumping to a file-visiting buffer390903 +Node: Debugging Tools391701 +Node: Keystroke Index393880 +Node: Command Index427986 +Node: Function Index465125 +Node: Variable Index481396 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20210102.1019/magit.info-1 b/elpa/magit-20210128.1702/magit.info-1 similarity index 99% rename from elpa/magit-20210102.1019/magit.info-1 rename to elpa/magit-20210128.1702/magit.info-1 index 04f66c6f..7431b26a 100644 --- a/elpa/magit-20210102.1019/magit.info-1 +++ b/elpa/magit-20210128.1702/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-1133-g2fb44690b+1). +This manual is for Magit version 2.90.1 (v2.90.1-1157-g10a931f15+1). Copyright (C) 2015-2021 Jonas Bernoulli @@ -3858,6 +3858,17 @@ File: magit.info, Node: Diff Options, Next: Revision Buffer, Prev: Commands A dimmed at all depends on ‘magit-diff-highlight-hunk-region-functions’. + -- User Option: magit-diff-extra-stat-arguments + + This option specifies additional arguments to be used alongside + ‘--stat’. + + The value is a list of zero or more arguments or a function that + takes no argument and returns such a list. These arguments are + allowed here: ‘--stat-width’, ‘--stat-name-width’, + ‘--stat-graph-width’ and ‘--compact-summary’. Also see *note + (gitman)git-diff::. +  File: magit.info, Node: Revision Buffer, Prev: Diff Options, Up: Diffing @@ -4349,8 +4360,11 @@ following suffix commands. Start a bisect session. Bisecting a bug means to find the commit that introduced it. This - command starts such a bisect session by asking for a known good and - a bad commit. + command starts such a bisect session by asking for a known good + commit and a known bad commit. If you’re bisecting a change that + isn’t a regression, you can select alternate terms that are + conceptually more fitting than "bad" and "good", but the infix + arguments to do so are disabled by default. ‘B s’ (‘magit-bisect-run’) @@ -4369,6 +4383,13 @@ following suffix commands. Mark the current commit as good. Use this after you have asserted that the commit does not contain the bug in question. +‘B m’ (‘magit-bisect-mark’) + + Mark the current commit with one of the bisect terms. This command + provides an alternative to ‘magit-bisect-bad’ and + ‘magit-bisect-good’ and is useful when using terms other than "bad" + and "good". This suffix is disabled by default. + ‘B k’ (‘magit-bisect-skip’) Skip the current commit. Use this if for some reason the current @@ -7748,41 +7769,3 @@ Also see *note (gitman)git-subtree::. This command extracts the history of the subtree PREFIX. - -File: magit.info, Node: Worktree, Next: Common Commands, Prev: Subtree, Up: Miscellaneous - -8.5 Worktree -============ - -Also see *note (gitman)git-worktree::. - -‘%’ (‘magit-worktree’) - - This transient prefix command binds the following suffix commands - and displays them in a temporary buffer until a suffix is invoked. - -‘% b’ (‘magit-worktree-checkout’) - - Checkout BRANCH in a new worktree at PATH. - -‘% c’ (‘magit-worktree-branch’) - - 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 - primary worktree cannot be deleted. - -‘% g’ (‘magit-worktree-status’) - - Show the status for the worktree at point. - - If there is no worktree at point, then read one in the minibuffer. - If the worktree at point is the one whose status is already being - displayed in the current buffer, then show it in Dired instead. - diff --git a/elpa/magit-20210102.1019/magit.info-2 b/elpa/magit-20210128.1702/magit.info-2 similarity index 99% rename from elpa/magit-20210102.1019/magit.info-2 rename to elpa/magit-20210128.1702/magit.info-2 index bb6e5dae..0b8d3c80 100644 --- a/elpa/magit-20210102.1019/magit.info-2 +++ b/elpa/magit-20210128.1702/magit.info-2 @@ -17,6 +17,44 @@ START-INFO-DIR-ENTRY * Magit: (magit). Using Git from Emacs with Magit. END-INFO-DIR-ENTRY + +File: magit.info, Node: Worktree, Next: Common Commands, Prev: Subtree, Up: Miscellaneous + +8.5 Worktree +============ + +Also see *note (gitman)git-worktree::. + +‘%’ (‘magit-worktree’) + + This transient prefix command binds the following suffix commands + and displays them in a temporary buffer until a suffix is invoked. + +‘% b’ (‘magit-worktree-checkout’) + + Checkout BRANCH in a new worktree at PATH. + +‘% c’ (‘magit-worktree-branch’) + + 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 + primary worktree cannot be deleted. + +‘% g’ (‘magit-worktree-status’) + + Show the status for the worktree at point. + + If there is no worktree at point, then read one in the minibuffer. + If the worktree at point is the one whose status is already being + displayed in the current buffer, then show it in Dired instead. +  File: magit.info, Node: Common Commands, Next: Wip Modes, Prev: Worktree, Up: Miscellaneous @@ -1071,21 +1109,15 @@ refresh because that also automatically moves to the next change. Calls git synchronously with ARGS and then refreshes. - -- Function: magit-run-git-with-input input &rest args - - Calls git synchronously with ARGS and sends it INPUT on standard - input. - - INPUT should be a buffer or the name of an existing buffer. The - content of that buffer is used as the process’s standard input. - After the process returns a refresh is performed. + -- Function: magit-run-git-with-input &rest args - As a special case, INPUT may also be nil. In that case the content - of the current buffer is used as standard input and *no* refresh is - performed. + Calls git synchronously with ARGS and sends it the content of the + current buffer on standard input. - This function actually runs git asynchronously. But then it waits - for the process to return, so the function itself is synchronous. + If the current buffer’s ‘default-directory’ is on a remote + filesystem, this function actually runs git asynchronously. But + then it waits for the process to return, so the function itself is + synchronous. -- Function: magit-run-git-with-logfile file &rest args @@ -1136,7 +1168,7 @@ refresh because that also automatically moves to the next change. current when this function was called (if it is a Magit buffer and still alive), as well as the respective Magit status buffer. - -- Function: magit-start-git &rest args + -- Function: magit-start-git input &rest args Start Git, prepare for refresh, and return the process object. @@ -2210,18 +2242,19 @@ Appendix C Keystroke Index * b <2>: Editing Rebase Sequences. (line 85) * B B: Bisecting. (line 16) -* B b: Bisecting. (line 31) +* B b: Bisecting. (line 34) * b b: Branch Commands. (line 49) * b C: Branch Commands. (line 29) * b c: Branch Commands. (line 67) -* B g: Bisecting. (line 36) -* B k: Bisecting. (line 41) +* B g: Bisecting. (line 39) +* B k: Bisecting. (line 51) * b k: Branch Commands. (line 147) * b l: Branch Commands. (line 74) +* B m: Bisecting. (line 44) * b n: Branch Commands. (line 57) -* B r: Bisecting. (line 47) +* B r: Bisecting. (line 57) * b r: Branch Commands. (line 153) -* B s: Bisecting. (line 24) +* B s: Bisecting. (line 27) * b s: Branch Commands. (line 97) * b S: Branch Commands. (line 125) * b x: Branch Commands. (line 131) @@ -2708,11 +2741,12 @@ Appendix D Command Index * magit-am-skip: Maildir Patches. (line 38) * magit-apply: Applying. (line 33) * magit-bisect: Bisecting. (line 8) -* magit-bisect-bad: Bisecting. (line 31) -* magit-bisect-good: Bisecting. (line 36) -* magit-bisect-reset: Bisecting. (line 47) -* magit-bisect-run: Bisecting. (line 24) -* magit-bisect-skip: Bisecting. (line 41) +* magit-bisect-bad: Bisecting. (line 34) +* magit-bisect-good: Bisecting. (line 39) +* magit-bisect-mark: Bisecting. (line 44) +* magit-bisect-reset: Bisecting. (line 57) +* magit-bisect-run: Bisecting. (line 27) +* magit-bisect-skip: Bisecting. (line 51) * magit-bisect-start: Bisecting. (line 16) * magit-blame: Blaming. (line 18) * magit-blame <1>: Blaming. (line 102) @@ -3228,7 +3262,7 @@ Appendix E Function Index (line 17) * magit-get-section: Matching Sections. (line 16) * magit-git: Calling Git for Effect. - (line 65) + (line 59) * magit-git-exit-code: Getting a Value from Git. (line 10) * magit-git-failure: Getting a Value from Git. @@ -3250,7 +3284,7 @@ Appendix E Function Index * magit-git-true: Getting a Value from Git. (line 24) * magit-git-wash: Calling Git for Effect. - (line 70) + (line 64) * magit-hunk-set-window-start: Section Movement. (line 51) * magit-ido-completing-read: Support for Completion Frameworks. (line 48) @@ -3347,13 +3381,13 @@ Appendix E Function Index * magit-run-git: Calling Git for Effect. (line 36) * magit-run-git-async: Calling Git for Effect. - (line 80) + (line 74) * magit-run-git-with-editor: Calling Git for Effect. - (line 93) + (line 87) * magit-run-git-with-input: Calling Git for Effect. (line 40) * magit-run-git-with-logfile: Calling Git for Effect. - (line 56) + (line 50) * magit-save-window-configuration: Switching Buffers. (line 89) * magit-section-case: Matching Sections. (line 71) * magit-section-hide: Section Visibility. (line 49) @@ -3367,9 +3401,9 @@ Appendix E Function Index * magit-section-toggle-children: Section Visibility. (line 68) * magit-section-value-if: Matching Sections. (line 61) * magit-start-git: Calling Git for Effect. - (line 105) + (line 99) * magit-start-process: Calling Git for Effect. - (line 124) + (line 118) * magit-stashes-maybe-update-stash-buffer: Section Movement. (line 106) * magit-status-maybe-update-blob-buffer: Section Movement. (line 100) * magit-status-maybe-update-revision-buffer: Section Movement. @@ -3446,7 +3480,7 @@ Appendix F Variable Index (line 17) * magit-auto-revert-tracked-only: Automatic Reverting of File-Visiting Buffers. (line 55) -* magit-bisect-show-graph: Bisecting. (line 55) +* magit-bisect-show-graph: Bisecting. (line 65) * magit-blame-disable-modes: Blaming. (line 165) * magit-blame-echo-style: Blaming. (line 148) * magit-blame-goto-chunk-hook: Blaming. (line 171) @@ -3476,6 +3510,7 @@ Appendix F Variable Index * magit-diff-adjust-tab-width: Diff Options. (line 21) * magit-diff-buffer-file-locked: Commands for Buffers Visiting Files. (line 61) +* magit-diff-extra-stat-arguments: Diff Options. (line 128) * magit-diff-hide-trailing-cr-characters: Diff Options. (line 90) * magit-diff-highlight-hunk-region-functions: Diff Options. (line 94) * magit-diff-highlight-indentation: Diff Options. (line 75) @@ -3530,7 +3565,7 @@ Appendix F Variable Index * magit-prefix-use-buffer-arguments: Transient Arguments and Buffer Variables. (line 64) * magit-process-raise-error: Calling Git for Effect. - (line 151) + (line 145) * magit-pull-or-fetch: Fetching. (line 59) * magit-reflog-margin: Reflog. (line 23) * magit-refresh-args: Refreshing Buffers. (line 55) @@ -3575,7 +3610,7 @@ Appendix F Variable Index * magit-status-sections-hook: Status Sections. (line 10) * magit-submodule-list-columns: Listing Submodules. (line 21) * magit-this-process: Calling Git for Effect. - (line 146) + (line 140) * magit-uniquify-buffer-names: Naming Buffers. (line 74) * magit-unstage-committed: Staging and Unstaging. (line 56) diff --git a/elpa/magit-todos-20200128.828/magit-todos-autoloads.el b/elpa/magit-todos-20200128.828/magit-todos-autoloads.el deleted file mode 100644 index ac45b3e8..00000000 --- a/elpa/magit-todos-20200128.828/magit-todos-autoloads.el +++ /dev/null @@ -1,48 +0,0 @@ -;;; magit-todos-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(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)) -;;; Generated autoloads from magit-todos.el - -(defvar magit-todos-mode nil "\ -Non-nil if Magit-Todos mode is enabled. -See the `magit-todos-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `magit-todos-mode'.") - -(custom-autoload 'magit-todos-mode "magit-todos" nil) - -(autoload 'magit-todos-mode "magit-todos" "\ -Show list of to-do items in Magit status buffer for tracked files in repo. - -\(fn &optional ARG)" t nil) - -(autoload 'magit-todos-list "magit-todos" "\ -Show to-do list of the current Git repository in a buffer. -With prefix, prompt for repository. - -\(fn &optional DIRECTORY)" t nil) - -(autoload 'magit-todos-list-internal "magit-todos" "\ -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-20200128.828/magit-todos-pkg.el b/elpa/magit-todos-20200128.828/magit-todos-pkg.el deleted file mode 100644 index 189b1043..00000000 --- a/elpa/magit-todos-20200128.828/magit-todos-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "magit-todos" "20200128.828" "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 "5d42e20b47daf844ac42d4d5aa93d3a75958eee7" :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-20200128.828/magit-todos.el b/elpa/magit-todos-20200128.828/magit-todos.el deleted file mode 100644 index dda0b418..00000000 --- a/elpa/magit-todos-20200128.828/magit-todos.el +++ /dev/null @@ -1,1438 +0,0 @@ -;;; magit-todos.el --- Show source file TODOs in Magit -*- lexical-binding: t; -*- - -;; Copyright (C) 2018 Adam Porter - -;; Author: Adam Porter -;; URL: http://github.com/alphapapa/magit-todos -;; Package-Version: 20200128.828 -;; Version: 1.5 -;; 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 - -;;; Commentary: - -;; This package displays keyword entries from source code comments and Org files -;; in the Magit status buffer. Activating an item jumps to it in its file. By -;; default, it uses keywords from `hl-todo', minus a few (like "NOTE"). - -;;;; Usage: - -;; Run `magit-todos-mode', then open a Magit status buffer. - -;;;; Tips: - -;; + You can customize settings in the `magit-todos' group. - -;;; Installation: - -;;;; MELPA - -;; If you installed from MELPA, you're done. - -;;;; Manual - -;; Install these required packages: - -;; async -;; dash -;; f -;; hl-todo -;; magit -;; pcre2el -;; s - -;; Then put this file in your load-path, and put this in your init file: - -;; (require 'magit-todos) - -;;; License: - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Code: - -;;;; Requirements - -(require 'cl-lib) -(require 'org) -(require 'grep) -(require 'seq) - -(require 'async) -(require 'dash) -(require 'f) -(require 'hl-todo) -(require 'magit) -(require 'pcre2el) -(require 's) - -;;;; Structs - -(cl-defstruct magit-todos-item - filename org-level line column position keyword suffix description) - -;;;; Variables - -(defvar magit-todos-keywords-list nil - "List of to-do keywords. -Set automatically by `magit-todos-keywords' customization.") - -(defvar magit-todos-grep-result-regexp nil - "Regular expression for grep results. -This should be set automatically by customizing -`magit-todos-keywords'.") - -(defvar magit-todos-ag-result-regexp nil - "Regular expression for ag results. -This should be set automatically by customizing -`magit-todos-keywords'.") - -(defvar magit-todos-rg-result-regexp nil - "Regular expression for rg results. -This should be set automatically by customizing -`magit-todos-keywords'.") - -(defvar magit-todos-git-grep-result-regexp nil - "Regular expression for git-grep results. -This should be set automatically by customizing -`magit-todos-keywords'.") - -(defvar magit-todos-search-regexp nil - "Regular expression to match keyword items with rg, ag, and git-grep. -This should be set automatically by customizing -`magit-todos-keywords'.") - -(defvar-local magit-todos-active-scan nil - "The current scan's process. -Used to avoid running multiple simultaneous scans for a -magit-status buffer.") - -(defvar magit-todos-section-map - (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-branch-list-toggle) - (define-key map "B" #'magit-todos-branch-list-set-commit) - (define-key map [remap magit-visit-thing] #'magit-todos-list) - map) - "Keymap for `magit-todos' top-level section.") - -(defvar magit-todos-item-section-map - (let ((map (copy-keymap magit-todos-section-map))) - (define-key map [remap magit-visit-thing] #'magit-todos-jump-to-item) - (define-key map [remap magit-diff-show-or-scroll-up] #'magit-todos-peek-at-item) - map) - "Keymap for `magit-todos' individual to-do item sections. -See https://magit.vc/manual/magit/Creating-Sections.html for more -details about how section maps work.") - -(defvar-local magit-todos-show-filenames nil - "Whether to show filenames next to to-do items. -Set automatically depending on grouping.") - -(defvar-local magit-todos-updating nil - "Whether items are being updated now.") - -(defvar-local magit-todos-last-update-time nil - "When the items were last updated. -A time value as returned by `current-time'.") - -(defvar-local magit-todos-item-cache nil - "Items found by most recent scan.") - -(defvar magit-todos-scanners nil - "Scanners defined by `magit-todos-defscanner'.") - -(defvar magit-todos-section-heading "TODOs" - "Allows overriding of section heading.") - -;;;; Customization - -(defgroup magit-todos nil - "Show TODO items in source code comments in repos' files." - :group 'magit) - -(defcustom magit-todos-scanner nil - "File scanning method. -\"Automatic\" will attempt to use rg, ag, git-grep, and -find-grep, in that order. " - :type '(choice (const :tag "Automatic" nil) - (function :tag "Custom function")) - :set (lambda (option value) - (when magit-todos-scanners - ;; Only try to set when scanners are defined. - (unless value - ;; Choosing automatically - (setq value (or (magit-todos--choose-scanner) - (progn - (display-warning 'magit-todos - "`magit-todos' was unable to find a suitable scanner. Please install \"rg\", or a PCRE-compatible version of \"git\" or \"grep\". Disabling `magit-todos-mode'." - :error) - (magit-todos-mode -1) - nil)))) - (set-default option value)))) - -(defcustom magit-todos-nice t - "Run scanner with \"nice\"." - :type 'boolean) - -(defcustom magit-todos-ignore-case nil - "Upcase keywords found in files. -If nil, a keyword like \"Todo:\" will not be shown. `upcase' can -be a relatively expensive function, so this can be disabled if -necessary." - :type 'boolean) - -(defcustom magit-todos-update t - "When or how often to scan for to-dos. -When set to manual updates, the list can be updated with the -command `magit-todos-update'. When caching is enabled, scan for -items whenever the Magit status buffer is refreshed and at least -N seconds have passed since the last scan; otherwise, use cached -items." - :type '(choice (const :tag "Automatically, when the Magit status buffer is refreshed" t) - (integer :tag "Automatically, but cache items for N seconds") - (const :tag "Manually" nil))) - -(defcustom magit-todos-fontify-keyword-headers t - "Apply keyword faces to group keyword headers." - :type 'boolean) - -(defcustom magit-todos-keyword-suffix (rx (optional "(" (1+ (not (any ")"))) ")") ":") - "Regular expression matching suffixes after keywords. -e.g. to match a keyword like \"TODO(user):\", use \"([^)]+):\". - -If the suffix should be optional, the entire regexp should be -made explicitly optional. However, it is not necessary to -account for optional whitespace after the suffix, as this is done -automatically. - -Note: the suffix applies only to non-Org files." - :type `(choice (const :tag "Optional username in parens, then required colon (matching e.g. \"TODO:\" or \"TODO(user):\")" - ,(rx (optional "(" (1+ (not (any ")"))) ")") ":")) - (const :tag "Required colon (matching e.g. \"TODO:\"" ":") - (string :tag "Custom regexp")) - :package-version '(magit-todos . "1.2")) - -(defcustom magit-todos-ignored-keywords '("NOTE" "DONE") - "Ignored keywords. Automatically removed from `magit-todos-keywords'." - :type '(repeat string) - :set (lambda (option value) - (set-default option value) - (when (boundp 'magit-todos-keywords) - ;; Avoid setting `magit-todos-keywords' before it's defined. - - ;; HACK: Testing with `fboundp' is the only way I have been able to find that fixes this - ;; problem. I tried using ":set-after '(magit-todos-ignored-keywords)" on - ;; `magit-todos-keywords', but it had no effect. I looked in the manual, which seems to - ;; suggest that using ":initialize 'custom-initialize-safe-set" might fix it--but that - ;; function is no longer to be found in the Emacs source tree. It was committed in 2005, - ;; and now it's gone, but the manual still mentions it. ??? - (custom-reevaluate-setting 'magit-todos-keywords)))) - -(defcustom magit-todos-keywords 'hl-todo-keyword-faces - "To-do keywords to display in Magit status buffer. -If set to a list variable, may be a plain list or an alist in -which the keys are the keywords. - -When set, sets `magit-todos-search-regexp' to the appropriate -regular expression." - :type '(choice (repeat :tag "Custom list" string) - (const :tag "Keywords from `hl-todo'" hl-todo-keyword-faces) - (variable :tag "List variable")) - :set (lambda (option value) - (set-default option value) - (let ((keywords (cl-typecase value - (null (user-error "Please add some keywords")) - (symbol (if (and (consp (symbol-value value)) - (consp (car (symbol-value value)))) - (mapcar #'car (symbol-value value)) - (symbol-value value))) - (list value)))) - (setq magit-todos-keywords-list (seq-difference keywords magit-todos-ignored-keywords))))) - -(defcustom magit-todos-max-items 10 - "Automatically collapse the section if there are more than this many items." - :type 'integer) - -(defcustom magit-todos-auto-group-items 20 - "Whether or when to automatically group items." - :type '(choice (integer :tag "When there are more than this many items") - (const :tag "Always" always) - (const :tag "Never" never))) - -(defcustom magit-todos-buffer-item-factor 10 - "Multiply `magit-todos-auto-group-items' and `magit-todos-max-items' by this factor in dedicated `magit-todos' buffers." - :type 'integer) - -(defcustom magit-todos-group-by '(magit-todos-item-keyword magit-todos-item-filename) - "How to group items. -One or more attributes may be chosen, and they will be grouped in -order." - :type '(repeat (choice (const :tag "By filename" magit-todos-item-filename) - (const :tag "By keyword" magit-todos-item-keyword) - (const :tag "By suffix" magit-todos-item-suffix) - (const :tag "By first path component" magit-todos-item-first-path-component)))) - -(defcustom magit-todos-fontify-org t - "Fontify items from Org files as Org headings." - :type 'boolean) - -(defcustom magit-todos-sort-order '(magit-todos--sort-by-keyword - magit-todos--sort-by-filename - magit-todos--sort-by-position) - "Order in which to sort items." - :type '(repeat (choice (const :tag "Keyword" magit-todos--sort-by-keyword) - (const :tag "Suffix" magit-todos--sort-by-suffix) - (const :tag "Filename" magit-todos--sort-by-filename) - (const :tag "Buffer position" magit-todos--sort-by-position) - (function :tag "Custom function")))) - -(defcustom magit-todos-depth nil - "Maximum depth of files in repo working tree to scan for to-dos. -A value of 0 means to search only the current directory, while a -value of 1 means to search directories one level deeper, etc. -Deeper scans can be slow in large projects. You may wish to set -this in a directory-local variable for certain projects." - :type '(choice (const :tag "Unlimited" nil) - (const :tag "Repo root directory only" 0) - (integer :tag "N levels below the repo root"))) - -(defcustom magit-todos-insert-at 'bottom - "Insert the to-dos section after this section in the Magit status buffer. -Specific sections may be chosen, using the first symbol returned -by evaluating \"(magit-section-ident (magit-current-section))\" -in the status buffer with point on the desired section, -e.g. `recent' for the \"Recent commits\" section. Note that this -may not work exactly as desired when the built-in scanner is -used." - :type '(choice (const :tag "Top" top) - (const :tag "Bottom" bottom) - (const :tag "After untracked files" untracked) - (const :tag "After unstaged files" unstaged) - (symbol :tag "After selected section"))) - -(defcustom magit-todos-exclude-globs nil - "Glob patterns to exclude from searches." - :type '(repeat string)) - -(defcustom magit-todos-branch-list 'branch - "Show branch diff to-do list. - -This can be toggled locally in Magit buffers with command -`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-merge-base-ref "master" - "Commit ref passed to command \"git merge-base HEAD\". -Determines the ancestor commit from which the current branch's -todos should be searched for. May be overridden in the case that -a branch is branched off another branch rather than master. For -example, consider the following commit graph: - ----A1---A2---A3 (master) - \ - B1---B2---B3 (topic) - \ - C1---C2---C3 (topic2, HEAD) - -By default, the branch todo list would show todos from both the -\"topic\" branch and the \"topic2\" branch. To show only todos -from the \"topic2\" branch, this option could be set to -\"topic\"." - :type 'string) - -;;;; Commands - -;;;###autoload -(define-minor-mode magit-todos-mode - "Show list of to-do items in Magit status buffer for tracked files in repo." - :require 'magit-todos - :group 'magit-todos - :global t - (if magit-todos-mode - (progn - (pcase (lookup-key magit-status-mode-map "jT") - ('nil (define-key magit-status-mode-map "jT" #'magit-todos-jump-to-todos)) - ('magit-todos-jump-to-todos nil) - (_ (message "magit-todos: Not overriding bind of \"jT\" in `magit-status-mode-map'."))) - (magit-add-section-hook 'magit-status-sections-hook - #'magit-todos--insert-todos - 'magit-insert-staged-changes - 'append) - (add-hook 'magit-status-mode-hook #'magit-todos--add-to-status-buffer-kill-hook 'append)) - ;; Disable mode - (when (equal (lookup-key magit-status-mode-map "jT") #'magit-todos-jump-to-todos) - (define-key magit-status-mode-map "jT" nil)) - (remove-hook 'magit-status-sections-hook #'magit-todos--insert-todos) - (remove-hook 'magit-status-mode-hook #'magit-todos--add-to-status-buffer-kill-hook))) - -(defun magit-todos-update () - "Update the to-do list manually. -Only necessary when option `magit-todos-update' is nil." - (interactive) - (unless magit-todos-mode - (user-error "Please activate `magit-todos-mode'")) - (let ((inhibit-read-only t)) - ;; Delete twice since there might also be the branch-local section. - (magit-todos--delete-section [* todos]) - (magit-todos--delete-section [* todos]) - ;; HACK: See other note on `magit-todos-updating'. - (setq magit-todos-updating t) - (magit-todos--insert-todos))) - -(defun magit-todos-branch-list-toggle () - "Toggle branch diff to-do list in current Magit buffer." - (interactive) - (setq-local magit-todos-branch-list (not magit-todos-branch-list)) - (magit-todos-update)) - -(defun magit-todos-branch-list-set-commit (ref) - "Set commit ref used in branch to-do list." - (interactive (list (completing-read "Refname: " (magit-list-refnames)))) - (setq-local magit-todos-branch-list-merge-base-ref ref) - (magit-todos-update)) - -(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)) - (buffer (magit-todos--item-buffer item))) - (pop-to-buffer buffer) - (magit-todos--goto-item item) - (when (derived-mode-p 'org-mode) - (org-show-entry)) - (when peek - (select-window status-window)))) - -(defun magit-todos-peek-at-item () - "Peek at current item." - (interactive) - (magit-todos-jump-to-item :peek t)) - -;;;;; Jump to section - -(magit-define-section-jumper magit-jump-to-todos "TODOs" todos) - -(defun magit-todos-jump-to-todos () - "Jump to TODOs section, and update it if empty." - (interactive) - (let ((already-in-section-p (magit-section-match [* todos]))) - (magit-jump-to-todos) - (when (and (or (integerp magit-todos-update) - (not magit-todos-update)) - (or already-in-section-p - (= 0 (length (oref (magit-current-section) children))))) - (magit-todos-update)))) - -;;;; Dedicated buffer - -;;;###autoload -(defun magit-todos-list (&optional directory) - "Show to-do list of the current Git repository in a buffer. -With prefix, prompt for repository." - ;; Mostly copied from `magit-status' - (interactive - (let ((magit--refresh-cache (list (cons 0 0)))) - (list (and (or current-prefix-arg (not (magit-toplevel))) - (magit-read-repository))))) - (condition-case nil - (let ((magit--refresh-cache (list (cons 0 0)))) - (setq directory (if directory - (file-name-as-directory (expand-file-name directory)) - default-directory)) - (magit-todos-list-internal directory)) - ('magit-outside-git-repo (cl-letf (((symbol-function 'magit-toplevel) (lambda (&rest _) default-directory))) - (call-interactively #'magit-todos-list))))) - -(put 'magit-todos-list 'interactive-only 'magit-todos-list-internal) - -;;;###autoload -(defun magit-todos-list-internal (directory) - "Open buffer showing to-do list of repository at DIRECTORY." - (magit--tramp-asserts directory) - (let ((default-directory directory)) - (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. - -\\\ -Type \\[magit-refresh] to refresh the list. -Type \\[magit-section-toggle] to expand or hide the section at point. -Type \\[magit-visit-thing] to visit the item at point. -Type \\[magit-diff-show-or-scroll-up] to peek at the item at point." - :group 'magit-todos) - -(defun magit-todos-list-refresh-buffer () - "Refresh the current `magit-todos-list-mode' buffer." - (setq-local magit-todos-max-items (* magit-todos-max-items magit-todos-buffer-item-factor)) - (when (numberp magit-todos-auto-group-items) - (setq-local magit-todos-auto-group-items (* magit-todos-auto-group-items magit-todos-buffer-item-factor))) - (magit-section-show (magit-insert-section (type magit-root-section) - (magit-insert-status-headers) - (magit-todos--insert-todos)))) - -;;;; Functions - -(defun magit-todos--coalesce-groups (groups) - "Return GROUPS, coalescing any groups with `equal' keys. -GROUPS should be an alist. Assumes that each group contains -unique items. Intended for post-processing the result of -`-group-by'." - (cl-loop with keys = (-uniq (-map #'car groups)) - for key in keys - for matching-groups = (--select (equal key (car it)) groups) - collect (cons key (apply #'append (-map #'cdr matching-groups))))) - -(defun magit-todos--add-to-status-buffer-kill-hook () - "Add `magit-todos--kill-active-scan' to `kill-buffer-hook' locally." - (add-hook 'kill-buffer-hook #'magit-todos--kill-active-scan 'append 'local)) - -(defun magit-todos--kill-active-scan () - "Kill `magit-todos-active-scan'. -To be called in status buffers' `kill-buffer-hook'." - (when (and magit-todos-active-scan - (process-live-p magit-todos-active-scan)) - (kill-process magit-todos-active-scan) - (when-let* ((buffer (process-buffer magit-todos-active-scan)) - (alive (buffer-live-p buffer))) - (kill-buffer buffer)))) - -(defun magit-todos--add-to-custom-type (symbol value) - "Add VALUE to the end of SYMBOL's `custom-type' property." - (declare (indent defun)) - (pcase-let* ((`(,type . ,choices) (get symbol 'custom-type)) - (choices (append (list value) choices))) - (put symbol 'custom-type - (append (list type) choices)))) - -(defun magit-todos--choose-scanner () - "Return function to call to scan for items with. -Chooses automatically in order defined in `magit-todos-scanners'." - (cl-loop for scanner in magit-todos-scanners - ;; I guess it would be better to avoid `eval', but it seems like the natural - ;; way to do this. - when (eval (alist-get 'test scanner)) - return (alist-get 'function scanner))) - -(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) - "Callback for git diff scanner output." - ;; NOTE: Doesn't handle newlines in filenames or diff.mnemonicPrefix. - (cl-macrolet ((next-diff () `(re-search-forward (rx bol "diff --git ") nil t)) - (next-filename () `(when (re-search-forward (rx bol "+++ b/" (group (1+ nonl))) nil t) - (match-string 1))) - (next-hunk-line-number () `(when (re-search-forward (rx bol "@@ -" - (1+ digit) (optional "," (1+ digit)) (1+ space) - "+" (group (1+ digit)) (optional "," (1+ digit))) - file-end t) - (string-to-number (match-string 1)))) - (file-end () `(or (save-excursion - (when (re-search-forward (rx bol "diff --git ") - nil t) - (match-beginning 0))) - (point-max))) - (hunk-end () `(or (save-excursion - (when (re-search-forward (rx (or (seq bol "diff --git ") - (seq bol "@@ "))) - nil t) - (match-beginning 0))) - (point-max)))) - (with-current-buffer (process-buffer process) - (goto-char (point-min)) - (let (items filename file-end hunk-end line-number) - (while (next-diff) - (while (setf filename (next-filename)) - (setf file-end (file-end)) - (while (setf line-number (next-hunk-line-number)) - (setf hunk-end (hunk-end)) - (while (re-search-forward (rx bol "+") hunk-end t) - ;; Since "git diff-index" doesn't accept PCREs to its "-G" option, we have to test the search regexp ourselves. - (when (re-search-forward search-regexp-elisp (line-end-position) t) - (when-let* ((line (buffer-substring (line-beginning-position) (line-end-position))) - (item (with-temp-buffer - ;; NOTE: We fake grep output by inserting the filename, line number, position, etc. - ;; This lets us use the same results regexp that's used for grep-like output. - (save-excursion - (insert filename ":" (number-to-string line-number) ":0: " line)) - (magit-todos--line-item results-regexp filename)))) - (push item items))) - (cl-incf line-number))))) - (let ((magit-todos-section-heading heading)) - (magit-todos--insert-items magit-status-buffer items :branch-p t)))))) - -(defun magit-todos--delete-section (condition) - "Delete the section specified by CONDITION from the Magit status buffer. -See `magit-section-match'. Also delete it from root section's children." - (save-excursion - (goto-char (point-min)) - (when-let ((section (cl-loop until (magit-section-match condition) - ;; Use `forward-line' instead of `magit-section-forward' because - ;; sometimes it skips our section. - do (forward-line 1) - when (eobp) - return nil - finally return (magit-current-section)))) - ;; Delete the section from root section's children. This makes the section-jumper command - ;; work when a replacement section is inserted after deleting this section. - (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. 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." - (or (find-buffer-visiting (magit-todos-item-filename item)) - (find-file-noselect (magit-todos-item-filename item)))) - -(defun magit-todos--goto-item (item) - "Move point to ITEM. -Assumes current buffer is ITEM's buffer." - (pcase-let* (((cl-struct magit-todos-item position line column keyword) item)) - (if position - (goto-char position) - (goto-char (point-min)) - (forward-line (1- line)) - (if column - (forward-char column) - (when (re-search-forward (regexp-quote keyword) (line-end-position) t) - (goto-char (match-beginning 0))))))) - -(defun magit-todos--insert-todos () - "Insert to-do items into current buffer. -This function should be called from inside a ‘magit-status’ buffer." - (declare (indent defun)) - (when magit-todos-active-scan - ;; Avoid running multiple scans for a single magit-status buffer. - (let ((buffer (process-buffer magit-todos-active-scan))) - (when (process-live-p magit-todos-active-scan) - (delete-process magit-todos-active-scan)) - (when (buffer-live-p buffer) - (kill-buffer buffer))) - (setq magit-todos-active-scan nil)) - (pcase magit-todos-update - ((or 't ; Automatic - ;; Manual and updating now - (and 'nil (guard magit-todos-updating)) - ;; Caching and cache expired - (and (pred integerp) (guard (or magit-todos-updating ; Forced update - (>= (float-time - (time-subtract (current-time) - magit-todos-last-update-time)) - magit-todos-update) - (null magit-todos-last-update-time))))) - ;; Scan and insert. - ;; HACK: I don't like setting a special var here, because it seems like lexically binding a - ;; 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-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) - :directory default-directory - :depth magit-todos-depth - :heading (format "TODOs (branched from %s)" magit-todos-branch-list-merge-base-ref)))) - -(cl-defun magit-todos--insert-items (magit-status-buffer items &key branch-p) - "Insert to-do ITEMS into MAGIT-STATUS-BUFFER. -If BRANCH-P is non-nil, do not update `magit-todos-item-cache', -`magit-todos-last-update-time', and `magit-todos-updating'." - (declare (indent defun)) - ;; NOTE: This could be factored out into some kind of `magit-insert-section-async' macro if necessary. - ;; MAYBE: Use `magit-insert-section-body'. - (when (not (buffer-live-p magit-status-buffer)) - (message "`magit-todos--insert-items-callback': Callback called for deleted buffer")) - (let* ((items (magit-todos--sort items)) - (num-items (length items)) - (group-fns (pcase magit-todos-auto-group-items - ('never nil) - ('always magit-todos-group-by) - ((pred integerp) (when (> num-items magit-todos-auto-group-items) - magit-todos-group-by)) - (_ (error "Invalid value for magit-todos-auto-group-items")))) - (magit-todos-show-filenames (not (member 'magit-todos-item-filename group-fns))) - (magit-section-show-child-count t) - ;; HACK: "For internal use only." But this makes collapsing the new section work! - (magit-insert-section--parent magit-root-section) - (inhibit-read-only t)) - (when (buffer-live-p magit-status-buffer) - ;; Don't try to select a killed status buffer - (with-current-buffer magit-status-buffer - (unless branch-p - ;; Don't do any of this for the branch-diff scanner. - (when magit-todos-updating - (when (or (null magit-todos-update) ; Manual updates - (integerp magit-todos-update)) ; Caching - (setq magit-todos-item-cache items) - (setq magit-todos-last-update-time (current-time))) - ;; HACK: I don't like setting this special var, but it works. See other comment where - ;; it's set t. - (setq magit-todos-updating nil))) - (save-excursion - ;; Insert items - (goto-char (point-min)) - ;; Go to insertion position - (pcase magit-todos-insert-at - ('top (cl-loop for ((this-section . _) . _) = (magit-section-ident (magit-current-section)) - until (not (member this-section '(branch tags))) - do (magit-section-forward))) - ('bottom (goto-char (oref (-last-item (oref magit-root-section children)) end))) - (_ (magit-todos--skip-section (vector '* magit-todos-insert-at)))) - ;; Insert section - (let ((reminder (if magit-todos-update - "" ; Automatic updates: no reminder - ;; Manual updates: remind user - " (update manually)"))) - (if (not items) - (unless magit-todos-update - ;; Manual updates: Insert section to remind user - (let ((magit-insert-section--parent magit-root-section)) - (magit-insert-section (todos) - (magit-insert-heading (concat (propertize magit-todos-section-heading 'face 'magit-section-heading) - " (0)" reminder "\n"))))) - (let ((section (magit-todos--insert-groups :type 'todos - :heading (format "%s (%s)%s" - (propertize magit-todos-section-heading 'face 'magit-section-heading) - num-items reminder) - :group-fns group-fns - :items items - :depth 0))) - (insert "\n") - (magit-todos--set-visibility :section section :num-items num-items))))))))) - -(cl-defun magit-todos--insert-groups (&key depth group-fns heading type items) - "Insert ITEMS into grouped Magit section and return the section. - -DEPTH sets indentation and should be 0 for a top-level group. It -is automatically incremented when this function calls itself. - -GROUP-FNS may be a list of functions to which ITEMS are applied -with `-group-by' to group them. Items are grouped -hierarchically, i.e. when GROUP-FNS has more than one function, -items are first grouped by the first function, then subgroups are -created which group items by subsequent functions. - -HEADING is a string which is the group's heading. The count of -items in each group is automatically appended. - -TYPE is a symbol which is used by Magit internally to identify -sections." - ;; NOTE: `magit-insert-section' seems to bind `magit-section-visibility-cache' to nil, so setting - ;; visibility within calls to it probably won't work as intended. - (declare (indent defun)) - (let* ((indent (s-repeat (* 2 depth) " ")) - (heading (concat indent heading)) - (magit-insert-section--parent (if (= 0 depth) - magit-root-section - magit-insert-section--parent))) - (if (and (consp group-fns) - (> (length group-fns) 0)) - ;; Insert more groups - (let* ((groups (--> (-group-by (car group-fns) items) - (cl-loop for group in-ref it - ;; HACK: Set ":" keys to nil so they'll be grouped together. - do (pcase (car group) - (":" (setf (car group) nil))) - finally return it) - (magit-todos--coalesce-groups it))) - (section (magit-insert-section ((eval type)) - (magit-insert-heading heading) - (cl-loop for (group-type . items) in groups - for group-name = (pcase group-type - ;; Use "[Other]" instead of empty group name. - ;; HACK: ":" is hard-coded, even though the - ;; suffix regexp could differ. If users change - ;; the suffix so this doesn't apply, it - ;; shouldn't cause any problems, it just won't - ;; look as pretty. - ((or "" ":" 'nil) "[Other]") - (_ (s-chop-suffix ":" group-type))) - do (magit-todos--insert-groups - :depth (1+ depth) :group-fns (cdr group-fns) - :type (intern group-name) :items items - :heading (concat - (if (and magit-todos-fontify-keyword-headers - (member group-name magit-todos-keywords-list)) - (propertize group-name 'face (magit-todos--keyword-face group-name)) - group-name) - ;; Item count - (if (= 1 (length group-fns)) - ":" ; Let Magit add the count. - ;; Add count ourselves. - (concat " " (format "(%s)" (length items)))))))))) - (magit-todos--set-visibility :depth depth :num-items (length items) :section section) - ;; Add top-level section to root section's children - (when (= 0 depth) - (push section (oref magit-root-section children))) - ;; Don't forget to return the section! - section) - ;; Insert individual to-do items - (magit-todos--insert-group :depth (1+ depth) :type type :items items :heading heading)))) - -(cl-defun magit-todos--insert-group (&key depth heading type items) - "Insert ITEMS into Magit section and return the section. - -DEPTH sets indentation and should be 0 for a top-level group. - -HEADING is a string which is the group's heading. The count of -items in each group is automatically appended. - -TYPE is a symbol which is used by Magit internally to identify -sections." - ;; NOTE: `magit-insert-section' seems to bind `magit-section-visibility-cache' to nil, so setting - ;; visibility within calls to it probably won't work as intended. - (declare (indent defun)) - (let* ((indent (s-repeat (* 2 depth) " ")) - (magit-insert-section--parent (if (= 0 depth) - magit-root-section - magit-insert-section--parent)) - (width (- (window-text-width) depth)) - (section (magit-insert-section ((eval type)) - (magit-insert-heading heading) - (dolist (item items) - (let* ((filename (propertize (magit-todos-item-filename item) 'face 'magit-filename)) - (string (--> (concat indent - (when magit-todos-show-filenames - (concat filename " ")) - (funcall (if (s-suffix? ".org" filename) - #'magit-todos--format-org - #'magit-todos--format-plain) - item)) - (truncate-string-to-width it width)))) - (magit-insert-section (todos-item item) - (insert string "\n"))))))) - (magit-todos--set-visibility :depth depth :num-items (length items) :section section) - ;; Don't forget to return the section! - section)) - -(cl-defun magit-todos--set-visibility (&key section num-items depth) - "Set the visibility of SECTION. - -If the section's visibility is cached by Magit, the cached -setting is applied. Otherwise, visibility is set according to -whether NUM-ITEMS is greater than `magit-todos-max-items'. - -When DEPTH is greater than 0, NUM-ITEMS is compared to -`magit-todos-max-items' divided by DEPTH multiplied by 2, -i.e. the max number of items which cause sections to be -automatically hidden halves at each deeper level." - (declare (indent defun)) - (pcase (magit-section-cached-visibility section) - ('hide (magit-section-hide section)) - ('show (magit-section-show section)) - (_ (if (> num-items (pcase depth - (0 magit-todos-max-items) - (_ (/ magit-todos-max-items (* depth 2))))) - ;; HACK: We have to do this manually because the set-visibility-hook doesn't work. - (magit-section-hide section) - ;; Not hidden: show section manually (necessary for some reason) - (magit-section-show section))))) - -(defun magit-todos--skip-section (condition) - "Move past the section matching CONDITION. -See `magit-section-match'." - (goto-char (point-min)) - (cl-loop until (magit-section-match condition) - do (magit-section-forward)) - (cl-loop until (not (magit-section-match condition)) - do (condition-case nil - ;; `magit-section-forward' raises an error when there are no more sections. - (magit-section-forward) - (error (progn - (goto-char (1- (point-max))) - (cl-return)))))) - -(cl-defun magit-todos--line-item (regexp &optional filename) - "Return item on current line, parsing current buffer with REGEXP. -FILENAME is added to the item as its filename. Sets match data. -This should be called in a process's output buffer from one of -the async callback functions. The calling function should -advance to the next line." - (let ((case-fold-search magit-todos-ignore-case)) - (when (re-search-forward regexp (line-end-position) t) - (make-magit-todos-item :filename (or filename - (match-string 8)) - :line (--when-let (match-string 2) - (string-to-number it)) - :column (--when-let (match-string 3) - (string-to-number it)) - :position (--when-let (match-string 9) - (string-to-number it)) - :org-level (match-string 1) - :keyword (match-string 4) - :suffix (match-string 6) - :description (match-string 5))))) - -(defun magit-todos--keyword-face (keyword) - "Return face for KEYWORD." - ;; TODO(alphapapa): Instead of upcasing here, upcase in the lookup, so it can still be displayed - ;; non-uppercase. Preserving the distinction might be useful. - (when magit-todos-ignore-case - (setq keyword (upcase keyword))) - (let ((face (assoc-default keyword hl-todo-keyword-faces #'string=))) - (cl-typecase face - (string (list :inherit 'hl-todo :foreground face)) - (t face)))) - -(defun magit-todos--fontify-like-in-org-mode (s &optional odd-levels) - "Fontify string S like in Org-mode. - -`org-fontify-like-in-org-mode' is a very, very slow function -because it creates a new temporary buffer and runs `org-mode' for -every string it fontifies. This function reuses a single -invisible buffer and only runs `org-mode' when the buffer is -created." - (let ((buffer (get-buffer " *magit-todos--fontify-like-in-org-mode*"))) - (unless buffer - (setq buffer (get-buffer-create " *magit-todos--fontify-like-in-org-mode*")) - (with-current-buffer buffer - (buffer-disable-undo) - (org-mode))) - (with-current-buffer buffer - (erase-buffer) - (insert s) - (let ((org-odd-levels-only odd-levels)) - (font-lock-ensure) - (buffer-string))))) - -(defun magit-todos-item-first-path-component (item) - "Return ITEM's first directory. -This assumes that ITEM's filename is already set to a path -relative to the repo's directory (i.e. this would not be very -useful with absolute paths)." - (car (f-split (magit-todos-item-filename item)))) - -(cl-defun magit-todos--async-start-process (name &key command finish-func) - "Start the executable PROGRAM asynchronously. See `async-start'. -PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the -process object when done. If FINISH-FUNC is nil, the future -object will return the process object when the program is -finished. Set DEFAULT-DIRECTORY to change PROGRAM's current -working directory. - -This is a copy of `async-start-process' that does not override -`process-connection-type'. It also uses keyword arguments." - (declare (indent defun)) - ;; TODO: Drop this function when possible. See - ;; . - (let* ((args (cdr command)) - (command (car command)) - (buf (generate-new-buffer (concat " *" name "*"))) - (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) - (set-process-sentinel proc #'magit-todos--async-when-done) - (unless (string= name "emacs") - (set (make-local-variable 'async-callback-for-process) t)) - proc))) - -(defun magit-todos--async-when-done (proc &optional _change) - "Process sentinel used to retrieve the value from the child process. - -This is a copy of `async-when-done' that does not raise an error -if the process's buffer has already been deleted." - ;; I wish it weren't necessary to copy this function here, but at the moment it seems like the - ;; only reasonable way to work around this problem of `async-when-done' trying to select deleted - ;; buffers. I already tried not deleting the buffers, but then I got bug reports about that and - ;; had to revert it. I don't know if I'm encountering a bug in my code, in `async', or in Emacs - ;; itself, because it seems that `async-when-done' is being called on the wrong buffers: When I'm - ;; connected with `matrix-client', and when I have a Magit status buffer opened with - ;; `magit-todos-mode' active, then when one of the `url' process buffers from Matrix gets its - ;; sentinel called, I get an error from `async-when-done' trying to select the already-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. - ;; 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)) - ;; 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 - (funcall async-callback proc) - (unless async-debug - (kill-buffer (current-buffer)))) - (set (make-local-variable 'async-callback-value) proc) - (set (make-local-variable 'async-callback-value-set) t)) - (goto-char (point-max)) - (backward-sexp) - (async-handle-result async-callback (read (current-buffer)) - (current-buffer))) - (set (make-local-variable 'async-callback-value) - (list 'error - (format "Async process '%s' failed with exit code %d" - (process-name proc) (process-exit-status proc)))) - (set (make-local-variable 'async-callback-value-set) t)))))) - -;;;;; Formatters - -(defun magit-todos--format-plain (item) - "Return ITEM formatted as from a non-Org file." - (format "%s%s %s" - (propertize (magit-todos-item-keyword item) - 'face (magit-todos--keyword-face (magit-todos-item-keyword item))) - (or (magit-todos-item-suffix item) "") - (or (magit-todos-item-description item) ""))) - -(defun magit-todos--format-org (item) - "Return ITEM formatted as from an Org file." - (magit-todos--fontify-like-in-org-mode - (concat (magit-todos-item-org-level item) " " - (magit-todos-item-keyword item) " " - (magit-todos-item-description item)))) - -;;;;; Sorting - -(defun magit-todos--sort (items) - "Return ITEMS sorted according to `magit-todos-sort-order'." - (dolist (fn (reverse magit-todos-sort-order) items) - (setq items (sort items fn)))) - -(defun magit-todos--sort-by-keyword (a b) - "Return non-nil if A's keyword is before B's in `magit-todos-keywords-list'." - (cl-flet ((keyword-index (keyword) - (or (-elem-index keyword magit-todos-keywords-list) 0))) - (< (keyword-index (magit-todos-item-keyword a)) - (keyword-index (magit-todos-item-keyword b))))) - -(defun magit-todos--sort-by-position (a b) - "Return non-nil if A's position in its file is before B's." - (let ((a-position (or (magit-todos-item-position a) - (magit-todos-item-line a))) - (b-position (or (magit-todos-item-position b) - (magit-todos-item-line b)))) - (< a-position b-position))) - -(defun magit-todos--sort-by-filename (a b) - "Return non-nil if A's filename is `string<' B's." - (string< (magit-todos-item-filename a) - (magit-todos-item-filename b))) - -(defun magit-todos--sort-by-suffix (a b) - "Return non-nil if A's suffix is `string<' B's." - (string< (magit-todos-item-suffix a) - (magit-todos-item-suffix b))) - -;;;; Scanners - -(cl-defmacro magit-todos-defscanner (name &key test command results-regexp - (callback (function 'magit-todos--scan-callback))) - "Define a `magit-todos' scanner named NAME. - -NAME is a string, which may contain spaces. It is only used for -descriptive purposes. - -TEST is an unquoted sexp which is used to determine whether the -scanner is usable. In most cases, it should use -`executable-find' to look for the scanner command. - -COMMAND is a sexp which should evaluate to the scanner command, -i.e. a list of strings to be eventually passed to -`start-process'. Nil elements are removed, numbers are converted -to strings, and nested lists are flattened into a single list. -It is evaluated each time the scanner is run. - -Within the COMMAND list these variables are available: - -`depth': When non-nil, an integer, which is the depth that should -be passed to the scanner's max-depth option (i.e. `magit-todos-depth'). - -`directory': The directory in which the scan should be run. - -`extra-args': The value of the customization variable -\"magit-todos-NAME-extra-args\" (see below). - -`keywords': List of item keywords defined in -`magit-todos-keywords-list'. - -`search-regexp-pcre': PCRE-compatible regular expression to be passed -to the scanner process. - -`search-regexp-elisp': Emacs regular expression, which may be -used for scanners written as Emacs Lisp functions. - -RESULTS-REGEXP is an optional string or unquoted sexp which is -used to match results in the scanner process's output buffer. -Typically this will be a sexp which calls `rx-to-string'. It is -evaluated each time the scanner is run. If nil, the appropriate -default is used which matches results in the form: - - FILENAME:LINE:MATCH - -Where MATCH may also match Org outline heading stars when -appropriate. Custom regexps may also match column numbers or -byte offsets in the appropriate numbered groups; see -`make-magit-todos-item'. - -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: - -\"magit-todos-NAME-extra-args\": A customization setting, a list -of strings to be passed to the scanner as extra arguments. - -\"magit-todos--scan-with-NAME\": The function which runs the -scanner command. - -It also adds the scanner to the customization variable -`magit-todos-scanner', and to the variable -`magit-todos-scanners' (which is used to set -`magit-todos-scanner' by calling `magit-todos--choose-scanner')." - ;; TODO: Try to obviate the -scanners variable, let --choose-scanner use the - ;; custom-type of -scanner directly. Maybe, anyway--I don't want to ugly up the UI - ;; for users. - (declare (indent defun) (debug (stringp [&rest &or [":test" def-form] - [":command" def-form] - [":results-regexp" [&or stringp def-form]]]))) - (let* ((name-without-spaces (s-replace " " "-" name)) - (scan-fn-name (concat "magit-todos--scan-with-" name-without-spaces)) - (scan-fn-symbol (intern scan-fn-name)) - (extra-args-var (intern (format "magit-todos-%s-extra-args" name-without-spaces)))) - `(progn - (defcustom ,extra-args-var nil - ,(format "Extra arguments passed to %s." name) - :type '(repeat string)) - - ;; 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'. - -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)) - (extra-args (when ,extra-args-var - (--map (s-split (rx (1+ space)) it 'omit-nulls) - ,extra-args-var))) - (keywords magit-todos-keywords-list) - (search-regexp-elisp (rx-to-string - `(or - ;; Org item - (seq bol (group (1+ "*")) - (1+ blank) - (group (or ,@keywords)) - (1+ space) - (group (1+ not-newline))) - ;; Non-Org - (seq (or bol (1+ blank)) - (group (or ,@keywords)) - (regexp ,magit-todos-keyword-suffix) - (optional (1+ blank) - (group (1+ not-newline))))))) - (search-regexp-pcre (rxt-elisp-to-pcre search-regexp-elisp)) - (results-regexp (or ,results-regexp - (rx-to-string - `(seq bol - ;; Filename - (group-n 8 (1+ (not (any ":")))) ":" - ;; Line - (group-n 2 (1+ digit)) ":" - (or - ;; Org item - (seq (group-n 1 (1+ "*")) - (1+ blank) - (group-n 4 (or ,@keywords)) - (1+ blank) - (group-n 5 (1+ not-newline))) - ;; Non-Org - (seq (optional (1+ not-newline)) - (group-n 4 (or ,@keywords)) - (optional (group-n 6 (regexp ,magit-todos-keyword-suffix))) - (optional (1+ blank)) - (optional (group-n 5 (1+ not-newline))))))))) - (command (-flatten - (-non-nil - (list (when magit-todos-nice - (list "nice" "-n5")) - ,command))))) - ;; Convert any numbers in command to strings (e.g. depth). - (cl-loop for elt in-ref command - when (numberp elt) - do (setf elt (number-to-string elt))) - ;; 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 - (list (cons 'name ,name) - (cons 'function #',scan-fn-symbol) - (cons 'test ',test)) - 'append)))) - -;; NOTE: These scanners handle the max-depth option differently. git-grep seems to handle it in the -;; most useful way, with a setting of 0 meaning to look no deeper than the current directory, and a -;; setting of 1 searching directories one level deeper. In comparison, rg and find effectively -;; subtract one from the value, as a setting of 0 returns no results, and a setting of 1 searches -;; only the current directory (which means that when the max-depth is set to 0, the whole command is -;; essentially a no-op, which is pointless). Since we want `magit-todos-depth' to behave -;; consistently with all scanners, we will treat it the way git-grep does, and for the other -;; scanners we'll add one to its value. - -(magit-todos-defscanner "rg" - :test (executable-find "rg") - :command (list "rg" "--no-heading" "--line-number" - (when depth - (list "--maxdepth" (1+ depth))) - (when magit-todos-ignore-case - "--ignore-case") - (when magit-todos-exclude-globs - (--map (list "--glob" (concat "!" it)) - magit-todos-exclude-globs)) - extra-args search-regexp-pcre directory)) - -(magit-todos-defscanner "git grep" - :test (string-match "--perl-regexp" (shell-command-to-string "git grep --magit-todos-testing-git-grep")) - :command (list "git" "--no-pager" "grep" - "--full-name" "--no-color" "-n" - (when depth - (list "--max-depth" depth)) - (when magit-todos-ignore-case - "--ignore-case") - "--perl-regexp" - "-e" search-regexp-pcre - extra-args "--" directory - (when magit-todos-exclude-globs - (--map (concat ":!" it) - magit-todos-exclude-globs)))) - -(magit-todos-defscanner "git diff" - ;; 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 (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" - (-> "git merge-base HEAD " - (concat magit-todos-branch-list-merge-base-ref) - shell-command-to-string - string-trim))) - :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 - ;; used much, if at all, so I'm not going to go to the trouble to fix this now. - :test (string-match "--perl-regexp" (shell-command-to-string "grep --help")) - :command (let* ((grep-find-template (progn - (unless grep-find-template - (grep-compute-defaults)) - (->> grep-find-template - (s-replace " grep " " grep -b -E ") - (s-replace " -nH " " -H ")))) - (_ (when depth - (setq grep-find-template - (s-replace " " (concat " -maxdepth " (1+ depth) " ") - grep-find-template))))) - ;; Modified from `rgrep-default-command' - (list "find" directory - (list (when grep-find-ignored-directories - (list "-type" "d" - "(" "-path" - (-interpose (list "-o" "-path") - (-non-nil (--map (cond ((stringp it) - (concat "*/" it)) - ((consp it) - (and (funcall (car it) it) - (concat "*/" (cdr it))))) - grep-find-ignored-directories))) - ")" "-prune")) - (when grep-find-ignored-files - (list "-o" "-type" "f" - "(" "-name" - (-interpose (list "-o" "-name") - (--map (cond ((stringp it) it) - ((consp it) (and (funcall (car it) it) - (cdr it)))) - grep-find-ignored-files)) - ")" "-prune")) - (when magit-todos-exclude-globs - (list "-o" "(" - (--map (list "-iname" it) - magit-todos-exclude-globs) - ")" "-prune"))) - (list "-o" "-type" "f") - ;; NOTE: This uses "grep -P", i.e. "Interpret the pattern as a - ;; Perl-compatible regular expression (PCRE). This is highly - ;; experimental and grep -P may warn of unimplemented features." But it - ;; does seem to work properly, at least on GNU grep. Using "grep -E" - ;; with this PCRE regexp doesn't work quite right, as it doesn't match - ;; all the keywords, but pcre2el doesn't convert to "extended regular - ;; expressions", so this will have to do. Maybe we should test whether - ;; the version of grep installed supports "-P". - ;; NOTE: For some reason, when "-execdir" is used, the callback function is never - ;; called, even though the process terminates and its buffer has the correct - ;; output. It works correctly when "-exec" is used, so we use that. - (list "-exec" "grep" "-bPH" - (when magit-todos-ignore-case - "--ignore-case") - extra-args - search-regexp-pcre "{}" "+")))) - -;;;;; Set scanner default value - -;; 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)))) - -(declare-function ivy-read "ext:ivy") - -(with-eval-after-load 'ivy - (defvar ivy-magit-todos-history nil - "History for `ivy-magit-todos'.") - - (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))) - :history 'ivy-magit-todos-history - :caller 'ivy-magit-todos))) - -;;;;; 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) - -;;; magit-todos.el ends here -- 2.47.3