From af7edfe2c635495a30905b9df9fcb1ce815e4fda Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 5 Apr 2018 14:33:31 +0200 Subject: [PATCH] update magit to 20180404.1428 Signed-off-by: Andreas Gerler --- elpa/magit-20180118.313/magit-extras.el | 340 ---- elpa/magit-20180118.313/magit-pkg.el | 12 - elpa/magit-20180118.313/magit.info | 180 --- .../AUTHORS.md | 6 + elpa/magit-20180404.1428/LICENSE | 676 ++++++++ .../dir | 0 .../git-rebase.el | 6 +- .../magit-apply.el | 215 ++- .../magit-autoloads.el | 591 ++++--- .../magit-autorevert.el | 0 .../magit-bisect.el | 10 +- .../magit-blame.el | 6 +- .../magit-bookmark.el | 0 .../magit-branch.el | 89 +- .../magit-collab.el | 46 +- .../magit-commit.el | 33 +- .../magit-core.el | 0 .../magit-diff.el | 85 +- .../magit-ediff.el | 0 elpa/magit-20180404.1428/magit-extras.el | 621 ++++++++ .../magit-files.el | 37 +- .../magit-git.el | 332 +++- .../magit-imenu.el | 0 .../magit-log.el | 77 +- .../magit-margin.el | 11 +- elpa/magit-20180404.1428/magit-merge.el | 274 ++++ .../magit-mode.el | 129 +- .../magit-notes.el | 0 .../magit-obsolete.el | 10 +- elpa/magit-20180404.1428/magit-pkg.el | 12 + .../magit-process.el | 53 +- .../magit-refs.el | 475 +++--- .../magit-remote.el | 87 +- .../magit-repos.el | 27 +- elpa/magit-20180404.1428/magit-reset.el | 102 ++ .../magit-section.el | 161 +- .../magit-sequence.el | 166 +- .../magit-stash.el | 22 +- .../magit-status.el | 61 +- .../magit-submodule.el | 239 +-- .../magit-subtree.el | 0 elpa/magit-20180404.1428/magit-tag.el | 99 ++ .../magit-utils.el | 88 +- .../magit-wip.el | 4 +- .../magit-worktree.el | 16 +- .../magit.el | 572 +------ elpa/magit-20180404.1428/magit.info | 181 +++ .../magit.info-1 | 670 ++++---- .../magit.info-2 | 433 +++++- elpa/magit-popup-20180329.1302/dir | 18 + .../magit-popup-autoloads.el | 16 + .../magit-popup-pkg.el | 10 + elpa/magit-popup-20180329.1302/magit-popup.el | 1363 +++++++++++++++++ .../magit-popup.info | 740 +++++++++ 54 files changed, 6882 insertions(+), 2519 deletions(-) delete mode 100644 elpa/magit-20180118.313/magit-extras.el delete mode 100644 elpa/magit-20180118.313/magit-pkg.el delete mode 100644 elpa/magit-20180118.313/magit.info rename elpa/{magit-20180118.313 => magit-20180404.1428}/AUTHORS.md (97%) create mode 100644 elpa/magit-20180404.1428/LICENSE rename elpa/{magit-20180118.313 => magit-20180404.1428}/dir (100%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/git-rebase.el (99%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-apply.el (81%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-autoloads.el (85%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-autorevert.el (100%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-bisect.el (96%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-blame.el (99%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-bookmark.el (100%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-branch.el (94%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-collab.el (76%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-commit.el (93%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-core.el (100%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-diff.el (97%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-ediff.el (100%) create mode 100644 elpa/magit-20180404.1428/magit-extras.el rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-files.el (93%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-git.el (86%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-imenu.el (100%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-log.el (96%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-margin.el (94%) create mode 100644 elpa/magit-20180404.1428/magit-merge.el rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-mode.el (93%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-notes.el (100%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-obsolete.el (94%) create mode 100644 elpa/magit-20180404.1428/magit-pkg.el rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-process.el (96%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-refs.el (57%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-remote.el (93%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-repos.el (94%) create mode 100644 elpa/magit-20180404.1428/magit-reset.el rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-section.el (90%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-sequence.el (80%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-stash.el (96%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-status.el (91%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-submodule.el (66%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-subtree.el (100%) create mode 100644 elpa/magit-20180404.1428/magit-tag.el rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-utils.el (93%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-wip.el (99%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit-worktree.el (93%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit.el (50%) create mode 100644 elpa/magit-20180404.1428/magit.info rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit.info-1 (94%) rename elpa/{magit-20180118.313 => magit-20180404.1428}/magit.info-2 (88%) create mode 100644 elpa/magit-popup-20180329.1302/dir create mode 100644 elpa/magit-popup-20180329.1302/magit-popup-autoloads.el create mode 100644 elpa/magit-popup-20180329.1302/magit-popup-pkg.el create mode 100644 elpa/magit-popup-20180329.1302/magit-popup.el create mode 100644 elpa/magit-popup-20180329.1302/magit-popup.info diff --git a/elpa/magit-20180118.313/magit-extras.el b/elpa/magit-20180118.313/magit-extras.el deleted file mode 100644 index 760f4f87..00000000 --- a/elpa/magit-20180118.313/magit-extras.el +++ /dev/null @@ -1,340 +0,0 @@ -;;; magit-extras.el --- additional functionality for Magit -*- lexical-binding: t -*- - -;; Copyright (C) 2008-2018 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. - -;; Magit is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; Magit is distributed in the hope that it will be useful, but WITHOUT -;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -;; License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with Magit. If not, see http://www.gnu.org/licenses. - -;;; Commentary: - -;; Additional functionality for Magit. - -;;; Code: - -(require 'magit) - -(declare-function dired-do-shell-command 'dired-aux) -(declare-function dired-read-shell-command 'dired-aux) - -(defgroup magit-extras nil - "Additional functionality for Magit." - :group 'magit-extensions) - -;;; External Tools - -(defcustom magit-gitk-executable - (or (and (eq system-type 'windows-nt) - (let ((exe (expand-file-name - "gitk" (file-name-nondirectory magit-git-executable)))) - (and (file-executable-p exe) exe))) - (executable-find "gitk") "gitk") - "The Gitk executable." - :group 'magit-extras - :set-after '(magit-git-executable) - :type 'string) - -;;;###autoload -(defun magit-run-git-gui () - "Run `git gui' for the current git repository." - (interactive) - (magit-with-toplevel - (magit-process-file magit-git-executable nil 0 nil "gui"))) - -;;;###autoload -(defun magit-run-git-gui-blame (commit filename &optional linenum) - "Run `git gui blame' on the given FILENAME and COMMIT. -Interactively run it for the current file and the `HEAD', with a -prefix or when the current file cannot be determined let the user -choose. When the current buffer is visiting FILENAME instruct -blame to center around the line point is on." - (interactive - (let (revision filename) - (when (or current-prefix-arg - (not (setq revision "HEAD" - filename (magit-file-relative-name nil 'tracked)))) - (setq revision (magit-read-branch-or-commit "Blame from revision")) - (setq filename (magit-read-file-from-rev revision "Blame file"))) - (list revision filename - (and (equal filename - (ignore-errors - (magit-file-relative-name buffer-file-name))) - (line-number-at-pos))))) - (magit-with-toplevel - (apply #'magit-process-file magit-git-executable nil 0 nil "gui" "blame" - `(,@(and linenum (list (format "--line=%d" linenum))) - ,commit - ,filename)))) - -;;;###autoload -(defun magit-run-gitk () - "Run `gitk' in the current repository." - (interactive) - (magit-process-file magit-gitk-executable nil 0)) - -;;;###autoload -(defun magit-run-gitk-branches () - "Run `gitk --branches' in the current repository." - (interactive) - (magit-process-file magit-gitk-executable nil 0 nil "--branches")) - -;;;###autoload -(defun magit-run-gitk-all () - "Run `gitk --all' in the current repository." - (interactive) - (magit-process-file magit-gitk-executable nil 0 nil "--all")) - -;;; Emacs Tools - -;;;###autoload -(defun ido-enter-magit-status () - "Drop into `magit-status' from file switching. - -To make this command available use something like: - - (add-hook \\='ido-setup-hook - (lambda () - (define-key ido-completion-map - (kbd \"C-x g\") \\='ido-enter-magit-status))) - -Starting with Emacs 25.1 the Ido keymaps are defined just once -instead of every time Ido is invoked, so now you can modify it -like pretty much every other keymap: - - (define-key ido-common-completion-map - (kbd \"C-x g\") 'ido-enter-magit-status)" - (interactive) - (with-no-warnings ; FIXME these are internal variables - (setq ido-exit 'fallback fallback 'magit-status)) - (exit-minibuffer)) - -;;;###autoload -(defun magit-dired-jump (&optional other-window) - "Visit file at point using Dired. -With a prefix argument, visit in another window. If there -is no file at point, then instead visit `default-directory'." - (interactive "P") - (dired-jump other-window (-if-let (file (magit-file-at-point)) - (progn (setq file (expand-file-name file)) - (if (file-directory-p file) - (concat file "/.") - file)) - (concat default-directory "/.")))) - -;;;###autoload -(defun magit-dired-log (&optional follow) - "Show log for all marked files, or the current file." - (interactive "P") - (-if-let (topdir (magit-toplevel default-directory)) - (let ((args (car (magit-log-arguments))) - (files (dired-get-marked-files nil nil #'magit-file-tracked-p))) - (unless files - (user-error "No marked file is being tracked by Git")) - (when (and follow - (not (member "--follow" args)) - (not (cdr files))) - (push "--follow" args)) - (magit-mode-setup-internal - #'magit-log-mode - (list (list (or (magit-get-current-branch) "HEAD")) - args - (let ((default-directory topdir)) - (mapcar #'file-relative-name files))) - magit-log-buffer-file-locked)) - (magit--not-inside-repository-error))) - -;;;###autoload -(defun magit-do-async-shell-command (file) - "Open FILE with `dired-do-async-shell-command'. -Interactively, open the file at point." - (interactive (list (or (magit-file-at-point) - (completing-read "Act on file: " - (magit-list-files))))) - (require 'dired-aux) - (dired-do-async-shell-command - (dired-read-shell-command "& on %s: " current-prefix-arg (list file)) - nil (list file))) - -;;; Shift Selection - -(defun magit--turn-on-shift-select-mode-p () - (and shift-select-mode - this-command-keys-shift-translated - (not mark-active) - (not (eq (car-safe transient-mark-mode) 'only)))) - -;;;###autoload -(defun magit-previous-line (&optional arg try-vscroll) - "Like `previous-line' but with Magit-specific shift-selection. - -Magit's selection mechanism is based on the region but selects an -area that is larger than the region. This causes `previous-line' -when invoked while holding the shift key to move up one line and -thereby select two lines. When invoked inside a hunk body this -command does not move point on the first invocation and thereby -it only selects a single line. Which inconsistency you prefer -is a matter of preference." - (declare (interactive-only - "use `forward-line' with negative argument instead.")) - (interactive "p\np") - (unless arg (setq arg 1)) - (let ((stay (or (magit-diff-inside-hunk-body-p) - (magit-section-position-in-heading-p)))) - (if (and stay (= arg 1) (magit--turn-on-shift-select-mode-p)) - (push-mark nil nil t) - (with-no-warnings - (handle-shift-selection) - (previous-line (if stay (max (1- arg) 1) arg) try-vscroll))))) - -;;;###autoload -(defun magit-next-line (&optional arg try-vscroll) - "Like `next-line' but with Magit-specific shift-selection. - -Magit's selection mechanism is based on the region but selects -an area that is larger than the region. This causes `next-line' -when invoked while holding the shift key to move down one line -and thereby select two lines. When invoked inside a hunk body -this command does not move point on the first invocation and -thereby it only selects a single line. Which inconsistency you -prefer is a matter of preference." - (declare (interactive-only forward-line)) - (interactive "p\np") - (unless arg (setq arg 1)) - (let ((stay (or (magit-diff-inside-hunk-body-p) - (magit-section-position-in-heading-p)))) - (if (and stay (= arg 1) (magit--turn-on-shift-select-mode-p)) - (push-mark nil nil t) - (with-no-warnings - (handle-shift-selection) - (next-line (if stay (max (1- arg) 1) arg) try-vscroll))))) - -;;; Clean - -;;;###autoload -(defun magit-clean (&optional arg) - "Remove untracked files from the working tree. -With a prefix argument also remove ignored files, -with two prefix arguments remove ignored files only. -\n(git clean -f -d [-x|-X])" - (interactive "p") - (when (yes-or-no-p (format "Remove %s files? " - (pcase arg - (1 "untracked") - (4 "untracked and ignored") - (_ "ignored")))) - (magit-wip-commit-before-change) - (magit-run-git "clean" "-f" "-d" (pcase arg (4 "-x") (16 "-X"))))) - -(put 'magit-clean 'disabled t) - -;;; Gitignore - -;;;###autoload -(defun magit-gitignore (file-or-pattern &optional local) - "Instruct Git to ignore FILE-OR-PATTERN. -With a prefix argument only ignore locally." - (interactive (list (magit-gitignore-read-pattern current-prefix-arg) - current-prefix-arg)) - (let ((gitignore - (if local - (magit-git-dir (convert-standard-filename "info/exclude")) - (expand-file-name ".gitignore" (magit-toplevel))))) - (make-directory (file-name-directory gitignore) t) - (with-temp-buffer - (when (file-exists-p gitignore) - (insert-file-contents gitignore)) - (goto-char (point-max)) - (unless (bolp) - (insert "\n")) - (insert (replace-regexp-in-string "\\(\\\\*\\)" "\\1\\1" file-or-pattern)) - (insert "\n") - (write-region nil nil gitignore)) - (if local - (magit-refresh) - (magit-run-git "add" ".gitignore")))) - -;;;###autoload -(defun magit-gitignore-locally (file-or-pattern) - "Instruct Git to locally ignore FILE-OR-PATTERN." - (interactive (list (magit-gitignore-read-pattern t))) - (magit-gitignore file-or-pattern t)) - -(defun magit-gitignore-read-pattern (local) - (let* ((default (magit-current-file)) - (choices - (delete-dups - (--mapcat - (cons (concat "/" it) - (-when-let (ext (file-name-extension it)) - (list (concat "/" (file-name-directory "foo") "*." ext) - (concat "*." ext)))) - (magit-untracked-files))))) - (when default - (setq default (concat "/" default)) - (unless (member default choices) - (setq default (concat "*." (file-name-extension default))) - (unless (member default choices) - (setq default nil)))) - (magit-completing-read (concat "File or pattern to ignore" - (and local " locally")) - choices nil nil nil nil default))) - -;;; ChangeLog - -;;;###autoload -(defun magit-add-change-log-entry (&optional whoami file-name other-window) - "Find change log file and add date entry and item for current change. -This differs from `add-change-log-entry' (which see) in that -it acts on the current hunk in a Magit buffer instead of on -a position in a file-visiting buffer." - (interactive (list current-prefix-arg - (prompt-for-change-log-name))) - (let (buf pos) - (save-window-excursion - (call-interactively #'magit-diff-visit-file) - (setq buf (current-buffer)) - (setq pos (point))) - (save-excursion - (with-current-buffer buf - (goto-char pos) - (add-change-log-entry whoami file-name other-window))))) - -;;;###autoload -(defun magit-add-change-log-entry-other-window (&optional whoami file-name) - "Find change log file in other window and add entry and item. -This differs from `add-change-log-entry-other-window' (which see) -in that it acts on the current hunk in a Magit buffer instead of -on a position in a file-visiting buffer." - (interactive (and current-prefix-arg - (list current-prefix-arg - (prompt-for-change-log-name)))) - (magit-add-change-log-entry whoami file-name t)) - -;;; Miscellaneous - -;;;###autoload -(defun magit-abort-dwim () - "Abort current operation. -Depending on the context, this will abort a merge, a rebase, a -patch application, a cherry-pick, a revert, or a bisect." - (interactive) - (cond ((magit-merge-state) (magit-merge-abort)) - ((magit-rebase-in-progress-p) (magit-rebase-abort)) - ((magit-am-in-progress-p) (magit-am-abort)) - ((magit-sequencer-in-progress-p) (magit-sequencer-abort)) - ((magit-bisect-in-progress-p) (magit-bisect-reset)))) - -(provide 'magit-extras) -;;; magit-extras.el ends here diff --git a/elpa/magit-20180118.313/magit-pkg.el b/elpa/magit-20180118.313/magit-pkg.el deleted file mode 100644 index 79a8d89f..00000000 --- a/elpa/magit-20180118.313/magit-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(define-package "magit" "20180118.313" "A Git porcelain inside Emacs." - '((emacs "24.4") - (async "20170823") - (dash "20170810") - (ghub "20171207") - (git-commit "20170823") - (let-alist "1.0.5") - (magit-popup "20171121") - (with-editor "20170817"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/magit-20180118.313/magit.info b/elpa/magit-20180118.313/magit.info deleted file mode 100644 index 3829380f..00000000 --- a/elpa/magit-20180118.313/magit.info +++ /dev/null @@ -1,180 +0,0 @@ -This is magit.info, produced by makeinfo version 5.2 from magit.texi. - - Copyright (C) 2015-2018 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: 752 -magit.info-2: 302320 - -Tag Table: -(Indirect) -Node: Top752 -Node: Introduction6103 -Node: Installation10826 -Node: Installing from an Elpa Archive11166 -Node: Installing from the Git Repository12269 -Node: Post-Installation Tasks15022 -Node: Getting Started16307 -Node: Interface Concepts21654 -Node: Modes and Buffers21986 -Node: Switching Buffers23731 -Node: Naming Buffers28272 -Node: Quitting Windows31281 -Node: Automatic Refreshing of Magit Buffers32913 -Node: Automatic Saving of File-Visiting Buffers35681 -Node: Automatic Reverting of File-Visiting Buffers36866 -Node: Risk of Reverting Automatically41862 -Node: Sections44245 -Node: Section Movement45186 -Node: Section Visibility49277 -Node: Section Hooks53124 -Node: Section Types and Values55405 -Node: Section Options56675 -Node: Popup Buffers and Prefix Commands57147 -Node: Completion Confirmation and the Selection59528 -Node: Action Confirmation59965 -Node: Completion and Confirmation66205 -Node: The Selection69391 -Node: The hunk-internal region72290 -Node: Support for Completion Frameworks73379 -Node: Additional Completion Options78195 -Node: Running Git78794 -Node: Viewing Git Output79067 -Node: Git Process Status80200 -Node: Running Git Manually81165 -Node: Git Executable83567 -Node: Global Git Arguments85849 -Node: Inspecting86655 -Node: Status Buffer87802 -Node: Status Sections90715 -Node: Status Header Sections95230 -Node: Status Module Sections97860 -Node: Status Options100361 -Node: Repository List102115 -Node: Logging104273 -Node: Refreshing Logs106720 -Node: Log Buffer108105 -Node: Log Margin111900 -Node: Select from Log114540 -Node: Reflog116644 -Node: Cherries118161 -Node: Diffing119888 -Node: Refreshing Diffs122835 -Node: Diff Buffer126326 -Node: Diff Options129060 -Node: Revision Buffer133335 -Node: Ediffing135873 -Node: References Buffer139469 -Node: References Sections146769 -Node: Bisecting147630 -Node: Visiting Blobs149368 -Node: Blaming149877 -Node: Manipulating154665 -Node: Repository Setup154981 -Node: Staging and Unstaging156021 -Node: Staging from File-Visiting Buffers160102 -Node: Applying161270 -Node: Committing163163 -Node: Initiating a Commit163746 -Node: Editing Commit Messages167057 -Node: Branching177453 -Node: The Two Remotes177653 -Node: The Branch Popup180270 -Node: The Branch Config Popup197117 -Node: Merging203021 -Node: Resolving Conflicts205188 -Node: Rebasing210189 -Node: Editing Rebase Sequences214345 -Node: Information About In-Progress Rebase217375 -Ref: Information About In-Progress Rebase-Footnote-1226123 -Node: Cherry Picking226719 -Node: Reverting228457 -Node: Resetting229820 -Node: Stashing231237 -Node: Transferring235749 -Node: Remotes235987 -Node: The Remote Popup236143 -Node: The Remote Config Popup238774 -Node: Fetching240426 -Node: Pulling241782 -Node: Pushing242618 -Node: Creating and Sending Patches247353 -Node: Applying Patches248190 -Node: Miscellaneous249776 -Node: Tagging250079 -Node: Notes250863 -Node: Submodules253174 -Node: Listing Submodules253388 -Node: Submodule Popup255265 -Node: Subtree256550 -Node: Common Commands257797 -Node: Wip Modes259543 -Node: Minor Mode for Buffers Visiting Files266340 -Node: Minor Mode for Buffers Visiting Blobs269689 -Node: Customizing270502 -Node: Per-Repository Configuration272170 -Node: Essential Settings273817 -Node: Safety274141 -Node: Performance275906 -Node: Microsoft Windows Performance282754 -Node: MacOS Performance283945 -Ref: MacOS Performance-Footnote-1285181 -Ref: MacOS Performance-Footnote-2285263 -Ref: MacOS Performance-Footnote-3285323 -Node: Plumbing285489 -Node: Calling Git286312 -Node: Getting a Value from Git287837 -Node: Calling Git for Effect290923 -Node: Section Plumbing297441 -Node: Creating Sections297669 -Node: Section Selection302320 -Node: Matching Sections304000 -Node: Refreshing Buffers309433 -Node: Conventions312568 -Node: Theming Faces312760 -Node: FAQ320875 -Node: FAQ - How to …?321317 -Node: How to show git's output?321681 -Node: How to install the gitman info manual?322435 -Node: How to show diffs for gpg-encrypted files?323405 -Node: How does branching and pushing work?324001 -Node: Can Magit be used as ‘ediff-version-control-package’?324370 -Node: FAQ - Issues and Errors326365 -Node: Magit is slow327169 -Node: I changed several thousand files at once and now Magit is unusable327383 -Node: I am having problems committing328112 -Node: I am using MS Windows and cannot push with Magit328593 -Node: I am using OS X and SOMETHING works in shell but not in Magit329210 -Node: Diffs contain control sequences330016 -Node: Expanding a file to show the diff causes it to disappear331090 -Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer331647 -Node: The mode-line information isn't always up-to-date332699 -Node: Emacs 245 hangs when loading Magit333766 -Node: A branch and tag sharing the same name breaks SOMETHING334380 -Node: Debugging Tools335186 -Node: Keystroke Index336921 -Node: Command Index366928 -Node: Function Index398536 -Node: Variable Index412585 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/magit-20180118.313/AUTHORS.md b/elpa/magit-20180404.1428/AUTHORS.md similarity index 97% rename from elpa/magit-20180118.313/AUTHORS.md rename to elpa/magit-20180404.1428/AUTHORS.md index 9ca756e3..a3cff499 100644 --- a/elpa/magit-20180118.313/AUTHORS.md +++ b/elpa/magit-20180404.1428/AUTHORS.md @@ -92,7 +92,9 @@ Contributors - Dan Erikson - Daniel Brockman - Daniel Farina +- Daniel Gröber - Daniel Hackney +- Daniel Kraus - Daniel Mai - Dan LaManna - Dato Simó @@ -101,6 +103,7 @@ Contributors - David Hull - David L. Rager - David Wallin +- Dean Kariniemi <8913263+d3k4r@users.noreply.github.com> - Dennis Paskorz - Divye Kapoor - Dominique Quatravaux @@ -152,6 +155,7 @@ Contributors - Justin Guenther - Justin Thomas - Kan-Ru Chen +- Kenny Ballou - Keshav Kini - Kévin Le Gouguec - Kimberly Wolk @@ -278,11 +282,13 @@ Contributors - Tom Feist - Tunc Uzlu - Vineet Naik +- Vladimir Panteleev - Wei Huang - Wilfred Hughes - Win Treese - Wouter Bolsterlee - Xavier Noria +- Xu Chunyang - Yann Hodique - York Zhao - Yuichi Higashi diff --git a/elpa/magit-20180404.1428/LICENSE b/elpa/magit-20180404.1428/LICENSE new file mode 100644 index 00000000..44325404 --- /dev/null +++ b/elpa/magit-20180404.1428/LICENSE @@ -0,0 +1,676 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/elpa/magit-20180118.313/dir b/elpa/magit-20180404.1428/dir similarity index 100% rename from elpa/magit-20180118.313/dir rename to elpa/magit-20180404.1428/dir diff --git a/elpa/magit-20180118.313/git-rebase.el b/elpa/magit-20180404.1428/git-rebase.el similarity index 99% rename from elpa/magit-20180118.313/git-rebase.el rename to elpa/magit-20180404.1428/git-rebase.el index dd2549ca..010b3a19 100644 --- a/elpa/magit-20180118.313/git-rebase.el +++ b/elpa/magit-20180404.1428/git-rebase.el @@ -494,7 +494,7 @@ running 'man git-rebase' at the command line) for details." (defun git-rebase-cancel-confirm (force) (or (not (buffer-modified-p)) force - (magit-confirm 'abort-rebase "Abort this rebase"))) + (magit-confirm 'abort-rebase "Abort this rebase" nil 'noabort))) (defun git-rebase-autostash-save () (--when-let (magit-file-line (magit-git-dir "rebase-merge/autostash")) @@ -521,6 +521,8 @@ running 'man git-rebase' at the command line) for details." (git-rebase-match-comment-line 0 'font-lock-comment-face) (,(concat git-rebase-comment-re " *" action-re) 0 'git-rebase-killed-action t) + ("\\[[^[]*\\]" + 0 'magit-keyword t) (,(format "^%s Rebase \\([^ ]*\\) onto \\([^ ]*\\)" comment-start) (1 'git-rebase-comment-hash t) (2 'git-rebase-comment-hash t)) @@ -556,7 +558,7 @@ By default, this is the same except for the \"pick\" command." (replace-match (format "%-8s" (mapconcat #'key-description - (--filter (not (eq (elt it 0) 'menu-bar)) + (--remove (eq (elt it 0) 'menu-bar) (reverse (where-is-internal cmd))) ", ")) t t nil 2)))))))) diff --git a/elpa/magit-20180118.313/magit-apply.el b/elpa/magit-20180404.1428/magit-apply.el similarity index 81% rename from elpa/magit-20180118.313/magit-apply.el rename to elpa/magit-20180404.1428/magit-apply.el index 027d26ff..b4a35969 100644 --- a/elpa/magit-20180118.313/magit-apply.el +++ b/elpa/magit-20180404.1428/magit-apply.el @@ -35,21 +35,21 @@ (require 'magit-wip) ;; For `magit-apply' -(declare-function magit-am-popup 'magit-sequence) -(declare-function magit-patch-apply-popup 'magit-files) +(declare-function magit-am-popup "magit-sequence" (&optional arg)) +(declare-function magit-patch-apply-popup "magit-files" (&optional arg)) ;; For `magit-discard-files' -(declare-function magit-checkout-stage 'magit) -(declare-function magit-checkout-read-stage 'magit) +(declare-function magit-checkout-stage "magit-merge" (file arg)) +(declare-function magit-checkout-read-stage "magit-merge" (file)) (defvar auto-revert-verbose) ;; For `magit-stage-untracked' -(declare-function magit-submodule-add 'magit-submodule) -(declare-function magit-submodule-read-name-for-path 'magit-submodule) -(declare-function borg--maybe-absorb-gitdir 'borg) -(declare-function borg--sort-submodule-sections 'borg) +(declare-function magit-submodule-add "magit-submodule" + (url &optional path name args)) +(declare-function magit-submodule-read-name-for-path "magit-submodule" + (path &optional prefer-short)) +(declare-function borg--maybe-absorb-gitdir "borg" (pkg)) +(declare-function borg--sort-submodule-sections "borg" (file)) (defvar borg-user-emacs-directory) -(require 'dired) - ;;; Options (defcustom magit-delete-by-moving-to-trash t @@ -264,8 +264,7 @@ With a prefix argument also stage previously untracked (but not ignored) files." (interactive "P") (when (magit-anything-staged-p) - (unless (magit-confirm 'stage-all-changes) - (user-error "Abort"))) + (magit-confirm 'stage-all-changes)) (magit-with-toplevel (magit-stage-1 (if all "--all" "-u")))) @@ -380,8 +379,7 @@ without requiring confirmation." (interactive) (when (or (magit-anything-unstaged-p) (magit-untracked-files)) - (unless (magit-confirm 'unstage-all-changes) - (user-error "Abort"))) + (magit-confirm 'unstage-all-changes)) (magit-wip-commit-before-change nil " before unstage") (magit-run-git "reset" "HEAD" "--") (magit-wip-commit-after-apply nil " after unstage")) @@ -403,12 +401,12 @@ without requiring confirmation." (`(,_ list) (magit-discard-files it))))) (defun magit-discard-region (section) - (when (magit-confirm 'discard "Discard region") - (magit-discard-apply section 'magit-apply-region))) + (magit-confirm 'discard "Discard region") + (magit-discard-apply section 'magit-apply-region)) (defun magit-discard-hunk (section) - (when (magit-confirm 'discard "Discard hunk") - (magit-discard-apply section 'magit-apply-hunk))) + (magit-confirm 'discard "Discard hunk") + (magit-discard-apply section 'magit-apply-hunk)) (defun magit-discard-apply (section apply) (if (eq (magit-diff-type section) 'unstaged) @@ -424,11 +422,10 @@ without requiring confirmation." (funcall apply section "--reverse" "--index")))) (defun magit-discard-hunks (sections) - (when (magit-confirm 'discard - (format "Discard %s hunks from %s" - (length sections) - (magit-section-parent-value (car sections)))) - (magit-discard-apply-n sections 'magit-apply-hunks))) + (magit-confirm 'discard (format "Discard %s hunks from %s" + (length sections) + (magit-section-parent-value (car sections)))) + (magit-discard-apply-n sections 'magit-apply-hunks)) (defun magit-discard-apply-n (sections apply) (let ((section (car sections))) @@ -481,89 +478,91 @@ without requiring confirmation." (when resolve (dolist (file (nreverse resolve)) (magit-checkout-stage file (magit-checkout-read-stage file)))) - (magit-discard-files--resurrect (nreverse resurrect)) - (magit-discard-files--delete (nreverse delete) status) - (magit-discard-files--rename (nreverse rename) status) - (magit-discard-files--discard (nreverse discard) - (nreverse discard-new)) + (when resurrect + (magit-discard-files--resurrect (nreverse resurrect))) + (when delete + (magit-discard-files--delete (nreverse delete) status)) + (when rename + (magit-discard-files--rename (nreverse rename) status)) + (when (or discard discard-new) + (magit-discard-files--discard (nreverse discard) + (nreverse discard-new))) (magit-wip-commit-after-apply files " after discard")) (magit-refresh)))) (defun magit-discard-files--resurrect (files) - (when (magit-confirm-files 'resurrect files) - (if (eq (magit-diff-type) 'staged) - (magit-call-git "reset" "--" files) - (magit-call-git "checkout" "--" files)))) + (magit-confirm-files 'resurrect files) + (if (eq (magit-diff-type) 'staged) + (magit-call-git "reset" "--" files) + (magit-call-git "checkout" "--" files))) (defun magit-discard-files--delete (files status) - (when (if magit-delete-by-moving-to-trash - (magit-confirm-files 'trash files) - (magit-confirm-files 'delete files)) - (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash)) - (dolist (file files) - (if (memq (magit-diff-type) '(unstaged untracked)) - (progn (dired-delete-file file dired-recursive-deletes - magit-delete-by-moving-to-trash) - (dired-clean-up-after-deletion file)) - (pcase (nth 3 (assoc file status)) - (? (delete-file file t) - (magit-call-git "rm" "--cached" "--" file)) - (?M (let ((temp (magit-git-string "checkout-index" "--temp" file))) - (string-match - (format "\\(.+?\\)\t%s" (regexp-quote file)) temp) - (rename-file (match-string 1 temp) - (setq temp (concat file ".~{index}~"))) - (delete-file temp t)) - (magit-call-git "rm" "--cached" "--force" "--" file)) - (?D (magit-call-git "checkout" "--" file) - (delete-file file t) - (magit-call-git "rm" "--cached" "--force" "--" file)))))))) + (magit-confirm-files (if magit-delete-by-moving-to-trash 'trash 'delete) + files) + (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash)) + (dolist (file files) + (if (memq (magit-diff-type) '(unstaged untracked)) + (progn (dired-delete-file file dired-recursive-deletes + magit-delete-by-moving-to-trash) + (dired-clean-up-after-deletion file)) + (pcase (nth 3 (assoc file status)) + (? (delete-file file t) + (magit-call-git "rm" "--cached" "--" file)) + (?M (let ((temp (magit-git-string "checkout-index" "--temp" file))) + (string-match + (format "\\(.+?\\)\t%s" (regexp-quote file)) temp) + (rename-file (match-string 1 temp) + (setq temp (concat file ".~{index}~"))) + (delete-file temp t)) + (magit-call-git "rm" "--cached" "--force" "--" file)) + (?D (magit-call-git "checkout" "--" file) + (delete-file file t) + (magit-call-git "rm" "--cached" "--force" "--" file))))))) (defun magit-discard-files--rename (files status) - (when (magit-confirm 'rename "Undo rename %s" "Undo %i renames" - (mapcar (lambda (file) - (setq file (assoc file status)) - (format "%s -> %s" (cadr file) (car file))) - files)) - (dolist (file files) - (let ((orig (cadr (assoc file status)))) - (if (file-exists-p file) - (progn - (--when-let (file-name-directory orig) - (make-directory it t)) - (magit-call-git "mv" file orig)) - (magit-call-git "rm" "--cached" "--" file) - (magit-call-git "reset" "--" orig)))))) + (magit-confirm 'rename "Undo rename %s" "Undo %i renames" nil + (mapcar (lambda (file) + (setq file (assoc file status)) + (format "%s -> %s" (cadr file) (car file))) + files)) + (dolist (file files) + (let ((orig (cadr (assoc file status)))) + (if (file-exists-p file) + (progn + (--when-let (file-name-directory orig) + (make-directory it t)) + (magit-call-git "mv" file orig)) + (magit-call-git "rm" "--cached" "--" file) + (magit-call-git "reset" "--" orig))))) (defun magit-discard-files--discard (sections new-files) (let ((files (--map (oref it value) sections))) - (when (magit-confirm-files - 'discard (append files new-files) - (format "Discard %s changes in" (magit-diff-type))) - (if (eq (magit-diff-type (car sections)) 'unstaged) - (magit-call-git "checkout" "--" files) - (when new-files - (magit-call-git "add" "--" new-files) - (magit-call-git "reset" "--" new-files)) - (let ((binaries (magit-staged-binary-files))) - (when binaries - (setq sections - (--filter (not (member (oref it value) binaries)) - sections))) - (cond ((= (length sections) 1) - (magit-discard-apply (car sections) 'magit-apply-diff)) - (sections - (magit-discard-apply-n sections 'magit-apply-diffs))) - (when binaries - (let ((modified (magit-unstaged-files t))) - (setq binaries (--separate (member it modified) binaries))) - (when (cadr binaries) - (magit-call-git "reset" "--" (cadr binaries))) - (when (car binaries) - (user-error - (concat - "Cannot discard staged changes to binary files, " - "which also have unstaged changes. Unstage instead."))))))))) + (magit-confirm-files 'discard (append files new-files) + (format "Discard %s changes in" (magit-diff-type))) + (if (eq (magit-diff-type (car sections)) 'unstaged) + (magit-call-git "checkout" "--" files) + (when new-files + (magit-call-git "add" "--" new-files) + (magit-call-git "reset" "--" new-files)) + (let ((binaries (magit-staged-binary-files))) + (when binaries + (setq sections + (--remove (member (oref it value) binaries) + sections))) + (cond ((= (length sections) 1) + (magit-discard-apply (car sections) 'magit-apply-diff)) + (sections + (magit-discard-apply-n sections 'magit-apply-diffs))) + (when binaries + (let ((modified (magit-unstaged-files t))) + (setq binaries (--separate (member it modified) binaries))) + (when (cadr binaries) + (magit-call-git "reset" "--" (cadr binaries))) + (when (car binaries) + (user-error + (concat + "Cannot discard staged changes to binary files, " + "which also have unstaged changes. Unstage instead.")))))))) ;;;; Reverse @@ -584,19 +583,19 @@ so causes the change to be applied to the index as well." (`(,_ list) (magit-reverse-files it args))))) (defun magit-reverse-region (section args) - (when (magit-confirm 'reverse "Reverse region") - (magit-reverse-apply section 'magit-apply-region args))) + (magit-confirm 'reverse "Reverse region") + (magit-reverse-apply section 'magit-apply-region args)) (defun magit-reverse-hunk (section args) - (when (magit-confirm 'reverse "Reverse hunk") - (magit-reverse-apply section 'magit-apply-hunk args))) + (magit-confirm 'reverse "Reverse hunk") + (magit-reverse-apply section 'magit-apply-hunk args)) (defun magit-reverse-hunks (sections args) - (when (magit-confirm 'reverse - (format "Reverse %s hunks from %s" - (length sections) - (magit-section-parent-value (car sections)))) - (magit-reverse-apply sections 'magit-apply-hunks args))) + (magit-confirm 'reverse + (format "Reverse %s hunks from %s" + (length sections) + (magit-section-parent-value (car sections)))) + (magit-reverse-apply sections 'magit-apply-hunks args)) (defun magit-reverse-file (section args) (magit-reverse-files (list section) args)) @@ -606,10 +605,10 @@ so causes the change to be applied to the index as well." (let ((bs (magit-staged-binary-files))) (--separate (member (oref it value) bs) sections))] - (when (magit-confirm-files 'reverse (--map (oref it value) sections)) - (if (= (length sections) 1) - (magit-reverse-apply (car sections) 'magit-apply-diff args) - (magit-reverse-apply sections 'magit-apply-diffs args))) + (magit-confirm-files 'reverse (--map (oref it value) sections)) + (if (= (length sections) 1) + (magit-reverse-apply (car sections) 'magit-apply-diff args) + (magit-reverse-apply sections 'magit-apply-diffs args)) (when binaries (user-error "Cannot reverse binary files")))) diff --git a/elpa/magit-20180118.313/magit-autoloads.el b/elpa/magit-20180404.1428/magit-autoloads.el similarity index 85% rename from elpa/magit-20180118.313/magit-autoloads.el rename to elpa/magit-20180404.1428/magit-autoloads.el index 7e4972c8..cd4132df 100644 --- a/elpa/magit-20180118.313/magit-autoloads.el +++ b/elpa/magit-20180404.1428/magit-autoloads.el @@ -3,8 +3,8 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "git-rebase" "git-rebase.el" (23136 41405 671630 -;;;;;; 959000)) +;;;### (autoloads nil "git-rebase" "git-rebase.el" (23238 5904 70048 +;;;;;; 74000)) ;;; Generated autoloads from git-rebase.el (autoload 'git-rebase-mode "git-rebase" "\ @@ -23,110 +23,8 @@ running 'man git-rebase' at the command line) for details. ;;;*** -;;;### (autoloads nil "magit" "magit.el" (23136 41405 717484 33000)) +;;;### (autoloads nil "magit" "magit.el" (23238 5904 100293 75000)) ;;; Generated autoloads from magit.el - (autoload 'magit-merge-popup "magit" nil t) - -(autoload 'magit-merge "magit" "\ -Merge commit REV into the current branch; using default message. - -Unless there are conflicts or a prefix argument is used create a -merge commit using a generic commit message and without letting -the user inspect the result. With a prefix argument pretend the -merge failed to give the user the opportunity to inspect the -merge. - -\(git merge --no-edit|--no-commit [ARGS] REV) - -\(fn REV &optional ARGS NOCOMMIT)" t nil) - -(autoload 'magit-merge-editmsg "magit" "\ -Merge commit REV into the current branch; and edit message. -Perform the merge and prepare a commit message but let the user -edit it. - -\(git merge --edit --no-ff [ARGS] REV) - -\(fn REV &optional ARGS)" t nil) - -(autoload 'magit-merge-nocommit "magit" "\ -Merge commit REV into the current branch; pretending it failed. -Pretend the merge failed to give the user the opportunity to -inspect the merge and change the commit message. - -\(git merge --no-commit --no-ff [ARGS] REV) - -\(fn REV &optional ARGS)" t nil) - -(autoload 'magit-merge-preview "magit" "\ -Preview result of merging REV into the current branch. - -\(fn REV)" t nil) - -(autoload 'magit-merge-abort "magit" "\ -Abort the current merge operation. - -\(git merge --abort) - -\(fn)" t nil) - (autoload 'magit-reset-popup "magit" nil t) - -(autoload 'magit-reset-index "magit" "\ -Reset the index to COMMIT. -Keep the head and working tree as-is, so if COMMIT refers to the -head this effectively unstages all changes. - -\(git reset COMMIT .) - -\(fn COMMIT)" t nil) - -(autoload 'magit-reset "magit" "\ -Reset the head and index to COMMIT, but not the working tree. -With a prefix argument also reset the working tree. - -\(git reset --mixed|--hard COMMIT) - -\(fn COMMIT &optional HARD)" t nil) - -(autoload 'magit-reset-head "magit" "\ -Reset the head and index to COMMIT, but not the working tree. - -\(git reset --mixed COMMIT) - -\(fn COMMIT)" t nil) - -(autoload 'magit-reset-soft "magit" "\ -Reset the head to COMMIT, but not the index and working tree. - -\(git reset --soft REVISION) - -\(fn COMMIT)" t nil) - -(autoload 'magit-reset-hard "magit" "\ -Reset the head, index, and working tree to COMMIT. - -\(git reset --hard REVISION) - -\(fn COMMIT)" t nil) - (autoload 'magit-tag-popup "magit" nil t) - -(autoload 'magit-tag "magit" "\ -Create a new tag with the given NAME at REV. -With a prefix argument annotate the tag. - -\(git tag [--annotate] NAME REV) - -\(fn NAME REV &optional ARGS)" t nil) - -(autoload 'magit-tag-delete "magit" "\ -Delete one or more tags. -If the region marks multiple tags (and nothing else), then offer -to delete those, otherwise prompt for a single tag to be deleted, -defaulting to the tag at point. - -\(git tag -d TAGS) - -\(fn TAGS)" t nil) (autoload 'magit-dispatch-popup "magit" nil t) (autoload 'magit-run-popup "magit" nil t) @@ -180,8 +78,8 @@ and Emacs to it. ;;;*** -;;;### (autoloads nil "magit-apply" "magit-apply.el" (23136 41405 -;;;;;; 687457 541000)) +;;;### (autoloads nil "magit-apply" "magit-apply.el" (23238 5904 +;;;;;; 79183 226000)) ;;; Generated autoloads from magit-apply.el (autoload 'magit-stage-file "magit-apply" "\ @@ -216,8 +114,8 @@ Remove all changes from the staging area. ;;;*** -;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (23136 -;;;;;; 41405 656396 85000)) +;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (23238 +;;;;;; 5904 60696 186000)) ;;; Generated autoloads from magit-autorevert.el (defvar magit-revert-buffers t) @@ -246,8 +144,8 @@ See `auto-revert-mode' for more information on Auto-Revert mode. ;;;*** -;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (23136 41405 -;;;;;; 685693 119000)) +;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (23238 5904 +;;;;;; 78245 837000)) ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect-popup "magit-bisect" nil t) @@ -298,8 +196,8 @@ bisect run'. ;;;*** -;;;### (autoloads nil "magit-blame" "magit-blame.el" (23136 41405 -;;;;;; 713583 966000)) +;;;### (autoloads nil "magit-blame" "magit-blame.el" (23238 5904 +;;;;;; 98278 743000)) ;;; Generated autoloads from magit-blame.el (autoload 'magit-blame-popup "magit-blame" nil t) @@ -316,9 +214,9 @@ If the buffer visits a revision of that file, then blame up to that revision, otherwise blame the file's full history, including uncommitted changes. -If Magit-Blame mode is already turned on then blame recursively, by -visiting REVISION:FILE (using `magit-find-file'), where revision -is the revision before the revision that added the lines at +If Magit-Blame mode is already turned on then blame recursively, +by visiting REVISION:FILE (using `magit-find-file'), where +revision is a parent of the revision that added the lines at point. ARGS is a list of additional arguments to pass to `git blame'; @@ -328,8 +226,8 @@ only arguments available from `magit-blame-popup' should be used. ;;;*** -;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (23136 -;;;;;; 41405 675373 276000)) +;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (23238 +;;;;;; 5904 72174 306000)) ;;; Generated autoloads from magit-bookmark.el (autoload 'magit-bookmark--status-jump "magit-bookmark" "\ @@ -434,8 +332,8 @@ Create a Magit submodule list bookmark. ;;;*** -;;;### (autoloads nil "magit-branch" "magit-branch.el" (23136 41405 -;;;;;; 683693 933000)) +;;;### (autoloads nil "magit-branch" "magit-branch.el" (23238 5904 +;;;;;; 77221 552000)) ;;; Generated autoloads from magit-branch.el (autoload 'magit-branch-popup "magit" nil t) @@ -586,6 +484,20 @@ the remote. \(fn OLD NEW &optional FORCE)" t nil) +(autoload 'magit-branch-shelve "magit-branch" "\ +Shelve a BRANCH. +Rename \"refs/heads/BRANCH\" to \"refs/shelved/BRANCH\", +and also rename the respective reflog file. + +\(fn BRANCH)" t nil) + +(autoload 'magit-branch-unshelve "magit-branch" "\ +Unshelve a BRANCH +Rename \"refs/shelved/BRANCH\" to \"refs/heads/BRANCH\", +and also rename the respective reflog file. + +\(fn BRANCH)" t nil) + (autoload 'magit-branch-config-popup "magit-branch" "\ Popup console for setting branch variables. @@ -713,8 +625,8 @@ When `never' (the default) then the variable is never set. ;;;*** -;;;### (autoloads nil "magit-collab" "magit-collab.el" (23136 41405 -;;;;;; 705936 705000)) +;;;### (autoloads nil "magit-collab" "magit-collab.el" (23238 5904 +;;;;;; 93109 446000)) ;;; Generated autoloads from magit-collab.el (autoload 'magit-browse-pull-request "magit-collab" "\ @@ -727,8 +639,8 @@ be lifted eventually to support other Git forges. ;;;*** -;;;### (autoloads nil "magit-commit" "magit-commit.el" (23136 41405 -;;;;;; 658182 227000)) +;;;### (autoloads nil "magit-commit" "magit-commit.el" (23238 5904 +;;;;;; 61640 672000)) ;;; Generated autoloads from magit-commit.el (autoload 'magit-commit "magit-commit" "\ @@ -808,10 +720,21 @@ Create a squash commit targeting COMMIT and instantly rebase. \(fn &optional COMMIT ARGS)" t nil) +(autoload 'magit-commit-reshelve "magit-commit" "\ +Change the committer date and possibly the author date of `HEAD'. + +If you are the author of `HEAD', then both dates are changed, +otherwise only the committer date. The current time is used +as the initial minibuffer input and the original author (if +that is you) or committer date is available as the previous +history element. + +\(fn DATE)" t nil) + ;;;*** -;;;### (autoloads nil "magit-diff" "magit-diff.el" (23136 41405 710989 -;;;;;; 251000)) +;;;### (autoloads nil "magit-diff" "magit-diff.el" (23238 5904 96972 +;;;;;; 454000)) ;;; Generated autoloads from magit-diff.el (autoload 'magit-diff-popup "magit-diff" "\ @@ -868,6 +791,11 @@ Show changes between the working tree and the index. \(fn &optional ARGS FILES)" t nil) +(autoload 'magit-diff-unmerged "magit-diff" "\ +Show changes that are being merged. + +\(fn &optional ARGS FILES)" t nil) + (autoload 'magit-diff-while-committing "magit-diff" "\ While committing, show the changes that are about to be committed. While amending, invoking the command again toggles between @@ -895,8 +823,8 @@ for a revision. ;;;*** -;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (23136 41405 -;;;;;; 699067 934000)) +;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (23238 5904 +;;;;;; 89544 993000)) ;;; Generated autoloads from magit-ediff.el (autoload 'magit-ediff-popup "magit-ediff" nil t) @@ -984,8 +912,8 @@ stash that were staged. ;;;*** -;;;### (autoloads nil "magit-extras" "magit-extras.el" (23136 41405 -;;;;;; 659866 526000)) +;;;### (autoloads nil "magit-extras" "magit-extras.el" (23238 5904 +;;;;;; 62671 280000)) ;;; Generated autoloads from magit-extras.el (autoload 'magit-run-git-gui "magit-extras" "\ @@ -1120,6 +1048,62 @@ on a position in a file-visiting buffer. \(fn &optional WHOAMI FILE-NAME)" t nil) +(autoload 'magit-reshelve-since "magit-extras" "\ +Change the author and committer dates of the commits since REV. + +Ask the user for the first reachable commit whose dates should +be changed. The read the new date for that commit. The initial +minibuffer input and the previous history element offer good +values. The next commit will be created one minute later and so +on. + +This command is only intended for interactive use and should only +be used on highly rearranged and unpublished history. + +\(fn REV)" t nil) + +(autoload 'magit-copy-section-value "magit-extras" "\ +Save the value of the current section for later use. + +Save the section value to the `kill-ring', and, provided that +the current section is a commit, branch, or tag section, push +the (referenced) revision to the `magit-revision-stack' for use +with `magit-pop-revision-stack'. + +When the current section is a branch or a tag, and a prefix +argument is used, then save the revision at its tip to the +`kill-ring' instead of the reference name. + +When the region is active, then save that to the `kill-ring', +like `kill-ring-save' would, instead of behaving as described +above. + +\(fn)" t nil) + +(autoload 'magit-copy-buffer-revision "magit-extras" "\ +Save the revision of the current buffer for later use. + +Save the revision shown in the current buffer to the `kill-ring' +and push it to the `magit-revision-stack'. + +This command is mainly intended for use in `magit-revision-mode' +buffers, the only buffers where it is always unambiguous exactly +which revision should be saved. + +Most other Magit buffers usually show more than one revision, in +some way or another, so this command has to select one of them, +and that choice might not always be the one you think would have +been the best pick. + +In such buffers it is often more useful to save the value of +the current section instead, using `magit-copy-section-value'. + +When the region is active, then save that to the `kill-ring', +like `kill-ring-save' would, instead of behaving as described +above. + +\(fn)" t nil) + (autoload 'magit-abort-dwim "magit-extras" "\ Abort current operation. Depending on the context, this will abort a merge, a rebase, a @@ -1129,8 +1113,8 @@ patch application, a cherry-pick, a revert, or a bisect. ;;;*** -;;;### (autoloads nil "magit-files" "magit-files.el" (23136 41405 -;;;;;; 673621 781000)) +;;;### (autoloads nil "magit-files" "magit-files.el" (23238 5904 +;;;;;; 71120 342000)) ;;; Generated autoloads from magit-files.el (autoload 'magit-find-file "magit-files" "\ @@ -1177,8 +1161,8 @@ Checkout FILE from REV. ;;;*** -;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (23136 41405 -;;;;;; 697269 116000)) +;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (23238 5904 +;;;;;; 88357 305000)) ;;; Generated autoloads from magit-imenu.el (autoload 'magit-imenu--log-prev-index-position-function "magit-imenu" "\ @@ -1294,8 +1278,8 @@ beginning of the line. ;;;*** -;;;### (autoloads nil "magit-log" "magit-log.el" (23136 41405 701080 -;;;;;; 500000)) +;;;### (autoloads nil "magit-log" "magit-log.el" (23238 5904 90471 +;;;;;; 712000)) ;;; Generated autoloads from magit-log.el (autoload 'magit-log-buffer-file-popup "magit-log" "\ @@ -1378,15 +1362,96 @@ Show commits in a branch that are not merged in the upstream branch. ;;;*** -;;;### (autoloads nil "magit-notes" "magit-notes.el" (23136 41405 -;;;;;; 736286 140000)) +;;;### (autoloads nil "magit-merge" "magit-merge.el" (23238 5904 +;;;;;; 85985 140000)) +;;; Generated autoloads from magit-merge.el + (autoload 'magit-merge-popup "magit" nil t) + +(autoload 'magit-merge "magit-merge" "\ +Merge commit REV into the current branch; using default message. + +Unless there are conflicts or a prefix argument is used create a +merge commit using a generic commit message and without letting +the user inspect the result. With a prefix argument pretend the +merge failed to give the user the opportunity to inspect the +merge. + +\(git merge --no-edit|--no-commit [ARGS] REV) + +\(fn REV &optional ARGS NOCOMMIT)" t nil) + +(autoload 'magit-merge-editmsg "magit-merge" "\ +Merge commit REV into the current branch; and edit message. +Perform the merge and prepare a commit message but let the user +edit it. + +\(git merge --edit --no-ff [ARGS] REV) + +\(fn REV &optional ARGS)" t nil) + +(autoload 'magit-merge-nocommit "magit-merge" "\ +Merge commit REV into the current branch; pretending it failed. +Pretend the merge failed to give the user the opportunity to +inspect the merge and change the commit message. + +\(git merge --no-commit --no-ff [ARGS] REV) + +\(fn REV &optional ARGS)" t nil) + +(autoload 'magit-merge-into "magit-merge" "\ +Merge the current branch into BRANCH and remove the former. + +Before merging, force push the source branch to its push-remote, +provided the respective remote branch already exists, ensuring +that the respective pull-request (if any) won't get stuck on some +obsolete version of the commits that are being merged. Finally +if `magit-branch-pull-request' was used to create the merged +branch, then also remove the respective remote branch. + +\(fn BRANCH &optional ARGS)" t nil) + +(autoload 'magit-merge-absorb "magit-merge" "\ +Merge BRANCH into the current branch and remove the former. + +Before merging, force push the source branch to its push-remote, +provided the respective remote branch already exists, ensuring +that the respective pull-request (if any) won't get stuck on some +obsolete version of the commits that are being merged. Finally +if `magit-branch-pull-request' was used to create the merged +branch, then also remove the respective remote branch. + +\(fn BRANCH &optional ARGS)" t nil) + +(autoload 'magit-merge-squash "magit-merge" "\ +Squash commit REV into the current branch; don't create a commit. + +\(git merge --squash REV) + +\(fn REV)" t nil) + +(autoload 'magit-merge-preview "magit-merge" "\ +Preview result of merging REV into the current branch. + +\(fn REV)" t nil) + +(autoload 'magit-merge-abort "magit-merge" "\ +Abort the current merge operation. + +\(git merge --abort) + +\(fn)" t nil) + +;;;*** + +;;;### (autoloads nil "magit-notes" "magit-notes.el" (23238 5904 +;;;;;; 109938 714000)) ;;; Generated autoloads from magit-notes.el (autoload 'magit-notes-popup "magit" nil t) ;;;*** -;;;### (autoloads nil "magit-refs" "magit-refs.el" (23136 41405 661697 -;;;;;; 181000)) +;;;### (autoloads nil "magit-refs" "magit-refs.el" (23238 5904 63680 +;;;;;; 22000)) ;;; Generated autoloads from magit-refs.el (autoload 'magit-show-refs-popup "magit-refs" "\ @@ -1415,8 +1480,8 @@ Refs are compared with a branch read from the user. ;;;*** -;;;### (autoloads nil "magit-remote" "magit-remote.el" (23136 41405 -;;;;;; 725744 209000)) +;;;### (autoloads nil "magit-remote" "magit-remote.el" (23238 5904 +;;;;;; 104814 209000)) ;;; Generated autoloads from magit-remote.el (autoload 'magit-clone "magit-remote" "\ @@ -1441,10 +1506,24 @@ Delete the remote named REMOTE. \(fn REMOTE)" t nil) +(autoload 'magit-remote-prune "magit-remote" "\ +Remove stale remote-tracking branches for REMOTE. + +\(fn REMOTE)" t nil) + (autoload 'magit-remote-prune-refspecs "magit-remote" "\ -Remove stale refspecs and tracking branches for REMOTE. -If there are only stale refspecs, then offer to either delete the -remote or replace the refspecs with the default refspec instead. +Remove stale refspecs for REMOTE. + +A refspec is stale if there no longer exists at least one branch +on the remote that would be fetched due to that refspec. A stale +refspec is problematic because its existence causes Git to refuse +to fetch according to the remaining non-stale refspecs. + +If only stale refspecs remain, then offer to either delete the +remote or to replace the stale refspecs with the default refspec. + +Also remove the remote-tracking branches that were created due to +the now stale refspecs. Other stale branches are not removed. \(fn REMOTE)" t nil) @@ -1510,6 +1589,16 @@ removed on the respective remote. Fetch from all remotes. \(fn)" t nil) + +(autoload 'magit-fetch-modules "magit-remote" "\ +Fetch all submodules. + +Option `magit-fetch-modules-jobs' controls how many submodules +are being fetched in parallel. Also fetch the super-repository, +because `git-fetch' does not support not doing that. With a +prefix argument fetch all remotes. + +\(fn &optional ALL)" t nil) (autoload 'magit-pull-popup "magit-remote" nil t) (autoload 'magit-pull-and-fetch-popup "magit-remote" nil t) @@ -1655,8 +1744,8 @@ is asked to pull. START has to be reachable from that commit. ;;;*** -;;;### (autoloads nil "magit-repos" "magit-repos.el" (23136 41405 -;;;;;; 709110 269000)) +;;;### (autoloads nil "magit-repos" "magit-repos.el" (23238 5904 +;;;;;; 95744 285000)) ;;; Generated autoloads from magit-repos.el (autoload 'magit-list-repositories "magit-repos" "\ @@ -1670,8 +1759,53 @@ control which repositories are displayed. ;;;*** -;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (23136 -;;;;;; 41405 721154 941000)) +;;;### (autoloads nil "magit-reset" "magit-reset.el" (23238 5904 +;;;;;; 94293 154000)) +;;; Generated autoloads from magit-reset.el + (autoload 'magit-reset-popup "magit" nil t) + +(autoload 'magit-reset-index "magit-reset" "\ +Reset the index to COMMIT. +Keep the head and working tree as-is, so if COMMIT refers to the +head this effectively unstages all changes. + +\(git reset COMMIT .) + +\(fn COMMIT)" t nil) + +(autoload 'magit-reset "magit-reset" "\ +Reset the head and index to COMMIT, but not the working tree. +With a prefix argument also reset the working tree. + +\(git reset --mixed|--hard COMMIT) + +\(fn COMMIT &optional HARD)" t nil) + +(autoload 'magit-reset-head "magit-reset" "\ +Reset the head and index to COMMIT, but not the working tree. + +\(git reset --mixed COMMIT) + +\(fn COMMIT)" t nil) + +(autoload 'magit-reset-soft "magit-reset" "\ +Reset the head to COMMIT, but not the index and working tree. + +\(git reset --soft REVISION) + +\(fn COMMIT)" t nil) + +(autoload 'magit-reset-hard "magit-reset" "\ +Reset the head, index, and working tree to COMMIT. + +\(git reset --hard REVISION) + +\(fn COMMIT)" t nil) + +;;;*** + +;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (23238 +;;;;;; 5904 102328 994000)) ;;; Generated autoloads from magit-sequence.el (autoload 'magit-sequencer-continue "magit-sequence" "\ @@ -1706,6 +1840,38 @@ the region selects multiple commits, then apply all of them, without prompting. \(fn COMMITS &optional ARGS)" t nil) + +(autoload 'magit-cherry-harvest "magit-sequence" "\ +Move COMMITS from another BRANCH onto the current branch. +Remove the COMMITS from BRANCH and stay on the current branch. +If a conflict occurs, then you have to fix that and finish the +process manually. + +\(fn COMMITS BRANCH &optional ARGS)" t nil) + +(autoload 'magit-cherry-donate "magit-sequence" "\ +Move COMMITS from the current branch onto another existing BRANCH. +Remove COMMITS from the current branch and stay on that branch. +If a conflict occurs, then you have to fix that and finish the +process manually. + +\(fn COMMITS BRANCH &optional ARGS)" t nil) + +(autoload 'magit-cherry-spinout "magit-sequence" "\ +Move COMMITS from the current branch onto a new BRANCH. +Remove COMMITS from the current branch and stay on that branch. +If a conflict occurs, then you have to fix that and finish the +process manually. + +\(fn COMMITS BRANCH START-POINT &optional ARGS)" t nil) + +(autoload 'magit-cherry-spinoff "magit-sequence" "\ +Move COMMITS from the current branch onto a new BRANCH. +Remove COMMITS from the current branch and checkout BRANCH. +If a conflict occurs, then you have to fix that and finish +the process manually. + +\(fn COMMITS BRANCH START-POINT &optional ARGS)" t nil) (autoload 'magit-revert-popup "magit-sequence" nil t) (autoload 'magit-revert "magit-sequence" "\ @@ -1826,8 +1992,8 @@ Abort the current rebase operation, restoring the original branch. ;;;*** -;;;### (autoloads nil "magit-stash" "magit-stash.el" (23136 41405 -;;;;;; 693437 511000)) +;;;### (autoloads nil "magit-stash" "magit-stash.el" (23238 5904 +;;;;;; 84720 792000)) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash-popup "magit-stash" nil t) @@ -1933,8 +2099,8 @@ Show all diffs of a stash in a buffer. ;;;*** -;;;### (autoloads nil "magit-status" "magit-status.el" (23136 41405 -;;;;;; 704009 426000)) +;;;### (autoloads nil "magit-status" "magit-status.el" (23238 5904 +;;;;;; 91797 296000)) ;;; Generated autoloads from magit-status.el (autoload 'magit-init "magit-status" "\ @@ -1965,63 +2131,75 @@ then offer to initialize it as a new repository. ;;;*** -;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (23136 -;;;;;; 41405 738113 17000)) +;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (23238 +;;;;;; 5904 111806 568000)) ;;; Generated autoloads from magit-submodule.el (autoload 'magit-submodule-popup "magit-submodule" nil t) (autoload 'magit-submodule-add "magit-submodule" "\ -Add the repository at URL as a submodule. - -Optional PATH is the path to the submodule relative to the root -of the superproject. If it is nil, then the path is determined -based on the URL. +Add the repository at URL as a module. -Optional NAME is the name of the submodule. If it is nil, then -PATH also becomes the name. +Optional PATH is the path to the module relative to the root of +the superproject. If it is nil, then the path is determined +based on the URL. Optional NAME is the name of the module. If +it is nil, then PATH also becomes the name. -\(fn URL &optional PATH NAME)" t nil) +\(fn URL &optional PATH NAME ARGS)" t nil) (autoload 'magit-submodule-read-name-for-path "magit-submodule" "\ \(fn PATH &optional PREFER-SHORT)" nil nil) -(autoload 'magit-submodule-setup "magit-submodule" "\ -Clone and register missing submodules and checkout appropriate commits. +(autoload 'magit-submodule-register "magit-submodule" "\ +Register MODULES. -\(fn)" t nil) +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user. -(autoload 'magit-submodule-init "magit-submodule" "\ -Register submodules listed in \".gitmodules\" into \".git/config\". +\(fn MODULES)" t nil) -\(fn)" t nil) +(autoload 'magit-submodule-populate "magit-submodule" "\ +Create MODULES working directories, checking out the recorded commits. + +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user. + +\(fn MODULES)" t nil) (autoload 'magit-submodule-update "magit-submodule" "\ -Clone missing submodules and checkout appropriate commits. -With a prefix argument also register submodules in \".git/config\". +Update MODULES by checking out the recorded commits. -\(fn &optional INIT)" t nil) +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user. -(autoload 'magit-submodule-sync "magit-submodule" "\ -Update each submodule's remote URL according to \".gitmodules\". +\(fn MODULES ARGS)" t nil) -\(fn)" t nil) +(autoload 'magit-submodule-synchronize "magit-submodule" "\ +Synchronize url configuration of MODULES. -(autoload 'magit-submodule-fetch "magit-submodule" "\ -Fetch all submodules. +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user. -Option `magit-submodule-fetch-jobs' controls how many submodules -are being fetched in parallel. Also fetch the super-repository, -because `git-fetch' does not support not doing that. With a -prefix argument fetch all remotes. +\(fn MODULES ARGS)" t nil) -\(fn &optional ALL)" t nil) +(autoload 'magit-submodule-unpopulate "magit-submodule" "\ +Remove working directories of MODULES. -(autoload 'magit-submodule-deinit "magit-submodule" "\ -Unregister the submodule at PATH. +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user. -\(fn PATH)" t nil) +\(fn MODULES ARGS)" t nil) (autoload 'magit-insert-modules "magit-submodule" "\ Insert submodule sections. @@ -2069,8 +2247,8 @@ Display a list of the current repository's submodules. ;;;*** -;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (23136 41405 -;;;;;; 679032 636000)) +;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (23238 5904 +;;;;;; 73316 479000)) ;;; Generated autoloads from magit-subtree.el (autoload 'magit-subtree-popup "magit-subtree" nil t) @@ -2106,8 +2284,33 @@ Extract the history of the subtree PREFIX. ;;;*** -;;;### (autoloads nil "magit-utils" "magit-utils.el" (23136 41405 -;;;;;; 655055 816000)) +;;;### (autoloads nil "magit-tag" "magit-tag.el" (23238 5904 83258 +;;;;;; 341000)) +;;; Generated autoloads from magit-tag.el + (autoload 'magit-tag-popup "magit" nil t) + +(autoload 'magit-tag "magit-tag" "\ +Create a new tag with the given NAME at REV. +With a prefix argument annotate the tag. + +\(git tag [--annotate] NAME REV) + +\(fn NAME REV &optional ARGS)" t nil) + +(autoload 'magit-tag-delete "magit-tag" "\ +Delete one or more tags. +If the region marks multiple tags (and nothing else), then offer +to delete those, otherwise prompt for a single tag to be deleted, +defaulting to the tag at point. + +\(git tag -d TAGS) + +\(fn TAGS)" t nil) + +;;;*** + +;;;### (autoloads nil "magit-utils" "magit-utils.el" (23238 5904 +;;;;;; 59686 267000)) ;;; Generated autoloads from magit-utils.el (autoload 'magit-emacs-Q-command "magit-utils" "\ @@ -2132,8 +2335,8 @@ See info node `(magit)Debugging Tools' for more information. ;;;*** -;;;### (autoloads nil "magit-wip" "magit-wip.el" (23136 41405 665772 -;;;;;; 555000)) +;;;### (autoloads nil "magit-wip" "magit-wip.el" (23238 5904 66508 +;;;;;; 461000)) ;;; Generated autoloads from magit-wip.el (defvar magit-wip-after-save-mode nil "\ @@ -2201,8 +2404,8 @@ command which is about to be called are committed. ;;;*** -;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (23136 -;;;;;; 41405 731725 396000)) +;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (23238 +;;;;;; 5904 107352 870000)) ;;; Generated autoloads from magit-worktree.el (autoload 'magit-worktree-popup "magit-worktree" nil t) @@ -2220,7 +2423,7 @@ Create a new BRANCH and check it out in a new worktree at PATH. ;;;### (autoloads nil nil ("magit-core.el" "magit-git.el" "magit-margin.el" ;;;;;; "magit-mode.el" "magit-obsolete.el" "magit-pkg.el" "magit-process.el" -;;;;;; "magit-section.el") (23136 41405 727723 664000)) +;;;;;; "magit-section.el") (23238 5904 106157 387000)) ;;;*** diff --git a/elpa/magit-20180118.313/magit-autorevert.el b/elpa/magit-20180404.1428/magit-autorevert.el similarity index 100% rename from elpa/magit-20180118.313/magit-autorevert.el rename to elpa/magit-20180404.1428/magit-autorevert.el diff --git a/elpa/magit-20180118.313/magit-bisect.el b/elpa/magit-20180404.1428/magit-bisect.el similarity index 96% rename from elpa/magit-20180118.313/magit-bisect.el rename to elpa/magit-20180404.1428/magit-bisect.el index 2a34bf41..c6280712 100644 --- a/elpa/magit-20180118.313/magit-bisect.el +++ b/elpa/magit-20180404.1428/magit-bisect.el @@ -89,9 +89,9 @@ other actions from the bisect popup (\ (defun magit-bisect-reset () "After bisecting, cleanup bisection state and return to original `HEAD'." (interactive) - (when (magit-confirm 'reset-bisect) - (magit-run-git "bisect" "reset") - (ignore-errors (delete-file (magit-git-dir "BISECT_CMD_OUTPUT"))))) + (magit-confirm 'reset-bisect) + (magit-run-git "bisect" "reset") + (ignore-errors (delete-file (magit-git-dir "BISECT_CMD_OUTPUT")))) ;;;###autoload (defun magit-bisect-good () @@ -192,7 +192,7 @@ bisect run'." (save-restriction (narrow-to-region beg (point)) (goto-char (point-min)) - (magit-insert-section (bisect-log heading t) + (magit-insert-section (bisect-item heading t) (insert (propertize heading 'face 'magit-section-secondary-heading)) (magit-insert-heading) (magit-wash-sequence @@ -203,7 +203,7 @@ bisect run'." "# first bad commit: \\[\\([a-z0-9]\\{40\\}\\)\\] [^\n]+\n" nil t) (magit-bind-match-strings (hash) nil (magit-delete-match) - (magit-insert-section (bisect-log) + (magit-insert-section (bisect-item) (insert hash " is the first bad commit\n")))))) (provide 'magit-bisect) diff --git a/elpa/magit-20180118.313/magit-blame.el b/elpa/magit-20180404.1428/magit-blame.el similarity index 99% rename from elpa/magit-20180118.313/magit-blame.el rename to elpa/magit-20180404.1428/magit-blame.el index 7079f3eb..e1bf447c 100644 --- a/elpa/magit-20180118.313/magit-blame.el +++ b/elpa/magit-20180404.1428/magit-blame.el @@ -259,9 +259,9 @@ If the buffer visits a revision of that file, then blame up to that revision, otherwise blame the file's full history, including uncommitted changes. -If Magit-Blame mode is already turned on then blame recursively, by -visiting REVISION:FILE (using `magit-find-file'), where revision -is the revision before the revision that added the lines at +If Magit-Blame mode is already turned on then blame recursively, +by visiting REVISION:FILE (using `magit-find-file'), where +revision is a parent of the revision that added the lines at point. ARGS is a list of additional arguments to pass to `git blame'; diff --git a/elpa/magit-20180118.313/magit-bookmark.el b/elpa/magit-20180404.1428/magit-bookmark.el similarity index 100% rename from elpa/magit-20180118.313/magit-bookmark.el rename to elpa/magit-20180404.1428/magit-bookmark.el diff --git a/elpa/magit-20180118.313/magit-branch.el b/elpa/magit-20180404.1428/magit-branch.el similarity index 94% rename from elpa/magit-20180118.313/magit-branch.el rename to elpa/magit-20180404.1428/magit-branch.el index 3e868b9f..804baeb0 100644 --- a/elpa/magit-20180118.313/magit-branch.el +++ b/elpa/magit-20180404.1428/magit-branch.el @@ -33,6 +33,7 @@ (require 'magit) (require 'magit-collab) +(require 'magit-reset) ;;; Options @@ -375,7 +376,8 @@ Please see the manual for more information." (remote .head.repo.owner.login) (branch .head.ref) (pr-branch branch)) - (when (member branch (list .base.ref .base.default_branch)) + (when (or (not .maintainer_can_modify) + (magit-branch-p branch)) (setq branch (format "pr-%s" .number))) (when (magit-branch-p branch) (user-error "Branch `%s' already exists" branch)) @@ -567,23 +569,23 @@ defaulting to the branch at point." (interactive (let ((branches (magit-region-values 'branch t)) (force current-prefix-arg)) - (if (if (> (length branches) 1) - (magit-confirm t nil "Delete %i branches" branches) - (setq branches - (list (magit-read-branch-prefer-other - (if force "Force delete branch" "Delete branch"))))) - (unless force - (--when-let (-remove #'magit-branch-merged-p branches) - (if (magit-confirm 'delete-unmerged-branch - "Delete unmerged branch %s" - "Delete %i unmerged branches" it) - (setq force branches) - (or (setq branches (-difference branches it)) - (user-error "Abort"))))) - (user-error "Abort")) + (if (> (length branches) 1) + (magit-confirm t nil "Delete %i branches" nil branches) + (setq branches + (list (magit-read-branch-prefer-other + (if force "Force delete branch" "Delete branch"))))) + (unless force + (-when-let (unmerged (-remove #'magit-branch-merged-p branches)) + (if (magit-confirm 'delete-unmerged-branch + "Delete unmerged branch %s" + "Delete %i unmerged branches" + 'noabort unmerged) + (setq force branches) + (or (setq branches (-difference branches unmerged)) + (user-error "Abort"))))) (list branches force))) (let* ((refs (-map #'magit-ref-fullname branches)) - (ambiguous (--filter (not it) refs))) + (ambiguous (--remove it refs))) (when ambiguous (user-error "%s ambiguous. Please cleanup using git directly." @@ -626,19 +628,17 @@ defaulting to the branch at point." (?a "[a]bort" 'abort))) (`detach (unless (or (equal force '(4)) (member branch force) - (magit-branch-merged-p branch t) - (magit-confirm 'delete-unmerged-branch - "Delete unmerged branch %s" "" - (list branch))) - (user-error "Abort")) + (magit-branch-merged-p branch t)) + (magit-confirm 'delete-unmerged-branch + "Delete unmerged branch %s" "" + nil (list branch))) (magit-call-git "checkout" "--detach")) (`master (unless (or (equal force '(4)) (member branch force) - (magit-branch-merged-p branch "master") - (magit-confirm 'delete-unmerged-branch - "Delete unmerged branch %s" "" - (list branch))) - (user-error "Abort")) + (magit-branch-merged-p branch "master")) + (magit-confirm 'delete-unmerged-branch + "Delete unmerged branch %s" "" + nil (list branch))) (magit-call-git "checkout" "master")) (`abort (user-error "Abort"))) (setq force t)) @@ -746,6 +746,43 @@ the remote." (magit-branch-unset-pushRemote old) (magit-refresh)) +;;;###autoload +(defun magit-branch-shelve (branch) + "Shelve a BRANCH. +Rename \"refs/heads/BRANCH\" to \"refs/shelved/BRANCH\", +and also rename the respective reflog file." + (interactive (list (magit-read-other-local-branch "Shelve branch"))) + (let ((old (concat "refs/heads/" branch)) + (new (concat "refs/shelved/" branch))) + (magit-git "update-ref" new old "") + (magit--rename-reflog-file old new) + (magit-branch-unset-pushRemote branch) + (magit-run-git "branch" "-D" branch))) + +;;;###autoload +(defun magit-branch-unshelve (branch) + "Unshelve a BRANCH +Rename \"refs/shelved/BRANCH\" to \"refs/heads/BRANCH\", +and also rename the respective reflog file." + (interactive + (list (magit-completing-read + "Unshelve branch" + (--map (substring it 8) + (magit-list-refnames "refs/shelved")) + nil t))) + (let ((old (concat "refs/shelved/" branch)) + (new (concat "refs/heads/" branch))) + (magit-git "update-ref" new old "") + (magit--rename-reflog-file old new) + (magit-run-git "update-ref" "-d" old))) + +(defun magit--rename-reflog-file (old new) + (let ((old (magit-git-dir (concat "logs/" old))) + (new (magit-git-dir (concat "logs/" new)))) + (when (file-exists-p old) + (make-directory (file-name-directory new) t) + (rename-file old new t)))) + ;;; Config Popup (defvar magit-branch-config-branch nil) diff --git a/elpa/magit-20180118.313/magit-collab.el b/elpa/magit-20180404.1428/magit-collab.el similarity index 76% rename from elpa/magit-20180118.313/magit-collab.el rename to elpa/magit-20180404.1428/magit-collab.el index be93dfd5..ee350431 100644 --- a/elpa/magit-20180118.313/magit-collab.el +++ b/elpa/magit-20180404.1428/magit-collab.el @@ -82,10 +82,7 @@ be lifted eventually to support other Git forges." Return the Git forge's API response. Currently this function only supports Github, but that will change eventually." (let* ((origin (magit-upstream-repository)) - (url (magit-get "remote" origin "url")) - (id (and (string-match "github.com[:/]\\(.+?\\)\\(?:\\.git\\)?\\'" - url) - (match-string 1 url))) + (id (magit--forge-id origin)) (fmtfun (lambda (pull-request) (format "%s %s" (cdr (assq 'number pull-request)) @@ -98,8 +95,10 @@ only supports Github, but that will change eventually." (number (and (string-match "\\([0-9]+\\)" choice) (string-to-number (match-string 1 choice))))) (and number - (or (--first (= (cdr (assq 'number it)) number) prs) - (ghub-get (format "/repos/%s" id) nil :auth 'magit))))) + ;; Don't reuse the pr from the list, it lacks some information + ;; that is only returned when requesting a single pr. #3371 + (ghub-get (format "/repos/%s/pulls/%s" id number) + nil :auth 'magit)))) (defun magit-upstream-repository () "Return the remote name of the upstream repository. @@ -111,17 +110,33 @@ exist, then raise an error." (unless (magit-remote-p remote) (error "No remote named `%s' exists (consider setting `magit.upstream')" remote)) - (unless (string-match-p "github\\.com" (magit-get "remote" remote "url")) + (unless (magit--github-remote-p remote) (error "Currently only Github is supported")) remote)) +(defun magit--forge-id (remote) + (let ((url (magit-get "remote" remote "url"))) + (and (string-match "\\([^:/]+/[^/]+?\\)\\(?:\\.git\\)?\\'" url) + (match-string 1 url)))) + (defconst magit--github-url-regexp "\ -\\`\\(?:git://\\|git@\\|ssh://git@\\|https://\\)github.com[/:]\ -\\(\\([^/]+\\)/\\(.+?\\)\\)\ +\\`\\(?:git://\\|git@\\|ssh://git@\\|https://\\)\ +\\(.*?\\)[/:]\ +\\(\\([^:/]+\\)/\\([^/]+?\\)\\)\ \\(?:\\.git\\)?\\'") (defun magit--github-url-p (url) - (and url (string-match-p magit--github-url-regexp url))) + (save-match-data + (and url + (string-match magit--github-url-regexp url) + (let ((host (match-string 1 url))) + ;; Match values like "github.com-as-someone", which are + ;; translated to just "github.com" according to settings + ;; in "~/.ssh/config". Theoretically this could result + ;; in false-positives, but that's rather unlikely. #3392 + (and (or (string-match-p (regexp-quote "github.com") host) + (string-match-p (regexp-quote (ghub--host)) host)) + host))))) (defun magit--github-remote-p (remote) (or (--when-let (magit-get "remote" remote "pushurl") @@ -131,11 +146,12 @@ exist, then raise an error." (defun magit--github-url-equal (r1 r2) (or (equal r1 r2) - (let ((n1 (and (string-match magit--github-url-regexp r1) - (match-string 1 r1))) - (n2 (and (string-match magit--github-url-regexp r2) - (match-string 1 r2)))) - (and n1 n2 (equal n1 n2))))) + (save-match-data + (let ((n1 (and (string-match magit--github-url-regexp r1) + (match-string 2 r1))) + (n2 (and (string-match magit--github-url-regexp r2) + (match-string 2 r2)))) + (and n1 n2 (equal n1 n2)))))) (provide 'magit-collab) ;;; magit-collab.el ends here diff --git a/elpa/magit-20180118.313/magit-commit.el b/elpa/magit-20180404.1428/magit-commit.el similarity index 93% rename from elpa/magit-20180118.313/magit-commit.el rename to elpa/magit-20180404.1428/magit-commit.el index 99613d15..5defecaa 100644 --- a/elpa/magit-20180118.313/magit-commit.el +++ b/elpa/magit-20180404.1428/magit-commit.el @@ -34,12 +34,6 @@ (eval-when-compile (require 'epa)) ; for `epa-protocol' (eval-when-compile (require 'epg)) -(declare-function epg-sub-key-id 'epg) -(declare-function epg-key-sub-key-list 'epg) -(declare-function epg-key-user-id-list 'epg) -(declare-function epg-user-id-string 'epg) -(declare-function epg-decode-dn 'epg) -(declare-function epg-list-keys 'epg) ;;; Options @@ -336,6 +330,33 @@ depending on the value of option `magit-commit-squash-confirm'." (t (user-error "Nothing staged")))) +(defvar magit--reselve-history nil) + +;;;###autoload +(defun magit-commit-reshelve (date) + "Change the committer date and possibly the author date of `HEAD'. + +If you are the author of `HEAD', then both dates are changed, +otherwise only the committer date. The current time is used +as the initial minibuffer input and the original author (if +that is you) or committer date is available as the previous +history element." + (interactive + (let ((author-p (magit-rev-author-p "HEAD"))) + (push (magit-rev-format (if author-p "%ad" "%cd") "HEAD" + (concat "--date=format:%F %T %z")) + magit--reselve-history) + (list (read-string (if author-p + "Change author and committer dates to: " + "Change committer date to: ") + (cons (format-time-string "%F %T %z") 17) + 'magit--reselve-history)))) + (let ((process-environment process-environment)) + (push (concat "GIT_COMMITTER_DATE=" date) process-environment) + (magit-run-git "commit" "--amend" "--no-edit" + (and (magit-rev-author-p "HEAD") + (concat "--date=" date))))) + ;;; Pending Diff (defun magit-commit-diff () diff --git a/elpa/magit-20180118.313/magit-core.el b/elpa/magit-20180404.1428/magit-core.el similarity index 100% rename from elpa/magit-20180118.313/magit-core.el rename to elpa/magit-20180404.1428/magit-core.el diff --git a/elpa/magit-20180118.313/magit-diff.el b/elpa/magit-20180404.1428/magit-diff.el similarity index 97% rename from elpa/magit-20180118.313/magit-diff.el rename to elpa/magit-20180404.1428/magit-diff.el index f382f5a9..b4c7e70e 100644 --- a/elpa/magit-20180118.313/magit-diff.el +++ b/elpa/magit-20180404.1428/magit-diff.el @@ -32,20 +32,23 @@ (require 'magit-core) ;; For `magit-diff-popup' -(declare-function magit-stash-show 'magit-stash) +(declare-function magit-stash-show "magit-stash" (stash &optional args files)) ;; For `magit-diff-visit-file' -(declare-function dired-jump 'dired-x) -(declare-function magit-find-file-noselect 'magit) -(declare-function magit-status-internal 'magit) +(declare-function dired-jump "dired-x" (&optional other-window file-name)) +(declare-function magit-find-file-noselect "magit-files" (rev file)) +(declare-function magit-status-internal "magit-status" (directory)) ;; For `magit-diff-while-committing' -(declare-function magit-commit-message-buffer 'magit) +(declare-function magit-commit-message-buffer "magit-commit" ()) ;; For `magit-insert-revision-gravatar' (defvar gravatar-size) ;; For `magit-show-commit' and `magit-diff-show-or-scroll' -(declare-function magit-blame-chunk-get 'magit-blame) -(declare-function magit-blame-mode 'magit-blame) +(declare-function magit-blame-chunk-get "magit-blame" (key &optional pos)) +(declare-function magit-blame-mode "magit-blame" (&optional arg)) (defvar magit-blame-mode) (defvar git-rebase-line) +;; For `magit-diff-unmerged' +(declare-function magit-merge-in-progress-p "magit-merge" ()) +(declare-function magit--merge-range "magit-merge" (&optional head)) (require 'diff-mode) (require 'smerge-mode) @@ -392,6 +395,8 @@ any build." :group 'magit-status :type '(repeat (string :tag "Argument"))) +(put 'magit-diff-section-arguments 'permanent-local t) + ;;; Faces (defface magit-diff-file-heading @@ -671,7 +676,10 @@ and `:slant'." (defvar magit-diff-section-file-args nil) (put 'magit-diff-section-file-args 'permanent-local t) -(put 'magit-diff-section-arguments 'permanent-local t) +(put 'magit-diff-section-file-args 'safe-local-variable + (lambda (val) + (and (listp val) + (-all-p #'stringp val)))) (defun magit-diff-get-buffer-args () (cond ((and magit-use-sticky-arguments @@ -757,8 +765,14 @@ buffer." "Show changes for the thing at point." (interactive (magit-diff-arguments)) (pcase (magit-diff--dwim) + (`unmerged (magit-diff-unmerged args files)) (`unstaged (magit-diff-unstaged args files)) - (`staged (magit-diff-staged nil args files)) + (`staged + (let ((file (magit-file-at-point))) + (if (and file (equal (cddr (car (magit-file-status file))) '(?D ?U))) + ;; File was deleted by us and modified by them. Show the latter. + (magit-diff-unmerged args (list file)) + (magit-diff-staged nil args files)))) (`(commit . ,value) (magit-diff (format "%s^..%s" value value) args files)) (`(stash . ,value) (magit-stash-show value args)) @@ -773,8 +787,8 @@ buffer." The information can be in three forms: 1. TYPE A symbol describing a type of diff where no additional information - is needed to generate the diff. Currently, this includes `staged' - and `unstaged'. + is needed to generate the diff. Currently, this includes `staged', + `unstaged' and `unmerged'. 2. (TYPE . VALUE) Like #1 but the diff requires additional information, which is given by VALUE. Currently, this includes `commit' and `stash', @@ -808,6 +822,7 @@ If no DWIM context is found, nil is returned." (magit-section-case ([* unstaged] 'unstaged) ([* staged] 'staged) + (unmerged 'unmerged) (unpushed (oref it value)) (unpulled (oref it value)) (branch (let ((current (magit-get-current-branch)) @@ -907,6 +922,14 @@ a commit read from the minibuffer." (interactive (magit-diff-arguments)) (magit-diff-setup nil nil args files)) +;;;###autoload +(defun magit-diff-unmerged (&optional args files) + "Show changes that are being merged." + (interactive (magit-diff-arguments)) + (unless (magit-merge-in-progress-p) + (user-error "No merge is in progress")) + (magit-diff-setup (magit--merge-range) nil args files)) + ;;;###autoload (defun magit-diff-while-committing (&optional args) "While committing, show the changes that are about to be committed. @@ -964,8 +987,10 @@ be committed." (interactive (list (read-file-name "First file: " nil nil t) (read-file-name "Second file: " nil nil t))) (magit-diff-setup nil (list "--no-index") - nil (list (expand-file-name a) - (expand-file-name b)))) + nil (list (magit-convert-filename-for-git + (expand-file-name a)) + (magit-convert-filename-for-git + (expand-file-name b))))) (defvar-local magit-buffer-revision-hash nil) @@ -999,13 +1024,6 @@ for a revision." (expand-file-name (file-name-as-directory module)))) (unless (magit-rev-verify-commit rev) (user-error "%s is not a commit" rev)) - (-when-let (buffer (magit-mode-get-buffer 'magit-revision-mode)) - (with-current-buffer buffer - (let ((prev (car magit-refresh-args))) - (unless (equal rev prev) - (dolist (child (cdr (oref magit-root-section children))) - (when (magit-file-section-p child) - (magit-section-cache-visibility child))))))) (magit-mode-setup #'magit-revision-mode rev nil args files))) ;;;; Setting commands @@ -1194,13 +1212,15 @@ version of the file. To do this interactively use the command (if (magit-file-accessible-directory-p file) (magit-diff-visit-directory file other-window) (let* ((hunk (magit-diff-visit--hunk)) + (last (and magit-diff-visit-previous-blob + (not force-worktree) + (magit-section-match 'hunk) + (save-excursion + (goto-char (line-beginning-position)) + (looking-at "-")))) (line (and hunk (magit-diff-hunk-line hunk))) - (col (and hunk (magit-diff-hunk-column hunk))) - (rev (if (and magit-diff-visit-previous-blob - (magit-section-match 'hunk) - (save-excursion - (goto-char (line-beginning-position)) - (looking-at "-"))) + (col (and hunk (magit-diff-hunk-column hunk last))) + (rev (if last (magit-diff-visit--range-beginning) (magit-diff-visit--range-end))) (buf (if (and (not force-worktree) @@ -1409,10 +1429,11 @@ or `HEAD'." (forward-line))) (list line offset))) -(defun magit-diff-hunk-column (section) +(defun magit-diff-hunk-column (section visit-beginning) (if (or (< (point) (oref section content)) - (save-excursion (beginning-of-line) (looking-at-p "-"))) + (and (not visit-beginning) + (save-excursion (beginning-of-line) (looking-at-p "-")))) 0 (max 0 (- (+ (current-column) 2) (length (oref section value)))))) @@ -1657,7 +1678,7 @@ section or a child thereof." (setq heading (match-string 1)) (magit-delete-match) (goto-char beg) - (magit-insert-section it (diffstat) + (magit-insert-section (diffstat) (insert (propertize heading 'face 'magit-diff-file-heading)) (magit-insert-heading) (let (files) @@ -1722,9 +1743,9 @@ section or a child thereof." (magit-bind-match-strings (side _blob name) nil (pcase side ("result" (setq file name)) - ("our" (setq orig name)) - ("their" (setq file name)) - ("base" (setq base name)))) + ("our" (setq orig name)) + ("their" (setq file name)) + ("base" (setq base name)))) (magit-delete-line)) (when orig (setq orig (magit-decode-git-path orig))) (when file (setq file (magit-decode-git-path file))) diff --git a/elpa/magit-20180118.313/magit-ediff.el b/elpa/magit-20180404.1428/magit-ediff.el similarity index 100% rename from elpa/magit-20180118.313/magit-ediff.el rename to elpa/magit-20180404.1428/magit-ediff.el diff --git a/elpa/magit-20180404.1428/magit-extras.el b/elpa/magit-20180404.1428/magit-extras.el new file mode 100644 index 00000000..bf07ffe0 --- /dev/null +++ b/elpa/magit-20180404.1428/magit-extras.el @@ -0,0 +1,621 @@ +;;; magit-extras.el --- additional functionality for Magit -*- lexical-binding: t -*- + +;; Copyright (C) 2008-2018 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. + +;; Magit is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Magit is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Magit. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; Additional functionality for Magit. + +;;; Code: + +(require 'magit) + +(declare-function dired-read-shell-command "dired-aux" (prompt arg files)) + +(defgroup magit-extras nil + "Additional functionality for Magit." + :group 'magit-extensions) + +;;; External Tools + +(defcustom magit-gitk-executable + (or (and (eq system-type 'windows-nt) + (let ((exe (expand-file-name + "gitk" (file-name-nondirectory magit-git-executable)))) + (and (file-executable-p exe) exe))) + (executable-find "gitk") "gitk") + "The Gitk executable." + :group 'magit-extras + :set-after '(magit-git-executable) + :type 'string) + +;;;###autoload +(defun magit-run-git-gui () + "Run `git gui' for the current git repository." + (interactive) + (magit-with-toplevel + (magit-process-file magit-git-executable nil 0 nil "gui"))) + +;;;###autoload +(defun magit-run-git-gui-blame (commit filename &optional linenum) + "Run `git gui blame' on the given FILENAME and COMMIT. +Interactively run it for the current file and the `HEAD', with a +prefix or when the current file cannot be determined let the user +choose. When the current buffer is visiting FILENAME instruct +blame to center around the line point is on." + (interactive + (let (revision filename) + (when (or current-prefix-arg + (not (setq revision "HEAD" + filename (magit-file-relative-name nil 'tracked)))) + (setq revision (magit-read-branch-or-commit "Blame from revision")) + (setq filename (magit-read-file-from-rev revision "Blame file"))) + (list revision filename + (and (equal filename + (ignore-errors + (magit-file-relative-name buffer-file-name))) + (line-number-at-pos))))) + (magit-with-toplevel + (apply #'magit-process-file magit-git-executable nil 0 nil "gui" "blame" + `(,@(and linenum (list (format "--line=%d" linenum))) + ,commit + ,filename)))) + +;;;###autoload +(defun magit-run-gitk () + "Run `gitk' in the current repository." + (interactive) + (magit-process-file magit-gitk-executable nil 0)) + +;;;###autoload +(defun magit-run-gitk-branches () + "Run `gitk --branches' in the current repository." + (interactive) + (magit-process-file magit-gitk-executable nil 0 nil "--branches")) + +;;;###autoload +(defun magit-run-gitk-all () + "Run `gitk --all' in the current repository." + (interactive) + (magit-process-file magit-gitk-executable nil 0 nil "--all")) + +;;; Emacs Tools + +;;;###autoload +(defun ido-enter-magit-status () + "Drop into `magit-status' from file switching. + +To make this command available use something like: + + (add-hook \\='ido-setup-hook + (lambda () + (define-key ido-completion-map + (kbd \"C-x g\") \\='ido-enter-magit-status))) + +Starting with Emacs 25.1 the Ido keymaps are defined just once +instead of every time Ido is invoked, so now you can modify it +like pretty much every other keymap: + + (define-key ido-common-completion-map + (kbd \"C-x g\") 'ido-enter-magit-status)" + (interactive) + (with-no-warnings ; FIXME these are internal variables + (setq ido-exit 'fallback fallback 'magit-status)) + (exit-minibuffer)) + +;;;###autoload +(defun magit-dired-jump (&optional other-window) + "Visit file at point using Dired. +With a prefix argument, visit in another window. If there +is no file at point, then instead visit `default-directory'." + (interactive "P") + (dired-jump other-window (-if-let (file (magit-file-at-point)) + (progn (setq file (expand-file-name file)) + (if (file-directory-p file) + (concat file "/.") + file)) + (concat default-directory "/.")))) + +;;;###autoload +(defun magit-dired-log (&optional follow) + "Show log for all marked files, or the current file." + (interactive "P") + (-if-let (topdir (magit-toplevel default-directory)) + (let ((args (car (magit-log-arguments))) + (files (dired-get-marked-files nil nil #'magit-file-tracked-p))) + (unless files + (user-error "No marked file is being tracked by Git")) + (when (and follow + (not (member "--follow" args)) + (not (cdr files))) + (push "--follow" args)) + (magit-mode-setup-internal + #'magit-log-mode + (list (list (or (magit-get-current-branch) "HEAD")) + args + (let ((default-directory topdir)) + (mapcar #'file-relative-name files))) + magit-log-buffer-file-locked)) + (magit--not-inside-repository-error))) + +;;;###autoload +(defun magit-do-async-shell-command (file) + "Open FILE with `dired-do-async-shell-command'. +Interactively, open the file at point." + (interactive (list (or (magit-file-at-point) + (completing-read "Act on file: " + (magit-list-files))))) + (require 'dired-aux) + (dired-do-async-shell-command + (dired-read-shell-command "& on %s: " current-prefix-arg (list file)) + nil (list file))) + +;;; Shift Selection + +(defun magit--turn-on-shift-select-mode-p () + (and shift-select-mode + this-command-keys-shift-translated + (not mark-active) + (not (eq (car-safe transient-mark-mode) 'only)))) + +;;;###autoload +(defun magit-previous-line (&optional arg try-vscroll) + "Like `previous-line' but with Magit-specific shift-selection. + +Magit's selection mechanism is based on the region but selects an +area that is larger than the region. This causes `previous-line' +when invoked while holding the shift key to move up one line and +thereby select two lines. When invoked inside a hunk body this +command does not move point on the first invocation and thereby +it only selects a single line. Which inconsistency you prefer +is a matter of preference." + (declare (interactive-only + "use `forward-line' with negative argument instead.")) + (interactive "p\np") + (unless arg (setq arg 1)) + (let ((stay (or (magit-diff-inside-hunk-body-p) + (magit-section-position-in-heading-p)))) + (if (and stay (= arg 1) (magit--turn-on-shift-select-mode-p)) + (push-mark nil nil t) + (with-no-warnings + (handle-shift-selection) + (previous-line (if stay (max (1- arg) 1) arg) try-vscroll))))) + +;;;###autoload +(defun magit-next-line (&optional arg try-vscroll) + "Like `next-line' but with Magit-specific shift-selection. + +Magit's selection mechanism is based on the region but selects +an area that is larger than the region. This causes `next-line' +when invoked while holding the shift key to move down one line +and thereby select two lines. When invoked inside a hunk body +this command does not move point on the first invocation and +thereby it only selects a single line. Which inconsistency you +prefer is a matter of preference." + (declare (interactive-only forward-line)) + (interactive "p\np") + (unless arg (setq arg 1)) + (let ((stay (or (magit-diff-inside-hunk-body-p) + (magit-section-position-in-heading-p)))) + (if (and stay (= arg 1) (magit--turn-on-shift-select-mode-p)) + (push-mark nil nil t) + (with-no-warnings + (handle-shift-selection) + (next-line (if stay (max (1- arg) 1) arg) try-vscroll))))) + +;;; Clean + +;;;###autoload +(defun magit-clean (&optional arg) + "Remove untracked files from the working tree. +With a prefix argument also remove ignored files, +with two prefix arguments remove ignored files only. +\n(git clean -f -d [-x|-X])" + (interactive "p") + (when (yes-or-no-p (format "Remove %s files? " + (pcase arg + (1 "untracked") + (4 "untracked and ignored") + (_ "ignored")))) + (magit-wip-commit-before-change) + (magit-run-git "clean" "-f" "-d" (pcase arg (4 "-x") (16 "-X"))))) + +(put 'magit-clean 'disabled t) + +;;; Gitignore + +;;;###autoload +(defun magit-gitignore (file-or-pattern &optional local) + "Instruct Git to ignore FILE-OR-PATTERN. +With a prefix argument only ignore locally." + (interactive (list (magit-gitignore-read-pattern current-prefix-arg) + current-prefix-arg)) + (let ((gitignore + (if local + (magit-git-dir (convert-standard-filename "info/exclude")) + (expand-file-name ".gitignore" (magit-toplevel))))) + (make-directory (file-name-directory gitignore) t) + (with-temp-buffer + (when (file-exists-p gitignore) + (insert-file-contents gitignore)) + (goto-char (point-max)) + (unless (bolp) + (insert "\n")) + (insert (replace-regexp-in-string "\\(\\\\*\\)" "\\1\\1" file-or-pattern)) + (insert "\n") + (write-region nil nil gitignore)) + (if local + (magit-refresh) + (magit-run-git "add" ".gitignore")))) + +;;;###autoload +(defun magit-gitignore-locally (file-or-pattern) + "Instruct Git to locally ignore FILE-OR-PATTERN." + (interactive (list (magit-gitignore-read-pattern t))) + (magit-gitignore file-or-pattern t)) + +(defun magit-gitignore-read-pattern (local) + (let* ((default (magit-current-file)) + (choices + (delete-dups + (--mapcat + (cons (concat "/" it) + (-when-let (ext (file-name-extension it)) + (list (concat "/" (file-name-directory "foo") "*." ext) + (concat "*." ext)))) + (magit-untracked-files))))) + (when default + (setq default (concat "/" default)) + (unless (member default choices) + (setq default (concat "*." (file-name-extension default))) + (unless (member default choices) + (setq default nil)))) + (magit-completing-read (concat "File or pattern to ignore" + (and local " locally")) + choices nil nil nil nil default))) + +;;; ChangeLog + +;;;###autoload +(defun magit-add-change-log-entry (&optional whoami file-name other-window) + "Find change log file and add date entry and item for current change. +This differs from `add-change-log-entry' (which see) in that +it acts on the current hunk in a Magit buffer instead of on +a position in a file-visiting buffer." + (interactive (list current-prefix-arg + (prompt-for-change-log-name))) + (let (buf pos) + (save-window-excursion + (call-interactively #'magit-diff-visit-file) + (setq buf (current-buffer)) + (setq pos (point))) + (save-excursion + (with-current-buffer buf + (goto-char pos) + (add-change-log-entry whoami file-name other-window))))) + +;;;###autoload +(defun magit-add-change-log-entry-other-window (&optional whoami file-name) + "Find change log file in other window and add entry and item. +This differs from `add-change-log-entry-other-window' (which see) +in that it acts on the current hunk in a Magit buffer instead of +on a position in a file-visiting buffer." + (interactive (and current-prefix-arg + (list current-prefix-arg + (prompt-for-change-log-name)))) + (magit-add-change-log-entry whoami file-name t)) + +;;; Reshelve + +;;;###autoload +(defun magit-reshelve-since (rev) + "Change the author and committer dates of the commits since REV. + +Ask the user for the first reachable commit whose dates should +be changed. The read the new date for that commit. The initial +minibuffer input and the previous history element offer good +values. The next commit will be created one minute later and so +on. + +This command is only intended for interactive use and should only +be used on highly rearranged and unpublished history." + (interactive (list nil)) + (cond + ((not rev) + (let ((backup (concat "refs/original/refs/heads/" + (magit-get-current-branch)))) + (when (and (magit-ref-p backup) + (not (magit-y-or-n-p + "Backup ref %s already exists. Override? " backup))) + (user-error "Abort"))) + (magit-log-select 'magit-reshelve-since + "Type %p on a commit to reshelve it and the commits above it,")) + (t + (cl-flet ((adjust (time offset) + (format-time-string + "%F %T %z" + (+ (floor time) + (* offset 60) + (- (car (decode-time time))))))) + (let* ((start (concat rev "^")) + (range (concat start ".." (magit-get-current-branch))) + (time-rev (adjust (float-time (string-to-number + (magit-rev-format "%at" start))) + 1)) + (time-now (adjust (float-time) + (- (string-to-number + (magit-git-string "rev-list" "--count" + range)))))) + (push time-rev magit--reselve-history) + (let ((date (floor + (float-time + (date-to-time + (read-string "Date for first commit: " + time-now 'magit--reselve-history)))))) + (magit-with-toplevel + (magit-run-git-async + "filter-branch" "--force" "--env-filter" + (format "case $GIT_COMMIT in %s\nesac" + (mapconcat (lambda (rev) + (prog1 (format "%s) \ +export GIT_AUTHOR_DATE=\"%s\"; \ +export GIT_COMMITTER_DATE=\"%s\";;" rev date date) + (cl-incf date 60))) + (magit-git-lines "rev-list" "--reverse" + range) + " ")) + range "--") + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (> (process-exit-status process) 0) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (magit-run-git "update-ref" "-d" + (concat "refs/original/refs/heads/" + (magit-get-current-branch)))))))))))))) + +;;; Revision Stack + +(defvar magit-revision-stack nil) + +(defcustom magit-pop-revision-stack-format + '("[%N: %h] " "%N: %H\n %s\n" "\\[\\([0-9]+\\)[]:]") + "Control how `magit-pop-revision-stack' inserts a revision. + +The command `magit-pop-revision-stack' inserts a representation +of the revision last pushed to the `magit-revision-stack' into +the current buffer. It inserts text at point and/or near the end +of the buffer, and removes the consumed revision from the stack. + +The entries on the stack have the format (HASH TOPLEVEL) and this +option has the format (POINT-FORMAT EOB-FORMAT INDEX-REGEXP), all +of which may be nil or a string (though either one of EOB-FORMAT +or POINT-FORMAT should be a string, and if INDEX-REGEXP is +non-nil, then the two formats should be too). + +First INDEX-REGEXP is used to find the previously inserted entry, +by searching backward from point. The first submatch must match +the index number. That number is incremented by one, and becomes +the index number of the entry to be inserted. If you don't want +to number the inserted revisions, then use nil for INDEX-REGEXP. + +If INDEX-REGEXP is non-nil, then both POINT-FORMAT and EOB-FORMAT +should contain \"%N\", which is replaced with the number that was +determined in the previous step. + +Both formats, if non-nil and after removing %N, are then expanded +using `git show --format=FORMAT ...' inside TOPLEVEL. + +The expansion of POINT-FORMAT is inserted at point, and the +expansion of EOB-FORMAT is inserted at the end of the buffer (if +the buffer ends with a comment, then it is inserted right before +that)." + :package-version '(magit . "2.3.0") + :group 'magit-commands + :type '(list (choice (string :tag "Insert at point format") + (cons (string :tag "Insert at point format") + (repeat (string :tag "Argument to git show"))) + (const :tag "Don't insert at point" nil)) + (choice (string :tag "Insert at eob format") + (cons (string :tag "Insert at eob format") + (repeat (string :tag "Argument to git show"))) + (const :tag "Don't insert at eob" nil)) + (choice (regexp :tag "Find index regexp") + (const :tag "Don't number entries" nil)))) + +(defun magit-pop-revision-stack (rev toplevel) + "Insert a representation of a revision into the current buffer. + +Pop a revision from the `magit-revision-stack' and insert it into +the current buffer according to `magit-pop-revision-stack-format'. +Revisions can be put on the stack using `magit-copy-section-value' +and `magit-copy-buffer-revision'. + +If the stack is empty or with a prefix argument, instead read a +revision in the minibuffer. By using the minibuffer history this +allows selecting an item which was popped earlier or to insert an +arbitrary reference or revision without first pushing it onto the +stack. + +When reading the revision from the minibuffer, then it might not +be possible to guess the correct repository. When this command +is called inside a repository (e.g. while composing a commit +message), then that repository is used. Otherwise (e.g. while +composing an email) then the repository recorded for the top +element of the stack is used (even though we insert another +revision). If not called inside a repository and with an empty +stack, or with two prefix arguments, then read the repository in +the minibuffer too." + (interactive + (if (or current-prefix-arg (not magit-revision-stack)) + (let ((default-directory + (or (and (not (= (prefix-numeric-value current-prefix-arg) 16)) + (or (magit-toplevel) + (cadr (car magit-revision-stack)))) + (magit-read-repository)))) + (list (magit-read-branch-or-commit "Insert revision") + default-directory)) + (push (caar magit-revision-stack) magit-revision-history) + (pop magit-revision-stack))) + (if rev + (-let [(pnt-format eob-format idx-format) magit-pop-revision-stack-format] + (let ((default-directory toplevel) + (idx (and idx-format + (save-excursion + (if (re-search-backward idx-format nil t) + (number-to-string + (1+ (string-to-number (match-string 1)))) + "1")))) + pnt-args eob-args) + (when (listp pnt-format) + (setq pnt-args (cdr pnt-format)) + (setq pnt-format (car pnt-format))) + (when (listp eob-format) + (setq eob-args (cdr eob-format)) + (setq eob-format (car eob-format))) + (when pnt-format + (when idx-format + (setq pnt-format + (replace-regexp-in-string "%N" idx pnt-format t t))) + (magit-rev-insert-format pnt-format rev pnt-args) + (backward-delete-char 1)) + (when eob-format + (when idx-format + (setq eob-format + (replace-regexp-in-string "%N" idx eob-format t t))) + (save-excursion + (goto-char (point-max)) + (skip-syntax-backward ">s-") + (beginning-of-line) + (if (and comment-start (looking-at comment-start)) + (while (looking-at comment-start) + (forward-line -1)) + (forward-line) + (unless (= (current-column) 0) + (insert ?\n))) + (insert ?\n) + (magit-rev-insert-format eob-format rev eob-args) + (backward-delete-char 1))))) + (user-error "Revision stack is empty"))) + +(define-key git-commit-mode-map + (kbd "C-c C-w") 'magit-pop-revision-stack) + +;;;###autoload +(defun magit-copy-section-value () + "Save the value of the current section for later use. + +Save the section value to the `kill-ring', and, provided that +the current section is a commit, branch, or tag section, push +the (referenced) revision to the `magit-revision-stack' for use +with `magit-pop-revision-stack'. + +When the current section is a branch or a tag, and a prefix +argument is used, then save the revision at its tip to the +`kill-ring' instead of the reference name. + +When the region is active, then save that to the `kill-ring', +like `kill-ring-save' would, instead of behaving as described +above." + (interactive) + (if (use-region-p) + (copy-region-as-kill nil nil 'region) + (-when-let* ((section (magit-current-section)) + (value (oref section value))) + (magit-section-case + ((branch commit module-commit tag) + (let ((default-directory default-directory) ref) + (magit-section-case + ((branch tag) + (setq ref value)) + (module-commit + (setq default-directory + (file-name-as-directory + (expand-file-name (magit-section-parent-value section) + (magit-toplevel)))))) + (setq value (magit-rev-parse value)) + (push (list value default-directory) magit-revision-stack) + (kill-new (message "%s" (or (and current-prefix-arg ref) + value))))) + (t (kill-new (message "%s" value))))))) + +;;;###autoload +(defun magit-copy-buffer-revision () + "Save the revision of the current buffer for later use. + +Save the revision shown in the current buffer to the `kill-ring' +and push it to the `magit-revision-stack'. + +This command is mainly intended for use in `magit-revision-mode' +buffers, the only buffers where it is always unambiguous exactly +which revision should be saved. + +Most other Magit buffers usually show more than one revision, in +some way or another, so this command has to select one of them, +and that choice might not always be the one you think would have +been the best pick. + +In such buffers it is often more useful to save the value of +the current section instead, using `magit-copy-section-value'. + +When the region is active, then save that to the `kill-ring', +like `kill-ring-save' would, instead of behaving as described +above." + (interactive) + (if (use-region-p) + (copy-region-as-kill nil nil 'region) + (-when-let (rev (cond ((memq major-mode '(magit-cherry-mode + magit-log-select-mode + magit-reflog-mode + magit-refs-mode + magit-revision-mode + magit-stash-mode + magit-stashes-mode)) + (car magit-refresh-args)) + ((memq major-mode '(magit-diff-mode + magit-log-mode)) + (let ((r (caar magit-refresh-args))) + (if (string-match "\\.\\.\\.?\\(.+\\)" r) + (match-string 1 r) + r))) + ((eq major-mode 'magit-status-mode) "HEAD"))) + (when (magit-rev-verify-commit rev) + (setq rev (magit-rev-parse rev)) + (push (list rev default-directory) magit-revision-stack) + (kill-new (message "%s" rev)))))) + +;;; Miscellaneous + +;;;###autoload +(defun magit-abort-dwim () + "Abort current operation. +Depending on the context, this will abort a merge, a rebase, a +patch application, a cherry-pick, a revert, or a bisect." + (interactive) + (cond ((magit-merge-in-progress-p) (magit-merge-abort)) + ((magit-rebase-in-progress-p) (magit-rebase-abort)) + ((magit-am-in-progress-p) (magit-am-abort)) + ((magit-sequencer-in-progress-p) (magit-sequencer-abort)) + ((magit-bisect-in-progress-p) (magit-bisect-reset)))) + +(provide 'magit-extras) +;;; magit-extras.el ends here diff --git a/elpa/magit-20180118.313/magit-files.el b/elpa/magit-20180404.1428/magit-files.el similarity index 93% rename from elpa/magit-20180118.313/magit-files.el rename to elpa/magit-20180404.1428/magit-files.el index dac132ca..a985a1b4 100644 --- a/elpa/magit-20180118.313/magit-files.el +++ b/elpa/magit-20180404.1428/magit-files.el @@ -226,22 +226,7 @@ directory, while reading the FILENAME." ;;;###autoload (autoload 'magit-file-popup "magit" nil t) (magit-define-popup magit-file-popup "Popup console for Magit commands in file-visiting buffers." - :actions '((?s "Stage" magit-stage-file) - (?D "Diff..." magit-diff-buffer-file-popup) - (?L "Log..." magit-log-buffer-file-popup) - (?B "Blame..." magit-blame-popup) nil - (?u "Unstage" magit-unstage-file) - (?d "Diff" magit-diff-buffer-file) - (?l "Log" magit-log-buffer-file) - (?b "Blame" magit-blame) - (?p "Prev blob" magit-blob-previous) - (?c "Commit" magit-commit-popup) nil nil - (?r (lambda () - (with-current-buffer magit-pre-popup-buffer - (and (not buffer-file-name) - (propertize "...reverse" 'face 'default)))) - magit-blame-reverse) - (?n "Next blob" magit-blob-next)) + :actions magit-file-popup-actions :max-action-columns 5) (defvar magit-file-mode-lighter "") @@ -257,7 +242,7 @@ Currently this only adds the following key bindings. (defun magit-file-mode-turn-on () (and buffer-file-name - (ignore-errors (magit-inside-worktree-p)) + (magit-inside-worktree-p t) (magit-file-mode))) ;;;###autoload @@ -352,13 +337,15 @@ If FILE isn't tracked in Git, fallback to using `rename-file'." (newname (read-file-name (format "Rename %s to file: " file)))) (list (expand-file-name file (magit-toplevel)) (expand-file-name newname)))) - (if (magit-file-tracked-p file) + (if (magit-file-tracked-p (magit-convert-filename-for-git file)) (let ((oldbuf (get-file-buffer file))) (when (and oldbuf (buffer-modified-p oldbuf)) (user-error "Save %s before moving it" file)) (when (file-exists-p newname) (user-error "%s already exists" newname)) - (magit-run-git "mv" file newname) + (magit-run-git "mv" + (magit-convert-filename-for-git file) + (magit-convert-filename-for-git newname)) (when oldbuf (with-current-buffer oldbuf (let ((buffer-read-only buffer-read-only)) @@ -377,10 +364,9 @@ With a prefix argument FORCE do so even when the files have staged as well as unstaged changes." (interactive (list (or (--if-let (magit-region-values 'file t) (progn - (or (magit-file-tracked-p (car it)) - (user-error "Already untracked")) - (or (magit-confirm-files 'untrack it "Untrack") - (user-error "Abort"))) + (unless (magit-file-tracked-p (car it)) + (user-error "Already untracked")) + (magit-confirm-files 'untrack it "Untrack")) (list (magit-read-tracked-file "Untrack file")))) current-prefix-arg)) (magit-run-git "rm" "--cached" (and force "--force") "--" files)) @@ -392,8 +378,7 @@ With a prefix argument FORCE do so even when the files have uncommitted changes. When the files aren't being tracked in Git, then fallback to using `delete-file'." (interactive (list (--if-let (magit-region-values 'file t) - (or (magit-confirm-files 'delete it "Delete") - (user-error "Abort")) + (magit-confirm-files 'delete it "Delete") (list (magit-read-file "Delete file"))) current-prefix-arg)) (if (magit-file-tracked-p (car files)) @@ -495,7 +480,7 @@ If DEFAULT is non-nil, use this as the default value instead of (--when-let (magit-file-at-point) (file-relative-name it)))) (magit-patch-apply-arguments))) - (magit-run-git "apply" args "--" file)) + (magit-run-git "apply" args "--" (magit-convert-filename-for-git file))) (defun magit-patch-save (file &optional arg) "Write current diff into patch FILE. diff --git a/elpa/magit-20180118.313/magit-git.el b/elpa/magit-20180404.1428/magit-git.el similarity index 86% rename from elpa/magit-20180118.313/magit-git.el rename to elpa/magit-20180404.1428/magit-git.el index f8acbe92..9d9e0ce3 100644 --- a/elpa/magit-20180118.313/magit-git.el +++ b/elpa/magit-20180404.1428/magit-git.el @@ -34,12 +34,13 @@ (require 'magit-utils) (require 'magit-section) -(declare-function magit-call-git 'magit-process) -(declare-function magit-maybe-make-margin-overlay 'magit-log) -(declare-function magit-process-buffer 'magit-process) -(declare-function magit-process-file 'magit-process) -(declare-function magit-process-insert-section 'magit-process) -(declare-function magit-refresh 'magit-mode) +(declare-function magit-call-git "magit-process" (&rest args)) +(declare-function magit-maybe-make-margin-overlay "magit-margin" ()) +(declare-function magit-process-buffer "magit-process" (&optional nodisplay)) +(declare-function magit-process-file "magit-process" (&rest args)) +(declare-function magit-process-insert-section "magit-process" + (pwe program args &optional errcode errlog)) +(declare-function magit-refresh "magit-mode" ()) (defvar magit-process-error-message-regexps) (defvar magit-refresh-args) ; from `magit-mode' for `magit-current-file' (defvar magit-branch-prefer-remote-upstream) @@ -69,6 +70,12 @@ this." :type '(choice (coding-system :tag "Coding system to decode Git output") (const :tag "Use system default" nil))) +(defvar magit-git-w32-path-hack nil + "Alist of (EXE . (PATHENTRY)). +This specifies what additional PATH setting needs to be added to +the environment in order to run the non-wrapper git executables +successfully.") + (defcustom magit-git-executable ;; Git might be installed in a different location on a remote, so ;; it is better not to use the full path to the executable, except @@ -83,18 +90,28 @@ this." ;; alias makes this fail on 1.x (which is good, ;; because we would not want to end up using some ;; other cygpath). - (prog1 (car - (process-lines - it "-c" - "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" - "X" "git")) - (setq magit-git-environment - (cons (concat "PATH=" + (let* ((core-exe + (car + (process-lines + it "-c" + "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" + "X" "git"))) + (hack-entry (assoc core-exe magit-git-w32-path-hack)) + ;; Running the libexec/git-core executable + ;; requires some extra PATH entries. + (path-hack + (list (concat "PATH=" (car (process-lines it "-c" "alias.P=!cygpath -wp \"$PATH\"" - "P"))) - magit-git-environment)))) + "P")))))) + ;; The defcustom STANDARD expression can be + ;; evaluated many times, so make sure it is + ;; idempotent. + (if hack-entry + (setcdr hack-entry path-hack) + (push (cons core-exe path-hack) magit-git-w32-path-hack)) + core-exe)) ;; For 1.x, we search for bin/ next to cmd/. (let ((alt (directory-file-name (file-name-directory it)))) (if (and (equal (file-name-nondirectory alt) "cmd") @@ -275,17 +292,34 @@ ignore `magit-git-debug'." (goto-char (point-min)) (buffer-substring-no-properties (point) (line-end-position)))))) +(defun magit-git-output (&rest args) + "Execute Git with ARGS, returning its output." + (setq args (-flatten args)) + (magit--with-refresh-cache (cons default-directory args) + (with-temp-buffer + (apply #'magit-process-file magit-git-executable nil (list t nil) nil + (magit-process-git-arguments args)) + (buffer-substring-no-properties (point-min) (point-max))))) + +(define-error 'magit-invalid-git-boolean "Not a Git boolean") + (defun magit-git-true (&rest args) "Execute Git with ARGS, returning t if it prints \"true\". -Return t if the first (and usually only) output line is the -string \"true\", otherwise return nil." - (equal (magit-git-str args) "true")) +If it prints \"false\", then return nil. For any other output +signal `magit-invalid-git-boolean'." + (pcase (magit-git-output args) + ((or "true" "true\n") t) + ((or "false" "false\n") nil) + (output (signal 'magit-invalid-git-boolean output)))) (defun magit-git-false (&rest args) "Execute Git with ARGS, returning t if it prints \"false\". -Return t if the first (and usually only) output line is the -string \"false\", otherwise return nil." - (equal (magit-git-str args) "false")) +If it prints \"true\", then return nil. For any other output +signal `magit-invalid-git-boolean'." + (pcase (magit-git-output args) + ((or "true" "true\n") nil) + ((or "false" "false\n") t) + (output (signal 'magit-invalid-git-boolean output)))) (defun magit-git-insert (&rest args) "Execute Git with ARGS, inserting its output at point. @@ -521,37 +555,75 @@ returning the truename." ,@body) (magit--not-inside-repository-error))))) +(define-error 'magit-outside-git-repo "Not inside Git repository") +(define-error 'magit-git-executable-not-found + "Git executable cannot be found (see https://magit.vc/goto/e6a78ed2)") + (defun magit--not-inside-repository-error () (if (executable-find magit-git-executable) - (user-error "Not inside a Git repository: %s" default-directory) - (user-error "The `git' executable cannot be found. See %s" - "https://magit.vc/goto/e6a78ed2"))) - -(defun magit-inside-gitdir-p () - "Return t if `default-directory' is below a repository directory." - ;; This does not work if the gitdir is not located inside the - ;; working tree: (magit-rev-parse-p "--is-inside-git-dir"). - (-when-let (gitdir (magit-git-dir)) - (file-in-directory-p default-directory gitdir))) - -(defun magit-inside-worktree-p () - "Return t if `default-directory' is below the work tree of a repository." - (magit-rev-parse-p "--is-inside-work-tree")) - -(defun magit-bare-repo-p () - "Return t if the current repository is bare." - (magit-rev-parse-p "--is-bare-repository")) + (signal 'magit-outside-git-repo default-directory) + (signal 'magit-git-executable-not-found magit-git-executable))) + +(defun magit-inside-gitdir-p (&optioal noerror) + "Return t if `default-directory' is below the repository directory. +If it is below the working directory, then return nil. +If it isn't below either, then signal an error unless NOERROR +is non-nil, in which case return nil." + (and (magit--assert-default-directory noerror) + ;; Below a repository directory that is not located below the + ;; working directory "git rev-parse --is-inside-git-dir" prints + ;; "false", which is wrong. + (let ((gitdir (magit-git-dir))) + (cond (gitdir (file-in-directory-p default-directory gitdir)) + (noerror nil) + (t (signal 'magit-outside-git-repo default-directory)))))) + +(defun magit-inside-worktree-p (&optional noerror) + "Return t if `default-directory' is below the working directory. +If it is below the repository directory, then return nil. +If it isn't below either, then signal an error unless NOERROR +is non-nil, in which case return nil." + (and (magit--assert-default-directory noerror) + (condition-case nil + (magit-rev-parse-true "--is-inside-work-tree") + (magit-invalid-git-boolean + (and (not noerror) + (signal 'magit-outside-git-repo default-directory)))))) + +(defun magit-bare-repo-p (&optional noerror) + "Return t if the current repository is bare. +If it is non-bare, then return nil. If `default-directory' +isn't below a Git repository, then signal an error unless +NOERROR is non-nil, in which case return nil." + (and (magit--assert-default-directory noerror) + (condition-case nil + (magit-rev-parse-true "--is-bare-repository") + (magit-invalid-git-boolean + (and (not noerror) + (signal 'magit-outside-git-repo default-directory)))))) + +(defun magit--assert-default-directory (&optional noerror) + (or (file-directory-p default-directory) + (and (not noerror) + (let ((exists (file-exists-p default-directory))) + (signal (if exists 'file-error 'file-missing) + (list "Running git in directory" + (if exists + "Not a directory" + "No such file or directory") + default-directory)))))) (defun magit-git-repo-p (directory &optional non-bare) "Return t if DIRECTORY is a Git repository. When optional NON-BARE is non-nil also return nil if DIRECTORY is a bare repository." - (or (file-regular-p (expand-file-name ".git" directory)) - (file-directory-p (expand-file-name ".git" directory)) - (and (not non-bare) - (file-regular-p (expand-file-name "HEAD" directory)) - (file-directory-p (expand-file-name "refs" directory)) - (file-directory-p (expand-file-name "objects" directory))))) + (and (file-directory-p directory) ; Avoid archives, see #3397. + (or (file-regular-p (expand-file-name ".git" directory)) + (file-directory-p (expand-file-name ".git" directory)) + (and (not non-bare) + (file-regular-p (expand-file-name "HEAD" directory)) + (file-directory-p (expand-file-name "refs" directory)) + (file-directory-p (expand-file-name "objects" directory)))))) (defvar-local magit-buffer-revision nil) (defvar-local magit-buffer-refname nil) @@ -572,7 +644,8 @@ tracked file." (unless file (with-current-buffer (or (buffer-base-buffer) (current-buffer)) - (setq file (or magit-buffer-file-name buffer-file-name)))) + (setq file (or magit-buffer-file-name buffer-file-name + (and (derived-mode-p 'dired-mode) default-directory))))) (when (and file (or (not tracked) (magit-file-tracked-p (file-relative-name file)))) (--when-let (magit-toplevel @@ -683,8 +756,7 @@ Sorted from longest to shortest CYGWIN name." (defun magit-convert-filename-for-git (filename) "Convert FILENAME so that it can be passed to git. 1. If it's a remote filename, then remove the remote part. -2. Expand \"~/\", git isn't a shell and does not understand it. -3. Deal with an `windows-nt' Emacs vs. Cygwin Git incompatibility." +2. Deal with an `windows-nt' Emacs vs. Cygwin Git incompatibility." (if (file-name-absolute-p filename) (-if-let ((cyg . win) (cl-rassoc filename magit-cygwin-mount-points @@ -752,6 +824,13 @@ If optional FILES is non-nil, then only conflicts in those files are considered." (and (magit-git-string "ls-files" "--unmerged" files) t)) +(defun magit-module-worktree-p (module) + (magit-with-toplevel + (file-exists-p (expand-file-name (expand-file-name ".git" module))))) + +(defun magit-module-no-worktree-p (module) + (not (magit-module-worktree-p module))) + ;;; Revisions and References (defun magit-rev-parse (&rest args) @@ -765,11 +844,23 @@ If there is no output, return nil. Like `magit-rev-parse' but ignore `magit-git-debug'." (apply #'magit-git-str "rev-parse" args)) +(defun magit-rev-parse-true (&rest args) + "Execute `git rev-parse ARGS', returning t if it prints \"true\". +If it prints \"false\", then return nil. For any other output +signal an error." + (magit-git-true "rev-parse" args)) + +(defun magit-rev-parse-false (&rest args) + "Execute `git rev-parse ARGS', returning t if it prints \"false\". +If it prints \"true\", then return nil. For any other output +signal an error." + (magit-git-false "rev-parse" args)) + (defun magit-rev-parse-p (&rest args) "Execute `git rev-parse ARGS', returning t if it prints \"true\". Return t if the first (and usually only) output line is the string \"true\", otherwise return nil." - (magit-git-true "rev-parse" args)) + (equal (magit-git-str "rev-parse" args) "true")) (defun magit-rev-verify (rev) (magit-rev-parse-safe "--verify" rev)) @@ -796,6 +887,14 @@ string \"true\", otherwise return nil." (equal (magit-rev-parse rev) (magit-rev-parse "HEAD"))))) +(defun magit-rev-author-p (rev) + "Return t if the user is the author of REV. +More precisely return t if `user.name' is equal to the author +name of REV and/or `user.email' is equal to the author email +of REV." + (or (equal (magit-get "user.name") (magit-rev-format "%an" rev)) + (equal (magit-get "user.email") (magit-rev-format "%ae" rev)))) + (defun magit-rev-name (rev &optional pattern) "Return a symbolic name for REV. PATTERN is passed to the `--refs' flag of `git-name-rev' and can @@ -931,7 +1030,9 @@ to, or to some other symbolic-ref that points to the same ref." (magit-section-case (branch (magit-ref-maybe-qualify (oref it value))) (commit (let ((rev (oref it value))) - (or (magit-get-shortname rev) rev))) + (or (magit-name-branch rev) + (magit-get-shortname rev) + rev))) (tag (magit-ref-maybe-qualify (oref it value) "tags/"))) (thing-at-point 'git-revision t) (and (derived-mode-p 'magit-revision-mode @@ -951,6 +1052,18 @@ to, or to some other symbolic-ref that points to the same ref." (remote (oref it value)) (branch (magit-section-parent-value it)))) +(defun magit-module-at-point (&optional predicate) + (magit-section-when + '(submodule + [file modules-unpulled-from-upstream] + [file modules-unpulled-from-pushremote] + [file modules-unpushed-to-upstream] + [file modules-unpushed-to-pushremote]) + (let ((module (oref it value))) + (and (or (not predicate) + (funcall predicate module)) + module)))) + (defun magit-get-current-branch () "Return the refname of the currently checked out branch. Return nil if no branch is currently checked out." @@ -1130,18 +1243,24 @@ where COMMITS is the number of commits in TAG but not in REV." When NAMESPACES is non-nil, list refs from these namespaces rather than those from `magit-list-refs-namespaces'. -FORMAT is passed to the `--format' flag of `git for-each-ref' and -defaults to \"%(refname)\". +FORMAT is passed to the `--format' flag of `git for-each-ref' +and defaults to \"%(refname)\". If the format is \"%(refname)\" +or \"%(refname:short)\", then drop the symbolic-ref \"HEAD\". SORTBY is a key or list of keys to pass to the `--sort' flag of `git for-each-ref'. When nil, use `magit-list-refs-sortby'" - (magit-git-lines "for-each-ref" - (concat "--format=" (or format "%(refname)")) - (--map (concat "--sort=" it) - (pcase (or sortby magit-list-refs-sortby) - ((and val (pred stringp)) (list val)) - ((and val (pred listp)) val))) - (or namespaces magit-list-refs-namespaces))) + (unless format + (setq format "%(refname)")) + (let ((refs (magit-git-lines "for-each-ref" + (concat "--format=" format) + (--map (concat "--sort=" it) + (pcase (or sortby magit-list-refs-sortby) + ((and val (pred stringp)) (list val)) + ((and val (pred listp)) val))) + (or namespaces magit-list-refs-namespaces)))) + (if (member format '("%(refname)" "%(refname:short)")) + (--remove (string-match-p "\\(\\`\\|/\\)HEAD\\'" it) refs) + refs))) (defun magit-list-branches () (magit-list-refs (list "refs/heads" "refs/remotes"))) @@ -1153,17 +1272,17 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (magit-list-refs (concat "refs/remotes/" remote))) (defun magit-list-containing-branches (&optional commit) - (--filter (not (string-match-p "\\`(HEAD" it)) + (--remove (string-match-p "\\`(HEAD" it) (--map (substring it 2) (magit-git-lines "branch" "--contains" commit)))) (defun magit-list-merged-branches (&optional commit) - (--filter (not (string-match-p "\\`(HEAD" it)) + (--remove (string-match-p "\\`(HEAD" it) (--map (substring it 2) (magit-git-lines "branch" "--merged" commit)))) (defun magit-list-unmerged-branches (&optional commit) - (--filter (not (string-match-p "\\`(HEAD" it)) + (--remove (string-match-p "\\`(HEAD" it) (--map (substring it 2) (magit-git-lines "branch" "--no-merged" commit)))) @@ -1239,7 +1358,7 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (substring it 41)) (magit-git-lines "ls-remote" remote))) -(defun magit-get-submodules () +(defun magit-list-module-paths () (--mapcat (and (string-match "^160000 [0-9a-z]\\{40\\} 0\t\\(.+\\)$" it) (list (match-string 1 it))) (magit-git-items "ls-files" "-z" "--stage"))) @@ -1526,24 +1645,25 @@ the reference is used. The first regexp submatch becomes the (magit-git-success "update-index" "--add" "--remove" "--" files)) (defun magit-update-ref (ref message rev &optional stashish) - (or (if (not (version< (magit-git-version) "2.6.0")) - (zerop (magit-call-git "update-ref" "--create-reflog" - "-m" message ref rev - (or (magit-rev-verify ref) ""))) - ;; `--create-reflog' didn't exist before v2.6.0 - (let ((oldrev (magit-rev-verify ref)) - (logfile (magit-git-dir (concat "logs/" ref)))) - (unless (file-exists-p logfile) - (when oldrev - (magit-git-success "update-ref" "-d" ref oldrev)) - (make-directory (file-name-directory logfile) t) - (with-temp-file logfile) - (when (and oldrev (not stashish)) - (magit-git-success "update-ref" "-m" "enable reflog" - ref oldrev "")))) - (magit-git-success "update-ref" "-m" message ref rev - (or (magit-rev-verify ref) ""))) - (error "Cannot update %s with %s" ref rev))) + (let ((magit--refresh-cache nil)) + (or (if (not (version< (magit-git-version) "2.6.0")) + (zerop (magit-call-git "update-ref" "--create-reflog" + "-m" message ref rev + (or (magit-rev-verify ref) ""))) + ;; `--create-reflog' didn't exist before v2.6.0 + (let ((oldrev (magit-rev-verify ref)) + (logfile (magit-git-dir (concat "logs/" ref)))) + (unless (file-exists-p logfile) + (when oldrev + (magit-git-success "update-ref" "-d" ref oldrev)) + (make-directory (file-name-directory logfile) t) + (with-temp-file logfile) + (when (and oldrev (not stashish)) + (magit-git-success "update-ref" "-m" "enable reflog" + ref oldrev "")))) + (magit-git-success "update-ref" "-m" message ref rev + (or (magit-rev-verify ref) ""))) + (error "Cannot update %s with %s" ref rev)))) (defconst magit-range-re (concat "\\`\\([^ \t]*[^.]\\)?" ; revA @@ -1688,6 +1808,20 @@ the reference is used. The first regexp submatch becomes the nil nil nil 'magit-revision-history default) (user-error "Nothing selected")))) +(defun magit-read-other-local-branch + (prompt &optional exclude secondary-default no-require-match) + (let* ((current (magit-get-current-branch)) + (atpoint (magit-local-branch-at-point)) + (exclude (or exclude current)) + (default (or (and (not (equal atpoint exclude)) atpoint) + (and (not (equal current exclude)) current) + secondary-default + (magit-get-previous-branch)))) + (magit-completing-read prompt + (delete exclude (magit-list-local-branch-names)) + nil (not no-require-match) + nil 'magit-revision-history default))) + (defun magit-read-branch-prefer-other (prompt) (let* ((current (magit-get-current-branch)) (commit (magit-commit-at-point)) @@ -1773,8 +1907,36 @@ the reference is used. The first regexp submatch becomes the (magit-remote-at-point) (magit-get-remote)))) -(defun magit-read-module-path (prompt) - (magit-completing-read prompt (magit-get-submodules))) +(defun magit-read-module-path (prompt &optional predicate) + (magit-completing-read prompt (magit-list-module-paths) + predicate t nil nil + (magit-module-at-point predicate))) + +(defun magit-module-confirm (verb &optional predicate) + (let (modules) + (if current-prefix-arg + (progn + (setq modules (magit-list-module-paths)) + (when predicate + (setq modules (-filter predicate modules))) + (unless modules + (if predicate + (user-error "No modules satisfying %s available" predicate) + (user-error "No modules available")))) + (setq modules (magit-region-values + '(submodule + [file modules-unpulled-from-upstream] + [file modules-unpulled-from-pushremote] + [file modules-unpushed-to-upstream] + [file modules-unpushed-to-pushremote]))) + (when modules + (when predicate + (setq modules (-filter predicate modules))) + (unless modules + (user-error "No modules satisfying %s selected" predicate)))) + (if (> (length modules) 1) + (magit-confirm t nil (format "%s %%i modules" verb) nil modules) + (list (magit-read-module-path (format "%s module" verb) predicate))))) ;;; Variables @@ -1812,8 +1974,8 @@ the reference is used. The first regexp submatch becomes the "Return the boolean value of the Git variable specified by KEYS." (let ((key (mapconcat 'identity keys "."))) (if magit--refresh-cache - (equal "true" (car (magit-config-get-from-cached-list key))) - (magit-git-true "config" "--bool" key)))) + (equal "true" (car (last (magit-config-get-from-cached-list key)))) + (equal (magit-git-str "config" "--bool" key) "true")))) (defun magit-set (value &rest keys) "Set the value of the Git variable specified by KEYS to VALUE." diff --git a/elpa/magit-20180118.313/magit-imenu.el b/elpa/magit-20180404.1428/magit-imenu.el similarity index 100% rename from elpa/magit-20180118.313/magit-imenu.el rename to elpa/magit-20180404.1428/magit-imenu.el diff --git a/elpa/magit-20180118.313/magit-log.el b/elpa/magit-20180404.1428/magit-log.el similarity index 96% rename from elpa/magit-20180118.313/magit-log.el rename to elpa/magit-20180404.1428/magit-log.el index 91d4df70..39f55518 100644 --- a/elpa/magit-20180118.313/magit-log.el +++ b/elpa/magit-20180404.1428/magit-log.el @@ -32,12 +32,16 @@ (require 'magit-core) (require 'magit-diff) -(declare-function magit-blob-visit 'magit) -(declare-function magit-insert-head-branch-header 'magit) -(declare-function magit-insert-upstream-branch-header 'magit) -(declare-function magit-read-file-from-rev 'magit) -(declare-function magit-show-commit 'magit) -(defvar magit-refs-indent-cherry-lines) +(declare-function magit-blob-visit "magit-files" (blob-or-file line)) +(declare-function magit-insert-head-branch-header "magit-status" + (&optional branch)) +(declare-function magit-insert-upstream-branch-header "magit-status" + (&optional branch pull keyword)) +(declare-function magit-read-file-from-rev "magit-files" + (rev prompt &optional default)) +(declare-function magit-show-commit "magit-diff" + (arg1 &optional arg2 arg3 arg4)) +(defvar magit-refs-focus-column-width) (defvar magit-refs-margin) (defvar magit-refs-show-commit-count) (defvar magit-buffer-margin) @@ -127,6 +131,14 @@ This is useful if you use really long branch names." :group 'magit-log :type 'boolean) +(defcustom magit-log-header-line-function 'magit-log-header-line-sentence + "Function used to generate text shown in header line of log buffers." + :package-version '(magit . "2.12.0") + :group 'magit-log + :type '(choice (function-item magit-log-header-line-arguments) + (function-item magit-log-header-line-sentence) + function)) + (defface magit-log-graph '((((class color) (background light)) :foreground "grey30") (((class color) (background dark)) :foreground "grey80")) @@ -349,6 +361,7 @@ the upstream isn't ahead of the current branch) show." (?u "Show diffs" "--patch") (?s "Show diffstats" "--stat") (?h "Show header" "++header" magit-log++header) + (?r "Show in reverse order" "--reverse") (?D "Simplify by decoration" "--simplify-by-decoration") (?f "Follow renames when showing single-file log" "--follow")) :options ((?n "Limit number of commits" "-n") @@ -380,6 +393,7 @@ the upstream isn't ahead of the current branch) show." (?S "Show signatures" "--show-signature") (?u "Show diffs" "--patch") (?s "Show diffstats" "--stat") + (?r "Show in reverse order" "--reverse") (?D "Simplify by decoration" "--simplify-by-decoration") (?f "Follow renames when showing single-file log" "--follow")) :options ((?n "Limit number of commits" "-n") @@ -672,9 +686,7 @@ active, restrict the log to the lines that the region touches." ;; of a trailing newline. (1- end))))))))) (require 'magit) - (-if-let (file (or (magit-file-relative-name) - (and (derived-mode-p 'dired-mode) - default-directory))) + (-if-let (file (magit-file-relative-name)) (magit-mode-setup-internal #'magit-log-mode (list (list (or magit-buffer-refname @@ -683,7 +695,7 @@ active, restrict the log to the lines that the region touches." (let ((args (car (magit-log-arguments)))) (when (and follow (not (member "--follow" args))) (push "--follow" args)) - (when (and beg end) + (when (and (file-regular-p file) beg end) (setq args (cons (format "-L%s,%s:%s" beg end file) (cl-delete "-L" args :test 'string-prefix-p))) @@ -831,13 +843,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (defun magit-log-refresh-buffer (revs args files) (magit-set-header-line-format - (concat "Commits in " - (mapconcat #'identity revs " ") - (and files (concat " touching " - (mapconcat 'identity files " "))) - (--some (and (string-prefix-p "-L" it) - (concat " " it)) - args))) + (funcall magit-log-header-line-function revs args files)) (if (= (length files) 1) (unless (magit-file-tracked-p (car files)) (setq args (cons "--full-history" args))) @@ -867,6 +873,27 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (magit-insert-section (logbuf) (magit-insert-log revs args files))) +(defun magit-log-header-line-arguments (revs args files) + "Return string describing some of the used arguments." + (mapconcat (lambda (arg) + (if (string-match-p " " arg) + (prin1 arg) + arg)) + `("git" "log" ,@args ,@revs "--" ,@files) + " ")) + +(defun magit-log-header-line-sentence (revs args files) + "Return string containing all arguments." + (concat "Commits in " + (mapconcat #'identity revs " ") + (and (member "--reverse" args) + " in reverse") + (and files (concat " touching " + (mapconcat 'identity files " "))) + (--some (and (string-prefix-p "-L" it) + (concat " " it)) + args))) + (defun magit-insert-log (revs &optional args files) "Insert a log section. Do not add this to a hook variable." @@ -888,9 +915,11 @@ Do not add this to a hook variable." (--when-let (--first (string-match "^\\+\\+order=\\(.+\\)$" it) args) (setq args (cons (format "--%s-order" (match-string 1 it)) (remove it args)))) - (if (member "--decorate" args) - (cons "--decorate=full" (remove "--decorate" args)) - args)) + (when (member "--decorate" args) + (setq args (cons "--decorate=full" (remove "--decorate" args)))) + (when (member "--reverse" args) + (setq args (remove "--graph" args))) + args) "--use-mailmap" "--no-prefix" revs "--" files))) (defvar magit-commit-section-map @@ -963,6 +992,8 @@ Do not add this to a hook variable." (defvar magit-log-count nil) +(defvar magit-log-format-message-function 'magit-log-propertize-keywords) + (defun magit-log-wash-log (style args) (setq args (-flatten args)) (when (and (member "--graph" args) @@ -1025,7 +1056,7 @@ Do not add this to a hook variable." (when cherry (when (and (derived-mode-p 'magit-refs-mode) magit-refs-show-commit-count) - (insert (make-string magit-refs-indent-cherry-lines ?\s))) + (insert (make-string (1- magit-refs-focus-column-width) ?\s))) (insert (propertize cherry 'face (if (string= cherry "-") 'magit-cherry-equivalent 'magit-cherry-unmatched))) @@ -1059,7 +1090,7 @@ Do not add this to a hook variable." (?Y 'magit-signature-expired-key) (?R 'magit-signature-revoked) (?E 'magit-signature-error))))) - (insert (magit-log-propertize-keywords msg))) + (insert (funcall magit-log-format-message-function hash msg))) (when (and refs magit-log-show-refname-after-summary) (insert ?\s) (insert (magit-format-ref-labels refs))) @@ -1123,7 +1154,7 @@ Do not add this to a hook variable." (insert graph ?\n)))))))) t) -(defun magit-log-propertize-keywords (msg) +(defun magit-log-propertize-keywords (_rev msg) (let ((start 0)) (while (string-match "\\[[^[]*\\]" msg start) (setq start (match-end 0)) diff --git a/elpa/magit-20180118.313/magit-margin.el b/elpa/magit-20180404.1428/magit-margin.el similarity index 94% rename from elpa/magit-20180118.313/magit-margin.el rename to elpa/magit-20180404.1428/magit-margin.el index 552839e9..9e80e78b 100644 --- a/elpa/magit-20180118.313/magit-margin.el +++ b/elpa/magit-20180404.1428/magit-margin.el @@ -61,9 +61,14 @@ does not carry to other options." (magit-define-popup magit-margin-popup "Popup console for changing appearance of the margin." :actions '("Margin" - (?L "toggle visibility" magit-toggle-margin) - (?l "cycle style" magit-cycle-margin-style) - (?d "toggle details" magit-toggle-margin-details)) + (?L "Toggle visibility" magit-toggle-margin) + (?l "Cycle style" magit-cycle-margin-style) + (?d "Toggle details" magit-toggle-margin-details) + (lambda () + (and (with-current-buffer magit-pre-popup-buffer + (derived-mode-p 'magit-refs-mode)) + (propertize "Left edge" 'face 'magit-popup-heading))) + (?v "Change verbosity" magit-refs-set-show-commit-count)) :max-action-columns 1) (defun magit-toggle-margin () diff --git a/elpa/magit-20180404.1428/magit-merge.el b/elpa/magit-20180404.1428/magit-merge.el new file mode 100644 index 00000000..3715721f --- /dev/null +++ b/elpa/magit-20180404.1428/magit-merge.el @@ -0,0 +1,274 @@ +;;; magit-merge.el --- merge functionality -*- lexical-binding: t -*- + +;; Copyright (C) 2010-2018 The Magit Project Contributors +;; +;; You should have received a copy of the AUTHORS.md file which +;; lists all contributors. If not, see http://magit.vc/authors. + +;; Author: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli + +;; Magit is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Magit is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Magit. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; This library implements merge commands. + +;;; Code: + +(require 'magit) + +;;; Commands + +;;;###autoload (autoload 'magit-merge-popup "magit" nil t) +(magit-define-popup magit-merge-popup + "Popup console for merge commands." + :man-page "git-merge" + :switches '((?f "Fast-forward only" "--ff-only") + (?n "No fast-forward" "--no-ff")) + :options '((?s "Strategy" "--strategy=")) + :actions '((?m "Merge" magit-merge) + (?p "Preview merge" magit-merge-preview) + (?e "Merge and edit message" magit-merge-editmsg) nil + (?n "Merge but don't commit" magit-merge-nocommit) + (?s "Squash merge" magit-merge-squash) + (?a "Absorb" magit-merge-absorb) + (?i "Merge into" magit-merge-into)) + :sequence-actions '((?m "Commit merge" magit-commit) + (?a "Abort merge" magit-merge-abort)) + :sequence-predicate 'magit-merge-in-progress-p + :default-action 'magit-merge + :max-action-columns 2) + +;;;###autoload +(defun magit-merge (rev &optional args nocommit) + "Merge commit REV into the current branch; using default message. + +Unless there are conflicts or a prefix argument is used create a +merge commit using a generic commit message and without letting +the user inspect the result. With a prefix argument pretend the +merge failed to give the user the opportunity to inspect the +merge. + +\(git merge --no-edit|--no-commit [ARGS] REV)" + (interactive (list (magit-read-other-branch-or-commit "Merge") + (magit-merge-arguments) + current-prefix-arg)) + (magit-merge-assert) + (magit-run-git-async "merge" (if nocommit "--no-commit" "--no-edit") args rev)) + +;;;###autoload +(defun magit-merge-editmsg (rev &optional args) + "Merge commit REV into the current branch; and edit message. +Perform the merge and prepare a commit message but let the user +edit it. +\n(git merge --edit --no-ff [ARGS] REV)" + (interactive (list (magit-read-other-branch-or-commit "Merge") + (magit-merge-arguments))) + (magit-merge-assert) + (cl-pushnew "--no-ff" args :test #'equal) + (apply #'magit-run-git-with-editor "merge" "--edit" + (append args (list rev)))) + +;;;###autoload +(defun magit-merge-nocommit (rev &optional args) + "Merge commit REV into the current branch; pretending it failed. +Pretend the merge failed to give the user the opportunity to +inspect the merge and change the commit message. +\n(git merge --no-commit --no-ff [ARGS] REV)" + (interactive (list (magit-read-other-branch-or-commit "Merge") + (magit-merge-arguments))) + (magit-merge-assert) + (cl-pushnew "--no-ff" args :test #'equal) + (magit-run-git-async "merge" "--no-commit" args rev)) + +;;;###autoload +(defun magit-merge-into (branch &optional args) + "Merge the current branch into BRANCH and remove the former. + +Before merging, force push the source branch to its push-remote, +provided the respective remote branch already exists, ensuring +that the respective pull-request (if any) won't get stuck on some +obsolete version of the commits that are being merged. Finally +if `magit-branch-pull-request' was used to create the merged +branch, then also remove the respective remote branch." + (interactive (list (magit-read-other-branch + (format "Merge `%s' into" (magit-get-current-branch))) + (magit-merge-arguments))) + (let ((current (magit-get-current-branch))) + (when (zerop (magit-call-git "checkout" branch)) + (magit--merge-absort current args)))) + +;;;###autoload +(defun magit-merge-absorb (branch &optional args) + "Merge BRANCH into the current branch and remove the former. + +Before merging, force push the source branch to its push-remote, +provided the respective remote branch already exists, ensuring +that the respective pull-request (if any) won't get stuck on some +obsolete version of the commits that are being merged. Finally +if `magit-branch-pull-request' was used to create the merged +branch, then also remove the respective remote branch." + (interactive (list (magit-read-other-local-branch "Absorb branch") + (magit-merge-arguments))) + (magit--merge-absort branch args)) + +(defun magit--merge-absort (branch args) + (when (equal branch "master") + (unless (yes-or-no-p + "Do you really wanto to merge `master' into another branch? ") + (user-error "Abort"))) + (-if-let (target (magit-get-push-branch branch t)) + (progn + (magit-git-push branch target (list "--force-with-lease")) + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (not (zerop (process-exit-status process))) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (magit--merge-absort-1 branch args)))))) + (magit--merge-absort-1 branch args))) + +(defun magit--merge-absort-1 (branch args) + (magit-run-git-async "merge" args "--no-edit" branch) + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (> (process-exit-status process) 0) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (magit-branch-maybe-delete-pr-remote branch) + (magit-branch-unset-pushRemote branch) + (magit-run-git "branch" "-D" branch)))))) + +;;;###autoload +(defun magit-merge-squash (rev) + "Squash commit REV into the current branch; don't create a commit. +\n(git merge --squash REV)" + (interactive (list (magit-read-other-branch-or-commit "Squash"))) + (magit-merge-assert) + (magit-run-git-async "merge" "--squash" rev)) + +;;;###autoload +(defun magit-merge-preview (rev) + "Preview result of merging REV into the current branch." + (interactive (list (magit-read-other-branch-or-commit "Preview merge"))) + (magit-mode-setup #'magit-merge-preview-mode rev)) + +(define-derived-mode magit-merge-preview-mode magit-diff-mode "Magit Merge" + "Mode for previewing a merge." + :group 'magit-diff + (hack-dir-local-variables-non-file-buffer)) + +(defun magit-merge-preview-refresh-buffer (rev) + (let* ((branch (magit-get-current-branch)) + (head (or branch (magit-rev-verify "HEAD")))) + (magit-set-header-line-format (format "Preview merge of %s into %s" + rev + (or branch "HEAD"))) + (magit-insert-section (diffbuf) + (magit-git-wash #'magit-diff-wash-diffs + "merge-tree" (magit-git-string "merge-base" head rev) head rev)))) + +;;;###autoload +(defun magit-merge-abort () + "Abort the current merge operation. +\n(git merge --abort)" + (interactive) + (unless (file-exists-p (magit-git-dir "MERGE_HEAD")) + (user-error "No merge in progress")) + (magit-confirm 'abort-merge) + (magit-run-git-async "merge" "--abort")) + +(defun magit-checkout-stage (file arg) + "During a conflict checkout and stage side, or restore conflict." + (interactive + (let ((file (magit-completing-read "Checkout file" + (magit-tracked-files) nil nil nil + 'magit-read-file-hist + (magit-current-file)))) + (cond ((member file (magit-unmerged-files)) + (list file (magit-checkout-read-stage file))) + ((yes-or-no-p (format "Restore conflicts in %s? " file)) + (list file "--merge")) + (t + (user-error "Quit"))))) + (pcase (cons arg (cddr (car (magit-file-status file)))) + ((or `("--ours" ?D ,_) + `("--theirs" ,_ ?D)) + (magit-run-git "rm" "--" file)) + (_ (if (equal arg "--merge") + ;; This fails if the file was deleted on one + ;; side. And we cannot do anything about it. + (magit-run-git "checkout" "--merge" "--" file) + (magit-call-git "checkout" arg "--" file) + (magit-run-git "add" "-u" "--" file))))) + +;;; Utilities + +(defun magit-merge-in-progress-p () + (file-exists-p (magit-git-dir "MERGE_HEAD"))) + +(defun magit--merge-range (&optional head) + (unless head + (setq head (magit-get-shortname + (car (magit-file-lines (magit-git-dir "MERGE_HEAD")))))) + (and head + (concat (magit-git-string "merge-base" "--octopus" "HEAD" head) + ".." head))) + +(defun magit-merge-assert () + (or (not (magit-anything-modified-p t)) + (magit-confirm 'merge-dirty + "Merging with dirty worktree is risky. Continue"))) + +(defun magit-checkout-read-stage (file) + (magit-read-char-case (format "For %s checkout: " file) t + (?o "[o]ur stage" "--ours") + (?t "[t]heir stage" "--theirs") + (?c "[c]onflict" "--merge"))) + +;;; Sections + +(defvar magit-unmerged-section-map + (let ((map (make-sparse-keymap))) + (define-key map [remap magit-visit-thing] 'magit-diff-dwim) + map) + "Keymap for `unmerged' sections.") + +(defun magit-insert-merge-log () + "Insert section for the on-going merge. +Display the heads that are being merged. +If no merge is in progress, do nothing." + (when (magit-merge-in-progress-p) + (let* ((heads (mapcar #'magit-get-shortname + (magit-file-lines (magit-git-dir "MERGE_HEAD")))) + (range (magit--merge-range (car heads)))) + (magit-insert-section (unmerged range) + (magit-insert-heading + (format "Merging %s:" (mapconcat #'identity heads ", "))) + (magit-insert-log + range + (let ((args magit-log-section-arguments)) + (unless (member "--decorate=full" magit-log-section-arguments) + (push "--decorate=full" args)) + args)))))) + +(provide 'magit-merge) +;;; magit-merge.el ends here diff --git a/elpa/magit-20180118.313/magit-mode.el b/elpa/magit-20180404.1428/magit-mode.el similarity index 93% rename from elpa/magit-20180118.313/magit-mode.el rename to elpa/magit-20180404.1428/magit-mode.el index eddb83f9..be9a5bc5 100644 --- a/elpa/magit-20180118.313/magit-mode.el +++ b/elpa/magit-20180404.1428/magit-mode.el @@ -42,9 +42,9 @@ (defvar magit-diff-show-xref-buttons) (defvar magit-revision-show-xref-buttons) ;; For `magit-refresh' and `magit-refresh-all' -(declare-function magit-auto-revert-buffers 'magit-autorevert) +(declare-function magit-auto-revert-buffers "magit-autorevert" ()) ;; For `magit-refresh-buffer' -(declare-function magit-process-unset-mode-line-error-status 'magit-process) +(declare-function magit-process-unset-mode-line-error-status "magit-process" ()) (require 'format-spec) (require 'help-mode) @@ -144,7 +144,7 @@ which in turn uses the function specified here." :type '(radio (function-item magit-generate-buffer-name-default-function) (function :tag "Function"))) -(defcustom magit-buffer-name-format "*%M%v: %T" +(defcustom magit-buffer-name-format "%x%M%v: %t%x" "The format string used to name Magit buffers. The following %-sequences are supported: @@ -164,12 +164,19 @@ The following %-sequences are supported: repository, or if `magit-uniquify-buffer-names' is non-nil an abbreviation of that. -`%T' Like \"%t\", but append an asterisk if and only if - `magit-uniquify-buffer-names' is nil. +`%x' If `magit-uniquify-buffer-names' is nil \"*\", otherwise the + empty string. Due to limitations of the `uniquify' package, + buffer names must end with the path. -The value should always contain \"%m\" or \"%M\", \"%v\" or \"%V\", -and \"%t\" or \"%T\". If `magit-uniquify-buffer-names' is non-nil, -then the value must end with \"%t\" or \"%T\" (see issue #2841). +`%T' Obsolete, use \"%t%x\" instead. Like \"%t\", but append an + asterisk if and only if `magit-uniquify-buffer-names' is nil. + +The value should always contain \"%m\" or \"%M\", \"%v\" or +\"%V\", and \"%t\" (or the obsolete \"%T\"). + +If `magit-uniquify-buffer-names' is non-nil, then the value must +end with \"%t\" or \"%t%x\" (or the obsolete \"%T\"). See issue +#2841. This is used by `magit-generate-buffer-name-default-function'. If another `magit-generate-buffer-name-function' is used, then @@ -531,6 +538,7 @@ Magit is documented in info node `(magit)'." (make-local-variable 'text-property-default-nonsticky) (push (cons 'keymap t) text-property-default-nonsticky) (add-hook 'post-command-hook #'magit-section-update-highlight t t) + (add-hook 'deactivate-mark-hook #'magit-section-update-highlight t t) (setq-local redisplay-highlight-region-function 'magit-highlight-region) (setq-local redisplay-unhighlight-region-function 'magit-unhighlight-region) (when (bound-and-true-p global-linum-mode) @@ -812,6 +820,7 @@ account." (?v . ,(or v "")) (?V . ,(if v (concat " " v) "")) (?t . ,n) + (?x . ,(if magit-uniquify-buffer-names "" "*")) (?T . ,(if magit-uniquify-buffer-names n (concat n "*"))))))) (defun magit-toggle-buffer-lock () @@ -952,27 +961,29 @@ Refresh the current buffer if its major mode derives from Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (interactive) (unless inhibit-magit-refresh - (let ((start (current-time)) - (magit--refresh-cache (or magit--refresh-cache - (list (cons 0 0))))) - (when magit-refresh-verbose - (message "Refreshing magit...")) - (magit-run-hook-with-benchmark 'magit-pre-refresh-hook) - (when (derived-mode-p 'magit-mode) - (magit-refresh-buffer)) - (--when-let (and magit-refresh-status-buffer - (not (derived-mode-p 'magit-status-mode)) - (magit-mode-get-buffer 'magit-status-mode)) - (with-current-buffer it - (magit-refresh-buffer))) - (magit-auto-revert-buffers) - (magit-run-hook-with-benchmark 'magit-post-refresh-hook) - (when magit-refresh-verbose - (message "Refreshing magit...done (%.3fs, cached %s/%s)" - (float-time (time-subtract (current-time) start)) - (caar magit--refresh-cache) - (+ (caar magit--refresh-cache) - (cdar magit--refresh-cache))))))) + (unwind-protect + (let ((start (current-time)) + (magit--refresh-cache (or magit--refresh-cache + (list (cons 0 0))))) + (when magit-refresh-verbose + (message "Refreshing magit...")) + (magit-run-hook-with-benchmark 'magit-pre-refresh-hook) + (when (derived-mode-p 'magit-mode) + (magit-refresh-buffer)) + (--when-let (and magit-refresh-status-buffer + (not (derived-mode-p 'magit-status-mode)) + (magit-mode-get-buffer 'magit-status-mode)) + (with-current-buffer it + (magit-refresh-buffer))) + (magit-auto-revert-buffers) + (magit-run-hook-with-benchmark 'magit-post-refresh-hook) + (when magit-refresh-verbose + (message "Refreshing magit...done (%.3fs, cached %s/%s)" + (float-time (time-subtract (current-time) start)) + (caar magit--refresh-cache) + (+ (caar magit--refresh-cache) + (cdar magit--refresh-cache))))) + (run-hooks 'magit-unwind-refresh-hook)))) (defun magit-refresh-all () "Refresh all buffers belonging to the current repository. @@ -1084,7 +1095,7 @@ contents from scratch, which can be slow in large repositories. If you are not satisfied with Magit's performance, then you should obviously not add this function to that hook." (when (and (not disable-magit-save-buffers) - (magit-inside-worktree-p)) + (magit-inside-worktree-p t)) (--when-let (ignore-errors (magit-mode-get-buffer 'magit-status-mode)) (add-to-list 'magit-after-save-refresh-buffers it) (add-hook 'post-command-hook 'magit-after-save-refresh-buffers)))) @@ -1109,6 +1120,8 @@ if you so desire." (add-hook 'magit-pre-call-git-hook #'magit-maybe-save-repository-buffers) (add-hook 'magit-pre-start-git-hook #'magit-maybe-save-repository-buffers) +(defvar-local magit-inhibit-refresh-save nil) + (defun magit-save-repository-buffers (&optional arg) "Save file-visiting buffers belonging to the current repository. After any buffer where `buffer-save-without-query' is non-nil @@ -1117,10 +1130,23 @@ buffer which visits a file in the current repository. Optional argument (the prefix) non-nil means save all with no questions." (interactive "P") (-when-let (topdir (magit-rev-parse-safe "--show-toplevel")) - (let ((remote (file-remote-p topdir))) + (let ((remote (file-remote-p topdir)) + (save-some-buffers-action-alist + `((?Y (lambda (buffer) + (with-current-buffer buffer + (setq buffer-save-without-query t) + (save-buffer))) + "to save the current buffer and remember choice") + (?N (lambda (buffer) + (with-current-buffer buffer + (setq magit-inhibit-refresh-save t))) + "to skip the current buffer and remember choice") + ,@save-some-buffers-action-alist))) (save-some-buffers arg (lambda () - (and buffer-file-name + (and (not magit-inhibit-refresh-save) + buffer-file-name + (file-exists-p (file-name-directory buffer-file-name)) ;; Avoid needlessly connecting to unrelated remotes. (equal (file-remote-p buffer-file-name) remote) @@ -1223,17 +1249,7 @@ Currently `magit-log-mode', `magit-reflog-mode', (setq magit-refresh-args (cdr args)) (magit-refresh-buffer)) -;;; Utilities - -(defun magit-run-hook-with-benchmark (hook) - (when hook - (if magit-refresh-verbose - (let ((start (current-time))) - (message "Running %s..." hook) - (run-hooks hook) - (message "Running %s...done (%.3fs)" hook - (float-time (time-subtract (current-time) start)))) - (run-hooks hook)))) +;;; Repository-Local Cache (defvar magit-repository-local-cache nil "Alist mapping `magit-toplevel' paths to alists of key/value pairs.") @@ -1303,5 +1319,32 @@ Unless specified, REPOSITORY is the current buffer's repository." (setf (cdr cache) (cl-delete key (cdr cache) :key #'car :test #'equal))))) +(defun magit-zap-caches () + "Zap caches for the current repository. +Remove the repository's entry from `magit-repository-cache' +and set `magit-section-visibility-cache' to nil in all of the +repository's Magit buffers." + (interactive) + (magit-with-toplevel + (setq magit-repository-local-cache + (cl-delete default-directory + magit-repository-local-cache + :key #'car :test #'equal))) + (dolist (buffer (magit-mode-get-buffers)) + (with-current-buffer buffer + (setq magit-section-visibility-cache nil)))) + +;;; Utilities + +(defun magit-run-hook-with-benchmark (hook) + (when hook + (if magit-refresh-verbose + (let ((start (current-time))) + (message "Running %s..." hook) + (run-hooks hook) + (message "Running %s...done (%.3fs)" hook + (float-time (time-subtract (current-time) start)))) + (run-hooks hook)))) + (provide 'magit-mode) ;;; magit-mode.el ends here diff --git a/elpa/magit-20180118.313/magit-notes.el b/elpa/magit-20180404.1428/magit-notes.el similarity index 100% rename from elpa/magit-20180118.313/magit-notes.el rename to elpa/magit-20180404.1428/magit-notes.el diff --git a/elpa/magit-20180118.313/magit-obsolete.el b/elpa/magit-20180404.1428/magit-obsolete.el similarity index 94% rename from elpa/magit-20180118.313/magit-obsolete.el rename to elpa/magit-20180404.1428/magit-obsolete.el index b5439cb6..25f666b6 100644 --- a/elpa/magit-20180118.313/magit-obsolete.el +++ b/elpa/magit-20180404.1428/magit-obsolete.el @@ -134,8 +134,16 @@ use `magit-pre-refresh-hook', `magit-post-refresh-hook', (define-obsolete-function-alias 'magit-insert-unpulled-from-upstream-or-recent 'magit-insert-unpulled-from-upstream "Magit 2.12.0") +(define-obsolete-function-alias 'magit-get-submodules + 'magit-list-module-paths "Magit 2.12.0") + (make-obsolete-variable 'magit-no-confirm-default - 'magit-dwim-selection "Magit 2.12.0") + 'magit-dwim-selection + "Magit 2.12.0") + +(make-obsolete-variable 'magit-status-expand-stashes + 'magit-section-initial-visibility-alist + "Magit 2.12.0") (make-obsolete 'magit-section-type "use (oref ... type) instead" "Magit 2.12.0") (make-obsolete 'magit-section-value "use (oref ... value) instead" "Magit 2.12.0") diff --git a/elpa/magit-20180404.1428/magit-pkg.el b/elpa/magit-20180404.1428/magit-pkg.el new file mode 100644 index 00000000..991eafe3 --- /dev/null +++ b/elpa/magit-20180404.1428/magit-pkg.el @@ -0,0 +1,12 @@ +(define-package "magit" "20180404.1428" "A Git porcelain inside Emacs." + '((emacs "24.4") + (async "20170823") + (dash "20170810") + (ghub "20180328") + (git-commit "20180329") + (let-alist "1.0.5") + (magit-popup "20180329") + (with-editor "20180318"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/magit-20180118.313/magit-process.el b/elpa/magit-20180404.1428/magit-process.el similarity index 96% rename from elpa/magit-20180118.313/magit-process.el rename to elpa/magit-20180404.1428/magit-process.el index 6743f08a..1356c2b2 100644 --- a/elpa/magit-20180118.313/magit-process.el +++ b/elpa/magit-20180404.1428/magit-process.el @@ -41,11 +41,8 @@ (require 'magit-git) (require 'magit-mode) -(eval-when-compile (require 'dired)) -(declare-function dired-uncache 'dired) - -(eval-when-compile (require 'auth-source)) -(declare-function auth-source-search 'auth-source) +(declare-function auth-source-search "auth-source" + (&rest spec &key max require create delete &allow-other-keys)) ;;; Options @@ -287,10 +284,10 @@ optional NODISPLAY is non-nil also display it." (interactive) (magit-section-when process (let ((process (oref it value))) - (if (eq (process-status process) 'run) - (when (magit-confirm 'kill-process) - (kill-process process)) - (user-error "Process isn't running"))))) + (unless (eq (process-status process) 'run) + (user-error "Process isn't running")) + (magit-confirm 'kill-process) + (kill-process process)))) ;;; Synchronous Processes @@ -361,19 +358,27 @@ Process output goes into a new section in the buffer returned by Identical to `process-file' but temporarily enable Cygwin's \"noglob\" option during the call and ensure unix eol conversion." - (let ((process-environment (append (magit-cygwin-env-vars) - process-environment)) + (let ((process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system))) (apply #'process-file args))) -(defun magit-cygwin-env-vars () - (append magit-git-environment - (and magit-need-cygwin-noglob - (mapcar (lambda (var) - (concat var "=" (--if-let (getenv var) - (concat it " noglob") - "noglob"))) - '("CYGWIN" "MSYS"))))) +(defun magit-process-environment () + ;; The various w32 hacks are only applicable when running on the + ;; local machine. As of Emacs 25.1, a local binding of + ;; process-environment different from the top-level value affects + ;; the environment used in + ;; tramp-sh-handle-{start-file-process,process-file}. + (let ((local (not (file-remote-p default-directory)))) + (append magit-git-environment + (and local + (cdr (assoc magit-git-executable magit-git-w32-path-hack))) + (and local magit-need-cygwin-noglob + (mapcar (lambda (var) + (concat var "=" (--if-let (getenv var) + (concat it " noglob") + "noglob"))) + '("CYGWIN" "MSYS"))) + process-environment))) (defvar magit-this-process nil) @@ -402,8 +407,7 @@ flattened before use." (eq (process-status magit-this-process) 'run)) (sleep-for 0.005))) (run-hooks 'magit-pre-call-git-hook) - (-let* ((process-environment (append (magit-cygwin-env-vars) - process-environment)) + (-let* ((process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system)) (flat-args (magit-process-git-arguments args)) ((process-buf . section) @@ -522,8 +526,7 @@ Magit status buffer." ;; Don't use a pty, because it would set icrnl ;; which would modify the input (issue #20). (and (not input) magit-process-connection-type)) - (process-environment (append (magit-cygwin-env-vars) - process-environment)) + (process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system))) (apply #'start-file-process (file-name-nondirectory program) @@ -842,8 +845,6 @@ as argument." (setq mode-line-process str))) (force-mode-line-update t))) -(declare-function magit-repository-local-repository "magit-mode") - (defun magit-process-set-mode-line-error-status (&optional error str) "Apply an error face to the string set by `magit-process-set-mode-line'. @@ -971,7 +972,7 @@ Limited by `magit-process-error-tooltip-max-lines'." (setq default-dir (process-get arg 'default-dir)) (setq section (process-get arg 'section)) (setq arg (process-exit-status arg))) - (when (featurep 'dired) + (when (fboundp 'dired-uncache) (dired-uncache default-dir)) (when (buffer-live-p process-buf) (with-current-buffer process-buf diff --git a/elpa/magit-20180118.313/magit-refs.el b/elpa/magit-20180404.1428/magit-refs.el similarity index 57% rename from elpa/magit-20180118.313/magit-refs.el rename to elpa/magit-20180404.1428/magit-refs.el index 79bd73bb..2149a81b 100644 --- a/elpa/magit-20180118.313/magit-refs.el +++ b/elpa/magit-20180404.1428/magit-refs.el @@ -73,6 +73,27 @@ To change the value in an existing buffer use the command (put 'magit-refs-show-commit-count 'safe-local-variable 'symbolp) (put 'magit-refs-show-commit-count 'permanent-local t) +(defcustom magit-refs-pad-commit-counts nil + "Whether to pad all counts on all sides in `magit-refs-mode' buffers. + +If this is nil, then some commit counts are displayed right next +to one of the branches that appear next to the count, without any +space in between. This might look bad if the branch name faces +look too similar to `magit-dimmed'. + +If this is non-nil, then spaces are placed on both sides of all +commit counts." + :package-version '(magit . "2.12.0") + :group 'magit-refs + :type 'boolean) + +(defvar magit-refs-show-push-remote nil + "Whether to show the push-remotes of local branches. +Also show the commits that the local branch is ahead and behind +the push-target. Unfortunately there is a bug in Git that makes +this useless (the commits ahead and behind the upstream are +shown), so this isn't enabled yet.") + (defcustom magit-refs-show-remote-prefix nil "Whether to show the remote prefix in lists of remote branches. @@ -121,6 +142,62 @@ tags." :group 'magit-margin :type 'boolean) +(defcustom magit-refs-primary-column-width (cons 16 32) + "Width of the focus column in `magit-refs-mode' buffers. + +The primary column is the column that contains the name of the +branch that the current row is about. + +If this is an integer, then the column is that many columns wide. +Otherwise it has to be a cons-cell of two integers. The first +specifies the minimal width, the second the maximal width. In that +case the actual width is determined using the length of the names +of the shown local branches. (Remote branches and tags are not +taken into account when calculating to optimal width.)" + :package-version '(magit . "2.12.0") + :group 'magit-refs + :type '(choice (integer :tag "Constant wide") + (cons :tag "Wide constrains" + (integer :tag "Minimum") + (integer :tag "Maximum")))) + +(defcustom magit-refs-focus-column-width 5 + "Width of the focus column in `magit-refs-mode' buffers. + +The focus column is the first column, which marks one +branch (usually the current branch) as the focused branch using +\"*\" or \"@\". For each other reference, this column optionally +shows how many commits it is ahead of the focused branch and \"<\", or +if it isn't ahead then the commits it is behind and \">\", or if it +isn't behind either, then a \"=\". + +This column may also display only \"*\" or \"@\" for the focused +branch, in which case this option is ignored. Use \"L v\" to +change the verbosity of this column." + :package-version '(magit . "2.12.0") + :group 'magit-refs + :type 'integer) + +(defcustom magit-refs-filter-alist nil + "Alist controlling which refs are omitted from `magit-refs-mode' buffers. + +All keys are tried in order until one matches. Then its value +is used and subsequent elements are ignored. If the value is +non-nil, then the reference is displayed, otherwise it is not. +If no element matches, then the reference is displayed. + +A key can either be a regular expression that the refname has +to match, or a function that takes the refname as only argument +and returns a boolean. Contrary to how they are displayed in +the buffer, for comparison each tag begins with \"tags/\" and +each remote branch with \"/\"." + :package-version '(magit . "2.12.0") + :group 'magit-refs + :type '(alist :key-type (choice :tag "Key" regexp function) + :value-type (boolean :tag "Value" + :on "show (non-nil)" + :off "omit (nil)"))) + (defcustom magit-visit-ref-behavior nil "Control how `magit-visit-ref' behaves in `magit-refs-mode' buffers. @@ -384,7 +461,13 @@ Branch %s already exists. (call-interactively #'magit-show-commit))) ;;; Sections -;;;; Section Keymaps + +(defvar magit-remote-section-map + (let ((map (make-sparse-keymap))) + (define-key map [remap magit-delete-thing] 'magit-remote-remove) + (define-key map "R" 'magit-remote-rename) + map) + "Keymap for `remote' sections.") (defvar magit-branch-section-map (let ((map (make-sparse-keymap))) @@ -394,13 +477,6 @@ Branch %s already exists. map) "Keymap for `branch' sections.") -(defvar magit-remote-section-map - (let ((map (make-sparse-keymap))) - (define-key map [remap magit-delete-thing] 'magit-remote-remove) - (define-key map "R" 'magit-remote-rename) - map) - "Keymap for `remote' sections.") - (defvar magit-tag-section-map (let ((map (make-sparse-keymap))) (define-key map [remap magit-visit-thing] 'magit-visit-ref) @@ -408,21 +484,6 @@ Branch %s already exists. map) "Keymap for `tag' sections.") -;;;; Section Variables - -(defvar magit-refs-local-branch-format "%4c %-25n %U%m\n" - "Format used for local branches in refs buffers.") -(defvar magit-refs-remote-branch-format "%4c %-25n %m\n" - "Format used for remote branches in refs buffers.") -(defvar magit-refs-symref-format "%4c %-25n -> %m\n" - "Format used for symrefs in refs buffers.") -(defvar magit-refs-tags-format "%4c %-25n %m\n" - "Format used for tags in refs buffers.") -(defvar magit-refs-indent-cherry-lines 3 - "Indentation of cherries in refs buffers.") - -;;;; Branch Sections - (defun magit-insert-branch-description () "Insert header containing the description of the current branch. Insert a header line with the name and description of the @@ -440,27 +501,31 @@ line is inserted at all." (insert (mapconcat 'identity (cdr desc) "\n")) (insert "\n\n"))))) -(defun magit-insert-local-branches () - "Insert sections showing all local branches." - (magit-insert-section (local nil) - (magit-insert-heading "Branches:") - (dolist (line (magit-git-lines "for-each-ref" "--format=\ -%(HEAD)%00%(refname:short)%00%(objectname:short)%00%(subject)%00\ -%(upstream:short)%00%(upstream)%00%(upstream:track)" - "refs/heads" - (cadr magit-refresh-args))) - (pcase-let ((`(,head ,branch ,hash ,message - ,upstream ,uref ,utrack) - (-replace "" nil (split-string line "\0")))) - (magit-insert-branch - branch - magit-refs-local-branch-format (and (equal head "*") branch) - 'magit-branch-local hash message upstream uref - ;; Strip the brackets here because - ;; %(upstream:track,nobracket) was added in Git v2.13. - (and utrack (substring utrack 1 -1))))) - (insert ?\n) - (magit-make-margin-overlay nil t))) +(defun magit-insert-tags () + "Insert sections showing all tags." + (-when-let (tags (magit-git-lines "tag" "--list" "-n" + (cadr magit-refresh-args))) + (let ((_head (magit-rev-parse "HEAD"))) + (magit-insert-section (tags) + (magit-insert-heading "Tags:") + (dolist (tag tags) + (string-match "^\\([^ \t]+\\)[ \t]+\\([^ \t\n].*\\)?" tag) + (let ((tag (match-string 1 tag)) + (msg (match-string 2 tag))) + (when (magit-refs--insert-refname-p tag) + (magit-insert-section section (tag tag t) + (magit-insert-heading + (magit-refs--format-focus-column tag 'tag) + (propertize tag 'face 'magit-tag) + (make-string (max 1 (- magit-refs-primary-column-width + (length tag))) + ?\s) + (and msg (magit-log-propertize-keywords nil msg))) + (when (and magit-refs-margin-for-tags (magit-buffer-margin-p)) + (magit-refs--format-margin tag)) + (magit-refs--insert-cherry-commits tag section))))) + (insert ?\n) + (magit-make-margin-overlay nil t))))) (defun magit-insert-remote-branches () "Insert sections showing all remote-tracking branches." @@ -472,152 +537,208 @@ line is inserted at all." (format (propertize "Remote %s (%s):" 'face 'magit-section-heading) (propertize remote 'face 'magit-branch-remote) (concat pull (and pull push ", ") push)))) - (dolist (line (magit-git-lines "for-each-ref" "--format=\ -%(symref:short)%00%(refname:short)%00%(objectname:short)%00%(subject)" - (concat "refs/remotes/" remote) - (cadr magit-refresh-args))) - (pcase-let ((`(,symref ,branch ,hash ,message) - (-replace "" nil (split-string line "\0")))) - (if symref - (magit-insert-symref branch symref 'magit-branch-remote) - (magit-insert-branch - branch magit-refs-remote-branch-format nil - 'magit-branch-remote hash message nil nil nil - (and (not magit-refs-show-remote-prefix) - (1+ (length remote))))))) - (insert ?\n) - (magit-make-margin-overlay nil t)))) - -(defun magit-insert-branch (branch format &optional current face hash - message upstream uref utrack substring) - "For internal use, don't add to a hook." - (unless magit-refs-show-commit-count - (setq format (replace-regexp-in-string "%[0-9]\\([cC]\\)" "%1\\1" format t))) - (if branch - (magit-insert-section it (branch branch t) - (magit-insert-branch-1 it branch format - current face hash message - upstream uref utrack substring)) - (magit-insert-section it (commit (magit-rev-parse "HEAD") t) - (magit-insert-branch-1 it nil format - current face hash message - upstream uref utrack substring)))) - -(defun magit-insert-branch-1 - (section branch format current face - &optional hash message upstream uref utrack substring) - "For internal use, don't add to a hook." - (let* ((focus (car magit-refresh-args)) - (head (or focus "HEAD")) - (count (and branch - (magit-refs-format-commit-count branch head format))) - (mark (cond (current - (propertize (if (member focus (list nil branch)) "@" ".") - 'face 'magit-head)) - ((equal branch focus) - (propertize "#" 'face 'magit-tag))))) - (when upstream - (setq upstream (propertize upstream 'face - (if (string-prefix-p "refs/heads/" uref) - 'magit-branch-local - 'magit-branch-remote)))) - (when (and substring branch) - (setq branch (substring branch substring))) - (magit-insert-heading - (format-spec - format - `((?c . ,(or mark count "")) - (?C . ,(or mark " ")) - (?h . ,(or (propertize hash 'face 'magit-hash) "")) - (?m . ,(magit-log-propertize-keywords (or message ""))) - (?n . ,(propertize (or branch "(detached)") 'face face)) - (?u . ,(or upstream "")) - (?U . ,(if upstream - (format (propertize "[%s%s] " 'face 'magit-dimmed) - (if (equal utrack "gone") - (propertize upstream 'face 'error) - upstream) - (if (and utrack (not (equal utrack "gone"))) - (concat " " utrack) - "")) - ""))))) - (when (magit-buffer-margin-p) - (magit-refs-format-margin branch)) - (magit-refs-insert-cherry-commits head branch section))) - -(defun magit-insert-symref (symref ref face) - "For internal use, don't add to a hook." - (magit-insert-section (commit symref) - (insert - (format-spec (if magit-refs-show-commit-count - magit-refs-symref-format - (replace-regexp-in-string "%[0-9]\\([cC]\\)" "%1\\1" - magit-refs-symref-format t)) - `((?c . "") - (?n . ,(propertize symref 'face face)) - (?m . ,(propertize ref 'face face))))))) - -(defun magit-refs-format-commit-count (ref head format &optional tag-p) - (and (string-match-p "%-?[0-9]+c" format) - (if tag-p - (eq magit-refs-show-commit-count 'all) - magit-refs-show-commit-count) - (let ((count (cadr (magit-rev-diff-count head ref)))) - (and (> count 0) - (propertize (number-to-string count) 'face 'magit-dimmed))))) - -;;;; Tag Sections - -(defun magit-insert-tags () - "Insert sections showing all tags." - (-when-let (tags (magit-git-lines "tag" "-l" "-n")) - (magit-insert-section (tags) - (magit-insert-heading "Tags:") - (let ((head (or (car magit-refresh-args) - (magit-get-current-branch) - "HEAD")) - (format (if magit-refs-show-commit-count - magit-refs-tags-format - (replace-regexp-in-string - "%[0-9]\\([cC]\\)" "%1\\1" magit-refs-tags-format t)))) - (dolist (tag (nreverse tags)) - (string-match "^\\([^ \t]+\\)[ \t]+\\([^ \t\n].*\\)?" tag) - (let* ((message (match-string 2 tag)) - (tag (match-string 1 tag)) - (count (magit-refs-format-commit-count tag head format t)) - (mark (and (equal tag head) - (propertize "#" 'face 'magit-tag)))) - (magit-insert-section section (tag tag t) - (magit-insert-heading - (format-spec format - `((?n . ,(propertize tag 'face 'magit-tag)) - (?c . ,(or mark count "")) - (?m . ,(or message ""))))) - (when (and (magit-buffer-margin-p) - magit-refs-margin-for-tags) - (magit-refs-format-margin (concat tag "^{commit}"))) - (magit-refs-insert-cherry-commits head tag section))))) + (let (head) + (dolist (line (magit-git-lines "for-each-ref" "--format=\ +%(symref:short)%00%(refname:short)%00%(subject)" + (concat "refs/remotes/" remote) + (cadr magit-refresh-args))) + (pcase-let ((`(,head-branch ,branch ,msg) + (-replace "" nil (split-string line "\0")))) + (if head-branch + (progn (cl-assert (equal branch (concat remote "/HEAD"))) + (setq head head-branch)) + (when (magit-refs--insert-refname-p branch) + (magit-insert-section section (branch branch t) + (let ((headp (equal branch head)) + (abbrev (if magit-refs-show-remote-prefix + branch + (substring branch (1+ (length remote)))))) + (magit-insert-heading + (magit-refs--format-focus-column branch) + (propertize abbrev 'face + (if headp + 'magit-branch-remote-head + 'magit-branch-remote)) + (make-string (max 1 (- magit-refs-primary-column-width + (length abbrev))) + ?\s) + (magit-log-propertize-keywords nil msg))) + (when (magit-buffer-margin-p) + (magit-refs--format-margin branch)) + (magit-refs--insert-cherry-commits branch section))))))) (insert ?\n) (magit-make-margin-overlay nil t)))) -;;;; Cherry Sections +(defun magit-insert-local-branches () + "Insert sections showing all local branches." + (magit-insert-section (local nil) + (magit-insert-heading "Branches:") + (dolist (line (magit-refs--format-local-branches)) + (pcase-let ((`(,branch . ,strings) line)) + (magit-insert-section section + ((eval (if branch 'branch 'commit)) + (or branch (magit-rev-parse "HEAD")) + t) + (apply #'magit-insert-heading strings) + (when (magit-buffer-margin-p) + (magit-refs--format-margin branch)) + (magit-refs--insert-cherry-commits branch section)))) + (insert ?\n) + (magit-make-margin-overlay nil t))) -(defun magit-refs-insert-cherry-commits (head ref section) +(defun magit-refs--format-local-branches () + (let ((lines (-keep 'magit-refs--format-local-branch + (magit-git-lines + "for-each-ref" + (concat "--format=\ +%(HEAD)%00%(refname:short)%00\ +%(upstream:short)%00%(upstream)%00%(upstream:track)%00" + (if magit-refs-show-push-remote "\ +%(push:remotename)%00%(push)%00%(push:track)%00%(subject)" + "%00%00%00%(subject)")) + "refs/heads" + (cadr magit-refresh-args))))) + (unless (magit-get-current-branch) + (push (magit-refs--format-local-branch + (concat "*\0\0\0\0\0\0\0" (magit-rev-format "%s"))) + lines)) + (setq-local magit-refs-primary-column-width + (let ((def (default-value 'magit-refs-primary-column-width))) + (if (atom def) + def + (pcase-let ((`(,min . ,max) def)) + (min max (apply #'max min (mapcar #'car lines))))))) + (mapcar (lambda (arg) + (pcase-let ((`(,_ ,branch ,focus ,branch-desc ,u:ahead ,p:ahead + ,u:behind ,upstream ,p:behind ,push ,msg) + arg)) + (list branch focus branch-desc u:ahead p:ahead + (make-string (max 1 (- magit-refs-primary-column-width + (length (concat branch-desc + u:ahead + p:ahead + u:behind)))) + ?\s) + u:behind upstream p:behind push + msg))) + lines))) + +(defun magit-refs--format-local-branch (line) + (pcase-let ((`(,head ,branch ,upstream ,u:ref ,u:track + ,push ,p:ref ,p:track ,msg) + (-replace "" nil (split-string line "\0")))) + (when (or (not branch) + (magit-refs--insert-refname-p branch)) + (let* ((headp (equal head "*")) + (pushp (and push + magit-refs-show-push-remote + (magit-rev-verify p:ref) + (not (equal p:ref u:ref)))) + (branch-desc (propertize (or branch "(detached)") + 'face (if (and headp branch) + 'magit-branch-current + 'magit-branch-local))) + (u:ahead (and u:track + (string-match "ahead \\([0-9]+\\)" u:track) + (propertize + (concat (and magit-refs-pad-commit-counts " ") + (match-string 1 u:track) + ">") + 'face 'magit-dimmed))) + (u:behind (and u:track + (string-match "behind \\([0-9]+\\)" u:track) + (propertize + (concat "<" + (match-string 1 u:track) + (and magit-refs-pad-commit-counts " ")) + 'face 'magit-dimmed))) + (p:ahead (and pushp p:track + (string-match "ahead \\([0-9]+\\)" p:track) + (propertize + (concat (match-string 1 p:track) + ">" + (and magit-refs-pad-commit-counts " ")) + 'face 'magit-branch-remote))) + (p:behind (and pushp p:track + (string-match "behind \\([0-9]+\\)" p:track) + (propertize + (concat "<" + (match-string 1 p:track) + (and magit-refs-pad-commit-counts " ")) + 'face 'magit-dimmed)))) + (list (1+ (length (concat branch-desc u:ahead p:ahead u:behind))) + branch + (magit-refs--format-focus-column branch headp) + branch-desc u:ahead p:ahead u:behind + (and upstream + (concat (propertize + upstream 'face + (cond ((equal u:track "[gone]") + 'error) + ((string-prefix-p "refs/heads/" u:ref) + 'magit-branch-local) + (t + 'magit-branch-remote))) + " ")) + (and pushp + (concat p:behind + (propertize push 'face 'magit-branch-remote) + " ")) + (and msg (magit-log-propertize-keywords nil msg))))))) + +(defun magit-refs--format-focus-column (ref &optional type) + (let ((focus (car magit-refresh-args)) + (width (if magit-refs-show-commit-count + magit-refs-focus-column-width + 1))) + (format + (format "%%%ss " width) + (cond ((or (equal ref focus) + (and (eq type t) + (eq focus nil))) + (propertize (concat (if focus "@" "*") + (make-string (1- width) ?\s)) + 'face 'magit-section-heading)) + ((if (eq type 'tag) + (eq magit-refs-show-commit-count 'all) + magit-refs-show-commit-count) + (pcase-let ((`(,behind ,ahead) + (magit-rev-diff-count + (or (car magit-refresh-args) "HEAD") + ref))) + (propertize + (cond ((> ahead 0) (concat "<" (number-to-string ahead))) + ((> behind 0) (concat (number-to-string behind) ">")) + (t "=")) + 'face 'magit-dimmed))) + (t ""))))) + +(defun magit-refs--insert-refname-p (refname) + (--if-let (-first (-lambda ((key . _)) + (if (functionp key) + (funcall key refname) + (string-match-p key refname))) + magit-refs-filter-alist) + (cdr it) + t)) + +(defun magit-refs--insert-cherry-commits (ref section) (if (oref section hidden) (oset section washer - (apply-partially #'magit-refs-insert-cherry-commits-1 - head ref section)) - (magit-refs-insert-cherry-commits-1 head ref section))) + (apply-partially #'magit-refs--insert-cherry-commits-1 ref section)) + (magit-refs--insert-cherry-commits-1 ref section))) -(defun magit-refs-insert-cherry-commits-1 (head ref _section) +(defun magit-refs--insert-cherry-commits-1 (ref _section) (let ((start (point)) (magit-insert-section--current nil)) (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry) - "cherry" "-v" (magit-abbrev-arg) head ref magit-refresh-args) + "cherry" "-v" (magit-abbrev-arg) + (or (car magit-refresh-args) "HEAD") + ref magit-refresh-args) (unless (= (point) start) (magit-make-margin-overlay nil t)))) -(defun magit-refs-format-margin (commit) +(defun magit-refs--format-margin (commit) (save-excursion (goto-char (line-beginning-position 0)) (let ((line (magit-rev-format "%ct%cN" commit))) diff --git a/elpa/magit-20180118.313/magit-remote.el b/elpa/magit-20180404.1428/magit-remote.el similarity index 93% rename from elpa/magit-20180118.313/magit-remote.el rename to elpa/magit-20180404.1428/magit-remote.el index 67ae3140..777058fc 100644 --- a/elpa/magit-20180118.313/magit-remote.el +++ b/elpa/magit-20180404.1428/magit-remote.el @@ -31,6 +31,15 @@ (require 'magit) +;;; Options + +(defcustom magit-fetch-modules-jobs 4 + "Number of submodules to fetch in parallel. +Ignored for Git versions before v2.8.0." + :package-version '(magit . "2.12.0") + :group 'magit-commands + :type '(choice (const :tag "one at a time" nil) number)) + ;;; Clone (defcustom magit-clone-set-remote-head nil @@ -124,11 +133,12 @@ to be used to view and change remote related variables." magit-remote-config-variables)) :switches '("Switches for add" (?f "Fetch after add" "-f")) - :actions '((?a "Add" magit-remote-add) - (?C "Configure..." magit-remote-config-popup) - (?r "Rename" magit-remote-rename) - (?p "Prune refspecs" magit-remote-prune-refspecs) - (?k "Remove" magit-remote-remove)) + :actions '((?a "Add" magit-remote-add) + (?C "Configure..." magit-remote-config-popup) + (?r "Rename" magit-remote-rename) + (?p "Prune stale branches" magit-remote-prune) + (?k "Remove" magit-remote-remove) + (?P "Prune stale refspecs" magit-remote-prune-refspecs)) :max-action-columns 2) ;;;; Commands @@ -185,11 +195,26 @@ to be used to view and change remote related variables." (defconst magit--refspec-re "\\`\\(\\+\\)?\\([^:]+\\):\\(.*\\)\\'") +;;;###autoload +(defun magit-remote-prune (remote) + "Remove stale remote-tracking branches for REMOTE." + (interactive (list (magit-read-remote "Prune stale branches of remote"))) + (magit-run-git-async "remote" "prune" remote)) + ;;;###autoload (defun magit-remote-prune-refspecs (remote) - "Remove stale refspecs and tracking branches for REMOTE. -If there are only stale refspecs, then offer to either delete the -remote or replace the refspecs with the default refspec instead." + "Remove stale refspecs for REMOTE. + +A refspec is stale if there no longer exists at least one branch +on the remote that would be fetched due to that refspec. A stale +refspec is problematic because its existence causes Git to refuse +to fetch according to the remaining non-stale refspecs. + +If only stale refspecs remain, then offer to either delete the +remote or to replace the stale refspecs with the default refspec. + +Also remove the remote-tracking branches that were created due to +the now stale refspecs. Other stale branches are not removed." (interactive (list (magit-read-remote "Prune refspecs of remote"))) (let* ((tracking-refs (magit-list-remote-branches remote)) (remote-refs (magit-remote-list-refs remote)) @@ -229,16 +254,17 @@ remote or replace the refspecs with the default refspec instead." (magit-confirm 'prune-stale-refspecs (format "Prune stale refspec %s and branch %%s" refspec) (format "Prune stale refspec %s and %%i branches" refspec) - refs)) + nil refs)) (magit-confirm 'prune-stale-refspecs nil (format "Prune %%i stale refspecs and %i branches" (length (cl-mapcan (lambda (s) (copy-sequence (cdr s))) stale))) - (mapcar (pcase-lambda (`(,refspec . ,refs)) - (concat refspec "\n" - (mapconcat (lambda (b) (concat " " b)) - refs "\n"))) - stale))) + nil + (--map (pcase-let ((`(,refspec . ,refs) it)) + (concat refspec "\n" + (mapconcat (lambda (b) (concat " " b)) + refs "\n"))) + stale))) (pcase-dolist (`(,refspec . ,refs) stale) (magit-call-git "config" "--unset" variable (regexp-quote refspec)) @@ -430,7 +456,7 @@ Delete the symbolic-ref \"refs/remotes//HEAD\"." "Fetch" (?o "another branch" magit-fetch-branch) (?r "explicit refspec" magit-fetch-refspec) - (?m "submodules" magit-submodule-fetch)) + (?m "submodules" magit-fetch-modules)) :default-action 'magit-fetch :max-action-columns 1) @@ -488,7 +514,9 @@ Delete the symbolic-ref \"refs/remotes//HEAD\"." ;;;###autoload (defun magit-fetch-all (args) "Fetch from all remotes." - (interactive (list (magit-fetch-arguments))) + (interactive (list (cl-intersection (magit-fetch-arguments) + (list "--verbose" "--prune") + :test #'equal))) (run-hooks 'magit-credential-hook) (magit-run-git-async "remote" "update" args)) @@ -508,6 +536,23 @@ removed on the respective remote." (run-hooks 'magit-credential-hook) (magit-run-git-async "remote" "update")) +;;;###autoload +(defun magit-fetch-modules (&optional all) + "Fetch all submodules. + +Option `magit-fetch-modules-jobs' controls how many submodules +are being fetched in parallel. Also fetch the super-repository, +because `git-fetch' does not support not doing that. With a +prefix argument fetch all remotes." + (interactive "P") + (magit-with-toplevel + (magit-run-git-async + "fetch" "--verbose" "--recurse-submodules" + (and magit-fetch-modules-jobs + (version<= "2.8.0" (magit-git-version)) + (list "-j" (number-to-string magit-fetch-modules-jobs))) + (and all "--all")))) + ;;; Pull ;;;###autoload (autoload 'magit-pull-popup "magit-remote" nil t) @@ -580,7 +625,7 @@ missing. To add them use something like: "Fetch" (?o "another branch" magit-fetch-branch) (?s "explicit refspec" magit-fetch-refspec) - (?m "submodules" magit-submodule-fetch)) + (?m "submodules" magit-fetch-modules)) :default-action 'magit-fetch :max-action-columns 1) @@ -712,8 +757,7 @@ the push-remote can be changed before pushed to it." (setf (magit-get (if (eq magit-push-current-set-remote-if-missing 'default) "remote.pushDefault" - (format "branch.%s.pushRemote" - (magit-get-current-branch)))) + (format "branch.%s.pushRemote" it))) push-remote)) (-if-let (remote (magit-get-push-remote it)) (if (member remote (magit-list-remotes)) @@ -803,6 +847,8 @@ Both the source and the target are read in the minibuffer." (magit-push-arguments)))) (magit-git-push source target args)) +(defvar magit-push-refspecs-history nil) + ;;;###autoload (defun magit-push-refspecs (remote refspecs args) "Push one or multiple REFSPECS to a REMOTE. @@ -814,7 +860,8 @@ is used." (list (magit-read-remote "Push to remote") (split-string (magit-completing-read-multiple "Push refspec,s" - (cons "HEAD" (magit-list-local-branch-names))) + (cons "HEAD" (magit-list-local-branch-names)) + nil nil 'magit-push-refspecs-history) crm-default-separator t) (magit-push-arguments))) (run-hooks 'magit-credential-hook) diff --git a/elpa/magit-20180118.313/magit-repos.el b/elpa/magit-20180404.1428/magit-repos.el similarity index 94% rename from elpa/magit-20180118.313/magit-repos.el rename to elpa/magit-20180404.1428/magit-repos.el index af2fdefe..7fb5e2f3 100644 --- a/elpa/magit-20180118.313/magit-repos.el +++ b/elpa/magit-20180404.1428/magit-repos.el @@ -31,7 +31,7 @@ (require 'magit-core) -(declare-function magit-status-internal 'magit-status) +(declare-function magit-status-internal "magit-status" (directory)) (defvar x-stretch-cursor) @@ -121,16 +121,7 @@ control which repositories are displayed." (if magit-repository-directories (with-current-buffer (get-buffer-create "*Magit Repositories*") (magit-repolist-mode) - (setq tabulated-list-entries - (mapcar (-lambda ((id . path)) - (let ((default-directory path)) - (list path - (vconcat (--map (or (funcall (nth 2 it) id) "") - magit-repolist-columns))))) - (magit-list-repos-uniquify - (--map (cons (file-name-nondirectory (directory-file-name it)) - it) - (magit-list-repos))))) + (magit-repolist-refresh) (tabulated-list-print) (switch-to-buffer (current-buffer))) (message "You need to customize `magit-repository-directories' %s" @@ -141,7 +132,6 @@ control which repositories are displayed." (defvar magit-repolist-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map tabulated-list-mode-map) - (define-key map "g" 'magit-list-repositories) (define-key map (if (featurep 'jkl) [return] (kbd "C-m")) 'magit-repolist-status) map) @@ -165,11 +155,24 @@ control which repositories are displayed." (-flatten props))) magit-repolist-columns))) (tabulated-list-init-header) + (add-hook 'tabulated-list-revert-hook 'magit-repolist-refresh nil t) (setq imenu-prev-index-position-function 'magit-imenu--repolist-prev-index-position-function) (setq imenu-extract-index-name-function 'magit-imenu--repolist-extract-index-name-function)) +(defun magit-repolist-refresh () + (setq tabulated-list-entries + (mapcar (-lambda ((id . path)) + (let ((default-directory path)) + (list path + (vconcat (--map (or (funcall (nth 2 it) id) "") + magit-repolist-columns))))) + (magit-list-repos-uniquify + (--map (cons (file-name-nondirectory (directory-file-name it)) + it) + (magit-list-repos)))))) + ;;;; Columns (defun magit-repolist-column-ident (id) diff --git a/elpa/magit-20180404.1428/magit-reset.el b/elpa/magit-20180404.1428/magit-reset.el new file mode 100644 index 00000000..3dba6219 --- /dev/null +++ b/elpa/magit-20180404.1428/magit-reset.el @@ -0,0 +1,102 @@ +;;; magit-reset.el --- reset fuctionality -*- lexical-binding: t -*- + +;; Copyright (C) 2010-2018 The Magit Project Contributors +;; +;; You should have received a copy of the AUTHORS.md file which +;; lists all contributors. If not, see http://magit.vc/authors. + +;; Author: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli + +;; Magit is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Magit is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Magit. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; This library implements reset commands. + +;;; Code: + +(require 'magit) + +;;;###autoload (autoload 'magit-reset-popup "magit" nil t) +(magit-define-popup magit-reset-popup + "Popup console for reset commands." + :man-page "git-reset" + :actions '((?m "reset mixed (HEAD and index)" magit-reset-head) + (?s "reset soft (HEAD only)" magit-reset-soft) + (?h "reset hard (HEAD, index, and files)" magit-reset-hard) + (?i "reset index (index only)" magit-reset-index) nil + (?f "reset a file" magit-file-checkout)) + :max-action-columns 1) + +;;;###autoload +(defun magit-reset-index (commit) + "Reset the index to COMMIT. +Keep the head and working tree as-is, so if COMMIT refers to the +head this effectively unstages all changes. +\n(git reset COMMIT .)" + (interactive (list (magit-read-branch-or-commit "Reset index to"))) + (magit-reset-internal nil commit ".")) + +;;;###autoload +(defun magit-reset (commit &optional hard) + "Reset the head and index to COMMIT, but not the working tree. +With a prefix argument also reset the working tree. +\n(git reset --mixed|--hard COMMIT)" + (interactive (list (magit-read-branch-or-commit + (if current-prefix-arg + "Hard reset to" + "Reset head to")) + current-prefix-arg)) + (magit-reset-internal (if hard "--hard" "--mixed") commit)) + +;;;###autoload +(defun magit-reset-head (commit) + "Reset the head and index to COMMIT, but not the working tree. +\n(git reset --mixed COMMIT)" + (interactive (list (magit-read-branch-or-commit "Reset head to"))) + (magit-reset-internal "--mixed" commit)) + +;;;###autoload +(defun magit-reset-soft (commit) + "Reset the head to COMMIT, but not the index and working tree. +\n(git reset --soft REVISION)" + (interactive (list (magit-read-branch-or-commit "Soft reset to"))) + (magit-reset-internal "--soft" commit)) + +;;;###autoload +(defun magit-reset-hard (commit) + "Reset the head, index, and working tree to COMMIT. +\n(git reset --hard REVISION)" + (interactive (list (magit-read-branch-or-commit "Hard reset to"))) + (magit-reset-internal "--hard" commit)) + +(defun magit-reset-internal (arg commit &optional path) + (when (and (not (member arg '("--hard" nil))) + (equal (magit-rev-parse commit) + (magit-rev-parse "HEAD~"))) + (with-temp-buffer + (magit-git-insert "show" "-s" "--format=%B" "HEAD") + (when git-commit-major-mode + (funcall git-commit-major-mode)) + (git-commit-setup-font-lock) + (git-commit-save-message))) + (let ((cmd (if (and (equal commit "HEAD") (not arg)) "unstage" "reset"))) + (magit-wip-commit-before-change nil (concat " before " cmd)) + (magit-run-git "reset" arg commit "--" path) + (when (equal cmd "unstage") + (magit-wip-commit-after-apply nil " after unstage")))) + +(provide 'magit-reset) +;;; magit-reset.el ends here diff --git a/elpa/magit-20180118.313/magit-section.el b/elpa/magit-20180404.1428/magit-section.el similarity index 90% rename from elpa/magit-20180118.313/magit-section.el rename to elpa/magit-20180404.1428/magit-section.el index bcdb1f24..67e032c6 100644 --- a/elpa/magit-20180118.313/magit-section.el +++ b/elpa/magit-20180404.1428/magit-section.el @@ -35,9 +35,11 @@ (require 'magit-utils) -(declare-function magit-maybe-make-margin-overlay 'magit-log) -(declare-function magit-repository-local-get 'magit-mode) -(declare-function magit-repository-local-set 'magit-mode) +(declare-function magit-maybe-make-margin-overlay "magit-margin" ()) +(declare-function magit-repository-local-get "magit-mode" + (key &optional default repository)) +(declare-function magit-repository-local-set "magit-mode" + (key value &optional repository)) (defvar magit-keep-region-overlay) ;;; Options @@ -110,12 +112,44 @@ hardcoded section specific default (see `magit-insert-section')." :options '(magit-diff-expansion-threshold magit-section-cached-visibility)) -(defcustom magit-section-cache-visibility-types - '(unpulled unpushed untracked unstaged staged) - "List of section types for which visibility should be cached." +(defcustom magit-section-cache-visibility t + "Whether to cache visibility of sections. + +Sections always retain their visibility state when they are being +recreated during a refresh. But if a section disappears and then +later reappears again, then this option controls whether this is +the case. + +If t, then cache the visibility of all sections. If a list of +section types, then only do so for matching sections. If nil, +then don't do so for any sections." + :package-version '(magit . "2.12.0") + :group 'magit-section + :type '(choice (const :tag "Don't cache visibility" nil) + (const :tag "Cache visibility of all sections" t) + (repeat :tag "Cache visibility for section types" symbol))) + +(defcustom magit-section-initial-visibility-alist nil + "Alist controlling the initial visibility of sections. + +Each element maps a section type or lineage to the initial +visibility state for such sections. The state has to be one of +`show' or `hide', or a function that returns one of these symbols. +A function is called with the section as the only argument. + +Use the command `magit-describe-section' to determine a section's +lineage or type. The vector in the output is the section lineage +and the type is the first element of that vector. Wildcards can +be used, see `magit-section-match'. + +Currently this option is only used to override hardcoded defaults, +but in the future it will also be used set the defaults." :package-version '(magit . "2.12.0") :group 'magit-section - :type '(repeat symbol)) + :type '(alist :key-type (sexp :tag "Section type/lineage") + :value-type (choice (const hide) + (const show) + function))) (defface magit-section-highlight '((((class color) (background light)) :background "grey95") @@ -174,10 +208,21 @@ never modify it.") (defun magit-section-ident (section) "Return an unique identifier for SECTION. The return value has the form ((TYPE . VALUE)...)." - (cons (cons (oref section type) - (oref section value)) - (--when-let (oref section parent) - (magit-section-ident it)))) + (with-slots (type value parent) section + (cons (cons type + (cond ((not (memq type '(unpulled unpushed))) value) + ((string-match-p "@{upstream}" value) value) + ;; Unfortunately Git chokes on "@{push}" when + ;; the value of `push.default' does not allow a + ;; 1:1 mapping. Arbitrary commands may consult + ;; the section value so we cannot use "@{push}". + ;; But `unpushed' and `unpulled' sections should + ;; keep their identity when switching branches + ;; so we have to use another value here. + ((string-match-p "\\`\\.\\." value) "..@{push}") + (t "@{push}.."))) + (and parent + (magit-section-ident parent))))) (defun magit-get-section (ident &optional root) "Return the section identified by IDENT. @@ -195,6 +240,11 @@ IDENT has to be a list as returned by `magit-section-ident'." (pop ident)) section))) +(defun magit-section-lineage (section) + "Return the lineage of SECTION. +The return value has the form [TYPE...]." + (apply #'vector (mapcar #'car (magit-section-ident section)))) + (defvar magit-insert-section--current nil "For internal use only.") (defvar magit-insert-section--parent nil "For internal use only.") (defvar magit-insert-section--oldroot nil "For internal use only.") @@ -560,7 +610,7 @@ This command is intended for debugging purposes." (let ((section (magit-current-section))) (message "%S %S %s-%s" (oref section value) - (apply 'vector (mapcar 'car (magit-section-ident section))) + (magit-section-lineage section) (marker-position (oref section start)) (marker-position (oref section end))))) @@ -647,15 +697,23 @@ matches if no other CONDITION match, even if there is no section at point." (declare (indent 0) (debug (&rest (sexp body)))) - (let ((ident (cl-gensym "id"))) + (let ((lineage (cl-gensym "lineage"))) `(let* ((it (magit-current-section)) - (,ident (and it (mapcar 'car (magit-section-ident it))))) + (,lineage (and it (append (magit-section-lineage it) nil)))) (cond ,@(mapcar (lambda (clause) `(,(or (eq (car clause) t) `(and it (magit-section-match-1 - ',(car clause) ,ident))) + ',(car clause) ,lineage))) ,@(cdr clause))) clauses))))) + +(defun magit-section-match-assoc (section alist) + "Return the value associated with SECTION's type or lineage in ALIST." + (let ((ident (mapcar #'car (magit-section-ident section)))) + (--some (pcase-let ((`(,key . ,val) it)) + (and (magit-section-match-1 key ident) val)) + alist))) + ;;; Create (defvar magit-insert-section-hook nil @@ -708,9 +766,9 @@ anything this time around. [symbolp &optional form form]) body))) (let ((tp (cl-gensym "type")) - (s (if (symbolp (car args)) - (pop args) - (cl-gensym "section")))) + (s* (and (symbolp (car args)) + (pop args))) + (s (cl-gensym "section"))) `(let* ((,tp ,(let ((type (nth 0 (car args)))) (if (eq (car-safe type) 'eval) (cadr type) @@ -728,12 +786,18 @@ anything this time around. (-if-let (value (run-hook-with-args-until-success 'magit-section-set-visibility-hook ,s)) (eq value 'hide) - (--if-let (and magit-insert-section--oldroot - (magit-get-section - (magit-section-ident ,s) - magit-insert-section--oldroot)) - (oref it hidden) - ,(nth 2 (car args))))) + (-if-let (incarnation (and magit-insert-section--oldroot + (magit-get-section + (magit-section-ident ,s) + magit-insert-section--oldroot))) + (oref incarnation hidden) + (-if-let (value (magit-section-match-assoc + ,s magit-section-initial-visibility-alist)) + (progn + (when (functionp value) + (setq value (funcall value ,s))) + (eq value 'hide)) + ,(nth 2 (car args)))))) (let ((magit-insert-section--current ,s) (magit-insert-section--parent ,s) (magit-insert-section--oldroot @@ -742,7 +806,10 @@ anything this time around. (prog1 magit-root-section (setq magit-root-section ,s)))))) (catch 'cancel-section - ,@(cdr args) + ,@(if s* + `((let ((,s* ,s)) + ,@(cdr args))) + (cdr args)) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count ,s) (set-marker-insertion-type (oref ,s start) t) @@ -761,7 +828,8 @@ anything this time around. (put-text-property (point) next 'keymap map))) (goto-char next))))) (if (eq ,s magit-root-section) - (magit-section-show ,s) + (let ((magit-section-cache-visibility nil)) + (magit-section-show ,s)) (oset (oref ,s parent) children (nconc (oref (oref ,s parent) children) (list ,s))))) @@ -786,13 +854,13 @@ slot of the object representing the section being inserted to a marker at `point'. The section should only contain a single line when this function is used like this. -When called with arguments ARGS, which have to be strings, then -insert those strings at point. The section should not contain -any text before this happens and afterwards it should again only -contain a single line. If the `face' property is set anywhere -inside any of these strings, then insert all of them unchanged. -Otherwise use the `magit-section-heading' face for all inserted -text. +When called with arguments ARGS, which have to be strings, or +nil, then insert those strings at point. The section should not +contain any text before this happens and afterwards it should +again only contain a single line. If the `face' property is set +anywhere inside any of these strings, then insert all of them +unchanged. Otherwise use the `magit-section-heading' face for +all inserted text. The `content' property of the section struct is the end of the heading (which lasts from `start' to `content') and the beginning @@ -896,7 +964,8 @@ evaluated its BODY. Admittedly that's a bit of a hack." (setq magit-section-highlighted-section (and (not (oref section hidden)) section)))) - (setq deactivate-mark nil)))) + (when (version< emacs-version "25.1") + (setq deactivate-mark nil))))) (defun magit-section-highlight (section selection) "Highlight SECTION and if non-nil all sections in SELECTION. @@ -1010,13 +1079,13 @@ invisible." (defun magit-section-cached-visibility (section) "Set SECTION's visibility to the cached value." - (cdr (assoc (magit-section-visibility-ident section) + (cdr (assoc (magit-section-ident section) magit-section-visibility-cache))) (cl-defun magit-section-cache-visibility (&optional (section magit-insert-section--current)) ;; Emacs 24 doesn't have `alist-get'. - (let* ((id (magit-section-visibility-ident section)) + (let* ((id (magit-section-ident section)) (elt (assoc id magit-section-visibility-cache)) (val (if (oref section hidden) 'hide 'show))) (if elt @@ -1025,25 +1094,11 @@ invisible." (cl-defun magit-section-maybe-cache-visibility (&optional (section magit-insert-section--current)) - (when (memq (oref section type) - magit-section-cache-visibility-types) + (when (or (eq magit-section-cache-visibility t) + (memq (oref section type) + magit-section-cache-visibility)) (magit-section-cache-visibility section))) -(defun magit-section-visibility-ident (section) - (let ((type (oref section type)) - (value (oref section value))) - (cons type - (cond ((not (memq type '(unpulled unpushed))) value) - ((string-match-p "@{upstream}" value) value) - ;; Unfortunately Git chokes on "@{push}" when the - ;; value of `push.default' does not allow a 1:1 - ;; mapping. But collapsed logs of unpushed and - ;; unpulled commits in the status buffer should - ;; remain invisible after changing branches. - ;; So we have to pretend the value is constant. - ((string-match-p "\\`\\.\\." value) "..@{push}") - (t "@{push}.."))))) - (defun magit-preserve-section-visibility-cache () (when (derived-mode-p 'magit-status-mode 'magit-refs-mode) (magit-repository-local-set diff --git a/elpa/magit-20180118.313/magit-sequence.el b/elpa/magit-20180404.1428/magit-sequence.el similarity index 80% rename from elpa/magit-20180118.313/magit-sequence.el rename to elpa/magit-20180404.1428/magit-sequence.el index b5d71846..cd43d9fd 100644 --- a/elpa/magit-20180118.313/magit-sequence.el +++ b/elpa/magit-20180404.1428/magit-sequence.el @@ -126,8 +126,14 @@ This discards all changes made since the sequence started." (?F "Attempt fast-forward" "--ff")) :options '((?s "Strategy" "--strategy=") (?m "Replay merge relative to parent" "--mainline=")) - :actions '((?A "Cherry Pick" magit-cherry-pick) - (?a "Cherry Apply" magit-cherry-apply)) + :actions '("Apply here" + (?A "Pick" magit-cherry-pick) + (?a "Apply" magit-cherry-apply) + (?h "Harvest" magit-cherry-harvest) + "Apply elsewhere" + (?d "Donate" magit-cherry-donate) + (?n "Spinout" magit-cherry-spinout) + (?s "Spinoff" magit-cherry-spinoff)) :sequence-actions '((?A "Continue" magit-sequencer-continue) (?s "Skip" magit-sequencer-skip) (?a "Abort" magit-sequencer-abort)) @@ -139,6 +145,31 @@ This discards all changes made since the sequence started." (magit-read-other-branch-or-commit prompt)) (magit-cherry-pick-arguments))) +(defun magit--cherry-move-read-args (verb away fn) + (declare (indent defun)) + (let ((commits (or (nreverse (magit-region-values 'commit)) + (list (funcall (if away + 'magit-read-branch-or-commit + 'magit-read-other-branch-or-commit) + (format "%s cherry" (capitalize verb)))))) + (current (magit-get-current-branch))) + (unless current + (user-error "Cannot %s cherries while HEAD is detached" verb)) + (let ((reachable (magit-rev-ancestor-p (car commits) current)) + (msg "Cannot %s cherries that %s reachable from HEAD")) + (pcase (list away reachable) + (`(nil t) (user-error msg verb "are")) + (`(t nil) (user-error msg verb "are not")))) + `(,commits + ,@(funcall fn commits) + ,(magit-cherry-pick-arguments)))) + +(defun magit--cherry-spinoff-read-args (verb) + (magit--cherry-move-read-args verb t + (lambda (commits) + (butlast (magit-branch-read-args + (format "Create branch from %s cherries" commits)))))) + ;;;###autoload (defun magit-cherry-pick (commits &optional args) "Copy COMMITS from another branch onto the current branch. @@ -157,6 +188,109 @@ without prompting." (interactive (magit-cherry-pick-read-args "Apply changes from commit")) (magit--cherry-pick commits (cons "--no-commit" (remove "--ff" args)))) +;;;###autoload +(defun magit-cherry-harvest (commits branch &optional args) + "Move COMMITS from another BRANCH onto the current branch. +Remove the COMMITS from BRANCH and stay on the current branch. +If a conflict occurs, then you have to fix that and finish the +process manually." + (interactive + (magit--cherry-move-read-args "harvest" nil + (lambda (commits) + (list (let ((branches (magit-list-containing-branches (car commits)))) + (pcase (length branches) + (0 nil) + (1 (car branches)) + (_ (magit-completing-read + (format "Remove %s cherries from branch" (length commits)) + branches nil t)))))))) + (magit--cherry-move commits branch (magit-get-current-branch) args nil t)) + +;;;###autoload +(defun magit-cherry-donate (commits branch &optional args) + "Move COMMITS from the current branch onto another existing BRANCH. +Remove COMMITS from the current branch and stay on that branch. +If a conflict occurs, then you have to fix that and finish the +process manually." + (interactive + (magit--cherry-move-read-args "donate" t + (lambda (commits) + (list (magit-read-other-branch (format "Move %s cherries to branch" + (length commits))))))) + (magit--cherry-move commits (magit-get-current-branch) branch args)) + +;;;###autoload +(defun magit-cherry-spinout (commits branch start-point &optional args) + "Move COMMITS from the current branch onto a new BRANCH. +Remove COMMITS from the current branch and stay on that branch. +If a conflict occurs, then you have to fix that and finish the +process manually." + (interactive (magit--cherry-spinoff-read-args "spinout")) + (magit--cherry-move commits (magit-get-current-branch) branch args + start-point)) + +;;;###autoload +(defun magit-cherry-spinoff (commits branch start-point &optional args) + "Move COMMITS from the current branch onto a new BRANCH. +Remove COMMITS from the current branch and checkout BRANCH. +If a conflict occurs, then you have to fix that and finish +the process manually." + (interactive (magit--cherry-spinoff-read-args "spinoff")) + (magit--cherry-move commits (magit-get-current-branch) branch args + start-point t)) + +(defun magit--cherry-move (commits src dst args + &optional start-point checkout-dst) + (let ((current (magit-get-current-branch))) + (unless (magit-branch-p dst) + (let ((magit-process-raise-error t)) + (magit-call-git "branch" dst start-point)) + (--when-let (magit-get-indirect-upstream-branch start-point) + (magit-call-git "branch" "--set-upstream-to" it dst))) + (unless (equal dst current) + (let ((magit-process-raise-error t)) + (magit-call-git "checkout" dst))) + (if (not src) ; harvest only + (magit--cherry-pick commits args) + (let ((tip (car (last commits))) + (keep (concat (car commits) "^"))) + (magit--cherry-pick commits args) + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (> (process-exit-status process) 0) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (cond + ((magit-rev-equal tip src) + (magit-call-git "update-ref" + "-m" (format "reset: moving to %s" keep) + (magit-ref-fullname src) + keep tip) + (if (not checkout-dst) + (magit-run-git "checkout" src) + (magit-refresh))) + (t + (magit-call-git "checkout" src) + (let ((process-environment process-environment)) + (push (format "%s=perl -i -ne '/^pick (%s)/ or print'" + "GIT_SEQUENCE_EDITOR" + (mapconcat #'magit-rev-abbrev commits "|")) + process-environment) + (magit-run-git-sequencer "rebase" "-i" keep)) + (when checkout-dst + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (> (process-exit-status process) 0) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (magit-run-git "checkout" dst)))))))))))))))) + (defun magit--cherry-pick (commits args &optional revert) (let ((command (if revert "revert" "cherry-pick"))) (when (stringp commits) @@ -270,14 +404,18 @@ without prompting." "Apply patch: ") nil default)))) (magit-am-arguments))) - (magit-run-git-sequencer "am" args "--" (mapcar 'expand-file-name files))) + (magit-run-git-sequencer "am" args "--" + (--map (magit-convert-filename-for-git + (expand-file-name it)) + files))) ;;;###autoload (defun magit-am-apply-maildir (&optional maildir args) "Apply the patches from MAILDIR." (interactive (list (read-file-name "Apply mbox or Maildir: ") (magit-am-arguments))) - (magit-run-git-sequencer "am" args (expand-file-name maildir))) + (magit-run-git-sequencer "am" args (magit-convert-filename-for-git + (expand-file-name maildir)))) ;;;###autoload (defun magit-am-continue () @@ -507,26 +645,26 @@ edit. With a prefix argument the old message is reused as-is." (defun magit-rebase-skip () "Skip the current commit and restart the current rebase operation." (interactive) - (if (magit-rebase-in-progress-p) - (magit-run-git-sequencer "rebase" "--skip") - (user-error "No rebase in progress"))) + (unless (magit-rebase-in-progress-p) + (user-error "No rebase in progress")) + (magit-run-git-sequencer "rebase" "--skip")) ;;;###autoload (defun magit-rebase-edit () "Edit the todo list of the current rebase operation." (interactive) - (if (magit-rebase-in-progress-p) - (magit-run-git-sequencer "rebase" "--edit-todo") - (user-error "No rebase in progress"))) + (unless (magit-rebase-in-progress-p) + (user-error "No rebase in progress")) + (magit-run-git-sequencer "rebase" "--edit-todo")) ;;;###autoload (defun magit-rebase-abort () "Abort the current rebase operation, restoring the original branch." (interactive) - (if (magit-rebase-in-progress-p) - (when (magit-confirm 'abort-rebase "Abort this rebase") - (magit-run-git "rebase" "--abort")) - (user-error "No rebase in progress"))) + (unless (magit-rebase-in-progress-p) + (user-error "No rebase in progress")) + (magit-confirm 'abort-rebase "Abort this rebase") + (magit-run-git "rebase" "--abort")) (defun magit-rebase-in-progress-p () "Return t if a rebase is in progress." diff --git a/elpa/magit-20180118.313/magit-stash.el b/elpa/magit-20180404.1428/magit-stash.el similarity index 96% rename from elpa/magit-20180118.313/magit-stash.el rename to elpa/magit-20180404.1428/magit-stash.el index 56f5d593..5f56dfd6 100644 --- a/elpa/magit-20180118.313/magit-stash.el +++ b/elpa/magit-20180404.1428/magit-stash.el @@ -217,11 +217,9 @@ and forgo removing the stash." (defun magit-stash-drop (stash) "Remove a stash from the stash list. When the region is active offer to drop all contained stashes." - (interactive - (list (--if-let (magit-region-values 'stash) - (or (magit-confirm t "Drop %s" "Drop %i stashes" it) - (user-error "Abort")) - (magit-read-stash "Drop stash")))) + (interactive (list (--if-let (magit-region-values 'stash) + (magit-confirm t nil "Drop %i stashes" nil it) + (magit-read-stash "Drop stash")))) (dolist (stash (if (listp stash) (nreverse (prog1 stash (setq stash (car stash)))) (list stash))) @@ -240,11 +238,9 @@ When the region is active offer to drop all contained stashes." ;;;###autoload (defun magit-stash-clear (ref) "Remove all stashes saved in REF's reflog by deleting REF." - (interactive - (let ((ref (or (magit-section-when 'stashes) "refs/stash"))) - (if (magit-confirm t (format "Drop all stashes in %s" ref)) - (list ref) - (user-error "Abort")))) + (interactive (let ((ref (or (magit-section-when 'stashes) "refs/stash"))) + (magit-confirm t (format "Drop all stashes in %s" ref)) + (list ref))) (magit-run-git "update-ref" "-d" ref)) ;;;###autoload @@ -295,7 +291,8 @@ branch or `HEAD' as the string-point." (magit-call-git "checkout" "--" ".") (magit-call-git "reset" "--hard" "HEAD")) (when untracked - (magit-call-git "clean" "-f" (and (eq untracked 'all) "-x"))))) + (magit-call-git "clean" "--force" "-d" + (and (eq untracked 'all) "-x"))))) (when refresh (magit-refresh))) (unless noerror @@ -372,7 +369,8 @@ instead of \"Stashes:\"." "rebase-merge/autostash" "rebase-apply/autostash"))))))) (when (or autostash verified) - (magit-insert-section (stashes ref (not magit-status-expand-stashes)) + (magit-insert-section (stashes ref (with-no-warnings + (not magit-status-expand-stashes))) (magit-insert-heading heading) (when autostash (pcase-let ((`(,author ,date ,msg) diff --git a/elpa/magit-20180118.313/magit-status.el b/elpa/magit-20180404.1428/magit-status.el similarity index 91% rename from elpa/magit-20180118.313/magit-status.el rename to elpa/magit-20180404.1428/magit-status.el index afbdd52c..286e117e 100644 --- a/elpa/magit-20180118.313/magit-status.el +++ b/elpa/magit-20180404.1428/magit-status.el @@ -92,7 +92,8 @@ all." :type 'hook) (defcustom magit-status-expand-stashes t - "Whether the list of stashes is expanded initially." + "OBSOLETE. Whether the list of stashes is expanded initially. +Use `magit-section-visibility-alist' instead." :package-version '(magit . "2.3.0") :group 'magit-status :type 'boolean) @@ -327,6 +328,12 @@ The sections are inserted by running the functions on the hook (magit-insert-headers magit-status-headers-hook) (insert "In the beginning there was darkness\n\n"))) +(defvar magit-error-section-map + (let ((map (make-sparse-keymap))) + (define-key map [remap magit-visit-thing] 'magit-process-buffer) + map) + "Keymap for `error' sections.") + (defun magit-insert-error-header () "Insert the message about the Git error that just occured. @@ -369,7 +376,9 @@ detached `HEAD'." (when magit-status-show-hashes-in-headers (insert (propertize commit 'face 'magit-hash) ?\s)) (insert (propertize branch 'face 'magit-branch-local)) - (insert ?\s summary ?\n)) + (insert ?\s) + (insert (funcall magit-log-format-message-function branch summary)) + (insert ?\n)) (magit-insert-section (commit commit) (insert (format "%-10s" "Head: ")) (insert (propertize commit 'face 'magit-hash)) @@ -396,8 +405,9 @@ detached `HEAD'." (pcase-let ((`(,url ,branch) (split-string pull " "))) (insert branch " from " url " ")) (insert pull " ") - (if (magit-rev-verify pull) - (insert (or (magit-rev-format "%s" pull) "")) + (--if-let (and (magit-rev-verify pull) + (magit-rev-format "%s" pull)) + (insert (funcall magit-log-format-message-function pull it)) (insert (propertize "is missing" 'face 'font-lock-warning-face)))) (insert ?\n)))) @@ -412,8 +422,9 @@ detached `HEAD'." (magit-rev-format "%h" push)) (insert (propertize it 'face 'magit-hash) ?\s)) (insert (propertize push 'face 'magit-branch-remote) ?\s) - (if (magit-rev-verify push) - (insert (or (magit-rev-format "%s" push) "")) + (--if-let (and (magit-rev-verify push) + (magit-rev-format "%s" push)) + (insert (funcall magit-log-format-message-function push it)) (insert (propertize "is missing" 'face 'font-lock-warning-face))) (insert ?\n)))) @@ -487,22 +498,30 @@ remote in alphabetic order." (defun magit-insert-untracked-files () "Maybe insert a list or tree of untracked files. + Do so depending on the value of `status.showUntrackedFiles'. -Note that even if the value is `all', Magit still initially only -shows directories. But the directory sections can then be expanded -using \"TAB\"." - (let ((show (or (magit-get "status.showUntrackedFiles") "normal"))) +Note that even if the value is `all', Magit still initially +only shows directories. But the directory sections can then +be expanded using \"TAB\". + +If the first element of `magit-diff-section-arguments' is a +directory, then limit the list to files below that. The value +value of that variable can be set using \"D = f DIRECTORY RET g\"." + (let* ((show (or (magit-get "status.showUntrackedFiles") "normal")) + (base (car magit-diff-section-file-args)) + (base (and base (file-directory-p base) base))) (unless (equal show "no") (if (equal show "all") - (-when-let (files (magit-untracked-files)) + (-when-let (files (magit-untracked-files nil base)) (magit-insert-section (untracked) (magit-insert-heading "Untracked files:") - (magit-insert-un/tracked-files-1 files nil) + (magit-insert-un/tracked-files-1 files base) (insert ?\n))) (-when-let (files (--mapcat (and (eq (aref it 0) ??) (list (substring it 3))) - (magit-git-items "status" "-z" "--porcelain"))) + (magit-git-items "status" "-z" "--porcelain" + "--" base))) (magit-insert-section (untracked) (magit-insert-heading "Untracked files:") (dolist (file files) @@ -513,12 +532,18 @@ using \"TAB\"." (magit-define-section-jumper magit-jump-to-tracked "Tracked files" tracked) (defun magit-insert-tracked-files () - "Insert a tree of tracked files." + "Insert a tree of tracked files. + +If the first element of `magit-diff-section-arguments' is a +directory, then limit the list to files below that. The value +value of that variable can be set using \"D = f DIRECTORY RET g\"." (-when-let (files (magit-list-files)) - (magit-insert-section (tracked nil t) - (magit-insert-heading "Tracked files:") - (magit-insert-un/tracked-files-1 files nil) - (insert ?\n)))) + (let* ((base (car magit-diff-section-file-args)) + (base (and base (file-directory-p base) base))) + (magit-insert-section (tracked nil t) + (magit-insert-heading "Tracked files:") + (magit-insert-un/tracked-files-1 files base) + (insert ?\n))))) (defun magit-insert-un/tracked-files-1 (files directory) (while (and files (string-prefix-p (or directory "") (car files))) diff --git a/elpa/magit-20180118.313/magit-submodule.el b/elpa/magit-20180404.1428/magit-submodule.el similarity index 66% rename from elpa/magit-20180118.313/magit-submodule.el rename to elpa/magit-20180404.1428/magit-submodule.el index 7b0340e5..a83d4777 100644 --- a/elpa/magit-20180118.313/magit-submodule.el +++ b/elpa/magit-20180404.1428/magit-submodule.el @@ -96,38 +96,50 @@ an alist that supports the keys `:right-align' and `:pad-right'." (symbol)) (sexp :tag "Value")))))) -(defcustom magit-submodule-fetch-jobs 4 - "Number of submodules to fetch in parallel. -Ignored for Git versions before v2.8.0." - :package-version '(magit . "2.12.0") - :group 'magit-commands - :type '(choice (const :tag "one at a time" nil) number)) - -;;; Commands +;;; Popup ;;;###autoload (autoload 'magit-submodule-popup "magit-submodule" nil t) (magit-define-popup magit-submodule-popup "Popup console for submodule commands." :man-page "git-submodule" - :actions '((?a "Add" magit-submodule-add) - (?b "Setup" magit-submodule-setup) - (?i "Init" magit-submodule-init) - (?u "Update" magit-submodule-update) - (?s "Sync" magit-submodule-sync) - (?f "Fetch" magit-submodule-fetch) - (?d "Deinit" magit-submodule-deinit) - (?l "List" magit-list-submodules))) + :switches '((?f "Force" "--force") + (?r "Recursive" "--recursive") + (?N "Do not fetch" "--no-fetch") + (?C "Checkout tip" "--checkout") + (?R "Rebase onto tip" "--rebase") + (?M "Merge tip" "--merge") + (?U "Use upstream tip" "--remote")) + :actions + '((?a "Add git submodule add [--force]" + magit-submodule-add) + (?r "Register git submodule init" + magit-submodule-register) + (?p "Populate git submodule update --init" + magit-submodule-populate) + (?u "Update git submodule update [--force] [--no-fetch] + [--remote] [--recursive] [--checkout|--rebase|--merge]" + magit-submodule-update) + (?s "Synchronize git submodule sync [--recursive]" + magit-submodule-synchronize) + (?d "Unpopulate git submodule deinit [--force]" + magit-submodule-unpopulate) + nil + (?l "List all modules" magit-list-submodules) + (?f "Fetch all modules" magit-fetch-modules)) + :max-action-columns 1) + +(defun magit-submodule-filtered-arguments (&rest filters) + (--filter (and (member it filters) it) + (magit-submodule-arguments))) ;;;###autoload -(defun magit-submodule-add (url &optional path name) - "Add the repository at URL as a submodule. - -Optional PATH is the path to the submodule relative to the root -of the superproject. If it is nil, then the path is determined -based on the URL. +(defun magit-submodule-add (url &optional path name args) + "Add the repository at URL as a module. -Optional NAME is the name of the submodule. If it is nil, then -PATH also becomes the name." +Optional PATH is the path to the module relative to the root of +the superproject. If it is nil, then the path is determined +based on the URL. Optional NAME is the name of the module. If +it is nil, then PATH also becomes the name." (interactive (magit-with-toplevel (let* ((url (magit-read-string-ns "Add submodule (remote url)")) @@ -147,8 +159,14 @@ PATH also becomes the name." (match-string 1 url)))))))) (list url (directory-file-name path) - (magit-submodule-read-name-for-path path))))) - (magit-run-git "submodule" "add" (and name (list "--name" name)) url path)) + (magit-submodule-read-name-for-path path) + (magit-submodule-filtered-arguments "--force"))))) + (magit-with-toplevel + (magit-call-git "submodule" "add" (and name (list "--name" name)) + args "--" url path) + (unless (version< (magit-git-version) "2.11.0") + (magit-call-git "submodule" "absorbgitdirs" path)) + (magit-refresh))) ;;;###autoload (defun magit-submodule-read-name-for-path (path &optional prefer-short) @@ -164,62 +182,93 @@ PATH also becomes the name." (if prefer-short name path))))) ;;;###autoload -(defun magit-submodule-setup () - "Clone and register missing submodules and checkout appropriate commits." - (interactive) +(defun magit-submodule-register (modules) + "Register MODULES. + +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user." + ;; This command and the underlying "git submodule init" do NOT + ;; "initialize" modules. They merely "register" modules in the + ;; super-projects $GIT_DIR/config file, the purpose of which is to + ;; allow users to change such values before actually initializing + ;; the modules. + (interactive + (list (magit-module-confirm "Register" 'magit-module-no-worktree-p))) (magit-with-toplevel - (--if-let (--filter (not (file-exists-p (expand-file-name ".git" it))) - (magit-get-submodules)) - (magit-run-git-async "submodule" "update" "--init" "--" it) - (message "All submodules already setup")))) + (magit-run-git-async "submodule" "init" "--" modules))) ;;;###autoload -(defun magit-submodule-init () - "Register submodules listed in \".gitmodules\" into \".git/config\"." - (interactive) +(defun magit-submodule-populate (modules) + "Create MODULES working directories, checking out the recorded commits. + +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user." + ;; This is the command that actually "initializes" modules. + ;; A module is initialized when it has a working directory, + ;; a gitlink, and a .gitmodules entry. + (interactive + (list (magit-module-confirm "Populate" 'magit-module-no-worktree-p))) (magit-with-toplevel - (magit-run-git-async "submodule" "init"))) + (magit-run-git-async "submodule" "update" "--init" "--" modules))) ;;;###autoload -(defun magit-submodule-update (&optional init) - "Clone missing submodules and checkout appropriate commits. -With a prefix argument also register submodules in \".git/config\"." - (interactive "P") +(defun magit-submodule-update (modules args) + "Update MODULES by checking out the recorded commits. + +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user." + ;; Unlike `git-submodule's `update' command ours can only update + ;; "initialized" modules by checking out other commits but not + ;; "initialize" modules by creating the working directories. + ;; To do the latter we provide the "setup" command. + (interactive + (list (magit-module-confirm "Update" 'magit-module-worktree-p) + (magit-submodule-filtered-arguments + "--force" "--remote" "--recursive" "--checkout" "--rebase" "--merge" + "--no-fetch"))) (magit-with-toplevel - (magit-run-git-async "submodule" "update" (and init "--init")))) + (magit-run-git-async "submodule" "update" args "--" modules))) ;;;###autoload -(defun magit-submodule-sync () - "Update each submodule's remote URL according to \".gitmodules\"." - (interactive) - (magit-with-toplevel - (magit-run-git-async "submodule" "sync"))) +(defun magit-submodule-synchronize (modules args) + "Synchronize url configuration of MODULES. -;;;###autoload -(defun magit-submodule-fetch (&optional all) - "Fetch all submodules. - -Option `magit-submodule-fetch-jobs' controls how many submodules -are being fetched in parallel. Also fetch the super-repository, -because `git-fetch' does not support not doing that. With a -prefix argument fetch all remotes." - (interactive "P") +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user." + (interactive + (list (magit-module-confirm "Synchronize" 'magit-module-worktree-p) + (magit-submodule-filtered-arguments "--recursive"))) (magit-with-toplevel - (magit-run-git-async - "fetch" "--verbose" "--recurse-submodules" - (and magit-submodule-fetch-jobs - (version<= "2.8.0" (magit-git-version)) - (list "-j" (number-to-string magit-submodule-fetch-jobs))) - (and all "--all")))) + (magit-run-git-async "submodule" "sync" args "--" modules))) ;;;###autoload -(defun magit-submodule-deinit (path) - "Unregister the submodule at PATH." +(defun magit-submodule-unpopulate (modules args) + "Remove working directories of MODULES. + +With a prefix argument act on all suitable modules. Otherwise, +if the region selects modules, then act on those. Otherwise, if +there is a module at point, then act on that. Otherwise read a +single module from the user." + ;; Even though a package is "uninitialized" (it has no worktree) + ;; the super-projects $GIT_DIR/config may never-the-less set the + ;; module's url. This may happen if you `deinit' and then `init' + ;; to register (NOT initialize). Because the purpose of `deinit' + ;; is to remove the working directory AND to remove the url, this + ;; command does not limit itself to modules that have no working + ;; directory. (interactive - (list (magit-completing-read "Deinit module" (magit-get-submodules) - nil t nil nil (magit-section-when module)))) + (list (magit-module-confirm "Unpopulate") + (magit-submodule-filtered-arguments "--force"))) (magit-with-toplevel - (magit-run-git-async "submodule" "deinit" path))) + (magit-run-git-async "submodule" "deinit" args "--" modules))) ;;; Sections @@ -229,7 +278,7 @@ prefix argument fetch all remotes." Hook `magit-module-sections-hook' controls which module sections are inserted, and option `magit-module-sections-nested' controls whether they are wrapped in an additional section." - (-when-let (modules (magit-get-submodules)) + (-when-let (modules (magit-list-module-paths)) (if magit-module-sections-nested (magit-insert-section section (submodules nil t) (magit-insert-heading @@ -249,7 +298,7 @@ whether they are wrapped in an additional section." "Insert sections for all modules. For each section insert the path and the output of `git describe --tags', or, failing that, the abbreviated HEAD commit hash." - (-when-let (modules (magit-get-submodules)) + (-when-let (modules (magit-list-module-paths)) (magit-insert-section section (submodules nil t) (magit-insert-heading (format "%s (%s)" @@ -263,7 +312,7 @@ or, failing that, the abbreviated HEAD commit hash." (defun magit--insert-modules-overview (&optional _section) (magit-with-toplevel - (let* ((modules (magit-get-submodules)) + (let* ((modules (magit-list-module-paths)) (path-format (format "%%-%is " (min (apply 'max (mapcar 'length modules)) (/ (window-width) 2)))) @@ -275,7 +324,7 @@ or, failing that, the abbreviated HEAD commit hash." (insert (propertize (format path-format module) 'face 'magit-diff-file-heading)) (if (not (file-exists-p ".git")) - (insert "(uninitialized)") + (insert "(unpopulated)") (insert (format branch-format (--if-let (magit-get-current-branch) (propertize it 'face 'magit-branch-local) @@ -366,7 +415,7 @@ These sections can be expanded to show the respective commits." (defun magit--insert-modules-logs (heading type range) "For internal use, don't add to a hook." - (-when-let (modules (magit-get-submodules)) + (-when-let (modules (magit-list-module-paths)) (magit-insert-section section ((eval type) nil t) (string-match "\\`\\(.+\\) \\([^ ]+\\)\\'" heading) (magit-insert-heading @@ -375,17 +424,18 @@ These sections can be expanded to show the respective commits." (propertize (match-string 2 heading) 'face 'magit-branch-remote) ":")) (magit-with-toplevel (dolist (module modules) - (let ((default-directory - (expand-file-name (file-name-as-directory module)))) - (when (magit-file-accessible-directory-p default-directory) - (magit-insert-section sec (file module t) - (magit-insert-heading - (concat (propertize module 'face 'magit-diff-file-heading) ":")) - (magit-git-wash (apply-partially 'magit-log-wash-log 'module) - "-c" "push.default=current" "log" "--oneline" range) - (when (> (point) - (oref sec content)) - (delete-char -1))))))) + (when (magit-module-worktree-p module) + (let ((default-directory + (expand-file-name (file-name-as-directory module)))) + (when (magit-file-accessible-directory-p default-directory) + (magit-insert-section sec (file module t) + (magit-insert-heading + (concat (propertize module 'face 'magit-diff-file-heading) ":")) + (magit-git-wash (apply-partially 'magit-log-wash-log 'module) + "-c" "push.default=current" "log" "--oneline" range) + (when (> (point) + (oref sec content)) + (delete-char -1)))))))) (if (> (point) (oref section content)) (insert ?\n) @@ -399,20 +449,12 @@ These sections can be expanded to show the respective commits." (interactive) (magit-display-buffer (magit-mode-get-buffer 'magit-submodule-list-mode t)) (magit-submodule-list-mode) - (setq tabulated-list-entries - (mapcar (lambda (module) - (let ((default-directory - (expand-file-name (file-name-as-directory module)))) - (list module - (vconcat (--map (or (funcall (nth 2 it) module) "") - magit-submodule-list-columns))))) - (magit-get-submodules))) + (magit-submodule-list-refresh) (tabulated-list-print)) (defvar magit-submodule-list-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map magit-repolist-mode-map) - (define-key map "g" 'magit-list-submodules) map) "Local keymap for Magit-Submodule-List mode buffers.") @@ -428,6 +470,7 @@ These sections can be expanded to show the respective commits." (-flatten props))) magit-submodule-list-columns))) (tabulated-list-init-header) + (add-hook 'tabulated-list-revert-hook 'magit-submodule-list-refresh nil t) (setq imenu-prev-index-position-function #'magit-imenu--submodule-prev-index-position-function) (setq imenu-extract-index-name-function @@ -435,6 +478,18 @@ These sections can be expanded to show the respective commits." (setq-local bookmark-make-record-function #'magit-bookmark--submodules-make-record)) +(defun magit-submodule-list-refresh () + (setq tabulated-list-entries + (-keep (lambda (module) + (let ((default-directory + (expand-file-name (file-name-as-directory module)))) + (and (file-exists-p ".git") + (list module + (vconcat + (--map (or (funcall (nth 2 it) module) "") + magit-submodule-list-columns)))))) + (magit-list-module-paths)))) + (defun magit-modulelist-column-path (path) "Insert the relative path of the submodule." path) diff --git a/elpa/magit-20180118.313/magit-subtree.el b/elpa/magit-20180404.1428/magit-subtree.el similarity index 100% rename from elpa/magit-20180118.313/magit-subtree.el rename to elpa/magit-20180404.1428/magit-subtree.el diff --git a/elpa/magit-20180404.1428/magit-tag.el b/elpa/magit-20180404.1428/magit-tag.el new file mode 100644 index 00000000..f2f48b03 --- /dev/null +++ b/elpa/magit-20180404.1428/magit-tag.el @@ -0,0 +1,99 @@ +;;; magit-tag.el --- tag functionality -*- lexical-binding: t -*- + +;; Copyright (C) 2010-2018 The Magit Project Contributors +;; +;; You should have received a copy of the AUTHORS.md file which +;; lists all contributors. If not, see http://magit.vc/authors. + +;; Author: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli + +;; Magit is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Magit is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Magit. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; This library implements tag commands. + +;;; Code: + +(require 'magit) + +;;;###autoload (autoload 'magit-tag-popup "magit" nil t) +(magit-define-popup magit-tag-popup + "Popup console for tag commands." + :man-page "git-tag" + :switches '((?a "Annotate" "--annotate") + (?f "Force" "--force") + (?s "Sign" "--sign")) + :options '((?f "Sign" "--local-user=" magit-read-gpg-secret-key)) + :actions '((?t "Create" magit-tag) + (?k "Delete" magit-tag-delete) + (?p "Prune" magit-tag-prune)) + :default-action 'magit-tag) + +;;;###autoload +(defun magit-tag (name rev &optional args) + "Create a new tag with the given NAME at REV. +With a prefix argument annotate the tag. +\n(git tag [--annotate] NAME REV)" + (interactive (list (magit-read-tag "Tag name") + (magit-read-branch-or-commit "Place tag on") + (let ((args (magit-tag-arguments))) + (when current-prefix-arg + (cl-pushnew "--annotate" args)) + args))) + (magit-run-git-with-editor "tag" args name rev)) + +;;;###autoload +(defun magit-tag-delete (tags) + "Delete one or more tags. +If the region marks multiple tags (and nothing else), then offer +to delete those, otherwise prompt for a single tag to be deleted, +defaulting to the tag at point. +\n(git tag -d TAGS)" + (interactive (list (--if-let (magit-region-values 'tag) + (magit-confirm t nil "Delete %i tags" nil it) + (magit-read-tag "Delete tag" t)))) + (magit-run-git "tag" "-d" tags)) + +(defun magit-tag-prune (tags remote-tags remote) + "Offer to delete tags missing locally from REMOTE, and vice versa." + (interactive + (let* ((remote (magit-read-remote "Prune tags using remote")) + (tags (magit-list-tags)) + (rtags (prog2 (message "Determining remote tags...") + (magit-remote-list-tags remote) + (message "Determining remote tags...done"))) + (ltags (-difference tags rtags)) + (rtags (-difference rtags tags))) + (unless (or ltags rtags) + (message "Same tags exist locally and remotely")) + (unless (magit-confirm t + "Delete %s locally" + "Delete %i tags locally" + 'noabort ltags) + (setq ltags nil)) + (unless (magit-confirm t + "Delete %s from remote" + "Delete %i tags from remote" + 'noabort rtags) + (setq rtags nil)) + (list ltags rtags remote))) + (when tags + (magit-call-git "tag" "-d" tags)) + (when remote-tags + (magit-run-git-async "push" remote (--map (concat ":" it) remote-tags)))) + +(provide 'magit-tag) +;;; magit-tag.el ends here diff --git a/elpa/magit-20180118.313/magit-utils.el b/elpa/magit-20180404.1428/magit-utils.el similarity index 93% rename from elpa/magit-20180118.313/magit-utils.el rename to elpa/magit-20180404.1428/magit-utils.el index eb414ba9..aa0f1655 100644 --- a/elpa/magit-20180118.313/magit-utils.el +++ b/elpa/magit-20180404.1428/magit-utils.el @@ -44,11 +44,14 @@ (require 'crm) (eval-when-compile (require 'ido)) -(declare-function ido-completing-read+ 'ido-completing-read+) -(declare-function Info-get-token 'info) +(declare-function ido-completing-read+ "ido-completing-read+" + (prompt collection &optional predicate + require-match initial-input + hist def inherit-input-method)) +(declare-function Info-get-token "info" (pos start all &optional errorstring)) (eval-when-compile (require 'vc-git)) -(declare-function vc-git--run-command-string 'vc-git) +(declare-function vc-git--run-command-string "vc-git" (file &rest args)) (defvar magit-wip-before-change-mode) @@ -572,39 +575,33 @@ ACTION is a member of option `magit-slow-confirm'." (yes-or-no-p prompt) (y-or-n-p prompt))) -(cl-defun magit-confirm (action &optional prompt prompt-n (items nil sitems)) +(cl-defun magit-confirm (action &optional prompt prompt-n noabort + (items nil sitems)) (declare (indent defun)) (setq prompt-n (format (concat (or prompt-n prompt) "? ") (length items))) (setq prompt (format (concat (or prompt (magit-confirm-make-prompt action)) "? ") (car items))) - (cond ((and (not (eq action t)) - (or (eq magit-no-confirm t) - (memq action - `(,@magit-no-confirm - ,@(and magit-wip-before-change-mode - (memq 'safe-with-wip magit-no-confirm) - `(discard reverse - stage-all-changes - unstage-all-changes)))))) - (or (not sitems) items)) - ((not sitems) - (magit-y-or-n-p prompt action)) - ((= (length items) 1) - (and (magit-y-or-n-p prompt action) items)) - ((> (length items) 1) - (let ((buffer (get-buffer-create " *Magit Confirm*"))) - (with-current-buffer buffer - (with-current-buffer-window - buffer (cons 'display-buffer-below-selected - '((window-height . fit-window-to-buffer))) - (lambda (window _value) - (with-selected-window window - (unwind-protect (and (magit-y-or-n-p prompt-n action) items) - (when (window-live-p window) - (quit-restore-window window 'kill))))) - (dolist (item items) - (insert item "\n")))))))) + (or (cond ((and (not (eq action t)) + (or (eq magit-no-confirm t) + (memq action + `(,@magit-no-confirm + ,@(and magit-wip-before-change-mode + (memq 'safe-with-wip magit-no-confirm) + `(discard reverse + stage-all-changes + unstage-all-changes)))))) + (or (not sitems) items)) + ((not sitems) + (magit-y-or-n-p prompt action)) + ((= (length items) 1) + (and (magit-y-or-n-p prompt action) items)) + ((> (length items) 1) + (and (magit-y-or-n-p (concat (mapconcat #'identity items "\n") + "\n\n" prompt-n) + action) + items))) + (if noabort nil (user-error "Abort")))) (defun magit-confirm-files (action files &optional prompt) (when files @@ -613,7 +610,7 @@ ACTION is a member of option `magit-slow-confirm'." (magit-confirm action (concat prompt " %s") (concat prompt " %i files") - files))) + nil files))) (defun magit-confirm-make-prompt (action) (let ((prompt (symbol-name action))) @@ -787,18 +784,27 @@ and https://github.com/magit/magit/issues/2295." (defvar whitespace-mode) -(defun whitespace-dont-turn-on-in-magit-mode () +(defun whitespace-dont-turn-on-in-magit-mode (fn) "Prevent `whitespace-mode' from being turned on in Magit buffers. -Because `whitespace-mode' uses font-lock and Magit does not, -they are not compatible. See `magit-diff-paint-whitespace' -for an alternative." - (when (derived-mode-p 'magit-mode) + +Because `whitespace-mode' uses font-lock and Magit does not, they +are not compatible. Therefore you cannot turn on that minor-mode +in Magit buffers. If you try to enable it anyway, then this +advice prevents that. + +If the reason the attempt is made is that `global-whitespace-mode' +is enabled, then that is done silently. However if you call the local +minor-mode interactively, then that results in an error. + +See `magit-diff-paint-whitespace' for an alternative." + (if (not (derived-mode-p 'magit-mode)) + (funcall fn) (setq whitespace-mode nil) - (user-error - "Whitespace-Mode isn't compatible with Magit. %s" - "See `magit-diff-paint-whitespace' for an alternative."))) + (when (eq this-command 'whitespace-mode) + (user-error + "Whitespace mode NOT enabled because it is not compatible with Magit")))) -(advice-add 'whitespace-turn-on :before +(advice-add 'whitespace-turn-on :around 'whitespace-dont-turn-on-in-magit-mode) ;;; Kludges for Custom diff --git a/elpa/magit-20180118.313/magit-wip.el b/elpa/magit-20180404.1428/magit-wip.el similarity index 99% rename from elpa/magit-20180118.313/magit-wip.el rename to elpa/magit-20180404.1428/magit-wip.el index e5df97c0..257b45b5 100644 --- a/elpa/magit-20180118.313/magit-wip.el +++ b/elpa/magit-20180404.1428/magit-wip.el @@ -83,7 +83,7 @@ variant `magit-wip-after-save-mode'." :package-version '(magit . "2.1.0") :lighter magit-wip-after-save-local-mode-lighter (if magit-wip-after-save-local-mode - (if (and buffer-file-name (magit-inside-worktree-p)) + (if (and buffer-file-name (magit-inside-worktree-p t)) (add-hook 'after-save-hook 'magit-wip-commit-buffer-file t t) (setq magit-wip-after-save-local-mode nil) (user-error "Need a worktree and a file")) @@ -91,7 +91,7 @@ variant `magit-wip-after-save-mode'." (defun magit-wip-after-save-local-mode-turn-on () (and buffer-file-name - (ignore-errors (magit-inside-worktree-p)) + (magit-inside-worktree-p t) (magit-file-tracked-p buffer-file-name) (magit-wip-after-save-local-mode))) diff --git a/elpa/magit-20180118.313/magit-worktree.el b/elpa/magit-20180404.1428/magit-worktree.el similarity index 93% rename from elpa/magit-20180118.313/magit-worktree.el rename to elpa/magit-20180404.1428/magit-worktree.el index f323c10b..07179cda 100644 --- a/elpa/magit-20180118.313/magit-worktree.el +++ b/elpa/magit-20180404.1428/magit-worktree.el @@ -76,15 +76,15 @@ The primary worktree cannot be deleted." (if (file-directory-p (expand-file-name ".git" worktree)) (user-error "Deleting %s would delete the shared .git directory" worktree) (let ((primary (file-name-as-directory (caar (magit-list-worktrees))))) - (when (if magit-delete-by-moving-to-trash - (magit-confirm-files 'trash (list "worktree")) - (magit-confirm-files 'delete (list "worktree"))) + (magit-confirm-files (if magit-delete-by-moving-to-trash 'trash 'delete) + (list "worktree")) + (when (file-exists-p worktree) (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash)) - (delete-directory worktree t magit-delete-by-moving-to-trash)) - (if (file-exists-p default-directory) - (magit-run-git "worktree" "prune") - (let ((default-directory primary)) - (magit-run-git "worktree" "prune"))))))) + (delete-directory worktree t magit-delete-by-moving-to-trash))) + (if (file-exists-p default-directory) + (magit-run-git "worktree" "prune") + (let ((default-directory primary)) + (magit-run-git "worktree" "prune")))))) (defun magit-worktree-status (worktree) "Show the status for the worktree at point. diff --git a/elpa/magit-20180118.313/magit.el b/elpa/magit-20180404.1428/magit.el similarity index 50% rename from elpa/magit-20180118.313/magit.el rename to elpa/magit-20180404.1428/magit.el index dc6a00f1..0e25e543 100644 --- a/elpa/magit-20180118.313/magit.el +++ b/elpa/magit-20180404.1428/magit.el @@ -61,12 +61,6 @@ (require 'format-spec) (require 'package nil t) ; used in `magit-version' -(eval-when-compile (require 'dired-x)) -(declare-function dired-jump 'dired-x) -(eval-when-compile (require 'eshell)) -(declare-function eshell-parse-arguments 'eshell) -(eval-when-compile (require 'message)) - (defconst magit--minimal-git "1.9.4") (defconst magit--minimal-emacs "24.4") @@ -204,299 +198,30 @@ own faces for the `header-line', or for parts of the "Face for filenames." :group 'magit-faces) -;;; Commands -;;;; Merge - -;;;###autoload (autoload 'magit-merge-popup "magit" nil t) -(magit-define-popup magit-merge-popup - "Popup console for merge commands." - :man-page "git-merge" - :switches '((?f "Fast-forward only" "--ff-only") - (?n "No fast-forward" "--no-ff") - (?s "Squash" "--squash")) - :options '((?s "Strategy" "--strategy=")) - :actions '((?m "Merge" magit-merge) - (?e "Merge and edit message" magit-merge-editmsg) - (?p "Preview merge" magit-merge-preview) - (?n "Merge but don't commit" magit-merge-nocommit)) - :sequence-actions '((?m "Commit merge" magit-commit) - (?a "Abort merge" magit-merge-abort)) - :sequence-predicate 'magit-merge-state - :default-action 'magit-merge - :max-action-columns 2) - -;;;###autoload -(defun magit-merge (rev &optional args nocommit) - "Merge commit REV into the current branch; using default message. - -Unless there are conflicts or a prefix argument is used create a -merge commit using a generic commit message and without letting -the user inspect the result. With a prefix argument pretend the -merge failed to give the user the opportunity to inspect the -merge. - -\(git merge --no-edit|--no-commit [ARGS] REV)" - (interactive (list (magit-read-other-branch-or-commit "Merge") - (magit-merge-arguments) - current-prefix-arg)) - (magit-merge-assert) - (magit-run-git-async "merge" (if nocommit "--no-commit" "--no-edit") args rev)) - -;;;###autoload -(defun magit-merge-editmsg (rev &optional args) - "Merge commit REV into the current branch; and edit message. -Perform the merge and prepare a commit message but let the user -edit it. -\n(git merge --edit --no-ff [ARGS] REV)" - (interactive (list (magit-read-other-branch-or-commit "Merge") - (magit-merge-arguments))) - (magit-merge-assert) - (cl-pushnew "--no-ff" args :test #'equal) - (apply #'magit-run-git-with-editor "merge" "--edit" - (append args (list rev)))) - -;;;###autoload -(defun magit-merge-nocommit (rev &optional args) - "Merge commit REV into the current branch; pretending it failed. -Pretend the merge failed to give the user the opportunity to -inspect the merge and change the commit message. -\n(git merge --no-commit --no-ff [ARGS] REV)" - (interactive (list (magit-read-other-branch-or-commit "Merge") - (magit-merge-arguments))) - (magit-merge-assert) - (cl-pushnew "--no-ff" args :test #'equal) - (magit-run-git-async "merge" "--no-commit" args rev)) - -;;;###autoload -(defun magit-merge-preview (rev) - "Preview result of merging REV into the current branch." - (interactive (list (magit-read-other-branch-or-commit "Preview merge"))) - (magit-mode-setup #'magit-merge-preview-mode rev)) - -(define-derived-mode magit-merge-preview-mode magit-diff-mode "Magit Merge" - "Mode for previewing a merge." - :group 'magit-diff - (hack-dir-local-variables-non-file-buffer)) - -(defun magit-merge-preview-refresh-buffer (rev) - (let* ((branch (magit-get-current-branch)) - (head (or branch (magit-rev-verify "HEAD")))) - (magit-set-header-line-format (format "Preview merge of %s into %s" - rev - (or branch "HEAD"))) - (magit-insert-section (diffbuf) - (magit-git-wash #'magit-diff-wash-diffs - "merge-tree" (magit-git-string "merge-base" head rev) head rev)))) - -;;;###autoload -(defun magit-merge-abort () - "Abort the current merge operation. -\n(git merge --abort)" - (interactive) - (if (file-exists-p (magit-git-dir "MERGE_HEAD")) - (when (magit-confirm 'abort-merge) - (magit-run-git-async "merge" "--abort")) - (user-error "No merge in progress"))) - -(defun magit-checkout-stage (file arg) - "During a conflict checkout and stage side, or restore conflict." - (interactive - (let ((file (magit-completing-read "Checkout file" - (magit-tracked-files) nil nil nil - 'magit-read-file-hist - (magit-current-file)))) - (cond ((member file (magit-unmerged-files)) - (list file (magit-checkout-read-stage file))) - ((yes-or-no-p (format "Restore conflicts in %s? " file)) - (list file "--merge")) - (t - (user-error "Quit"))))) - (pcase (cons arg (cddr (car (magit-file-status file)))) - ((or `("--ours" ?D ,_) - `("--theirs" ,_ ?D)) - (magit-run-git "rm" "--" file)) - (_ (if (equal arg "--merge") - ;; This fails if the file was deleted on one - ;; side. And we cannot do anything about it. - (magit-run-git "checkout" "--merge" "--" file) - (magit-call-git "checkout" arg "--" file) - (magit-run-git "add" "-u" "--" file))))) - -(defun magit-merge-state () - (file-exists-p (magit-git-dir "MERGE_HEAD"))) - -(defun magit-merge-assert () - (or (not (magit-anything-modified-p t)) - (magit-confirm 'merge-dirty - "Merging with dirty worktree is risky. Continue") - (user-error "Abort"))) - -(defun magit-checkout-read-stage (file) - (magit-read-char-case (format "For %s checkout: " file) t - (?o "[o]ur stage" "--ours") - (?t "[t]heir stage" "--theirs") - (?c "[c]onflict" "--merge"))) - -(defun magit-insert-merge-log () - "Insert section for the on-going merge. -Display the heads that are being merged. -If no merge is in progress, do nothing." - (-when-let (heads (mapcar 'magit-get-shortname - (magit-file-lines (magit-git-dir "MERGE_HEAD")))) - (magit-insert-section (commit (car heads)) - (magit-insert-heading - (format "Merging %s:" (mapconcat 'identity heads ", "))) - (magit-insert-log - (concat (magit-git-string "merge-base" "--octopus" "HEAD" (car heads)) - ".." (car heads)) - (let ((args magit-log-section-arguments)) - (unless (member "--decorate=full" magit-log-section-arguments) - (push "--decorate=full" args)) - args))))) - -;;;; Reset - -;;;###autoload (autoload 'magit-reset-popup "magit" nil t) -(magit-define-popup magit-reset-popup - "Popup console for reset commands." - :man-page "git-reset" - :actions '((?m "reset mixed (HEAD and index)" magit-reset-head) - (?s "reset soft (HEAD only)" magit-reset-soft) - (?h "reset hard (HEAD, index, and files)" magit-reset-hard) - (?i "reset index (index only)" magit-reset-index) nil - (?f "reset a file" magit-file-checkout)) - :max-action-columns 1) - -;;;###autoload -(defun magit-reset-index (commit) - "Reset the index to COMMIT. -Keep the head and working tree as-is, so if COMMIT refers to the -head this effectively unstages all changes. -\n(git reset COMMIT .)" - (interactive (list (magit-read-branch-or-commit "Reset index to"))) - (magit-reset-internal nil commit ".")) - -;;;###autoload -(defun magit-reset (commit &optional hard) - "Reset the head and index to COMMIT, but not the working tree. -With a prefix argument also reset the working tree. -\n(git reset --mixed|--hard COMMIT)" - (interactive (list (magit-read-branch-or-commit - (if current-prefix-arg - "Hard reset to" - "Reset head to")) - current-prefix-arg)) - (magit-reset-internal (if hard "--hard" "--mixed") commit)) - -;;;###autoload -(defun magit-reset-head (commit) - "Reset the head and index to COMMIT, but not the working tree. -\n(git reset --mixed COMMIT)" - (interactive (list (magit-read-branch-or-commit "Reset head to"))) - (magit-reset-internal "--mixed" commit)) - -;;;###autoload -(defun magit-reset-soft (commit) - "Reset the head to COMMIT, but not the index and working tree. -\n(git reset --soft REVISION)" - (interactive (list (magit-read-branch-or-commit "Soft reset to"))) - (magit-reset-internal "--soft" commit)) - -;;;###autoload -(defun magit-reset-hard (commit) - "Reset the head, index, and working tree to COMMIT. -\n(git reset --hard REVISION)" - (interactive (list (magit-read-branch-or-commit "Hard reset to"))) - (magit-reset-internal "--hard" commit)) - -(defun magit-reset-internal (arg commit &optional path) - (when (and (not (member arg '("--hard" nil))) - (equal (magit-rev-parse commit) - (magit-rev-parse "HEAD~"))) - (with-temp-buffer - (magit-git-insert "show" "-s" "--format=%B" "HEAD") - (when git-commit-major-mode - (funcall git-commit-major-mode)) - (git-commit-setup-font-lock) - (git-commit-save-message))) - (let ((cmd (if (and (equal commit "HEAD") (not arg)) "unstage" "reset"))) - (magit-wip-commit-before-change nil (concat " before " cmd)) - (magit-run-git "reset" arg commit "--" path) - (when (equal cmd "unstage") - (magit-wip-commit-after-apply nil " after unstage")))) - -;;;; Tag - -;;;###autoload (autoload 'magit-tag-popup "magit" nil t) -(magit-define-popup magit-tag-popup - "Popup console for tag commands." - :man-page "git-tag" - :switches '((?a "Annotate" "--annotate") - (?f "Force" "--force") - (?s "Sign" "--sign")) - :options '((?f "Sign" "--local-user=" magit-read-gpg-secret-key)) - :actions '((?t "Create" magit-tag) - (?k "Delete" magit-tag-delete) - (?p "Prune" magit-tag-prune)) - :default-action 'magit-tag) - -;;;###autoload -(defun magit-tag (name rev &optional args) - "Create a new tag with the given NAME at REV. -With a prefix argument annotate the tag. -\n(git tag [--annotate] NAME REV)" - (interactive (list (magit-read-tag "Tag name") - (magit-read-branch-or-commit "Place tag on") - (let ((args (magit-tag-arguments))) - (when current-prefix-arg - (cl-pushnew "--annotate" args)) - args))) - (magit-run-git-with-editor "tag" args name rev)) - -;;;###autoload -(defun magit-tag-delete (tags) - "Delete one or more tags. -If the region marks multiple tags (and nothing else), then offer -to delete those, otherwise prompt for a single tag to be deleted, -defaulting to the tag at point. -\n(git tag -d TAGS)" - (interactive - (list (--if-let (magit-region-values 'tag) - (or (magit-confirm t "Delete %s" "Delete %i tags" it) - (user-error "Abort")) - (magit-read-tag "Delete tag" t)))) - (magit-run-git "tag" "-d" tags)) - -(defun magit-tag-prune (tags remote-tags remote) - "Offer to delete tags missing locally from REMOTE, and vice versa." - (interactive - (let* ((remote (magit-read-remote "Prune tags using remote")) - (tags (magit-list-tags)) - (rtags (prog2 (message "Determining remote tags...") - (magit-remote-list-tags remote) - (message "Determining remote tags...done"))) - (ltags (-difference tags rtags)) - (rtags (-difference rtags tags))) - (unless (or ltags rtags) - (message "Same tags exist locally and remotely")) - (unless (magit-confirm t "Delete %s locally" - "Delete %i tags locally" ltags) - (setq ltags nil)) - (unless (magit-confirm t "Delete %s from remote" - "Delete %i tags from remote" rtags) - (setq rtags nil)) - (list ltags rtags remote))) - (when tags - (magit-call-git "tag" "-d" tags)) - (when remote-tags - (magit-run-git-async "push" remote (--map (concat ":" it) remote-tags)))) - -;;;; Dispatch Popup +;;; Dispatch Popup + +(defvar magit-file-popup-actions + '((?s "Stage" magit-stage-file) + (?D "Diff..." magit-diff-buffer-file-popup) + (?L "Log..." magit-log-buffer-file-popup) + (?B "Blame..." magit-blame-popup) nil + (?u "Unstage" magit-unstage-file) + (?d "Diff" magit-diff-buffer-file) + (?l "Log" magit-log-buffer-file) + (?b "Blame" magit-blame) + (?p "Prev blob" magit-blob-previous) + (?c "Commit" magit-commit-popup) nil nil + (?r (lambda () + (with-current-buffer magit-pre-popup-buffer + (and (not buffer-file-name) + (propertize "...reverse" 'face 'default)))) + magit-blame-reverse) + (?n "Next blob" magit-blob-next))) ;;;###autoload (autoload 'magit-dispatch-popup "magit" nil t) (magit-define-popup magit-dispatch-popup "Popup console for dispatching other popups." - :actions '("Popup and dwim commands" + :actions `("Popup and dwim commands" (?A "Cherry-picking" magit-cherry-pick-popup) (?b "Branching" magit-branch-popup) (?B "Bisecting" magit-bisect-popup) @@ -525,7 +250,10 @@ defaulting to the tag at point. (?z "Stashing" magit-stash-popup) (?! "Running" magit-run-popup) (?% "Worktree" magit-worktree-popup) - "Applying changes" + (lambda () + (and (with-current-buffer magit-pre-popup-buffer + (derived-mode-p 'magit-mode)) + (propertize "Applying changes" 'face 'magit-popup-heading))) (?a "Apply" magit-apply) (?s "Stage" magit-stage) (?u "Unstage" magit-unstage) @@ -533,20 +261,29 @@ defaulting to the tag at point. (?S "Stage all" magit-stage-modified) (?U "Unstage all" magit-unstage-all) (?k "Discard" magit-discard) - "Essential commands" + (lambda () + (and (with-current-buffer magit-pre-popup-buffer + (derived-mode-p 'magit-mode)) + (propertize "Essential commands" 'face 'magit-popup-heading))) (?g " refresh current buffer" magit-refresh) ;; These bindings only work because of :setup-function. (?\t " toggle section at point" magit-section-toggle) (?\r " visit thing at point" magit-visit-thing) ;; This binding has no effect and only appears to do ;; so because it is identical to the global binding. - ("C-h m" "show all key bindings" describe-mode)) + ("C-h m" "show all key bindings" describe-mode) + (lambda () + (and (with-current-buffer magit-pre-popup-buffer + buffer-file-name) + (propertize "File commands" 'face 'magit-popup-heading))) + ,@magit-file-popup-actions) :setup-function 'magit-dispatch-popup-setup :max-action-columns (lambda (heading) (pcase heading ("Popup and dwim commands" 4) ("Applying changes" 3) - ("Essential commands" 1)))) + ("Essential commands" 1) + ("File commands" 5)))) (defvar magit-dispatch-popup-map (let ((map (make-sparse-keymap))) @@ -573,7 +310,7 @@ defaulting to the tag at point. (make-magit-popup-event :key 'return :fun 'magit-visit-thing))))) -;;;; Git Popup +;;; Git Popup (defcustom magit-shell-command-verbose-prompt t "Whether to show the working directory when reading a command. @@ -661,215 +398,7 @@ is run in the top-level directory of the current working tree." "Async shell command: ") initial-input 'magit-git-command-history))) -;;; Revision Stack - -(defvar magit-revision-stack nil) - -(defcustom magit-pop-revision-stack-format - '("[%N: %h] " "%N: %H\n %s\n" "\\[\\([0-9]+\\)[]:]") - "Control how `magit-pop-revision-stack' inserts a revision. - -The command `magit-pop-revision-stack' inserts a representation -of the revision last pushed to the `magit-revision-stack' into -the current buffer. It inserts text at point and/or near the end -of the buffer, and removes the consumed revision from the stack. - -The entries on the stack have the format (HASH TOPLEVEL) and this -option has the format (POINT-FORMAT EOB-FORMAT INDEX-REGEXP), all -of which may be nil or a string (though either one of EOB-FORMAT -or POINT-FORMAT should be a string, and if INDEX-REGEXP is -non-nil, then the two formats should be too). - -First INDEX-REGEXP is used to find the previously inserted entry, -by searching backward from point. The first submatch must match -the index number. That number is incremented by one, and becomes -the index number of the entry to be inserted. If you don't want -to number the inserted revisions, then use nil for INDEX-REGEXP. - -If INDEX-REGEXP is non-nil, then both POINT-FORMAT and EOB-FORMAT -should contain \"%N\", which is replaced with the number that was -determined in the previous step. - -Both formats, if non-nil and after removing %N, are then expanded -using `git show --format=FORMAT ...' inside TOPLEVEL. - -The expansion of POINT-FORMAT is inserted at point, and the -expansion of EOB-FORMAT is inserted at the end of the buffer (if -the buffer ends with a comment, then it is inserted right before -that)." - :package-version '(magit . "2.3.0") - :group 'magit-commands - :type '(list (choice (string :tag "Insert at point format") - (cons (string :tag "Insert at point format") - (repeat (string :tag "Argument to git show"))) - (const :tag "Don't insert at point" nil)) - (choice (string :tag "Insert at eob format") - (cons (string :tag "Insert at eob format") - (repeat (string :tag "Argument to git show"))) - (const :tag "Don't insert at eob" nil)) - (choice (regexp :tag "Find index regexp") - (const :tag "Don't number entries" nil)))) - -(defun magit-pop-revision-stack (rev toplevel) - "Insert a representation of a revision into the current buffer. - -Pop a revision from the `magit-revision-stack' and insert it into -the current buffer according to `magit-pop-revision-stack-format'. -Revisions can be put on the stack using `magit-copy-section-value' -and `magit-copy-buffer-revision'. - -If the stack is empty or with a prefix argument, instead read a -revision in the minibuffer. By using the minibuffer history this -allows selecting an item which was popped earlier or to insert an -arbitrary reference or revision without first pushing it onto the -stack. - -When reading the revision from the minibuffer, then it might not -be possible to guess the correct repository. When this command -is called inside a repository (e.g. while composing a commit -message), then that repository is used. Otherwise (e.g. while -composing an email) then the repository recorded for the top -element of the stack is used (even though we insert another -revision). If not called inside a repository and with an empty -stack, or with two prefix arguments, then read the repository in -the minibuffer too." - (interactive - (if (or current-prefix-arg (not magit-revision-stack)) - (let ((default-directory - (or (and (not (= (prefix-numeric-value current-prefix-arg) 16)) - (or (magit-toplevel) - (cadr (car magit-revision-stack)))) - (magit-read-repository)))) - (list (magit-read-branch-or-commit "Insert revision") - default-directory)) - (push (caar magit-revision-stack) magit-revision-history) - (pop magit-revision-stack))) - (if rev - (-let [(pnt-format eob-format idx-format) magit-pop-revision-stack-format] - (let ((default-directory toplevel) - (idx (and idx-format - (save-excursion - (if (re-search-backward idx-format nil t) - (number-to-string - (1+ (string-to-number (match-string 1)))) - "1")))) - pnt-args eob-args) - (when (listp pnt-format) - (setq pnt-args (cdr pnt-format)) - (setq pnt-format (car pnt-format))) - (when (listp eob-format) - (setq eob-args (cdr eob-format)) - (setq eob-format (car eob-format))) - (when pnt-format - (when idx-format - (setq pnt-format - (replace-regexp-in-string "%N" idx pnt-format t t))) - (magit-rev-insert-format pnt-format rev pnt-args) - (backward-delete-char 1)) - (when eob-format - (when idx-format - (setq eob-format - (replace-regexp-in-string "%N" idx eob-format t t))) - (save-excursion - (goto-char (point-max)) - (skip-syntax-backward ">s-") - (beginning-of-line) - (if (and comment-start (looking-at comment-start)) - (while (looking-at comment-start) - (forward-line -1)) - (forward-line) - (unless (= (current-column) 0) - (insert ?\n))) - (insert ?\n) - (magit-rev-insert-format eob-format rev eob-args) - (backward-delete-char 1))))) - (user-error "Revision stack is empty"))) - -(define-key git-commit-mode-map - (kbd "C-c C-w") 'magit-pop-revision-stack) - -(defun magit-copy-section-value () - "Save the value of the current section for later use. - -Save the section value to the `kill-ring', and, provided that -the current section is a commit, branch, or tag section, push -the (referenced) revision to the `magit-revision-stack' for use -with `magit-pop-revision-stack'. - -When the current section is a branch or a tag, and a prefix -argument is used, then save the revision at its tip to the -`kill-ring' instead of the reference name. - -When the region is active, then save that to the `kill-ring', -like `kill-ring-save' would, instead of behaving as described -above." - (interactive) - (if (use-region-p) - (copy-region-as-kill nil nil 'region) - (-when-let* ((section (magit-current-section)) - (value (oref section value))) - (magit-section-case - ((branch commit module-commit tag) - (let ((default-directory default-directory) ref) - (magit-section-case - ((branch tag) - (setq ref value)) - (module-commit - (setq default-directory - (file-name-as-directory - (expand-file-name (magit-section-parent-value section) - (magit-toplevel)))))) - (setq value (magit-rev-parse value)) - (push (list value default-directory) magit-revision-stack) - (kill-new (message "%s" (or (and current-prefix-arg ref) - value))))) - (t (kill-new (message "%s" value))))))) - -(defun magit-copy-buffer-revision () - "Save the revision of the current buffer for later use. - -Save the revision shown in the current buffer to the `kill-ring' -and push it to the `magit-revision-stack'. - -This command is mainly intended for use in `magit-revision-mode' -buffers, the only buffers where it is always unambiguous exactly -which revision should be saved. - -Most other Magit buffers usually show more than one revision, in -some way or another, so this command has to select one of them, -and that choice might not always be the one you think would have -been the best pick. - -In such buffers it is often more useful to save the value of -the current section instead, using `magit-copy-section-value'. - -When the region is active, then save that to the `kill-ring', -like `kill-ring-save' would, instead of behaving as described -above." - (interactive) - (if (use-region-p) - (copy-region-as-kill nil nil 'region) - (-when-let (rev (cond ((memq major-mode '(magit-cherry-mode - magit-log-select-mode - magit-reflog-mode - magit-refs-mode - magit-revision-mode - magit-stash-mode - magit-stashes-mode)) - (car magit-refresh-args)) - ((memq major-mode '(magit-diff-mode - magit-log-mode)) - (let ((r (caar magit-refresh-args))) - (if (string-match "\\.\\.\\.?\\(.+\\)" r) - (match-string 1 r) - r))) - ((eq major-mode 'magit-status-mode) "HEAD"))) - (when (magit-rev-verify-commit rev) - (setq rev (magit-rev-parse rev)) - (push (list rev default-directory) magit-revision-stack) - (kill-new (message "%s" rev)))))) - -;;; (Keywords) +;;; Font-Lock Keywords (defconst magit-font-lock-keywords (eval-when-compile @@ -890,7 +419,7 @@ above." (font-lock-add-keywords 'emacs-lisp-mode magit-font-lock-keywords) -;;; (Versions) +;;; Version (defvar magit-version 'undefined "The version of Magit that you're using. @@ -977,6 +506,8 @@ and Emacs to it." (message "Cannot determine Magit's version %S" debug))) magit-version)) +;;; Debugging Tools + (defun magit-debug-git-executable () "Display a buffer with information about `magit-git-executable'. See info node `(magit)Debugging Tools' for more information." @@ -1011,7 +542,7 @@ See info node `(magit)Debugging Tools' for more information." (magit-git-debug (lambda (err) (setq errmsg err)))) (or (magit-git-version t) errmsg))))))))) -;;; (Asserts) +;;; Startup Asserts (defun magit-startup-asserts () (let ((version (magit-git-version))) @@ -1046,20 +577,9 @@ or using some sort of application launcher, then you probably have to adjust the environment as seen by graphical interface. For X11 something like ~/.xinitrc should work.\n" magit--minimal-emacs emacs-version) - :error)) - (--each '((magit-log-edit . git-commit) - (git-commit-mode . git-commit) - (git-rebase-mode . git-rebase)) - (when (or (featurep (car it)) (locate-library (symbol-name (car it)))) - (display-warning 'magit (format "%s has to be removed - -Magit is no longer compatible with the library `%s', -which was used in earlier releases. Please remove it, so that -Magit can use the successor `%s' without the obsolete -library getting in the way. Then restart Emacs.\n" - (car it) (car it) (cdr it)) :error)))) + :error))) -;;; (Features) +;;; Loading Libraries (provide 'magit) @@ -1067,7 +587,11 @@ library getting in the way. Then restart Emacs.\n" (require 'magit-status) (require 'magit-refs) (require 'magit-files) + (require 'magit-collab) + (require 'magit-reset) (require 'magit-branch) + (require 'magit-merge) + (require 'magit-tag) (require 'magit-worktree) (require 'magit-notes) (require 'magit-sequence) diff --git a/elpa/magit-20180404.1428/magit.info b/elpa/magit-20180404.1428/magit.info new file mode 100644 index 00000000..548a2920 --- /dev/null +++ b/elpa/magit-20180404.1428/magit.info @@ -0,0 +1,181 @@ +This is magit.info, produced by makeinfo version 6.1 from magit.texi. + + Copyright (C) 2015-2018 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: 752 +magit.info-2: 302946 + +Tag Table: +(Indirect) +Node: Top752 +Node: Introduction6119 +Node: Installation10842 +Node: Installing from an Elpa Archive11182 +Node: Installing from the Git Repository12285 +Node: Post-Installation Tasks15038 +Node: Getting Started16323 +Node: Interface Concepts21670 +Node: Modes and Buffers22002 +Node: Switching Buffers23747 +Node: Naming Buffers28288 +Node: Quitting Windows31595 +Node: Automatic Refreshing of Magit Buffers33227 +Node: Automatic Saving of File-Visiting Buffers35995 +Node: Automatic Reverting of File-Visiting Buffers37180 +Node: Risk of Reverting Automatically42176 +Node: Sections44559 +Node: Section Movement45500 +Node: Section Visibility49591 +Node: Section Hooks54443 +Node: Section Types and Values56724 +Node: Section Options57994 +Node: Popup Buffers and Prefix Commands58466 +Node: Completion Confirmation and the Selection60847 +Node: Action Confirmation61284 +Node: Completion and Confirmation67524 +Node: The Selection70710 +Node: The hunk-internal region73609 +Node: Support for Completion Frameworks74698 +Node: Additional Completion Options79514 +Node: Running Git80113 +Node: Viewing Git Output80386 +Node: Git Process Status81519 +Node: Running Git Manually82484 +Node: Git Executable84886 +Node: Global Git Arguments87168 +Node: Inspecting87974 +Node: Status Buffer89121 +Node: Status Sections92034 +Node: Status Header Sections96549 +Node: Status Module Sections99179 +Node: Status Options101684 +Node: Repository List103438 +Node: Logging105596 +Node: Refreshing Logs108043 +Node: Log Buffer109428 +Node: Log Margin113223 +Node: Select from Log115863 +Node: Reflog117967 +Node: Cherries119484 +Node: Diffing121211 +Node: Refreshing Diffs124158 +Node: Diff Buffer127649 +Node: Diff Options130383 +Node: Revision Buffer134658 +Node: Ediffing137196 +Node: References Buffer140792 +Node: References Sections150557 +Node: Bisecting151418 +Node: Visiting Blobs153156 +Node: Blaming153665 +Node: Manipulating158445 +Node: Repository Setup158761 +Node: Staging and Unstaging159801 +Node: Staging from File-Visiting Buffers163882 +Node: Applying165050 +Node: Committing166943 +Node: Initiating a Commit167526 +Node: Editing Commit Messages170837 +Node: Branching181233 +Node: The Two Remotes181463 +Node: The Branch Popup184080 +Node: The Branch Config Popup200927 +Node: Auxillary Branch Commands206865 +Node: Merging207968 +Node: Resolving Conflicts211893 +Node: Rebasing216894 +Node: Editing Rebase Sequences221050 +Node: Information About In-Progress Rebase224080 +Ref: Information About In-Progress Rebase-Footnote-1232828 +Node: Cherry Picking233424 +Node: Reverting237676 +Node: Resetting239039 +Node: Stashing240456 +Node: Transferring244968 +Node: Remotes245206 +Node: The Remote Popup245362 +Node: The Remote Config Popup248830 +Node: Fetching250482 +Node: Pulling251838 +Node: Pushing252674 +Node: Creating and Sending Patches257409 +Node: Applying Patches258246 +Node: Miscellaneous259832 +Node: Tagging260135 +Node: Notes260919 +Node: Submodules263230 +Node: Listing Submodules263444 +Node: Submodule Popup265368 +Node: Subtree267821 +Node: Common Commands269068 +Node: Wip Modes270814 +Node: Minor Mode for Buffers Visiting Files277611 +Node: Minor Mode for Buffers Visiting Blobs280960 +Node: Customizing281773 +Node: Per-Repository Configuration283441 +Node: Essential Settings285088 +Node: Safety285412 +Node: Performance287177 +Node: Microsoft Windows Performance294025 +Node: MacOS Performance295216 +Ref: MacOS Performance-Footnote-1296452 +Ref: MacOS Performance-Footnote-2296534 +Ref: MacOS Performance-Footnote-3296594 +Node: Plumbing296760 +Node: Calling Git297583 +Node: Getting a Value from Git299108 +Node: Calling Git for Effect302946 +Node: Section Plumbing309464 +Node: Creating Sections309692 +Node: Section Selection313591 +Node: Matching Sections315271 +Node: Refreshing Buffers320704 +Node: Conventions323839 +Node: Theming Faces324031 +Node: FAQ332146 +Node: FAQ - How to ...?332588 +Node: How to show git's output?332948 +Node: How to install the gitman info manual?333702 +Node: How to show diffs for gpg-encrypted files?334672 +Node: How does branching and pushing work?335268 +Node: Can Magit be used as ediff-version-control-package?335631 +Node: FAQ - Issues and Errors337620 +Node: Magit is slow338418 +Node: I changed several thousand files at once and now Magit is unusable338632 +Node: I am having problems committing339361 +Node: I am using MS Windows and cannot push with Magit339842 +Node: I am using OS X and SOMETHING works in shell but not in Magit340459 +Node: Diffs contain control sequences341265 +Node: Expanding a file to show the diff causes it to disappear342339 +Node: Point is wrong in the COMMIT_EDITMSG buffer342890 +Node: The mode-line information isn't always up-to-date343936 +Node: Emacs 245 hangs when loading Magit344997 +Node: A branch and tag sharing the same name breaks SOMETHING345611 +Node: Debugging Tools346417 +Node: Keystroke Index348294 +Node: Command Index378958 +Node: Function Index411505 +Node: Variable Index425836 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20180118.313/magit.info-1 b/elpa/magit-20180404.1428/magit.info-1 similarity index 94% rename from elpa/magit-20180118.313/magit.info-1 rename to elpa/magit-20180404.1428/magit.info-1 index 1bc5412a..7c49b187 100644 --- a/elpa/magit-20180118.313/magit.info-1 +++ b/elpa/magit-20180404.1428/magit.info-1 @@ -1,4 +1,4 @@ -This is magit.info, produced by makeinfo version 5.2 from magit.texi. +This is magit.info, produced by makeinfo version 6.1 from magit.texi. Copyright (C) 2015-2018 Jonas Bernoulli @@ -30,7 +30,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.11.0 (2.11.0-411-g73ea37afb+1). +This manual is for Magit version 2.12.1 (2.12.1-9-g9453a96ff+1). Copyright (C) 2015-2018 Jonas Bernoulli @@ -190,6 +190,7 @@ Branching * The Two Remotes:: * The Branch Popup:: * The Branch Config Popup:: +* Auxillary Branch Commands:: Rebasing @@ -273,16 +274,16 @@ Conventions FAQ -* FAQ - How to …?:: +* FAQ - How to ...?:: * FAQ - Issues and Errors:: -FAQ - How to …? +FAQ - How to ...? * How to show git's output?:: * How to install the gitman info manual?:: * How to show diffs for gpg-encrypted files?:: * How does branching and pushing work?:: -* Can Magit be used as ‘ediff-version-control-package’?:: +* Can Magit be used as ediff-version-control-package?:: FAQ - Issues and Errors @@ -294,7 +295,7 @@ FAQ - Issues and Errors * I am using OS X and SOMETHING works in shell, but not in Magit: I am using OS X and SOMETHING works in shell but not in Magit. * Diffs contain control sequences:: * Expanding a file to show the diff causes it to disappear:: -* Point is wrong in the ‘COMMIT_EDITMSG’ buffer:: +* Point is wrong in the COMMIT_EDITMSG buffer:: * The mode-line information isn't always up-to-date:: * Emacs 24.5 hangs when loading Magit: Emacs 245 hangs when loading Magit. * A branch and tag sharing the same name breaks SOMETHING:: @@ -869,14 +870,21 @@ File: magit.info, Node: Naming Buffers, Next: Quitting Windows, Prev: Switchi or if ‘magit-uniquify-buffer-names’ is non-nil an abbreviation of that. + • ‘%x’ + + If ‘magit-uniquify-buffer-names’ is nil "*", otherwise the + empty string. Due to limitations of the ‘uniquify’ package, + buffer names must end with the path. + • ‘%T’ - Like ‘%t’, but append an asterisk if and only if - ‘magit-uniquify-buffer-names’ is nil. + Obsolete, use "%t%x" instead. Like ‘%t’, but append an + asterisk if and only if ‘magit-uniquify-buffer-names’ is nil. The value should always contain ‘%m’ or ‘%M’, ‘%v’ or ‘%V’, and - ‘%t’ or ‘%T’. If ‘magit-uniquify-buffer-names’ is non-nil, then - the value must end with ‘%t’ or ‘%T’ (see issue #2841). + ‘%t’ (or the obsolete ‘%T’). If ‘magit-uniquify-buffer-names’ is + non-nil, then the value must end with ‘%t’ or ‘%t%x’ (or the + obsolete ‘%T’). See issue #2841. -- User Option: magit-uniquify-buffer-names @@ -1393,14 +1401,33 @@ then the previous visibility is preserved. The initial visibility of certain sections can also be overwritten using the hook ‘magit-section-set-visibility-hook’. - -- User Option: magit-section-cache-visibility-types + -- User Option: magit-section-initial-visibility-alist + + This options can be used to override the initial visibility of + sections. In the future it will also be used to define the + defaults, but currently a section’s default is still hardcoded. + + The value is an alist. Each element maps a section type or lineage + to the initial visibility state for such sections. The state has + to be one of ‘show’ or ‘hide’, or a function that returns one of + these symbols. A function is called with the section as the only + argument. + + Use the command ‘magit-describe-section’ to determine a section’s + lineage or type. The vector in the output is the section lineage + and the type is the first element of that vector. Wildcards can be + used, see ‘magit-section-match’. + + -- User Option: magit-section-cache-visibility This option controls for which sections the previous visibility state should be restored if a section disappears and later appears - again. The value is a list of section types. + again. The value is a boolean or a list of section types. If t, + then the visibility of all sections is cached. Otherwise this is + only done for sections whose type matches one of the listed types. - This requires that ‘magit-section-cached-visibility’ is a member of - ‘magit-section-set-visibility-hook’. + This requires that the function ‘magit-section-cached-visibility’ + is a member of ‘magit-section-set-visibility-hook’. -- Variable: magit-section-set-visibility-hook @@ -1484,7 +1511,7 @@ but knowing them can be handy at times. ‘M-x magit-describe-section’ (‘magit-describe-section’) Show information about the section at point in the echo area, as - "VALUE [TYPE PARENT-TYPE…] BEGINNING-END". + "VALUE [TYPE PARENT-TYPE...] BEGINNING-END". Many commands behave differently depending on the type of the section at point and/or somehow consume the value of that section. But that is @@ -2526,11 +2553,11 @@ variable. are inserted, and option ‘magit-module-sections-nested’ controls whether they are wrapped in an additional section. - • Option: magit-module-sections-hook + -- User Option: magit-module-sections-hook Hook run by ‘magit-insert-modules’. - • Option: magit-module-sections-nested + -- User Option: magit-module-sections-nested This option controls whether ‘magit-insert-modules’ wraps inserted sections in an additional section. @@ -3162,7 +3189,7 @@ Buffers and Prefix Commands::). Show differences between two commits. - RANGE should be a range (A..B or A…B) but can also be a single + RANGE should be a range (A..B or A...B) but can also be a single commit. If one side of the range is omitted, then it defaults to ‘HEAD’. If just a commit is given, then changes in the working tree relative to that commit are shown. @@ -3170,7 +3197,7 @@ Buffers and Prefix Commands::). If the region is active, use the revisions on the first and last line of the region. With a prefix argument, instead of diffing the revisions, choose a revision to view changes along, starting at the - common ancestor of both revisions (i.e., use a "…" range). + common ancestor of both revisions (i.e., use a "..." range). ‘d w’ (‘magit-diff-working-tree’) @@ -3259,7 +3286,7 @@ the status buffer. ‘D r’ (‘magit-diff-switch-range-type’) This command converts the diff range type from "revA..revB" to - "revB…revA", or vice versa. + "revB...revA", or vice versa. ‘D f’ (‘magit-diff-flip-revs’) @@ -3586,7 +3613,7 @@ information on how to use Ediff itself, see *note (ediff)Top::. If the region is active, use the revisions on the first and last line of the region. With a prefix argument, instead of diffing the revisions, choose a revision to view changes along, starting at the - common ancestor of both revisions (i.e., use a "…" range). + common ancestor of both revisions (i.e., use a "..." range). ‘E m’ (‘magit-ediff-resolve’) @@ -3692,6 +3719,54 @@ File: magit.info, Node: References Buffer, Next: Bisecting, Prev: Ediffing, The default is ‘nil’ because anything else can be very expensive. + -- User Option: magit-refs-pad-commit-counts + + Whether to pad all commit counts on all sides in Magit-Refs mode + buffers. + + If this is nil, then some commit counts are displayed right next to + one of the branches that appear next to the count, without any + space in between. This might look bad if the branch name faces + look too similar to ‘magit-dimmed’. + + If this is non-nil, then spaces are placed on both sides of all + commit counts. + + -- User Option: magit-refs-show-remote-prefix + + Whether to show the remote prefix in lists of remote branches. + + Showing the prefix is redundant because the name of the remote is + already shown in the heading preceeding the list of its branches. + + -- User Option: magit-refs-primary-column-width + + Width of the primary column in ‘magit-refs-mode’ buffers. The + primary column is the column that contains the name of the branch + that the current row is about. + + If this is an integer, then the column is that many columns wide. + Otherwise it has to be a cons-cell of two integers. The first + specifies the minimal width, the second the maximal width. In that + case the actual width is determined using the length of the names + of the shown local branches. (Remote branches and tags are not + taken into account when calculating to optimal width.) + + -- User Option: magit-refs-focus-column-width + + Width of the focus column in ‘magit-refs-mode’ buffers. + + The focus column is the first column, which marks one branch + (usually the current branch) as the focused branch using ‘*’ or + ‘@’. For each other reference, this column optionally shows how + many commits it is ahead of the focused branch and ‘<’, or if it + isn’t ahead then the commits it is behind and ‘>’, or if it isn’t + behind either, then a ‘=’. + + This column may also display only ‘*’ or ‘@’ for the focused + branch, in which case this option is ignored. Use ‘L v’ to change + the verbosity of this column. + -- User Option: magit-refs-margin This option specifies whether the margin is initially shown in @@ -3752,22 +3827,22 @@ you should also change the others to keep things aligned. The following • ‘%U’ Upstream of this local branch and additional local vs. upstream information. - -- Variable: magit-refs-local-branch-format - - Format used for local branches in refs buffers. + -- User Option: magit-refs-filter-alist - -- Variable: magit-refs-remote-branch-format + This alist controls which tags and branches are omitted from being + displayed in ‘magit-refs-mode’ buffers. If it is ‘nil’, then all + refs are displayed (subject to ‘magit-refs-sections-hook’). - Format used for remote branches in refs buffers. + All keys are tried in order until one matches. Then its value is + used and subsequent elements are ignored. If the value is non-nil, + then the reference is displayed, otherwise it is not. If no + element matches, then the reference is displayed. - -- Variable: magit-refs-tags-format - - Format used for tags in refs buffers. - - -- Variable: magit-refs-indent-cherry-lines - - Indentation of cherries in refs buffers. This should be N-1 where - N is taken from "%Nc" in the above format strings. + A key can either be a regular expression that the refname has to + match, or a function that takes the refname as only argument and + returns a boolean. Contrary to how they are displayed in the + buffer, for comparison each tag begins with "tags/" and each remote + branch with "/". ‘RET’ (‘magit-visit-ref’) @@ -3979,8 +4054,8 @@ having to type out the command name. If Magit-Blame mode is already turned on in the current buffer then blaming is done recursively, by visiting REVISION:FILE (using - ‘magit-find-file’), where REVISION is the revision before the - revision that added the current line or chunk of lines. + ‘magit-find-file’), where REVISION is a parent of the revision that + added the current line or chunk of lines. ‘M-x magit-blame-reverse’ (‘magit-blame-reverse’) @@ -4539,7 +4614,7 @@ those that are already committed. determined in the previous step. Both formats, if non-nil and after removing %N, are then expanded - using ‘git show –format=FORMAT …’ inside TOPLEVEL. + using ‘git show –format=FORMAT ...’ inside TOPLEVEL. The expansion of POINT-FORMAT is inserted at point, and the expansion of EOB-FORMAT is inserted at the end of the buffer (if @@ -4693,6 +4768,7 @@ File: magit.info, Node: Branching, Next: Merging, Prev: Committing, Up: Mani * The Two Remotes:: * The Branch Popup:: * The Branch Config Popup:: +* Auxillary Branch Commands::  File: magit.info, Node: The Two Remotes, Next: The Branch Popup, Up: Branching @@ -4855,7 +4931,7 @@ features are available from separate popups. branch. If FROM is not reachable from ‘HEAD’ or is reachable from the source branch’s upstream, then an error is raised. -‘b R’ (‘magit-branch-pull-request’) +‘b Y’ (‘magit-branch-pull-request’) This command creates and configures a new branch from a Github pull-request, creating and configuring a new remote if necessary. @@ -4957,7 +5033,7 @@ features are available from separate popups. cleanup mentioned in the previous paragraph is not performed if you do that. -‘b r’ (‘magit-checkout-pull-request’) +‘b y’ (‘magit-checkout-pull-request’) This command creates and configures a new branch from a pull request, the same way ‘magit-branch-pull-request’ does. @@ -5112,7 +5188,7 @@ features are available from separate popups. 'magit-branch t)  -File: magit.info, Node: The Branch Config Popup, Prev: The Branch Popup, Up: Branching +File: magit.info, Node: The Branch Config Popup, Next: Auxillary Branch Commands, Prev: The Branch Popup, Up: Branching 6.5.3 The Branch Config Popup ----------------------------- @@ -5261,6 +5337,34 @@ e.g.: ‘magit-read-starting-point’, which includes all commands that change the upstream and many which create new branches. + +File: magit.info, Node: Auxillary Branch Commands, Prev: The Branch Config Popup, Up: Branching + +6.5.4 Auxillary Branch Commands +------------------------------- + +These commands are not available from the branch popup by default. + + -- Command: magit-branch-shelve + + This command shelve a branch. This is done by deleting the branch, + and creating a new reference "refs/shelved/BRANCH-NAME" pointing at + the same commit as the branch pointed at. If the deleted branch + had a reflog, then that is preserved as the reflog of the new + reference. + + This is useful if you want to move a branch out of sight, but are + not ready to completely discard it yet. + + -- Command: magit-branch-unshelve + + This command unshelve a branch that was previously shelved using + ‘magit-branch-shelve’. This is done by deleting the reference + "refs/shelved/BRANCH-NAME" and creating a branch "BRANCH-NAME" + pointing at the same commit as the deleted reference pointed at. + If the deleted reference had a reflog, then that is restored as the + reflog of the branch. +  File: magit.info, Node: Merging, Next: Resolving Conflicts, Prev: Branching, Up: Manipulating @@ -5280,11 +5384,11 @@ following commands. ‘m m’ (‘magit-merge’) - Merge another branch or an arbitrary revision into the current - branch. The branch or revision to be merged is read in the - minibuffer and defaults to the one at point. + This command merges another branch or an arbitrary revision into + the current branch. The branch or revision to be merged is read in + the minibuffer and defaults to the branch at point. - Unless there are conflicts or a prefix argument is used, the + Unless there are conflicts or a prefix argument is used, then the resulting merge commit uses a generic commit message, and the user does not get a chance to inspect or change it before the commit is created. With a prefix argument this does not actually create the @@ -5293,34 +5397,71 @@ following commands. ‘m e’ (‘magit-merge-editmsg’) - Merge another branch or an arbitrary revision into the current - branch and open a commit message buffer, so that the user can make - adjustments. The commit is not actually created until the user - finishes with ‘C-c C-c’. + This command merges another branch or an arbitrary revision into + the current branch and opens a commit message buffer, so that the + user can make adjustments. The commit is not actually created + until the user finishes with ‘C-c C-c’. ‘m n’ (‘magit-merge-nocommit’) - Merge another branch or an arbitrary revision into the current - branch, but do not actually create the commit. The user can then - further adjust the merge, even when automatic conflict resolution - succeeded and/or adjust the commit message. + This command merges another branch or an arbitrary revision into + the current branch, but does not actually create the merge commit. + The user can then further adjust the merge, even when automatic + conflict resolution succeeded and/or adjust the commit message. + +‘m a’ (‘magit-merge-absorb’) + + This command merges another local branch into the current branch + and then removes the former. + + Before the source branch is merged, it is first force pushed to its + push-remote, provided the respective remote branch already exists. + This ensures that the respective pull-request (if any) won’t get + stuck on some obsolete version of the commits that are being + merged. Finally, if ‘magit-branch-pull-request’ was used to create + the merged branch, then the respective remote branch is also + removed. + +‘m i’ (‘magit-merge-into’) + + This command merges the current branch into another local branch + and then removes the former. The latter becomes the new current + branch. + + Before the source branch is merged, it is first force pushed to its + push-remote, provided the respective remote branch already exists. + This ensures that the respective pull-request (if any) won’t get + stuck on some obsolete version of the commits that are being + merged. Finally, if ‘magit-branch-pull-request’ was used to create + the merged branch, then the respective remote branch is also + removed. + +‘m s’ (‘magit-merge-squash’) + + This command squashes the changes introduced by another branch or + an arbitrary revision into the current branch. This only applies + the changes made by the squashed commits. No information is + preserved that would allow creating an actual merge commit. + Instead of this command you should probably use a command from the + apply popup. ‘m p’ (‘magit-merge-preview’) - Preview result of merging another branch or an arbitrary revision - into the current branch. + This command shows a preview of merging another branch or an + arbitrary revision into the current branch. When a merge is in progress, then the popup buffer features these commands instead. ‘m m’ (‘magit-merge’) - After resolving conflicts, proceed with the merge. If there are - still conflicts, then this fails. + After the user resolved conflicts, this command proceeds with the + merge. If some conflicts weren’t resolved, then this command + fails. ‘m a’ (‘magit-merge-abort’) - Abort the current merge operation. + This command aborts the current merge operation.  File: magit.info, Node: Resolving Conflicts, Next: Rebasing, Prev: Merging, Up: Manipulating @@ -5865,6 +6006,59 @@ features the following commands. This command also has a top-level binding, which can be invoked without using the popup by typing ‘a’ at the top-level. + The following commands not only apply some commits to some branch, +but also remove them from some other branch. The removal is performed +using either ‘git-update-ref’ or if necessary ‘git-rebase’. Both +applying commits as well as removing them using ‘git-rebase’ can lead to +conflicts. If that happens, then these commands abort and you not only +have to resolve the conflicts but also finish the process the same way +you would have to if these commands didn’t exist at all. + +‘A h’ (‘magit-cherry-harvest’) + + This command moves the selected COMMITS that must be located on + another BRANCH onto the current branch instead, removing them from + the former. When this command succeeds, then the same branch is + current as before. + + Applying the commits on the current branch or removing them from + the other branch can lead to conflicts. When that happens, then + this command stops and you have to resolve the conflicts and then + finish the process manually. + +‘A d’ (‘magit-cherry-donate’) + + This command moves the selected COMMITS from the current branch + onto another existing BRANCH, removing them from the former. When + this command succeeds, then the same branch is current as before. + + Applying the commits on the other branch or removing them from the + current branch can lead to conflicts. When that happens, then this + command stops and you have to resolve the conflicts and then finish + the process manually. + +‘A n’ (‘magit-cherry-spinout’) + + This command moves the selected COMMITS from the current branch + onto a new branch BRANCH, removing them from the former. When this + command succeeds, then the same branch is current as before. + + Applying the commits on the other branch or removing them from the + current branch can lead to conflicts. When that happens, then this + command stops and you have to resolve the conflicts and then finish + the process manually. + +‘A s’ (‘magit-cherry-spinoff’) + + This command moves the selected COMMITS from the current branch + onto a new branch BRANCH, removing them from the former. When this + command succeeds, then the new branch is checked out. + + Applying the commits on the other branch or removing them from the + current branch can lead to conflicts. When that happens, then this + command stops and you have to resolve the conflicts and then finish + the process manually. + When a cherry-pick or revert is in progress, then the popup buffer features these commands instead. @@ -6162,39 +6356,57 @@ features are available from separate popups. ‘M a’ (‘magit-remote-add’) - Add a remote and fetch it. The remote name and url are read in the - minibuffer. + This command add a remote and fetches it. The remote name and url + are read in the minibuffer. ‘M r’ (‘magit-remote-rename’) - Rename a remote. Both the old and the new names are read in the - minibuffer. + This command renames a remote. Both the old and the new names are + read in the minibuffer. ‘M u’ (‘magit-remote-set-url’) - Change the url of a remote. Both the remote and the new url are - read in the minibuffer. + This command changes the url of a remote. Both the remote and the + new url are read in the minibuffer. ‘M k’ (‘magit-remote-remove’) - Delete a remote, read from the minibuffer. + This command deletes a remote, read in the minibuffer. -‘M p’ (‘magit-remote-prune-refspecs’) +‘M p’ (‘magit-remote-prune’) - Remove stale refspecs and tracking branches for REMOTE. If there - are only stale refspecs, then offer to either delete the remote or - replace the refspecs with the default refspec instead. + This command removes stale remote-tracking branches for a remote + read in the minibuffer. + +‘M P’ (‘magit-remote-prune-refspecs’) + + This command removes stale refspecs for a remote read in the + minibuffer. + + A refspec is stale if there no longer exists at least one branch on + the remote that would be fetched due to that refspec. A stale + refspec is problematic because its existence causes Git to refuse + to fetch according to the remaining non-stale refspecs. + + If only stale refspecs remain, then this command offers to either + delete the remote or to replace the stale refspecs with the default + refspec ("+refs/heads/*:refs/remotes/REMOTE/*"). + + This command also removes the remote-tracking branches that were + created due to the now stale refspecs. Other stale branches are + not removed. -- User Option: magit-remote-add-set-remote.pushDefault - Whether to set the value of ‘remote.pushDefault’ after adding a - remote. + This option controls whether the user is asked whether they want to + set ‘remote.pushDefault’ after adding a remote. - If ‘ask’, then always ask. If ‘ask-if-unset’, then ask, but only - if the variable isn’t set already. If ‘nil’, then don’t ever set. - If the value is a string, then set without asking, provided that - the name of the added remote is equal to that string and the - variable isn’t already set. + If ‘ask’, then users is always ask. If ‘ask-if-unset’, then the + user is only if the variable isn’t set already. If ‘nil’, then the + user isn’t asked and the variable isn’t set. If the value is a + string, then the variable is set without the user being asked, + provided that the name of the added remote is equal to that string + and the variable isn’t already set.  File: magit.info, Node: The Remote Config Popup, Prev: The Remote Popup, Up: Remotes @@ -6661,7 +6873,8 @@ The command ‘magit-list-submodules’ displays a list of the current repository’s submodules in a separate buffer. It’s also possible to display information about submodules directly in the status buffer of the super-repository by adding ‘magit-insert-submodules’ to the hook -‘magit-status-sections-hook’. +‘magit-status-sections-hook’ as described in *note Status Module +Sections::. -- Command: magit-list-submodules @@ -6707,37 +6920,60 @@ File: magit.info, Node: Submodule Popup, Prev: Listing Submodules, Up: Submod This prefix command shows the following suffix commands along with the appropriate infix arguments in a popup buffer. + Some of the below commands default to act on the modules that are +selected using the region. For brevity their description talk about +"the selected modules", but if no modules are selected, then they act on +the current module instead, or if point isn’t on a module, then the read +a single module to act on. With a prefix argument these commands ignore +the selection and the current module and instead act on all suitable +modules. + ‘o a’ (‘magit-submodule-add’) - Add the repository at URL as a submodule. Optional PATH is the - path to the submodule relative to the root of the super-project. - If it is nil then the path is determined based on URL. + This commands adds the repository at URL as a module. Optional + PATH is the path to the module relative to the root of the + super-project. If it is nil then the path is determined based on + URL. -‘o b’ (‘magit-submodule-setup’) +‘o r’ (‘magit-submodule-register’) - Clone and register missing submodules and checkout appropriate - commits. + This command registers the selected modules by copying their urls + from ".gitmodules" to "$GIT_DIR/config". These values can then be + edited before running ‘magit-submodule-populate’. If you don’t + need to edit any urls, then use the latter directly. -‘o i’ (‘magit-submodule-init’) +‘o p’ (‘magit-submodule-populate’) - Register submodules listed in ".gitmodules" into ".git/config". + This command creates the working directory or directories of the + selected modules, checking out the recorded commits. ‘o u’ (‘magit-submodule-update’) - Clone missing submodules and checkout appropriate commits. With a - prefix argument also register submodules in ".git/config". + This command updates the selected modules checking out the recorded + commits. + +‘o s’ (‘magit-submodule-synchronize’) + + This command synchronizes the urls of the selected modules, copying + the values from ".gitmodules" to the ".git/config" of the + super-project as well those of the modules. -‘o s’ (‘magit-submodule-sync’) +‘o d’ (‘magit-submodule-unpopulate’) - Update each submodule’s remote URL according to ".gitmodules". + This command removes the working directory of the selected modules. -‘o f’ (‘magit-submodule-fetch’) +‘o l’ (‘magit-list-submodules’) - Fetch submodule. With a prefix argument fetch all remotes. + This command displays a list of the current repository’s modules. -‘o d’ (‘magit-submodule-deinit’) +‘o f’ (‘magit-fetch-modules’) - Unregister the submodule at PATH. + This command fetches all modules. + + Option ‘magit-fetch-modules-jobs’ controls how many submodules are + being fetched in parallel. Also fetch the super-repository, + because ‘git fetch’ does not support not doing that. With a prefix + argument fetch all remotes.  File: magit.info, Node: Subtree, Next: Common Commands, Prev: Submodules, Up: Miscellaneous @@ -7594,253 +7830,3 @@ need to be able to debug them. therefore lead to an infinite recursion. You probably won’t ever need to use this function. - -File: magit.info, Node: Calling Git for Effect, Prev: Getting a Value from Git, Up: Calling Git - -10.1.2 Calling Git for Effect ------------------------------ - -These functions are used to run git to produce some effect. Most Magit -commands that actually run git do so by using such a function. - - Because we do not need to consume git’s output when using these -functions, their output is instead logged into a per-repository buffer, -which can be shown using ‘$’ from a Magit buffer or ‘M-x magit-process’ -elsewhere. - - These functions can have an effect in two distinct ways. Firstly, -running git may change something, i.e. create or push a new commit. -Secondly, that change may require that Magit buffers are refreshed to -reflect the changed state of the repository. But refreshing isn’t -always desirable, so only some of these functions do perform such a -refresh after git has returned. - - Sometimes it is useful to run git asynchronously. For example, when -the user has just initiated a push, then there is no reason to make her -wait until that has completed. In other cases it makes sense to wait -for git to complete before letting the user do something else. For -example after staging a change it is useful to wait until after the -refresh because that also automatically moves to the next change. - - -- Function: magit-call-git &rest args - - Calls git synchronously with ARGS. - - -- Function: magit-call-process program &rest args - - Calls PROGRAM synchronously with ARGS. - - -- Function: magit-run-git &rest args - - 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’ standard input. - After the process returns a refresh is performed. - - 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. - - 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 - - Calls git synchronously with ARGS. The process’ output is saved in - FILE. This is rarely useful and so this function might be removed - in the future. - - This function actually runs git asynchronously. But then it waits - for the process to return, so the function itself is synchronous. - - -- Function: magit-git &rest args - - Calls git synchronously with ARGS for side-effects only. This - function does not refresh the buffer. - - -- Function: magit-git-wash washer &rest args - - Execute Git with ARGS, inserting washed output at point. Actually - first insert the raw output at point. If there is no output call - ‘magit-cancel-section’. Otherwise temporarily narrow the buffer to - the inserted text, move to its beginning, and then call function - WASHER with ARGS as its sole argument. - - And now for the asynchronous variants. - - -- Function: magit-run-git-async &rest args - - Start Git, prepare for refresh, and return the process object. - ARGS is flattened and then used as arguments to Git. - - Display the command line arguments in the echo area. - - After Git returns some buffers are refreshed: the buffer that was - current when this function was called (if it is a Magit buffer and - still alive), as well as the respective Magit status buffer. - Unmodified buffers visiting files that are tracked in the current - repository are reverted if ‘magit-revert-buffers’ is non-nil. - - -- Function: magit-run-git-with-editor &rest args - - Export GIT_EDITOR and start Git. Also prepare for refresh and - return the process object. ARGS is flattened and then used as - arguments to Git. - - Display the command line arguments in the echo area. - - After Git returns some buffers are refreshed: the buffer that was - 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 - - Start Git, prepare for refresh, and return the process object. - - If INPUT is non-nil, it has to be a buffer or the name of an - existing buffer. The buffer content becomes the processes standard - input. - - Option ‘magit-git-executable’ specifies the Git executable and - option ‘magit-git-global-arguments’ specifies constant arguments. - The remaining arguments ARGS specify arguments to Git. They are - flattened before use. - - After Git returns, some buffers are refreshed: the buffer that was - current when this function was called (if it is a Magit buffer and - still alive), as well as the respective Magit status buffer. - Unmodified buffers visiting files that are tracked in the current - repository are reverted if ‘magit-revert-buffers’ is non-nil. - - -- Function: magit-start-process &rest args - - Start PROGRAM, prepare for refresh, and return the process object. - - If optional argument INPUT is non-nil, it has to be a buffer or the - name of an existing buffer. The buffer content becomes the - processes standard input. - - The process is started using ‘start-file-process’ and then setup to - use the sentinel ‘magit-process-sentinel’ and the filter - ‘magit-process-filter’. Information required by these functions is - stored in the process object. When this function returns the - process has not started to run yet so it is possible to override - the sentinel and filter. - - After the process returns, ‘magit-process-sentinel’ refreshes the - buffer that was current when ‘magit-start-process’ was called (if - it is a Magit buffer and still alive), as well as the respective - Magit status buffer. Unmodified buffers visiting files that are - tracked in the current repository are reverted if - ‘magit-revert-buffers’ is non-nil. - - -- Variable: magit-this-process - - The child process which is about to start. This can be used to - change the filter and sentinel. - - -- Variable: magit-process-raise-error - - When this is non-nil, then ‘magit-process-sentinel’ raises an error - if git exits with a non-zero exit status. For debugging purposes. - - -File: magit.info, Node: Section Plumbing, Next: Refreshing Buffers, Prev: Calling Git, Up: Plumbing - -10.2 Section Plumbing -===================== - -* Menu: - -* Creating Sections:: -* Section Selection:: -* Matching Sections:: - - -File: magit.info, Node: Creating Sections, Next: Section Selection, Up: Section Plumbing - -10.2.1 Creating Sections ------------------------- - - -- Macro: magit-insert-section &rest args - - Insert a section at point. - - TYPE is the section type, a symbol. Many commands that act on the - current section behave differently depending on that type. Also if - a variable ‘magit-TYPE-section-map’ exists, then use that as the - text-property ‘keymap’ of all text belonging to the section (but - this may be overwritten in subsections). TYPE can also have the - form ‘(eval FORM)’ in which case FORM is evaluated at runtime. - - Optional VALUE is the value of the section, usually a string that - is required when acting on the section. - - When optional HIDE is non-nil collapse the section body by default, - i.e. when first creating the section, but not when refreshing the - buffer. Otherwise, expand it by default. This can be overwritten - using ‘magit-section-set-visibility-hook’. When a section is - recreated during a refresh, then the visibility of predecessor is - inherited and HIDE is ignored (but the hook is still honored). - - BODY is any number of forms that actually insert the section’s - heading and body. Optional NAME, if specified, has to be a symbol, - which is then bound to the struct of the section being inserted. - - Before BODY is evaluated the ‘start’ of the section object is set - to the value of ‘point’ and after BODY was evaluated its ‘end’ is - set to the new value of ‘point’; BODY is responsible for moving - ‘point’ forward. - - If it turns out inside BODY that the section is empty, then - ‘magit-cancel-section’ can be used to abort and remove all traces - of the partially inserted section. This can happen when creating a - section by washing Git’s output and Git didn’t actually output - anything this time around. - - -- Function: magit-insert-heading &rest args - - Insert the heading for the section currently being inserted. - - This function should only be used inside ‘magit-insert-section’. - - When called without any arguments, then just set the ‘content’ slot - of the object representing the section being inserted to a marker - at ‘point’. The section should only contain a single line when - this function is used like this. - - When called with arguments ARGS, which have to be strings, then - insert those strings at point. The section should not contain any - text before this happens and afterwards it should again only - contain a single line. If the ‘face’ property is set anywhere - inside any of these strings, then insert all of them unchanged. - Otherwise use the ‘magit-section-heading’ face for all inserted - text. - - The ‘content’ property of the section struct is the end of the - heading (which lasts from ‘start’ to ‘content’) and the beginning - of the body (which lasts from ‘content’ to ‘end’). If the value of - ‘content’ is nil, then the section has no heading and its body - cannot be collapsed. If a section does have a heading then its - height must be exactly one line, including a trailing newline - character. This isn’t enforced; you are responsible for getting it - right. The only exception is that this function does insert a - newline character if necessary. - - -- Function: magit-cancel-section - - Cancel the section currently being inserted. This exits the - innermost call to ‘magit-insert-section’ and removes all traces of - what has already happened inside that call. - - -- Function: magit-define-section-jumper sym title &optional value - - Define an interactive function to go to section SYM. TITLE is the - displayed title of the section. - diff --git a/elpa/magit-20180118.313/magit.info-2 b/elpa/magit-20180404.1428/magit.info-2 similarity index 88% rename from elpa/magit-20180118.313/magit.info-2 rename to elpa/magit-20180404.1428/magit.info-2 index 74466e30..0442620c 100644 --- a/elpa/magit-20180118.313/magit.info-2 +++ b/elpa/magit-20180404.1428/magit.info-2 @@ -1,4 +1,4 @@ -This is magit.info, produced by makeinfo version 5.2 from magit.texi. +This is magit.info, produced by makeinfo version 6.1 from magit.texi. Copyright (C) 2015-2018 Jonas Bernoulli @@ -16,6 +16,256 @@ START-INFO-DIR-ENTRY * Magit: (magit). Using Git from Emacs with Magit. END-INFO-DIR-ENTRY + +File: magit.info, Node: Calling Git for Effect, Prev: Getting a Value from Git, Up: Calling Git + +10.1.2 Calling Git for Effect +----------------------------- + +These functions are used to run git to produce some effect. Most Magit +commands that actually run git do so by using such a function. + + Because we do not need to consume git’s output when using these +functions, their output is instead logged into a per-repository buffer, +which can be shown using ‘$’ from a Magit buffer or ‘M-x magit-process’ +elsewhere. + + These functions can have an effect in two distinct ways. Firstly, +running git may change something, i.e. create or push a new commit. +Secondly, that change may require that Magit buffers are refreshed to +reflect the changed state of the repository. But refreshing isn’t +always desirable, so only some of these functions do perform such a +refresh after git has returned. + + Sometimes it is useful to run git asynchronously. For example, when +the user has just initiated a push, then there is no reason to make her +wait until that has completed. In other cases it makes sense to wait +for git to complete before letting the user do something else. For +example after staging a change it is useful to wait until after the +refresh because that also automatically moves to the next change. + + -- Function: magit-call-git &rest args + + Calls git synchronously with ARGS. + + -- Function: magit-call-process program &rest args + + Calls PROGRAM synchronously with ARGS. + + -- Function: magit-run-git &rest args + + 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’ standard input. + After the process returns a refresh is performed. + + 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. + + 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 + + Calls git synchronously with ARGS. The process’ output is saved in + FILE. This is rarely useful and so this function might be removed + in the future. + + This function actually runs git asynchronously. But then it waits + for the process to return, so the function itself is synchronous. + + -- Function: magit-git &rest args + + Calls git synchronously with ARGS for side-effects only. This + function does not refresh the buffer. + + -- Function: magit-git-wash washer &rest args + + Execute Git with ARGS, inserting washed output at point. Actually + first insert the raw output at point. If there is no output call + ‘magit-cancel-section’. Otherwise temporarily narrow the buffer to + the inserted text, move to its beginning, and then call function + WASHER with ARGS as its sole argument. + + And now for the asynchronous variants. + + -- Function: magit-run-git-async &rest args + + Start Git, prepare for refresh, and return the process object. + ARGS is flattened and then used as arguments to Git. + + Display the command line arguments in the echo area. + + After Git returns some buffers are refreshed: the buffer that was + current when this function was called (if it is a Magit buffer and + still alive), as well as the respective Magit status buffer. + Unmodified buffers visiting files that are tracked in the current + repository are reverted if ‘magit-revert-buffers’ is non-nil. + + -- Function: magit-run-git-with-editor &rest args + + Export GIT_EDITOR and start Git. Also prepare for refresh and + return the process object. ARGS is flattened and then used as + arguments to Git. + + Display the command line arguments in the echo area. + + After Git returns some buffers are refreshed: the buffer that was + 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 + + Start Git, prepare for refresh, and return the process object. + + If INPUT is non-nil, it has to be a buffer or the name of an + existing buffer. The buffer content becomes the processes standard + input. + + Option ‘magit-git-executable’ specifies the Git executable and + option ‘magit-git-global-arguments’ specifies constant arguments. + The remaining arguments ARGS specify arguments to Git. They are + flattened before use. + + After Git returns, some buffers are refreshed: the buffer that was + current when this function was called (if it is a Magit buffer and + still alive), as well as the respective Magit status buffer. + Unmodified buffers visiting files that are tracked in the current + repository are reverted if ‘magit-revert-buffers’ is non-nil. + + -- Function: magit-start-process &rest args + + Start PROGRAM, prepare for refresh, and return the process object. + + If optional argument INPUT is non-nil, it has to be a buffer or the + name of an existing buffer. The buffer content becomes the + processes standard input. + + The process is started using ‘start-file-process’ and then setup to + use the sentinel ‘magit-process-sentinel’ and the filter + ‘magit-process-filter’. Information required by these functions is + stored in the process object. When this function returns the + process has not started to run yet so it is possible to override + the sentinel and filter. + + After the process returns, ‘magit-process-sentinel’ refreshes the + buffer that was current when ‘magit-start-process’ was called (if + it is a Magit buffer and still alive), as well as the respective + Magit status buffer. Unmodified buffers visiting files that are + tracked in the current repository are reverted if + ‘magit-revert-buffers’ is non-nil. + + -- Variable: magit-this-process + + The child process which is about to start. This can be used to + change the filter and sentinel. + + -- Variable: magit-process-raise-error + + When this is non-nil, then ‘magit-process-sentinel’ raises an error + if git exits with a non-zero exit status. For debugging purposes. + + +File: magit.info, Node: Section Plumbing, Next: Refreshing Buffers, Prev: Calling Git, Up: Plumbing + +10.2 Section Plumbing +===================== + +* Menu: + +* Creating Sections:: +* Section Selection:: +* Matching Sections:: + + +File: magit.info, Node: Creating Sections, Next: Section Selection, Up: Section Plumbing + +10.2.1 Creating Sections +------------------------ + + -- Macro: magit-insert-section &rest args + + Insert a section at point. + + TYPE is the section type, a symbol. Many commands that act on the + current section behave differently depending on that type. Also if + a variable ‘magit-TYPE-section-map’ exists, then use that as the + text-property ‘keymap’ of all text belonging to the section (but + this may be overwritten in subsections). TYPE can also have the + form ‘(eval FORM)’ in which case FORM is evaluated at runtime. + + Optional VALUE is the value of the section, usually a string that + is required when acting on the section. + + When optional HIDE is non-nil collapse the section body by default, + i.e. when first creating the section, but not when refreshing the + buffer. Otherwise, expand it by default. This can be overwritten + using ‘magit-section-set-visibility-hook’. When a section is + recreated during a refresh, then the visibility of predecessor is + inherited and HIDE is ignored (but the hook is still honored). + + BODY is any number of forms that actually insert the section’s + heading and body. Optional NAME, if specified, has to be a symbol, + which is then bound to the struct of the section being inserted. + + Before BODY is evaluated the ‘start’ of the section object is set + to the value of ‘point’ and after BODY was evaluated its ‘end’ is + set to the new value of ‘point’; BODY is responsible for moving + ‘point’ forward. + + If it turns out inside BODY that the section is empty, then + ‘magit-cancel-section’ can be used to abort and remove all traces + of the partially inserted section. This can happen when creating a + section by washing Git’s output and Git didn’t actually output + anything this time around. + + -- Function: magit-insert-heading &rest args + + Insert the heading for the section currently being inserted. + + This function should only be used inside ‘magit-insert-section’. + + When called without any arguments, then just set the ‘content’ slot + of the object representing the section being inserted to a marker + at ‘point’. The section should only contain a single line when + this function is used like this. + + When called with arguments ARGS, which have to be strings, then + insert those strings at point. The section should not contain any + text before this happens and afterwards it should again only + contain a single line. If the ‘face’ property is set anywhere + inside any of these strings, then insert all of them unchanged. + Otherwise use the ‘magit-section-heading’ face for all inserted + text. + + The ‘content’ property of the section struct is the end of the + heading (which lasts from ‘start’ to ‘content’) and the beginning + of the body (which lasts from ‘content’ to ‘end’). If the value of + ‘content’ is nil, then the section has no heading and its body + cannot be collapsed. If a section does have a heading then its + height must be exactly one line, including a trailing newline + character. This isn’t enforced; you are responsible for getting it + right. The only exception is that this function does insert a + newline character if necessary. + + -- Function: magit-cancel-section + + Cancel the section currently being inserted. This exits the + innermost call to ‘magit-insert-section’ and removes all traces of + what has already happened inside that call. + + -- Function: magit-define-section-jumper sym title &optional value + + Define an interactive function to go to section SYM. TITLE is the + displayed title of the section. +  File: magit.info, Node: Section Selection, Next: Matching Sections, Prev: Creating Sections, Up: Section Plumbing @@ -95,7 +345,7 @@ File: magit.info, Node: Matching Sections, Prev: Section Selection, Up: Secti • ‘[* TYPE...]’ - matches sections that match [TYPE…] and also recursively all + matches sections that match [TYPE...] and also recursively all their child sections. • ‘TYPE’ @@ -124,12 +374,12 @@ File: magit.info, Node: Matching Sections, Prev: Section Selection, Up: Secti Choose among clauses on the type of the section at point. - Each clause looks like (CONDITION BODY…). The type of the section - is compared against each CONDITION; the BODY forms of the first - match are evaluated sequentially and the value of the last form is - returned. Inside BODY the symbol ‘it’ is bound to the section at - point. If no clause succeeds or if there is no section at point - return nil. + Each clause looks like (CONDITION BODY...). The type of the + section is compared against each CONDITION; the BODY forms of the + first match are evaluated sequentially and the value of the last + form is returned. Inside BODY the symbol ‘it’ is bound to the + section at point. If no clause succeeds or if there is no section + at point return nil. See ‘magit-section-match’ for the forms CONDITION can take. Additionally a CONDITION of t is allowed in the final clause and @@ -427,14 +677,14 @@ made it into the manual yet, see * Menu: -* FAQ - How to …?:: +* FAQ - How to ...?:: * FAQ - Issues and Errors::  -File: magit.info, Node: FAQ - How to …?, Next: FAQ - Issues and Errors, Up: FAQ +File: magit.info, Node: FAQ - How to ...?, Next: FAQ - Issues and Errors, Up: FAQ -A.1 FAQ - How to …? -=================== +A.1 FAQ - How to ...? +===================== * Menu: @@ -442,10 +692,10 @@ A.1 FAQ - How to …? * How to install the gitman info manual?:: * How to show diffs for gpg-encrypted files?:: * How does branching and pushing work?:: -* Can Magit be used as ‘ediff-version-control-package’?:: +* Can Magit be used as ediff-version-control-package?::  -File: magit.info, Node: How to show git's output?, Next: How to install the gitman info manual?, Up: FAQ - How to …? +File: magit.info, Node: How to show git's output?, Next: How to install the gitman info manual?, Up: FAQ - How to ...? A.1.1 How to show git’s output? ------------------------------- @@ -462,7 +712,7 @@ debugging purposes, it’s possible to do so anyway by setting ‘magit-git-debug’ to ‘t’.  -File: magit.info, Node: How to install the gitman info manual?, Next: How to show diffs for gpg-encrypted files?, Prev: How to show git's output?, Up: FAQ - How to …? +File: magit.info, Node: How to install the gitman info manual?, Next: How to show diffs for gpg-encrypted files?, Prev: How to show git's output?, Up: FAQ - How to ...? A.1.2 How to install the gitman info manual? -------------------------------------------- @@ -483,7 +733,7 @@ one of the supported packages ‘man’ or ‘woman’, e.g.: (setq magit-view-git-manual-method 'man)  -File: magit.info, Node: How to show diffs for gpg-encrypted files?, Next: How does branching and pushing work?, Prev: How to install the gitman info manual?, Up: FAQ - How to …? +File: magit.info, Node: How to show diffs for gpg-encrypted files?, Next: How does branching and pushing work?, Prev: How to install the gitman info manual?, Up: FAQ - How to ...? A.1.3 How to show diffs for gpg-encrypted files? ------------------------------------------------ @@ -496,7 +746,7 @@ affects the diffs displayed inside Magit. echo "*.gpg filter=gpg diff=gpg" > .gitattributes  -File: magit.info, Node: How does branching and pushing work?, Next: Can Magit be used as ‘ediff-version-control-package’?, Prev: How to show diffs for gpg-encrypted files?, Up: FAQ - How to …? +File: magit.info, Node: How does branching and pushing work?, Next: Can Magit be used as ediff-version-control-package?, Prev: How to show diffs for gpg-encrypted files?, Up: FAQ - How to ...? A.1.4 How does branching and pushing work? ------------------------------------------ @@ -505,7 +755,7 @@ Please see *note Branching:: and  -File: magit.info, Node: Can Magit be used as ‘ediff-version-control-package’?, Prev: How does branching and pushing work?, Up: FAQ - How to …? +File: magit.info, Node: Can Magit be used as ediff-version-control-package?, Prev: How does branching and pushing work?, Up: FAQ - How to ...? A.1.5 Can Magit be used as ‘ediff-version-control-package’? ----------------------------------------------------------- @@ -539,7 +789,7 @@ Instead we provide the more useful command ‘magit-ediff-resolve’ which only shows yet-to-be resolved conflicts.  -File: magit.info, Node: FAQ - Issues and Errors, Prev: FAQ - How to …?, Up: FAQ +File: magit.info, Node: FAQ - Issues and Errors, Prev: FAQ - How to ...?, Up: FAQ A.2 FAQ - Issues and Errors =========================== @@ -553,7 +803,7 @@ A.2 FAQ - Issues and Errors * I am using OS X and SOMETHING works in shell, but not in Magit: I am using OS X and SOMETHING works in shell but not in Magit. * Diffs contain control sequences:: * Expanding a file to show the diff causes it to disappear:: -* Point is wrong in the ‘COMMIT_EDITMSG’ buffer:: +* Point is wrong in the COMMIT_EDITMSG buffer:: * The mode-line information isn't always up-to-date:: * Emacs 24.5 hangs when loading Magit: Emacs 245 hangs when loading Magit. * A branch and tag sharing the same name breaks SOMETHING:: @@ -641,7 +891,7 @@ then you can override these settings just for Magit by using: "-c" "color.diff=false")))  -File: magit.info, Node: Expanding a file to show the diff causes it to disappear, Next: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Prev: Diffs contain control sequences, Up: FAQ - Issues and Errors +File: magit.info, Node: Expanding a file to show the diff causes it to disappear, Next: Point is wrong in the COMMIT_EDITMSG buffer, Prev: Diffs contain control sequences, Up: FAQ - Issues and Errors A.2.7 Expanding a file to show the diff causes it to disappear -------------------------------------------------------------- @@ -651,7 +901,7 @@ probably set that variable for a reason, and should therefore only undo that setting in Magit by customizing ‘magit-git-global-arguments’.  -File: magit.info, Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Next: The mode-line information isn't always up-to-date, Prev: Expanding a file to show the diff causes it to disappear, Up: FAQ - Issues and Errors +File: magit.info, Node: Point is wrong in the COMMIT_EDITMSG buffer, Next: The mode-line information isn't always up-to-date, Prev: Expanding a file to show the diff causes it to disappear, Up: FAQ - Issues and Errors A.2.8 Point is wrong in the ‘COMMIT_EDITMSG’ buffer --------------------------------------------------- @@ -675,7 +925,7 @@ help: (pointback-mode -1))))  -File: magit.info, Node: The mode-line information isn't always up-to-date, Next: Emacs 245 hangs when loading Magit, Prev: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Up: FAQ - Issues and Errors +File: magit.info, Node: The mode-line information isn't always up-to-date, Next: Emacs 245 hangs when loading Magit, Prev: Point is wrong in the COMMIT_EDITMSG buffer, Up: FAQ - Issues and Errors A.2.9 The mode-line information isn’t always up-to-date ------------------------------------------------------- @@ -755,6 +1005,9 @@ issue. Please include all relevant output when reporting an issue. installed packages are loaded. This makes it easier to determine whether some issue lays with Magit or something else. + If you run Magit from its Git repository, then you should be able + to use ‘make emacs-Q’ instead of the output of this command. + ‘M-x magit-debug-git-executable’ (‘magit-debug-git-executable’) This command displays a buffer containing information about the @@ -817,9 +1070,13 @@ Appendix C Keystroke Index * A: Cherry Picking. (line 8) * A A: Cherry Picking. (line 16) * A a: Cherry Picking. (line 23) -* A A <1>: Cherry Picking. (line 36) -* A a <1>: Cherry Picking. (line 44) -* A s: Cherry Picking. (line 40) +* A A <1>: Cherry Picking. (line 89) +* A a <1>: Cherry Picking. (line 97) +* A d: Cherry Picking. (line 53) +* A h: Cherry Picking. (line 41) +* A n: Cherry Picking. (line 64) +* A s: Cherry Picking. (line 75) +* A s <1>: Cherry Picking. (line 93) * B: Bisecting. (line 8) * b: The Branch Popup. (line 12) * B B: Bisecting. (line 16) @@ -833,12 +1090,12 @@ Appendix C Keystroke Index * b l: The Branch Popup. (line 62) * b n: The Branch Popup. (line 45) * B r: Bisecting. (line 47) -* b R: The Branch Popup. (line 113) -* b r: The Branch Popup. (line 215) -* b r <1>: The Branch Popup. (line 243) +* b r: The Branch Popup. (line 243) * B s: Bisecting. (line 24) * b s: The Branch Popup. (line 85) * b x: The Branch Popup. (line 221) +* b Y: The Branch Popup. (line 113) +* b y: The Branch Popup. (line 215) * c: Initiating a Commit. (line 8) * c <1>: Editing Rebase Sequences. (line 72) @@ -995,17 +1252,21 @@ Appendix C Keystroke Index * L w: Refreshing Logs. (line 28) * m: Merging. (line 9) * M: The Remote Popup. (line 13) -* m a: Merging. (line 57) +* m a: Merging. (line 44) +* m a <1>: Merging. (line 94) * M a: The Remote Popup. (line 35) * M C: The Remote Popup. (line 26) * m e: Merging. (line 30) +* m i: Merging. (line 57) * M k: The Remote Popup. (line 50) * m m: Merging. (line 17) -* m m <1>: Merging. (line 52) +* m m <1>: Merging. (line 88) * m n: Merging. (line 37) -* m p: Merging. (line 44) +* m p: Merging. (line 80) * M p: The Remote Popup. (line 54) +* M P: The Remote Popup. (line 59) * M r: The Remote Popup. (line 40) +* m s: Merging. (line 71) * M u: The Remote Popup. (line 45) * M-1: Section Visibility. (line 33) * M-2: Section Visibility. (line 34) @@ -1029,7 +1290,7 @@ Appendix C Keystroke Index * M-x magit-blame-reverse: Blaming. (line 29) * M-x magit-clone: Repository Setup. (line 16) * M-x magit-debug-git-executable: Git Executable. (line 45) -* M-x magit-debug-git-executable <1>: Debugging Tools. (line 27) +* M-x magit-debug-git-executable <1>: Debugging Tools. (line 30) * M-x magit-describe-section: Section Types and Values. (line 13) * M-x magit-describe-section <1>: Matching Sections. (line 6) @@ -1049,7 +1310,7 @@ Appendix C Keystroke Index * M-x magit-version: Git Executable. (line 17) * M-x magit-version <1>: Debugging Tools. (line 10) * M-x magit-wip-commit: Wip Modes. (line 129) -* M-x with-editor-debug: Debugging Tools. (line 35) +* M-x with-editor-debug: Debugging Tools. (line 38) * n: Section Movement. (line 16) * n <1>: Blaming. (line 79) * N: Blaming. (line 83) @@ -1059,19 +1320,20 @@ Appendix C Keystroke Index (line 16) * o: Submodule Popup. (line 6) * O: Subtree. (line 8) -* o a: Submodule Popup. (line 11) +* o a: Submodule Popup. (line 19) * O a: Subtree. (line 20) -* o b: Submodule Popup. (line 17) * O c: Subtree. (line 24) -* o d: Submodule Popup. (line 39) -* o f: Submodule Popup. (line 35) +* o d: Submodule Popup. (line 49) +* o f: Submodule Popup. (line 57) * O f: Subtree. (line 32) -* o i: Submodule Popup. (line 22) +* o l: Submodule Popup. (line 53) * O m: Subtree. (line 28) +* o p: Submodule Popup. (line 33) * O p: Subtree. (line 36) -* o s: Submodule Popup. (line 31) +* o r: Submodule Popup. (line 26) +* o s: Submodule Popup. (line 43) * O s: Subtree. (line 41) -* o u: Submodule Popup. (line 26) +* o u: Submodule Popup. (line 38) * p: Section Movement. (line 10) * p <1>: Blaming. (line 87) * P: Blaming. (line 91) @@ -1110,7 +1372,7 @@ Appendix C Keystroke Index * r u: Rebasing. (line 29) * r w: Rebasing. (line 81) * RET: Diff Buffer. (line 6) -* RET <1>: References Buffer. (line 118) +* RET <1>: References Buffer. (line 166) * RET <2>: Blaming. (line 55) * RET <3>: Editing Rebase Sequences. (line 16) @@ -1305,13 +1567,21 @@ Appendix D Command Index * magit-branch-pull-request: The Branch Popup. (line 113) * magit-branch-rename: The Branch Popup. (line 243) * magit-branch-reset: The Branch Popup. (line 221) +* magit-branch-shelve: Auxillary Branch Commands. + (line 8) * magit-branch-spinoff: The Branch Popup. (line 85) +* magit-branch-unshelve: Auxillary Branch Commands. + (line 19) * magit-checkout: The Branch Popup. (line 37) * magit-checkout-pull-request: The Branch Popup. (line 215) * magit-cherry: Cherries. (line 17) * magit-cherry-apply: Cherry Picking. (line 23) +* magit-cherry-donate: Cherry Picking. (line 53) +* magit-cherry-harvest: Cherry Picking. (line 41) * magit-cherry-pick: Cherry Picking. (line 16) * magit-cherry-pick-popup: Cherry Picking. (line 8) +* magit-cherry-spinoff: Cherry Picking. (line 75) +* magit-cherry-spinout: Cherry Picking. (line 64) * magit-clone: Repository Setup. (line 16) * magit-commit: Initiating a Commit. (line 13) * magit-commit-amend: Initiating a Commit. (line 18) @@ -1329,7 +1599,7 @@ Appendix D Command Index * magit-copy-section-value: Common Commands. (line 10) * magit-cycle-margin-style: Log Margin. (line 60) * magit-debug-git-executable: Git Executable. (line 45) -* magit-debug-git-executable <1>: Debugging Tools. (line 27) +* magit-debug-git-executable <1>: Debugging Tools. (line 30) * magit-describe-section: Section Types and Values. (line 13) * magit-describe-section <1>: Matching Sections. (line 6) @@ -1384,6 +1654,7 @@ Appendix D Command Index * magit-fetch-branch: Fetching. (line 28) * magit-fetch-from-pushremote: Fetching. (line 16) * magit-fetch-from-upstream: Fetching. (line 20) +* magit-fetch-modules: Submodule Popup. (line 57) * magit-fetch-popup: Fetching. (line 11) * magit-fetch-refspec: Fetching. (line 33) * magit-file-checkout: Resetting. (line 37) @@ -1406,7 +1677,8 @@ Appendix D Command Index * magit-kill-this-buffer: Minor Mode for Buffers Visiting Blobs. (line 20) * magit-list-repositories: Repository List. (line 6) -* magit-list-submodules: Listing Submodules. (line 12) +* magit-list-submodules: Listing Submodules. (line 13) +* magit-list-submodules <1>: Submodule Popup. (line 53) * magit-log: Logging. (line 39) * magit-log-all: Logging. (line 58) * magit-log-all-branches: Logging. (line 54) @@ -1432,12 +1704,15 @@ Appendix D Command Index * magit-log-toggle-commit-limit: Log Buffer. (line 53) * magit-margin-popup: Log Margin. (line 47) * magit-merge: Merging. (line 17) -* magit-merge <1>: Merging. (line 52) -* magit-merge-abort: Merging. (line 57) +* magit-merge <1>: Merging. (line 88) +* magit-merge-abort: Merging. (line 94) +* magit-merge-absorb: Merging. (line 44) * magit-merge-editmsg: Merging. (line 30) +* magit-merge-into: Merging. (line 57) * magit-merge-nocommit: Merging. (line 37) * magit-merge-popup: Merging. (line 9) -* magit-merge-preview: Merging. (line 44) +* magit-merge-preview: Merging. (line 80) +* magit-merge-squash: Merging. (line 71) * magit-mode-bury-buffer: Quitting Windows. (line 6) * magit-notes-edit: Notes. (line 13) * magit-notes-merge: Notes. (line 37) @@ -1495,7 +1770,8 @@ Appendix D Command Index * magit-remote-config-popup <1>: The Remote Config Popup. (line 6) * magit-remote-popup: The Remote Popup. (line 13) -* magit-remote-prune-refspecs: The Remote Popup. (line 54) +* magit-remote-prune: The Remote Popup. (line 54) +* magit-remote-prune-refspecs: The Remote Popup. (line 59) * magit-remote-remove: The Remote Popup. (line 50) * magit-remote-rename: The Remote Popup. (line 40) * magit-remote-set-url: The Remote Popup. (line 45) @@ -1547,11 +1823,11 @@ Appendix D Command Index * magit-section-toggle: Section Visibility. (line 9) * magit-section-toggle-children: Section Visibility. (line 68) * magit-section-up: Section Movement. (line 31) -* magit-sequence-abort: Cherry Picking. (line 44) +* magit-sequence-abort: Cherry Picking. (line 97) * magit-sequence-abort <1>: Reverting. (line 38) -* magit-sequence-continue: Cherry Picking. (line 36) +* magit-sequence-continue: Cherry Picking. (line 89) * magit-sequence-continue <1>: Reverting. (line 30) -* magit-sequence-skip: Cherry Picking. (line 40) +* magit-sequence-skip: Cherry Picking. (line 93) * magit-sequence-skip <1>: Reverting. (line 34) * magit-shell-command: Running Git Manually. (line 39) @@ -1590,15 +1866,14 @@ Appendix D Command Index * magit-stash-show <1>: Stashing. (line 76) * magit-stash-worktree: Stashing. (line 25) * magit-status: Status Buffer. (line 22) -* magit-submodule-add: Submodule Popup. (line 11) -* magit-submodule-deinit: Submodule Popup. (line 39) +* magit-submodule-add: Submodule Popup. (line 19) * magit-submodule-fetch: Fetching. (line 42) -* magit-submodule-fetch <1>: Submodule Popup. (line 35) -* magit-submodule-init: Submodule Popup. (line 22) +* magit-submodule-populate: Submodule Popup. (line 33) * magit-submodule-popup: Submodule Popup. (line 6) -* magit-submodule-setup: Submodule Popup. (line 17) -* magit-submodule-sync: Submodule Popup. (line 31) -* magit-submodule-update: Submodule Popup. (line 26) +* magit-submodule-register: Submodule Popup. (line 26) +* magit-submodule-synchronize: Submodule Popup. (line 43) +* magit-submodule-unpopulate: Submodule Popup. (line 49) +* magit-submodule-update: Submodule Popup. (line 38) * magit-subtree-add: Subtree. (line 20) * magit-subtree-add-commit: Subtree. (line 24) * magit-subtree-merge: Subtree. (line 28) @@ -1624,7 +1899,7 @@ Appendix D Command Index (line 28) * magit-version: Git Executable. (line 17) * magit-version <1>: Debugging Tools. (line 10) -* magit-visit-ref: References Buffer. (line 118) +* magit-visit-ref: References Buffer. (line 166) * magit-wip-commit: Wip Modes. (line 129) * magit-wip-log: Wip Modes. (line 69) * magit-wip-log-current: Wip Modes. (line 77) @@ -1634,7 +1909,7 @@ Appendix D Command Index (line 24) * with-editor-cancel <1>: Editing Rebase Sequences. (line 11) -* with-editor-debug: Debugging Tools. (line 35) +* with-editor-debug: Debugging Tools. (line 38) * with-editor-finish: Editing Commit Messages. (line 19) * with-editor-finish <1>: Editing Rebase Sequences. @@ -1671,6 +1946,10 @@ Appendix E Function Index (line 6) * magit-branch-or-checkout: The Branch Popup. (line 347) * magit-branch-orphan: The Branch Popup. (line 342) +* magit-branch-shelve: Auxillary Branch Commands. + (line 8) +* magit-branch-unshelve: Auxillary Branch Commands. + (line 19) * magit-builtin-completing-read: Support for Completion Frameworks. (line 42) * magit-call-git: Calling Git for Effect. @@ -1764,7 +2043,7 @@ Appendix E Function Index * magit-insert-stashes: Status Sections. (line 67) * magit-insert-status-headers: Status Header Sections. (line 12) -* magit-insert-submodules: Listing Submodules. (line 34) +* magit-insert-submodules: Listing Submodules. (line 35) * magit-insert-tags: References Sections. (line 25) * magit-insert-tags-header: Status Header Sections. (line 56) @@ -1783,7 +2062,7 @@ Appendix E Function Index * magit-insert-user-header: Status Header Sections. (line 75) * magit-list-repositories: Repository List. (line 6) -* magit-list-submodules: Listing Submodules. (line 12) +* magit-list-submodules: Listing Submodules. (line 13) * magit-log-maybe-show-more-commits: Section Movement. (line 57) * magit-log-maybe-update-blob-buffer: Section Movement. (line 71) * magit-log-maybe-update-revision-buffer: Section Movement. (line 64) @@ -1963,6 +2242,10 @@ Appendix F Variable Index * magit-log-section-commit-count: Status Sections. (line 112) * magit-log-select-margin: Select from Log. (line 30) * magit-log-show-refname-after-summary: Log Buffer. (line 73) +* magit-module-sections-hook: Status Module Sections. + (line 20) +* magit-module-sections-nested: Status Module Sections. + (line 24) * magit-no-confirm: Action Confirmation. (line 18) * magit-pop-revision-stack-format: Editing Commit Messages. (line 92) @@ -1980,15 +2263,16 @@ Appendix F Variable Index * magit-refresh-function: Refreshing Buffers. (line 48) * magit-refresh-status-buffer: Automatic Refreshing of Magit Buffers. (line 46) -* magit-refs-indent-cherry-lines: References Buffer. (line 113) -* magit-refs-local-branch-format: References Buffer. (line 101) -* magit-refs-margin: References Buffer. (line 41) -* magit-refs-margin-for-tags: References Buffer. (line 67) -* magit-refs-remote-branch-format: References Buffer. (line 105) +* magit-refs-filter-alist: References Buffer. (line 149) +* magit-refs-focus-column-width: References Buffer. (line 74) +* magit-refs-margin: References Buffer. (line 89) +* magit-refs-margin-for-tags: References Buffer. (line 115) +* magit-refs-pad-commit-counts: References Buffer. (line 41) +* magit-refs-primary-column-width: References Buffer. (line 61) * magit-refs-sections-hook: References Sections. (line 13) * magit-refs-show-commit-count: References Buffer. (line 29) -* magit-refs-tags-format: References Buffer. (line 109) -* magit-remote-add-set-remote.pushDefault: The Remote Popup. (line 60) +* magit-refs-show-remote-prefix: References Buffer. (line 54) +* magit-remote-add-set-remote.pushDefault: The Remote Popup. (line 77) * magit-remote-popup-show-variables: The Remote Popup. (line 18) * magit-repolist-columns: Repository List. (line 14) * magit-repository-directories: Status Buffer. (line 30) @@ -1999,9 +2283,10 @@ Appendix F Variable Index * magit-root-section: Matching Sections. (line 80) * magit-save-repository-buffers: Automatic Saving of File-Visiting Buffers. (line 13) -* magit-section-cache-visibility-types: Section Visibility. (line 78) +* magit-section-cache-visibility: Section Visibility. (line 95) +* magit-section-initial-visibility-alist: Section Visibility. (line 78) * magit-section-movement-hook: Section Movement. (line 38) -* magit-section-set-visibility-hook: Section Visibility. (line 87) +* magit-section-set-visibility-hook: Section Visibility. (line 106) * magit-section-show-child-count: Section Options. (line 9) * magit-shell-command-verbose-prompt: Running Git Manually. (line 46) @@ -2011,16 +2296,16 @@ Appendix F Variable Index * magit-status-margin: Status Options. (line 10) * magit-status-refresh-hook: Status Options. (line 6) * magit-status-sections-hook: Status Sections. (line 10) -* magit-submodule-list-columns: Listing Submodules. (line 20) +* magit-submodule-list-columns: Listing Submodules. (line 21) * magit-this-process: Calling Git for Effect. (line 146) -* magit-uniquify-buffer-names: Naming Buffers. (line 67) +* magit-uniquify-buffer-names: Naming Buffers. (line 74) * magit-unstage-committed: Staging and Unstaging. (line 56) * magit-update-other-window-delay: Section Movement. (line 89) * magit-use-sticky-arguments: Popup Buffers and Prefix Commands. (line 36) -* magit-visit-ref-behavior: References Buffer. (line 129) +* magit-visit-ref-behavior: References Buffer. (line 177) * magit-wip-after-apply-mode: Wip Modes. (line 99) * magit-wip-after-apply-mode-lighter: Wip Modes. (line 141) * magit-wip-after-save-local-mode-lighter: Wip Modes. (line 137) diff --git a/elpa/magit-popup-20180329.1302/dir b/elpa/magit-popup-20180329.1302/dir new file mode 100644 index 00000000..c276dafb --- /dev/null +++ b/elpa/magit-popup-20180329.1302/dir @@ -0,0 +1,18 @@ +This is the file .../info/dir, which contains the +topmost node of the Info hierarchy, called (dir)Top. +The first time you invoke Info you start off looking at this node. + +File: dir, Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs" visits the Emacs manual, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: + +Emacs +* Magit-Popup: (magit-popup). Infix arguments with feedback. diff --git a/elpa/magit-popup-20180329.1302/magit-popup-autoloads.el b/elpa/magit-popup-20180329.1302/magit-popup-autoloads.el new file mode 100644 index 00000000..de27c3ee --- /dev/null +++ b/elpa/magit-popup-20180329.1302/magit-popup-autoloads.el @@ -0,0 +1,16 @@ +;;; magit-popup-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("magit-popup-pkg.el" "magit-popup.el") +;;;;;; (23238 5900 659502 226000)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; magit-popup-autoloads.el ends here diff --git a/elpa/magit-popup-20180329.1302/magit-popup-pkg.el b/elpa/magit-popup-20180329.1302/magit-popup-pkg.el new file mode 100644 index 00000000..a388a3ac --- /dev/null +++ b/elpa/magit-popup-20180329.1302/magit-popup-pkg.el @@ -0,0 +1,10 @@ +(define-package "magit-popup" "20180329.1302" "Define prefix-infix-suffix command combos" + '((emacs "24.4") + (async "1.9.2") + (dash "2.13.0")) + :keywords + '("bindings") + :url "https://github.com/magit/magit-popup") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/magit-popup-20180329.1302/magit-popup.el b/elpa/magit-popup-20180329.1302/magit-popup.el new file mode 100644 index 00000000..b5d12f78 --- /dev/null +++ b/elpa/magit-popup-20180329.1302/magit-popup.el @@ -0,0 +1,1363 @@ +;;; magit-popup.el --- Define prefix-infix-suffix command combos -*- lexical-binding: t -*- + +;; Copyright (C) 2010-2018 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. + +;; This library was inspired by and replaces library `magit-key-mode', +;; which was written by Phil Jackson and is +;; distributed under the GNU General Public License version 3 or later. + +;; Author: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli + +;; Package-Requires: ((emacs "24.4") (async "1.9.2") (dash "2.13.0")) +;; Keywords: bindings +;; Homepage: https://github.com/magit/magit-popup + +;; Magit-Popup is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Magit-Popup is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Magit-Popup. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; This package implements a generic interface for toggling switches +;; and setting options and then invoking an Emacs command which does +;; something with these arguments. The prototypical use is for the +;; command to call an external process, passing on the arguments as +;; command line arguments. But this is only one of many possible +;; uses (though the one this library is optimized for). + +;; With the Emacs concept of "prefix arguments" in mind this could be +;; described as "infix arguments with feedback in a buffer". + +;; Commands that set the prefix argument for the subsequent command do +;; not limit what that next command could be. But entering a command +;; console popup does limit the selection to the commands defined for +;; that popup, and so we use the term "infix" instead of "prefix". + +;;; Code: + +(require 'button) +(require 'cl-lib) +(require 'dash) +(require 'format-spec) +(eval-when-compile (require 'subr-x)) + +(and (require 'async-bytecomp nil t) + (cl-intersection '(all magit) + (bound-and-true-p async-bytecomp-allowed-packages)) + (fboundp 'async-bytecomp-package-mode) + (async-bytecomp-package-mode 1)) + +(declare-function info 'info) +(declare-function Man-find-section 'man) +(declare-function Man-next-section 'man) + +;; For branch actions. +(declare-function magit-branch-set-face 'magit-git) + +;;; Settings +;;;; Custom Groups + +(defgroup magit-popup nil + "Infix arguments with a popup as feedback." + :link '(info-link "(magit-popup)") + :group 'bindings) + +(defgroup magit-popup-faces nil + "Faces used by Magit-Popup." + :group 'magit-popup) + +;;;; Custom Options + +(defcustom magit-popup-display-buffer-action '((display-buffer-below-selected)) + "The action used to display a popup buffer. + +Popup buffers are displayed using `display-buffer' with the value +of this option as ACTION argument. You can also set this to nil +and instead add an entry to `display-buffer-alist'." + :package-version '(magit-popup . "2.4.0") + :group 'magit-popup + :type 'sexp) + +(defcustom magit-popup-manpage-package + (if (memq system-type '(windows-nt ms-dos)) 'woman 'man) + "The package used to display manpages. +One of `man' or `woman'." + :group 'magit-popup + :type '(choice (const man) (const woman))) + +(defcustom magit-popup-show-help-echo t + "Show usage information in the echo area." + :group 'magit-popup + :type 'boolean) + +(defcustom magit-popup-show-common-commands nil + "Whether to initially show section with commands common to all popups. +This section can also be toggled temporarily using \ +\\\\[magit-popup-toggle-show-common-commands]." + :package-version '(magit-popup . "2.9.0") + :group 'magit-popup + :type 'boolean) + +(defcustom magit-popup-use-prefix-argument 'default + "Control how prefix arguments affect infix argument popups. + +This option controls the effect that the use of a prefix argument +before entering a popup has. + +`default' With a prefix argument directly invoke the popup's + default action (an Emacs command), instead of bringing + up the popup. + +`popup' With a prefix argument bring up the popup, otherwise + directly invoke the popup's default action. + +`nil' Ignore prefix arguments." + :group 'magit-popup + :type '(choice + (const :tag "Call default action instead of showing popup" default) + (const :tag "Show popup instead of calling default action" popup) + (const :tag "Ignore prefix argument" nil))) + +;;;; Custom Faces + +(defface magit-popup-heading + '((t :inherit font-lock-keyword-face)) + "Face for key mode header lines." + :group 'magit-popup-faces) + +(defface magit-popup-key + '((t :inherit font-lock-builtin-face)) + "Face for key mode buttons." + :group 'magit-popup-faces) + +(defface magit-popup-argument + '((t :inherit font-lock-warning-face)) + "Face used to display enabled arguments in popups." + :group 'magit-popup-faces) + +(defface magit-popup-disabled-argument + '((t :inherit shadow)) + "Face used to display disabled arguments in popups." + :group 'magit-popup-faces) + +(defface magit-popup-option-value + '((t :inherit font-lock-string-face)) + "Face used to display option values in popups." + :group 'magit-popup-faces) + +;;;; Keymap + +(defvar magit-popup-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [remap self-insert-command] 'magit-invoke-popup-action) + (define-key map (kbd "- ") 'magit-invoke-popup-switch) + (define-key map (kbd "= ") 'magit-invoke-popup-option) + (define-key map (kbd "C-g") 'magit-popup-quit) + (define-key map (kbd "?") 'magit-popup-help) + (define-key map (kbd "C-h k") 'magit-popup-help) + (define-key map (kbd "C-h i") 'magit-popup-info) + (define-key map (kbd "C-t") 'magit-popup-toggle-show-common-commands) + (define-key map (kbd "C-c C-c") 'magit-popup-set-default-arguments) + (define-key map (kbd "C-x C-s") 'magit-popup-save-default-arguments) + (cond ((featurep 'jkl) + (define-key map (kbd "C-p") 'universal-argument) + (define-key map [return] 'push-button) + (define-key map (kbd "C-i") 'backward-button) + (define-key map (kbd "C-k") 'forward-button)) + (t + (define-key map (kbd "C-m") 'push-button) + (define-key map (kbd "DEL") 'backward-button) + (define-key map (kbd "C-p") 'backward-button) + (define-key map (kbd "C-i") 'forward-button) + (define-key map (kbd "C-n") 'forward-button))) + map) + "Keymap for `magit-popup-mode'. + +\\\ +This keymap contains bindings common to all popups. A section +listing these commands can be shown or hidden using \ +\\[magit-popup-toggle-show-common-commands]. + +The prefix used to toggle any switch can be changed by binding +another key to `magit-invoke-popup-switch'. Likewise binding +another key to `magit-invoke-popup-option' changes the prefixed +used to set any option. The two prefixes have to be different. +If you change these bindings, you should also change the `prefix' +property of the button types `magit-popup-switch-button' and +`magit-popup-option-button'. + +If you change any other binding, then you might have to also edit +`magit-popup-common-commands' for things to align correctly in +the section listing these commands. + +Never bind an alphabetic character in this keymap or you might +make it impossible to invoke certain actions.") + +(defvar magit-popup-common-commands + '(("Set defaults" magit-popup-set-default-arguments) + ("View popup manual" magit-popup-info) + ("Toggle this section" magit-popup-toggle-show-common-commands) + ("Save defaults" magit-popup-save-default-arguments) + (" Popup help prefix" magit-popup-help) + ("Abort" magit-popup-quit))) + +;;;; Buttons + +(define-button-type 'magit-popup-button + 'face nil + 'action (lambda (button) + (funcall (button-get button 'function) + (button-get button 'event)))) + +(define-button-type 'magit-popup-switch-button + 'supertype 'magit-popup-button + 'function 'magit-invoke-popup-switch + 'property :switches + 'heading "Switches\n" + 'formatter 'magit-popup-format-argument-button + 'format " %k %d (%a)" + 'prefix ?- + 'maxcols 1) + +(define-button-type 'magit-popup-option-button + 'supertype 'magit-popup-button + 'function 'magit-invoke-popup-option + 'property :options + 'heading "Options\n" + 'formatter 'magit-popup-format-argument-button + 'format " %k %d (%a%v)" + 'prefix ?= + 'maxcols 1) + +(define-button-type 'magit-popup-variable-button + 'supertype 'magit-popup-button + 'function 'magit-invoke-popup-action + 'property :variables + 'heading "Variables\n" + 'formatter 'magit-popup-format-variable-button + 'format " %k %d" + 'prefix nil + 'maxcols 1) + +(define-button-type 'magit-popup-action-button + 'supertype 'magit-popup-button + 'function 'magit-invoke-popup-action + 'property :actions + 'heading "Actions\n" + 'formatter 'magit-popup-format-action-button + 'format " %k %d" + 'prefix nil + 'maxcols :max-action-columns) + +(define-button-type 'magit-popup-command-button + 'supertype 'magit-popup-action-button + 'formatter 'magit-popup-format-command-button + 'action (lambda (button) + (let ((command (button-get button 'function))) + (unless (eq command 'push-button) + (call-interactively command))))) + +(define-button-type 'magit-popup-internal-command-button + 'supertype 'magit-popup-command-button + 'heading "Common Commands\n" + 'maxcols 3) + +;;; Events + +(defvar-local magit-this-popup nil + "The popup which is currently active. +This is intended for internal use only. +Don't confuse this with `magit-current-popup'.") + +(defvar-local magit-this-popup-events nil + "The events known to the active popup. +This is intended for internal use only. +Don't confuse this with `magit-current-popup-args'.") + +(defvar-local magit-previous-popup nil) + +(defvar-local magit-pre-popup-buffer nil + "The buffer that was current before invoking the active popup.") + +(defun magit-popup-get (prop) + "While a popup is active, get the value of PROP." + (if (memq prop '(:switches :options :variables :actions)) + (plist-get magit-this-popup-events prop) + (plist-get (symbol-value magit-this-popup) prop))) + +(defun magit-popup-put (prop val) + "While a popup is active, set the value of PROP to VAL." + (if (memq prop '(:switches :options :variables :actions)) + (setq magit-this-popup-events + (plist-put magit-this-popup-events prop val)) + (error "Property %s isn't supported" prop))) + +(defvar magit-current-popup nil + "The popup from which this editing command was invoked. + +Use this inside the `interactive' form of a popup aware command +to determine whether it was invoked from a popup and if so from +which popup. If the current command was invoked without the use +of a popup, then this is nil.") + +(defvar magit-current-popup-action nil + "The popup action now being executed.") + +(defvar magit-current-popup-args nil + "The value of the popup arguments for this editing command. + +If the current command was invoked from a popup, then this is +a list of strings of all the set switches and options. This +includes arguments which are set by default not only those +explicitly set during this invocation. + +When the value is nil, then that can be because no argument is +set, or because the current command wasn't invoked from a popup; +consult `magit-current-popup' to tell the difference. + +Generally it is better to use `NAME-arguments', which is created +by `magit-define-popup', instead of this variable or the function +by the same name, because `NAME-argument' uses the default value +for the arguments when the editing command is invoked directly +instead of from a popup. When the command is bound in several +popups that might not be feasible though.") + +(defun magit-current-popup-args (&rest filter) + "Return the value of the popup arguments for this editing command. + +The value is the same as that of the variable by the same name +\(which see), except that FILTER is applied. FILTER is a list +of regexps; only arguments that match one of them are returned. +The first element of FILTER may also be `:not' in which case +only arguments that don't match any of the regexps are returned, +or `:only' which doesn't change the behaviour." + (let ((-compare-fn (lambda (a b) (magit-popup-arg-match b a)))) + (-filter (if (eq (car filter) :not) + (lambda (arg) (not (-contains-p (cdr filter) arg))) + (when (eq (car filter) :only) + (pop filter)) + (lambda (arg) (-contains-p filter arg))) + magit-current-popup-args))) + +(defvar magit-current-pre-popup-buffer nil + "The buffer that was current before invoking the active popup. +This is bound when invoking an action or variable.") + +(defmacro magit-with-pre-popup-buffer (&rest body) + "Execute the forms in BODY in the buffer that current before the popup. +If `magit-current-pre-popup-buffer' is non-nil use that, else if +`magit-pre-popup-buffer' is non-nil use that, otherwise (when no +popup is involved) execute the forms in the current buffer." + (declare (indent 0)) + `(--if-let (or magit-current-pre-popup-buffer magit-pre-popup-buffer) + (with-current-buffer it ,@body) + ,@body)) + +(defun magit-popup-arg-match (pattern string) + (if (or (string-match-p "=$" pattern) + (string-match-p "^-[A-Z]$" pattern)) + (string-match (format "^%s\\(.*\\)$" pattern) string) + (string-equal string pattern))) + +(cl-defstruct magit-popup-event key dsc arg fun use val) + +(defun magit-popup-event-keydsc (ev) + (let ((key (magit-popup-event-key ev))) + (key-description (if (vectorp key) key (vector key))))) + +(defun magit-popup-lookup (event type) + (--first (equal (magit-popup-event-key it) event) + (-filter 'magit-popup-event-p (magit-popup-get type)))) + +(defun magit-popup-get-args () + (--mapcat (when (and (magit-popup-event-p it) + (magit-popup-event-use it)) + (list (format "%s%s" + (magit-popup-event-arg it) + (or (magit-popup-event-val it) "")))) + (append (magit-popup-get :switches) + (magit-popup-get :options)))) + +(defmacro magit-popup-convert-events (def form) + (declare (indent 1) (debug (form form))) + `(--map (if (or (null it) (stringp it) (functionp it)) it ,form) ,def)) + +(defun magit-popup-convert-switches (val def) + (magit-popup-convert-events def + (let ((a (nth 2 it))) + (make-magit-popup-event + :key (car it) :dsc (cadr it) :arg a + :use (and (member a val) t) + ;; For arguments implemented in lisp, this function's + ;; doc-string is used by `magit-popup-help'. That is + ;; the only thing it is used for. + :fun (and (string-prefix-p "\+\+" a) (nth 3 it)))))) + +(defun magit-popup-convert-options (val def) + (magit-popup-convert-events def + (let* ((a (nth 2 it)) + (r (format "^%s\\(.*\\)" a)) + (v (--first (string-match r it) val))) + (make-magit-popup-event + :key (car it) :dsc (cadr it) :arg a + :use (and v t) :val (and v (match-string 1 v)) + :fun (or (nth 3 it) 'read-from-minibuffer))))) + +(defun magit-popup-convert-variables (_val def) + (magit-popup-convert-events def + (make-magit-popup-event + :key (car it) :dsc (cadr it) :fun (nth 2 it) :arg (nth 3 it)))) + +(defun magit-popup-convert-actions (_val def) + (magit-popup-convert-events def + (make-magit-popup-event + :key (car it) :dsc (cadr it) :fun (nth 2 it)))) + +;;; Define + +(defmacro magit-define-popup (name doc &rest args) + "Define a popup command named NAME. + +NAME should begin with the package prefix and by convention end +with `-popup'. That name is used for the actual command as well +as for a variable used internally. DOC is used as the doc-string +of that command. + +Also define an option and a function named `SHORTNAME-arguments', +where SHORTNAME is NAME with the trailing `-popup' removed. The +name of this option and this function can be overwritten using +the optional argument OPTION, but that is rarely advisable. As a +special case if OPTION is specified but nil, do not define this +option and this function at all. + +The option `SHORTNAME-arguments' holds the default value for the +popup arguments. It can be customized from within the popup or +using the Custom interface. + +The function `SHORTNAME-arguments' is a wrapper around the +variable `magit-current-popup-args', both of which are intended +to be used inside the `interactive' form of commands commonly +invoked from the popup `NAME'. When such a command is invoked +from that popup, then the function `SHORTNAME-arguments' returns +the value of the variable `magit-current-popup-args'; however +when the command is invoked directly, then it returns the default +value of the variable `SHORTNAME-arguments'. + +Optional argument GROUP specifies the Custom group into which the +option is placed. If omitted, then the option is placed into some +group the same way it is done when directly using `defcustom' and +omitting the group, except when NAME begins with \"magit-\", in +which case the group `magit-git-arguments' is used. + +Optional argument MODE is deprecated, instead use the keyword +arguments `:setup-function' and/or `:refresh-function'. If MODE +is non-nil, then it specifies the mode used by the popup buffer, +instead of the default, which is `magit-popup-mode'. + +The remaining arguments should have the form + + [KEYWORD VALUE]... + +The following keywords are meaningful (and by convention are +usually specified in that order): + +`:actions' + The actions which can be invoked from the popup. VALUE is a + list whose members have the form (KEY DESC COMMAND), see + `magit-define-popup-action' for details. + + Actions are regular Emacs commands, which usually have an + `interactive' form setup to consume the values of the popup + `:switches' and `:options' when invoked from the corresponding + popup, else when invoked as the default action or directly + without using the popup, the default value of the variable + `SHORTNAME-arguments'. This is usually done by calling the + function `SHORTNAME-arguments'. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, which + is used as the heading, or nil, in which case the section is + not inserted. + + Members of VALUE may also be nil. This should only be used + together with `:max-action-columns' and allows having gaps in + the action grid, which can help arranging actions sensibly. + +`:default-action' + The default action of the popup which is used directly instead + of displaying the popup buffer, when the popup is invoked with + a prefix argument. Also see `magit-popup-use-prefix-argument' + and `:use-prefix', which can be used to inverse the meaning of + the prefix argument. + +`:use-prefix' + Controls when to display the popup buffer and when to invoke + the default action (if any) directly. This overrides the + global default set using `magit-popup-use-prefix-argument'. + The value, if specified, should be one of `default' or `popup', + or a function that is called with no arguments and returns one + of these symbols. + +`:max-action-columns' + The maximum number of actions to display on a single line, a + number or a function that returns a number and takes the name + of the section currently being inserted as argument. If there + isn't enough room to display as many columns as specified here, + then fewer are used. + +`:switches' + The popup arguments which can be toggled on and off. VALUE + is a list whose members have the form (KEY DESC SWITCH), see + `magit-define-popup-switch' for details. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, which + is used as the heading, or nil, in which case the section is + not inserted. + +`:options' + The popup arguments which take a value, as in \"--opt=OPTVAL\". + VALUE is a list whose members have the form (KEY DESC OPTION + READER), see `magit-define-popup-option' for details. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, which + is used as the heading, or nil, in which case the section is + not inserted. + +`:default-arguments' + The default arguments, a list of switches (which are then + enabled by default) and options with there default values, as + in \"--OPT=OPTVAL\". + +`:variables' + + Git variables which can be set from the popup. VALUE is a list + whose members have the form (KEY DESC COMMAND FORMATTER), see + `magit-define-popup-variable' for details. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, which + is used as the heading, or nil, in which case the section is + not inserted. + + Members of VALUE may also be actions as described above for + `:actions'. + + VALUE may also be a function that returns a list as describe + above. + +`:sequence-predicate' + When this function returns non-nil, then the popup uses + `:sequence-actions' instead of `:actions', and does not show + the `:switches' and `:options'. + +`:sequence-actions' + The actions which can be invoked from the popup, when + `:sequence-predicate' returns non-nil. + +`:setup-function' + When this function is specified, then it is used instead of + `magit-popup-default-setup'. + +`:refresh-function' + When this function is specified, then it is used instead of + calling `magit-popup-insert-section' three times with symbols + `magit-popup-switch-button', `magit-popup-option-button', and + finally `magit-popup-action-button' as argument. + +`:man-page' + The name of the manpage to be displayed when the user requests + help for a switch or argument. + +\(fn NAME DOC [GROUP [MODE [OPTION]]] :KEYWORD VALUE...)" + (declare (indent defun) (doc-string 2)) + (let* ((str (symbol-name name)) + (grp (if (keywordp (car args)) + (and (string-prefix-p "magit-" str) ''magit-git-arguments) + (pop args))) + (mode (and (not (keywordp (car args))) (pop args))) + (opt (if (keywordp (car args)) + (intern (concat (if (string-suffix-p "-popup" str) + (substring str 0 -6) + str) + "-arguments")) + (eval (pop args))))) + `(progn + (defun ,name (&optional arg) ,doc + (interactive "P") + (magit-invoke-popup ',name ,mode arg)) + (defvar ,name + (list :variable ',opt ,@args)) + (magit-define-popup-keys-deferred ',name) + ,@(when opt + `((defcustom ,opt (plist-get ,name :default-arguments) + "" + ,@(and grp (list :group grp)) + :type '(repeat (string :tag "Argument"))) + (defun ,opt () + (if (eq magit-current-popup ',name) + magit-current-popup-args + ,opt)) + (put ',opt 'definition-name ',name)))))) + +(defun magit-define-popup-switch (popup key desc switch + &optional enable at prepend) + "In POPUP, define KEY as SWITCH. + +POPUP is a popup command defined using `magit-define-popup'. +SWITCH is a string representing an argument that takes no value. +KEY is a character representing the second event in the sequence +of keystrokes used to toggle the argument. (The first event, the +prefix, is shared among all switches, defaults to -, and can be +changed in `magit-popup-mode-keymap'). + +DESC is a string describing the purpose of the argument, it is +displayed in the popup. + +If optional ENABLE is non-nil, then the switch is on by default. + +SWITCH is inserted after all other switches already defined for +POPUP, unless optional PREPEND is non-nil, in which case it is +placed first. If optional AT is non-nil, then it should be the +KEY of another switch already defined for POPUP, the argument +is then placed before or after AT, depending on PREPEND." + (declare (indent defun)) + (magit-define-popup-key popup :switches key + (list desc switch enable) at prepend)) + +(defun magit-define-popup-option (popup key desc option + &optional reader value at prepend) + "In POPUP, define KEY as OPTION. + +POPUP is a popup command defined using `magit-define-popup'. +OPTION is a string representing an argument that takes a value. +KEY is a character representing the second event in the sequence +of keystrokes used to set the argument's value. (The first +event, the prefix, is shared among all options, defaults to =, +and can be changed in `magit-popup-mode-keymap'). + +DESC is a string describing the purpose of the argument, it is +displayed in the popup. + +If optional VALUE is non-nil then the option is on by default, +and VALUE is its default value. + +READER is used to read a value from the user when the option is +invoked and does not currently have a value. It should take one +argument and use it as the prompt. If this is nil, then +`read-from-minibuffer' is used. + +OPTION is inserted after all other options already defined for +POPUP, unless optional PREPEND is non-nil, in which case it is +placed first. If optional AT is non-nil, then it should be the +KEY of another option already defined for POPUP, the argument +is then placed before or after AT, depending on PREPEND." + (declare (indent defun)) + (magit-define-popup-key popup :options key + (list desc option reader value) at prepend)) + +(defun magit-define-popup-variable (popup key desc command formatter + &optional at prepend) + "In POPUP, define KEY as COMMAND. + +POPUP is a popup command defined using `magit-define-popup'. +COMMAND is a command which calls `magit-popup-set-variable'. +FORMATTER is a function which calls `magit-popup-format-variable'. +These two functions have to be called with the same arguments. + +KEY is a character representing the event used interactively call +the COMMAND. + +DESC is the variable or a representation thereof. It's not +actually used for anything. + +COMMAND is inserted after all other commands already defined for +POPUP, unless optional PREPEND is non-nil, in which case it is +placed first. If optional AT is non-nil, then it should be the +KEY of another command already defined for POPUP, the command +is then placed before or after AT, depending on PREPEND." + (declare (indent defun)) + (magit-define-popup-key popup :variables key + (list desc command formatter) at prepend)) + +(defun magit-define-popup-action (popup key desc command + &optional at prepend) + "In POPUP, define KEY as COMMAND. + +POPUP is a popup command defined using `magit-define-popup'. +COMMAND can be any command but should usually consume the popup +arguments in its `interactive' form. +KEY is a character representing the event used invoke the action, +i.e. to interactively call the COMMAND. + +DESC is a string describing the purpose of the action, it is +displayed in the popup. + +COMMAND is inserted after all other commands already defined for +POPUP, unless optional PREPEND is non-nil, in which case it is +placed first. If optional AT is non-nil, then it should be the +KEY of another command already defined for POPUP, the command +is then placed before or after AT, depending on PREPEND." + (declare (indent defun)) + (magit-define-popup-key popup :actions key + (list desc command) at prepend)) + +(defun magit-define-popup-sequence-action + (popup key desc command &optional at prepend) + "Like `magit-define-popup-action' but for `:sequence-action'." + (declare (indent defun)) + (magit-define-popup-key popup :sequence-actions key + (list desc command) at prepend)) + +(defconst magit-popup-type-plural-alist + '((:switch . :switches) + (:option . :options) + (:variable . :variables) + (:action . :actions) + (:sequence-action . :sequence-actions))) + +(defun magit-popup-pluralize-type (type) + (or (cdr (assq type magit-popup-type-plural-alist)) + type)) + +(defun magit-define-popup-key + (popup type key def &optional at prepend) + "In POPUP, define KEY as an action, switch, or option. +It's better to use one of the specialized functions + `magit-define-popup-action', + `magit-define-popup-sequence-action', + `magit-define-popup-switch', + `magit-define-popup-option', or + `magit-define-popup-variable'." + (declare (indent defun)) + (setq type (magit-popup-pluralize-type type)) + (if (memq type '(:switches :options :variables :actions :sequence-actions)) + (if (boundp popup) + (let* ((plist (symbol-value popup)) + (value (plist-get plist type)) + (elt (assoc key value))) + (if elt + (setcdr elt def) + (setq elt (cons key def))) + (if at + (when (setq at (cl-member at value :key 'car-safe :test 'equal)) + (setq value (cl-delete key value :key 'car-safe :test 'equal)) + (if prepend + (progn (push (car at) (cdr at)) + (setcar at elt)) + (push elt (cdr at)))) + (setq value (cl-delete key value :key 'car-safe :test 'equal))) + (unless (assoc key value) + (setq value (if prepend + (cons elt value) + (append value (list elt))))) + (set popup (plist-put plist type value))) + (push (list type key def at prepend) + (get popup 'magit-popup-deferred))) + (error "Unknown popup event type: %s" type))) + +(defun magit-define-popup-keys-deferred (popup) + (dolist (args (get popup 'magit-popup-deferred)) + (condition-case err + (apply #'magit-define-popup-key popup args) + ((debug error) + (display-warning 'magit (error-message-string err) :error)))) + (put popup 'magit-popup-deferred nil)) + +(defun magit-change-popup-key (popup type from to) + "In POPUP, bind TO to what FROM was bound to. +TYPE is one of `:action', `:sequence-action', `:switch', or +`:option'. Bind TO and unbind FROM, both are characters." + (--if-let (assoc from (plist-get (symbol-value popup) + (magit-popup-pluralize-type type))) + (setcar it to) + (message "magit-change-popup-key: FROM key %c is unbound" from))) + +(defun magit-remove-popup-key (popup type key) + "In POPUP, remove KEY's binding of TYPE. +POPUP is a popup command defined using `magit-define-popup'. +TYPE is one of `:action', `:sequence-action', `:switch', or +`:option'. KEY is the character which is to be unbound." + (setq type (magit-popup-pluralize-type type)) + (let* ((plist (symbol-value popup)) + (alist (plist-get plist type)) + (value (assoc key alist))) + (set popup (plist-put plist type (delete value alist))))) + +;;; Invoke + +(defvar-local magit-popup-previous-winconf nil) + +(defun magit-invoke-popup (popup mode arg) + (let* ((def (symbol-value popup)) + (val (symbol-value (plist-get def :variable))) + (default (plist-get def :default-action)) + (local (plist-get def :use-prefix)) + (local (if (functionp local) + (funcall local) + local)) + (use-prefix (or local magit-popup-use-prefix-argument))) + (cond + ((or (and (eq use-prefix 'default) arg) + (and (eq use-prefix 'popup) (not arg))) + (if default + (let ((magit-current-popup (list popup 'default)) + (magit-current-popup-args + (let ((magit-this-popup popup) + (magit-this-popup-events nil)) + (magit-popup-default-setup val def) + (magit-popup-get-args)))) + (when (and arg (listp arg)) + (setq current-prefix-arg (and (not (= (car arg) 4)) + (list (/ (car arg) 4))))) + (call-interactively default)) + (message "%s has no default action; showing popup instead." popup) + (magit-popup-mode-setup popup mode))) + ((memq use-prefix '(default popup nil)) + (magit-popup-mode-setup popup mode) + (when magit-popup-show-help-echo + (message + (format + "[%s] show common commands, [%s] describe events, [%s] show manual" + (propertize "C-t" 'face 'magit-popup-key) + (propertize "?" 'face 'magit-popup-key) + (propertize "C-h i" 'face 'magit-popup-key))))) + (local + (error "Invalid :use-prefix popup property value: %s" use-prefix)) + (t + (error "Invalid magit-popup-use-prefix-argument value: %s" use-prefix))))) + +(defun magit-invoke-popup-switch (event) + (interactive (list last-command-event)) + (--if-let (magit-popup-lookup event :switches) + (progn + (setf (magit-popup-event-use it) + (not (magit-popup-event-use it))) + (magit-refresh-popup-buffer)) + (user-error "%c isn't bound to any switch" event))) + +(defun magit-invoke-popup-option (event) + (interactive (list last-command-event)) + (--if-let (magit-popup-lookup event :options) + (progn + (if (magit-popup-event-use it) + (setf (magit-popup-event-use it) nil) + (let* ((arg (magit-popup-event-arg it)) + (val (funcall + (magit-popup-event-fun it) + (concat arg (unless (string-match-p "=$" arg) ": ")) + (magit-popup-event-val it)))) + (setf (magit-popup-event-use it) t) + (setf (magit-popup-event-val it) val))) + (magit-refresh-popup-buffer)) + (user-error "%c isn't bound to any option" event))) + +(defun magit-invoke-popup-action (event) + (interactive (list last-command-event)) + (let ((action (magit-popup-lookup event :actions)) + (variable (magit-popup-lookup event :variables))) + (when (and variable (not (magit-popup-event-arg variable))) + (setq action variable) + (setq variable nil)) + (cond ((or action variable) + (let* ((magit-current-popup magit-this-popup) + (magit-current-popup-args (magit-popup-get-args)) + (magit-current-pre-popup-buffer magit-pre-popup-buffer) + (command (magit-popup-event-fun (or action variable))) + (magit-current-popup-action command)) + (when action + (magit-popup-quit)) + (setq this-command command) + (call-interactively command) + (unless action + (magit-refresh-popup-buffer)))) + ((eq event ?q) + (magit-popup-quit) + (when magit-previous-popup + (magit-popup-mode-setup magit-previous-popup nil))) + (t + (user-error "%c isn't bound to any action" event))))) + +(defun magit-popup-quit () + "Quit the current popup command without invoking an action." + (interactive) + (let ((winconf magit-popup-previous-winconf)) + (if (derived-mode-p 'magit-popup-mode) + (kill-buffer) + (magit-popup-help-mode -1) + (kill-local-variable 'magit-popup-previous-winconf)) + (when winconf + (set-window-configuration winconf)))) + +(defun magit-popup-read-number (prompt &optional default) + "Like `read-number' but DEFAULT may be a numeric string." + (read-number prompt (if (stringp default) + (string-to-number default) + default))) + +;;; Save + +(defun magit-popup-set-default-arguments (arg) + "Set default value for the arguments for the current popup. +Then close the popup without invoking an action; unless a prefix +argument is used in which case the popup remains open. + +For a popup named `NAME-popup' that usually means setting the +value of the custom option `NAME-arguments'." + (interactive "P") + (-if-let (var (magit-popup-get :variable)) + (progn (customize-set-variable var (magit-popup-get-args)) + (unless arg (magit-popup-quit))) + (user-error "Nothing to set"))) + +(defun magit-popup-save-default-arguments (arg) + "Save default value for the arguments for the current popup. +Then close the popup without invoking an action; unless a prefix +argument is used in which case the popup remains open. + +For a popup named `NAME-popup' that usually means saving the +value of the custom option `NAME-arguments'." + (interactive "P") + (-if-let (var (magit-popup-get :variable)) + (progn (customize-save-variable var (magit-popup-get-args)) + (unless arg (magit-popup-quit))) + (user-error "Nothing to save"))) + +;;; Help + +(defun magit-popup-toggle-show-common-commands () + "Show or hide an additional section with common commands. +The commands listed in this section are common to all popups +and are defined in `magit-popup-mode-map' (which see)." + (interactive) + (setq magit-popup-show-common-commands + (not magit-popup-show-common-commands)) + (magit-refresh-popup-buffer) + (fit-window-to-buffer)) + +(defun magit-popup-help () + "Show help for the argument or action at point." + (interactive) + (let* ((man (magit-popup-get :man-page)) + (key (read-key-sequence + (concat "Describe key" (and man " (? for manpage)") ": "))) + (int (aref key (1- (length key)))) + (def (or (lookup-key (current-local-map) key t) + (lookup-key (current-global-map) key)))) + (pcase def + (`magit-invoke-popup-switch + (--if-let (magit-popup-lookup int :switches) + (if (and (string-prefix-p "++" (magit-popup-event-arg it)) + (magit-popup-event-fun it)) + (magit-popup-describe-function (magit-popup-event-fun it)) + (magit-popup-manpage man it)) + (user-error "%c isn't bound to any switch" int))) + (`magit-invoke-popup-option + (--if-let (magit-popup-lookup int :options) + (if (and (string-prefix-p "++" (magit-popup-event-arg it)) + (magit-popup-event-fun it)) + (magit-popup-describe-function (magit-popup-event-fun it)) + (magit-popup-manpage man it)) + (user-error "%c isn't bound to any option" int))) + (`magit-popup-help + (magit-popup-manpage man nil)) + ((or `self-insert-command + `magit-invoke-popup-action) + (setq def (or (magit-popup-lookup int :actions) + (magit-popup-lookup int :variables))) + (if def + (magit-popup-describe-function (magit-popup-event-fun def)) + (ding) + (message nil))) + (`nil (ding) + (message nil)) + (_ (magit-popup-describe-function def))))) + +(defun magit-popup-manpage (topic arg) + (unless topic + (user-error "No man page associated with %s" + (magit-popup-get :man-page))) + (when arg + (setq arg (magit-popup-event-arg arg)) + (when (string-prefix-p "--" arg) + ;; handle '--' option and the '--[no-]' shorthand + (setq arg (cond ((string= "-- " arg) + "\\(?:\\[--\\] \\)?<[^[:space:]]+>\\.\\.\\.") + ((string-prefix-p "--no-" arg) + (concat "--" + "\\[?no-\\]?" + (substring arg 5))) + (t + (concat "--" + "\\(?:\\[no-\\]\\)?" + (substring arg 2))))))) + (let ((winconf (current-window-configuration)) buffer) + (pcase magit-popup-manpage-package + (`woman (delete-other-windows) + (split-window-below) + (with-no-warnings ; display-buffer-function is obsolete + (let ((display-buffer-alist nil) + (display-buffer-function nil) + (display-buffer-overriding-action nil)) + (woman topic))) + (setq buffer (current-buffer))) + (`man (cl-letf (((symbol-function #'fboundp) (lambda (_) nil))) + (setq buffer (man topic))) + (delete-other-windows) + (split-window-below) + (set-window-buffer (selected-window) buffer))) + (with-current-buffer buffer + (setq magit-popup-previous-winconf winconf) + (magit-popup-help-mode) + (fit-window-to-buffer (next-window)) + (if (and arg + (Man-find-section "OPTIONS") + (let ((case-fold-search nil) + ;; This matches preceding/proceeding options. + ;; Options such as '-a', '-S[]', and + ;; '--grep=' are matched by this regex + ;; without the shy group. The '. ' in the shy + ;; group is for options such as '-m + ;; parent-number', and the '-[^[:space:]]+ ' is + ;; for options such as '--mainline parent-number' + (others "-\\(?:. \\|-[^[:space:]]+ \\)?[^[:space:]]+")) + (re-search-forward + ;; should start with whitespace, and may have any + ;; number of options before/after + (format "^[\t\s]+\\(?:%s, \\)*?\\(?1:%s\\)%s\\(?:, %s\\)*$" + others + ;; options don't necessarily end in an '=' + ;; (e.g., '--gpg-sign[=]') + (string-remove-suffix "=" arg) + ;; Simple options don't end in an '='. + ;; Splitting this into 2 cases should make + ;; getting false positives less likely. + (if (string-suffix-p "=" arg) + ;; [^[:space:]]*[^.[:space:]] matches + ;; the option value, which is usually + ;; after the option name and either '=' + ;; or '[='. The value can't end in a + ;; period, as that means it's being used + ;; at the end of a sentence. The space + ;; is for options such as '--mainline + ;; parent-number'. + "\\(?: \\|\\[?=\\)[^[:space:]]*[^.[:space:]]" + ;; Either this doesn't match anything + ;; (e.g., '-a'), or the option is followed + ;; by a value delimited by a '[', '<', or + ;; ':'. A space might appear before this + ;; value, as in '-f '. The space + ;; alternative is for options such as '-m + ;; parent-number'. + "\\(?:\\(?: \\| ?[\\[<:]\\)[^[:space:]]*[^.[:space:]]\\)?") + others) + nil + t))) + (goto-char (match-beginning 1)) + (goto-char (point-min)))))) + +(defun magit-popup-describe-function (function) + (let ((winconf (current-window-configuration))) + (delete-other-windows) + (split-window-below) + (other-window 1) + (with-no-warnings ; display-buffer-function is obsolete + (let ((display-buffer-alist '(("" display-buffer-use-some-window))) + (display-buffer-function nil) + (display-buffer-overriding-action nil) + (help-window-select nil)) + (describe-function function))) + (fit-window-to-buffer) + (other-window 1) + (setq magit-popup-previous-winconf winconf) + (magit-popup-help-mode))) + +(defun magit-popup-info () + "Show the popup manual." + (interactive) + (let ((winconf (current-window-configuration))) + (delete-other-windows) + (split-window-below) + (info "(magit-popup.info)Usage") + (magit-popup-help-mode) + (setq magit-popup-previous-winconf winconf)) + (magit-popup-help-mode) + (fit-window-to-buffer (next-window))) + +(define-minor-mode magit-popup-help-mode + "Auxiliary minor mode used to restore previous window configuration. +When some sort of help buffer is created from within a popup, +then this minor mode is turned on in that buffer, so that when +the user quits it, the previous window configuration is also +restored." + :keymap '(([remap Man-quit] . magit-popup-quit) + ([remap Info-exit] . magit-popup-quit) + ([remap quit-window] . magit-popup-quit))) + +;;; Modes + +(define-derived-mode magit-popup-mode fundamental-mode "MagitPopup" + "Major mode for infix argument popups." + :mode 'magit-popup + (setq truncate-lines t) + (setq buffer-read-only t) + (setq-local scroll-margin 0) + (setq-local magit-popup-show-common-commands magit-popup-show-common-commands) + (hack-dir-local-variables-non-file-buffer)) + +(put 'magit-popup-mode 'mode-class 'special) + +(defun magit-popup-default-setup (val def) + (if (--when-let (magit-popup-get :sequence-predicate) + (funcall it)) + (magit-popup-put :actions (magit-popup-convert-actions + val (magit-popup-get :sequence-actions))) + (let ((vars (plist-get def :variables))) + (when (functionp vars) + (setq vars (funcall vars))) + (when vars + (magit-popup-put :variables (magit-popup-convert-variables val vars)))) + (magit-popup-put :switches (magit-popup-convert-switches + val (plist-get def :switches))) + (magit-popup-put :options (magit-popup-convert-options + val (plist-get def :options))) + (magit-popup-put :actions (magit-popup-convert-actions + val (plist-get def :actions))))) + +(defun magit-popup-mode-setup (popup mode) + (setq magit-previous-popup magit-current-popup) + (let ((val (symbol-value (plist-get (symbol-value popup) :variable))) + (def (symbol-value popup)) + (buf (current-buffer))) + (magit-popup-mode-display-buffer (get-buffer-create + (format "*%s*" popup)) + (or mode 'magit-popup-mode)) + (setq magit-this-popup popup) + (setq magit-pre-popup-buffer buf) + (if (bound-and-true-p magit-popup-setup-hook) ; obsolete + (run-hook-with-args 'magit-popup-setup-hook val def) + (funcall (or (magit-popup-get :setup-function) + 'magit-popup-default-setup) + val def))) + (magit-refresh-popup-buffer) + (fit-window-to-buffer nil nil (line-number-at-pos (point-max)))) + +(defun magit-popup-mode-display-buffer (buffer mode) + (let ((winconf (current-window-configuration))) + (select-window (display-buffer buffer magit-popup-display-buffer-action)) + (funcall mode) + (setq magit-popup-previous-winconf winconf))) + +(defvar magit-refresh-popup-buffer-hook nil + "Hook run by `magit-refresh-popup-buffer'. + +The hook is run right after inserting the representation of the +popup events but before optionally inserting the representation +of events shared by all popups and before point is adjusted.") + +(defun magit-refresh-popup-buffer () + (let* ((inhibit-read-only t) + (button (button-at (point))) + (prefix (and button (button-get button 'prefix))) + (event (and button (button-get button 'event)))) + (erase-buffer) + (save-excursion + (--if-let (magit-popup-get :refresh-function) + (funcall it) + (magit-popup-insert-section 'magit-popup-variable-button) + (magit-popup-insert-section 'magit-popup-switch-button) + (magit-popup-insert-section 'magit-popup-option-button) + (magit-popup-insert-section 'magit-popup-action-button)) + (run-hooks 'magit-refresh-popup-buffer-hook) + (when magit-popup-show-common-commands + (magit-popup-insert-command-section + 'magit-popup-internal-command-button + magit-popup-common-commands))) + (set-buffer-modified-p nil) + (when event + (while (and (ignore-errors (forward-button 1)) + (let ((b (button-at (point)))) + (or (not (equal (button-get b 'prefix) prefix)) + (not (equal (button-get b 'event) event))))))))) + +;;; Draw + +(defvar magit-popup-min-padding 3 + "Minimal amount of whitespace between columns in popup buffers.") + +(defun magit-popup-insert-section (type &optional spec heading) + (if (not spec) + (progn (setq spec (magit-popup-get (button-type-get type 'property))) + (when spec + (if (or (stringp (car spec)) + (functionp (car spec))) + (--each (--partition-by-header + (or (stringp it) (functionp it)) + spec) + (magit-popup-insert-section type (cdr it) (car it))) + (magit-popup-insert-section type spec)))) + (let* ((formatter (button-type-get type 'formatter)) + (items (mapcar (lambda (ev) + (and ev (or (funcall formatter type ev) '("")))) + (or spec (magit-popup-get + (button-type-get type 'property))))) + (maxcols (button-type-get type 'maxcols)) + (pred (magit-popup-get :sequence-predicate))) + (when items + (if (functionp heading) + (when (setq heading (funcall heading)) + (insert heading ?\n)) + (unless heading + (setq heading (button-type-get type 'heading))) + (insert (propertize heading 'face 'magit-popup-heading)) + (unless (string-match "\n$" heading) + (insert "\n"))) + (if (and pred (funcall pred)) + (setq maxcols nil) + (cl-typecase maxcols + (keyword (setq maxcols (magit-popup-get maxcols))) + (symbol (setq maxcols (symbol-value maxcols))))) + (when (functionp maxcols) + (setq maxcols (funcall maxcols heading))) + (when heading + (let ((colwidth + (+ (apply 'max (mapcar (lambda (e) (length (car e))) items)) + magit-popup-min-padding))) + (dolist (item items) + (unless (bolp) + (let ((padding (- colwidth (% (current-column) colwidth)))) + (if (and (< (+ (current-column) padding colwidth) + (window-width)) + (< (ceiling (/ (current-column) (* colwidth 1.0))) + (or maxcols 1000))) + (insert (make-string padding ?\s)) + (insert "\n")))) + (unless (equal item '("")) + (if item + (apply 'insert-button item) + (insert ?\s))))) + (insert (if (= (char-before) ?\n) "\n" "\n\n"))))))) + +(defun magit-popup-format-argument-button (type ev) + (list (format-spec + (button-type-get type 'format) + `((?k . ,(propertize (concat + (--when-let (button-type-get type 'prefix) + (char-to-string it)) + (magit-popup-event-keydsc ev)) + 'face 'magit-popup-key)) + (?d . ,(magit-popup-event-dsc ev)) + (?a . ,(propertize (magit-popup-event-arg ev) + 'face (if (magit-popup-event-use ev) + 'magit-popup-argument + 'magit-popup-disabled-argument))) + (?v . ,(let ((val (magit-popup-event-val ev))) + (if (and (magit-popup-event-use ev) + (not (equal val ""))) + (propertize (format "\"%s\"" val) + 'face 'magit-popup-option-value) + ""))))) + 'type type 'event (magit-popup-event-key ev))) + +(defun magit-popup-format-variable-button (type ev) + (if (not (magit-popup-event-arg ev)) + (magit-popup-format-action-button 'magit-popup-action-button ev) + (list (format-spec + (button-type-get type 'format) + `((?k . ,(propertize (magit-popup-event-keydsc ev) + 'face 'magit-popup-key)) + (?d . ,(funcall (magit-popup-event-arg ev))))) + 'type type 'event (magit-popup-event-key ev)))) + +(defun magit-popup-format-action-button (type ev) + (let* ((dsc (magit-popup-event-dsc ev)) + (fun (and (functionp dsc) dsc))) + (when fun + (setq dsc + (-when-let (branch (funcall fun)) + (if (text-property-not-all 0 (length branch) 'face nil branch) + branch + (magit-branch-set-face branch))))) + (when dsc + (list (format-spec + (button-type-get type 'format) + `((?k . ,(propertize (magit-popup-event-keydsc ev) + 'face 'magit-popup-key)) + (?d . ,dsc) + (?D . ,(if (and (not fun) + (eq (magit-popup-event-fun ev) + (magit-popup-get :default-action))) + (propertize dsc 'face 'bold) + dsc)))) + 'type type 'event (magit-popup-event-key ev))))) + +(defun magit-popup-insert-command-section (type spec) + (magit-popup-insert-section + type (mapcar (lambda (elt) + (list (car (where-is-internal (cadr elt) + (current-local-map))) + (car elt))) + spec))) + +(defun magit-popup-format-command-button (type elt) + (nconc (magit-popup-format-action-button + type (make-magit-popup-event :key (car elt) + :dsc (cadr elt))) + (list 'function (lookup-key (current-local-map) (car elt))))) + +;;; Utilities + +(defun magit-popup-import-file-args (args files) + (if files + (cons (concat "-- " (mapconcat #'identity files ",")) args) + args)) + +(defun magit-popup-export-file-args (args) + (let ((files (--first (string-prefix-p "-- " it) args))) + (when files + (setq args (remove files args)) + (setq files (split-string (substring files 3) ","))) + (list args files))) + +(defconst magit-popup-font-lock-keywords + (eval-when-compile + `((,(concat "(\\(magit-define-popup\\)\\_>" + "[ \t'\(]*" + "\\(\\(?:\\sw\\|\\s_\\)+\\)?") + (1 'font-lock-keyword-face) + (2 'font-lock-function-name-face nil t))))) + +(font-lock-add-keywords 'emacs-lisp-mode magit-popup-font-lock-keywords) + +;;; _ +(provide 'magit-popup) +;; Local Variables: +;; indent-tabs-mode: nil +;; End: +;;; magit-popup.el ends here diff --git a/elpa/magit-popup-20180329.1302/magit-popup.info b/elpa/magit-popup-20180329.1302/magit-popup.info new file mode 100644 index 00000000..e5cae82b --- /dev/null +++ b/elpa/magit-popup-20180329.1302/magit-popup.info @@ -0,0 +1,740 @@ +This is magit-popup.info, produced by makeinfo version 6.1 from +magit-popup.texi. + + Copyright (C) 2015-2018 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-Popup: (magit-popup). Infix arguments with feedback. +END-INFO-DIR-ENTRY + + +File: magit-popup.info, Node: Top, Next: Introduction, Up: (dir) + +Magit-Popup User Manual +*********************** + +Taking inspiration from regular prefix commands and prefix arguments, +this library implements a similar abstraction; a new kind of prefix +command that is associated with a specific set of infix arguments and +suffix commands. + +This manual is for Magit-Popup version 2.12.2 (v2.12.2-6-gbd04ebd+1). + + Copyright (C) 2015-2018 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. + +* Menu: + +* Introduction:: +* Usage:: +* Defining Prefix and Suffix Commands:: + +— The Detailed Node Listing — + +Usage + +* Customizing Existing Popups:: +* Other Options:: + +Defining Prefix and Suffix Commands + +* Defining Prefix Commands:: +* Defining Suffix Commands:: + + + +File: magit-popup.info, Node: Introduction, Next: Usage, Prev: Top, Up: Top + +1 Introduction +************** + +Taking inspiration from regular prefix commands and prefix arguments, +this library implements a similar abstraction; a new kind of prefix +command that is associated with a specific set of infix arguments and +suffix commands. + + Invoking such a prefix command displays a popup buffer which lists +the associated infix arguments and suffix commands. In that buffer each +argument is prefixed with the key sequence that can be used to toggle it +or change its value. Likewise each suffix command is prefixed with the +key used to invoke it. Such a popup buffer might look like this: + + ,----------------------------------------- + |Switches + | -l Show graph (--graph) + | -d Show refnames (--decorate) + | + |Options + | =m Search messages (--grep="popup") + | =p Search patches (-G) + | + |Action + | l Show log for current branch + | o Show log for another branch + '----------------------------------------- + + The user could then for example type ‘-l’ to toggle the ‘--graph’ +*switch* (when it is on then it is shown in green, otherwise in gray), +or ‘=m’ to change the value of the *option* ‘--grep’. + + Once all arguments are as desired one invokes a suffix command, which +causes the popup buffer to disappear. The suffix command should then +retrieve the infix arguments in its ‘interactive’ form like this is done +for prefix arguments. + + While such "prefix-infix-suffix" combos were inspired by regular +prefix commands and prefix arguments, they are also quite different. +This should illustrate the most basic differences: + + • A regular prefix command + + /- command1 + prefix --- command2 + \- command3 + + • Prefix arguments + + /- command1 + C-u ... --- command2 + \- well any command + + • A Prefix-Infix-Suffix combo + + /- argument1 -\ /- suffix1 + prefix----- argument2 --+-- suffix2 + ^ \- argument3 -/ + | | + '--------' + (refresh buffer) + + This library was written as a replacement for ‘magit-key-mode’, which +was used in Magit releases before 2.1.0. It is used to implement all +"popups" in the current Magit release but a future release will switch +to yet another implementation. + + This library does not depend on any other Magit libraries and it is +distributed as a separate package, which makes it possible to use it in +packages that are not related to Magit. But keep in mind that it will +be deprecated eventually. + + +File: magit-popup.info, Node: Usage, Next: Defining Prefix and Suffix Commands, Prev: Introduction, Up: Top + +2 Usage +******* + +Every popup buffers created with a prefix command contains a section +named "Actions" listing the available suffix commands. Most buffers +also contain a "Switches" and/or an "Options" section which list the two +types of infix arguments separately. + + Switches are arguments that can be toggled on or off. When a switch +is active then it is shown in color, when it is off then it is shown in +gray (of course the details depend on the color theme in use). + + Options are arguments that have a value. When an option has a value +then that is shown after the option itself. Because for some options +the empty string is a valid value, options are additionally colorized +like switches to indicate whether they are active or not. + + The events bound to suffix commands are always single alphabetic +characters. The bindings for arguments are always two events long. For +switches the first key is always ‘-’, for options it is always ‘=’. The +second key is always an alphabetic character. + + By default popup buffers also feature a section listing commands +common to all popups. To avoid conflicts with suffix commands, the +bindings of these common commands are not alphabetic characters. This +section is shown by default so that documentation-resistant users get a +chance to notice them. + + -- User Option: magit-popup-show-common-commands + + This option controls whether the section that lists the commands + that are common to all popups is initially shown. + + By default this is not the case, but note that you can temporarily + show this section using ‘C-t’, which therefore is the only common + command you actually have to memorize. + +‘C-t’ (‘magit-popup-toggle-show-common-commands’) + + Show or hide the section listing the commands shared by all popups. + +‘C-g’ (‘magit-popup-quit’) + + Quit popup buffer without invoking a suffix command. + + Without further action, setting arguments only affects the next +suffix command. Invoking the same prefix command again resets the +arguments to their default value, but the defaults can be changed +directly from the popup buffer itself. For a prefix command named +‘NAME-popup’ the default values are stored as the value of the custom +option named ‘NAME-arguments’. While this option can be customized +using the Custom interface, it is better to do so directly from the +popup buffer. + +‘C-c C-c’ (‘magit-popup-set-default-arguments’) + + This sets the default value for the arguments for the current + popup. + + Then the popup buffer is closed without invoking a suffix command; + unless a prefix argument is used in which case the popup remains + open. + +‘C-x C-s’ (‘magit-popup-save-default-arguments’) + + This sets the default value for the arguments for the current popup + and saves it for future Emacs sessions. + + Then the popup buffer is closed without invoking an action; unless + a prefix argument is used in which case the popup remains open. + + It is also possible to add additional arguments and commands to an +existing popup, but that cannot be done directly from the popup (or the +Custom interface). See *note Customizing Existing Popups::. + + Documentation about a popup’s arguments and commands can be shown +directly from the popup. + +‘C-h i’ (‘magit-popup-info’) + + Show this manual. + +‘?’ (‘magit-popup-help’) + + This command reads a key sequence and then shows the documentation + of the argument or command that sequence is bound to. In other + words type the same keys that you would use to invoke the argument + or command, but prefix the sequence with ‘?’. + + For suffix commands this shows the doc-string. For arguments this + command can only show something for popups that have an associated + man-page. If the man-page is set, then this command displays it in + a separate buffer and puts point on the entry about the argument in + question. + + The buffer which is used to display the documentation is selected. + Simply press ‘q’ to leave that buffer and restore the old window + configuration. + + While it isn’t very useful, it is possible to move around in a popup +buffer using ‘C-p’ and ‘C-n’, and to invoke the argument or command at +point using ‘RET’. But it is much more efficient to use the dedicated +key bindings instead, so these commands are not listed in popup buffers +along with the other common commands. + +* Menu: + +* Customizing Existing Popups:: +* Other Options:: + + +File: magit-popup.info, Node: Customizing Existing Popups, Next: Other Options, Up: Usage + +2.1 Customizing Existing Popups +=============================== + +It is possible to define additional infix arguments and suffix commands +to an existing popup using the following functions. + + You can find some examples which use the below commands at +. + + -- Function: magit-define-popup-switch popup key desc switch &optional + enable at prepend + + In POPUP, define KEY as SWITCH. + + POPUP is a popup command defined using ‘magit-define-popup’. + SWITCH is a string representing an argument that takes no value. + KEY is a character representing the second event in the sequence of + keystrokes used to toggle the argument. (The first event, the + prefix, is shared among all switches, defaults to ‘-’, and can be + changed in ‘magit-popup-mode-keymap’). + + DESC is a string describing the purpose of the argument, it is + displayed in the popup. + + If optional ENABLE is non-nil then the switch is on by default. + + SWITCH is inserted after all other switches already defined for + POPUP, unless optional PREPEND is non-nil, in which case it is + placed first. If optional AT is non-nil then it should be the KEY + of another switch already defined for POPUP, the argument is then + placed before or after AT, depending on PREPEND. + + -- Function: magit-define-popup-option popup key desc option &optional + reader value at prepend + + In POPUP, define KEY as OPTION. + + POPUP is a popup command defined using ‘magit-define-popup’. + OPTION is a string representing an argument that takes a value. + KEY is a character representing the second event in the sequence of + keystrokes used to set the argument’s value. (The first event, the + prefix, is shared among all options, defaults to ‘=’, and can be + changed in ‘magit-popup-mode-keymap’). + + DESC is a string describing the purpose of the argument, it is + displayed in the popup. + + If optional VALUE is non-nil then the option is on by default, and + VALUE is its default value. + + READER is used to read a value from the user when the option is + invoked and does not currently have a value. It should take one + argument and use it as the prompt. If this is nil, then + ‘read-from-minibuffer’ is used. + + OPTION is inserted after all other options already defined for + POPUP, unless optional PREPEND is non-nil, in which case it is + placed first. If optional AT is non-nil then it should be the KEY + of another option already defined for POPUP, the argument is then + placed before or after AT, depending on PREPEND. + + -- Function: magit-define-popup-action popup key desc command &optional + at prepend + + In POPUP, define KEY as COMMAND. + + POPUP is a popup command defined using ‘magit-define-popup’. + COMMAND can be any command but should usually consume the popup + arguments in its ‘interactive’ form. KEY is a character + representing the event used invoke the action, i.e. to + interactively call the COMMAND. + + DESC is a string describing the purpose of the action, it is + displayed in the popup. + + COMMAND is inserted after all other commands already defined for + POPUP, unless optional PREPEND is non-nil, in which case it is + placed first. If optional AT is non-nil then it should be the KEY + of another command already defined for POPUP, the command is then + placed before or after AT, depending on PREPEND. + + -- Function: magit-define-popup-sequence-action popup key desc command + &optional at prepend + + Like ‘magit-define-popup-action’, but modifies the value of the + ‘:sequence-actions’ property instead of ‘:actions’. + + -- Function: magit-define-popup-variable popup key desc command + formatter &optional at prepend + + In POPUP, define KEY as COMMAND. + + POPUP is a popup command defined using ‘magit-define-popup’. + COMMAND is a command which calls ‘magit-popup-set-variable’. + FORMATTER is a function which calls ‘magit-popup-format-variable’. + These two functions have to be called with the same arguments. + + KEY is a character representing the event used interactively call + the COMMAND. + + DESC is the variable or a representation thereof. It’s not + actually used for anything. + + COMMAND is inserted after all other commands already defined for + POPUP, unless optional PREPEND is non-nil, in which case it is + placed first. If optional AT is non-nil then it should be the KEY + of another command already defined for POPUP, the command is then + placed before or after AT, depending on PREPEND." + + -- Function: magit-change-popup-key popup type from to + + In POPUP, bind TO to what FROM was bound to. TYPE is one of + ‘:action’, ‘:sequence-action’, ‘:switch’, or ‘:option’. Bind TO + and unbind FROM, both are characters. + + -- Function: magit-remove-popup-key popup type key + + In POPUP, remove KEY’s binding of TYPE. POPUP is a popup command + defined using ‘magit-define-popup’. TYPE is one of ‘:action’, + ‘:sequence-action’, ‘:switch’, or ‘:option’. KEY is the character + which is to be unbound. + + It is also possible to change other aspects of a popup by setting a +property using ‘plist-put’. See *note Defining Prefix Commands:: for +valid properties. The most likely change Magit users might want to make +is: + + (plist-put magit-show-refs-popup :use-prefix nil) + + +File: magit-popup.info, Node: Other Options, Prev: Customizing Existing Popups, Up: Usage + +2.2 Other Options +================= + + -- User Option: magit-popup-use-prefix-argument + + This option controls the effect that the use of a prefix argument + before entering a popup has. + + • ‘default’ + + With a prefix argument directly invoke the popup’s default + action (an Emacs command), instead of bringing up the popup. + + • ‘popup’ + + With a prefix argument bring up the popup, otherwise directly + invoke the popup’s default action. + + • ‘nil’ + + Ignore prefix arguments. + + This option can be overridden for individual popups. + ‘magit-show-refs-popup’ for example defaults to invoking the + default action directly. It only shows the popup buffer when a + prefix argument is used. See *note Customizing Existing Popups::. + + -- User Option: magit-popup-manpage-package + + The Emacs package used to display man-pages, one of ‘man’ or + ‘woman’. + + -- User Option: magit-popup-display-buffer-action + + The option controls how the window used to display a popup buffer + is created. Popup buffers are displayed using ‘display-buffer’ + with the value of this option as ACTION argument. You can also set + this to nil and instead add an entry to ‘display-buffer-alist’. + + To emphasize the default action by making it bold use this: + + (button-type-put 'magit-popup-action-button 'format " %k %D") + + +File: magit-popup.info, Node: Defining Prefix and Suffix Commands, Prev: Usage, Up: Top + +3 Defining Prefix and Suffix Commands +************************************* + +If you write an extension for Magit then you should use this library now +and later when ‘transient’ is released port to that. + + If you are considering using this library to define popups for +packages not related to Magit, then keep in mind that it will be +superseded eventually. Once ‘transient’ has been released I will only +fix bugs in ‘magit-popup’ but not implement any new features. + + Also consider using ‘hydra’ instead. To some extend ‘magit-popup’ +and ‘hydra’ are similar but have a different focus. The main purpose of +‘magit-popup’ is to pass infix arguments to suffix commands. If all you +need is a command dispatcher then you are better of using ‘hydra’. Of +course ‘hydra’ may also be a better fit not only because of the features +it lacks, but also because of the features it provides, which are in +turn missing from ‘magit-popup’. + + Here is an example of how one defines a prefix command along with its +infix arguments, and then also one of its suffix commands. + + ;;;###autoload (autoload 'magit-tag-popup "magit" nil t) + (magit-define-popup magit-tag-popup + "Show popup buffer featuring tagging commands." + 'magit-commands + :man-page "git-tag" + :switches '((?a "Annotate" "--annotate") + (?s "Sign" "--sign") + (?f "Force" "--force")) + :actions '((?t "Create" magit-tag) + (?k "Delete" magit-tag-delete) + (?p "Prune" magit-tag-prune)) + :default-action 'magit-tag) + + ;;;###autoload + (defun magit-tag (name rev &optional args) + "Create a new tag with the given NAME at REV." + (interactive (list (magit-read-tag "Tag name") + (magit-read-branch-or-commit "Place tag on") + (magit-tag-arguments))) + (magit-run-git-with-editor "tag" args name rev)) + +* Menu: + +* Defining Prefix Commands:: +* Defining Suffix Commands:: + + +File: magit-popup.info, Node: Defining Prefix Commands, Next: Defining Suffix Commands, Up: Defining Prefix and Suffix Commands + +3.1 Defining Prefix Commands +============================ + +Prefix commands and their infix arguments are defined using the macro +‘magit-define-popup’. The key bindings and descriptions of suffix +commands are also defined using that macro, but the actual interactive +commands have to be defined separately using plain ‘defun’. + + -- Macro: magit-define-popup name doc [group [mode [option]]] :keyword + value... + + This macro defines a popup named NAME. The NAME should begin with + the package prefix and by convention end with ‘-popup’, it is used + as the name of the command which shows the popup and for an + internal variable (whose value is used to store information about + the popup and should not be accessed directly). DOC is the + doc-string of the popup command. + + This macro also defines an option and a function both named + ‘SHORTNAME-arguments’, where SHORTNAME is NAME with the trailing + ‘-popup’ removed. The name of this option and this function can be + overwritten using the optional argument OPTION, but that is rarely + advisable. As a special case if OPTION is specified but ‘nil’, + then this option and this function are not defined at all, which is + useful for popups that are used as simple dispatchers that offer no + arguments. + + The option ‘SHORTNAME-arguments’ holds the value for the popup + arguments. It can be customized from within the popup or using the + Custom interface. It can also have a buffer local value in any + non-popup buffer. The local value for the buffer from which the + popup command was invoked, can be set from within the popup buffer. + + The function ‘SHORTNAME-arguments’ returns the currently effective + value of the variable by the same name. See below for more + information. + + Optional argument GROUP specifies the Custom group into which the + option is placed. If omitted then the option is placed into some + group the same way it is done when directly using ‘defcustom’ and + omitting the group, except when NAME begins with "magit-", in which + case the group ‘magit-git-arguments’ is used. + + The optional argument MODE specifies the mode used by the popup + buffer. If it is omitted or ‘nil’ then ‘magit-popup-mode’ is used. + + The remaining arguments should have the form ‘[KEYWORD VALUE]...’. + + The following keywords are meaningful (and by convention are + usually specified in that order): + + • ‘:actions’ + + The actions which can be invoked from the popup. VALUE is a + list whose members have the form (KEY DESC COMMAND), see + ‘magit-define-popup-action’ for details. + + Actions are regular Emacs commands, which usually have an + ‘interactive’ form setup to consume the values of the popup + ‘:switches’ and ‘:options’ when invoked from the corresponding + popup, else when invoked as the default action or directly + without using the popup, the default value of the variable + ‘SHORTNAME-arguments’. This is usually done by calling the + function ‘SHORTNAME-arguments’. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, + which is used as the heading, or nil, in which case the + section is not inserted. + + Members of VALUE may also be nil. This should only be used + together with ‘:max-action-columns’ and allows having gaps in + the action grit, which can help arranging actions sensibly. + + • ‘:default-action’ + + The default action of the popup which is used directly instead + of displaying the popup buffer, when the popup is invoked with + a prefix argument. Also see ‘magit-popup-use-prefix-argument’ + and ‘:use-prefix’, which can be used to inverse the meaning of + the prefix argument. + + • ‘:use-prefix’ + + Controls when to display the popup buffer and when to invoke + the default action (if any) directly. This overrides the + global default set using ‘magit-popup-use-prefix-argument’. + The value, if specified, should be one of ‘default’ or + ‘prefix’, or a function that is called with no arguments and + returns one of these symbols. + + • ‘:max-action-columns’ + + The maximum number of actions to display on a single line, a + number or a function that return a number and takes the name + of the section currently being inserted as argument. If there + isn’t enough room to display as many columns as specified + here, then fewer are used. + + • ‘:switches’ + + The popup arguments which can be toggled on and off. VALUE is + a list whose members have the form ‘(KEY DESC SWITCH)’, see + ‘magit-define-popup-switch’ for details. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, + which is used as the heading, or nil, in which case the + section is not inserted. + + • ‘:options’ + + The popup arguments which take a value, as in "–opt~OPTVAL". + VALUE is a list whose members have the form ‘(KEY DESC OPTION + READER)’, see ‘magit-define-popup-option’ for details. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, + which is used as the heading, or nil, in which case the + section is not inserted. + + • ‘:default-arguments’ + + The default arguments, a list of switches (which are then + enabled by default) and options with there default values, as + in ‘"--OPT=OPTVAL"’. + + • ‘:variables’ + + Git variables which can be set from the popup. VALUE is a + list whose members have the form ‘(KEY DESC COMMAND + FORMATTER)’, see ‘magit-define-popup-variable’ for details. + + Members of VALUE may also be strings and functions, assuming + the first member is a string or function. In that case the + members are split into sections and these special elements are + used as headings. If such an element is a function then it is + called with no arguments and must return either a string, + which is used as the heading, or nil, in which case the + section is not inserted. + + Members of VALUE may also be actions as described above for + ‘:actions’. + + VALUE may also be a function that returns a list as describe + above. + + • ‘:sequence-predicate’ + + When this function returns non-nil, then the popup uses + ‘:sequence-actions’ instead of ‘:actions’, and does not show + the ‘:switches’ and ‘:options’. + + • ‘:sequence-actions’ + + The actions which can be invoked from the popup, when + ‘:sequence-predicate’ returns non-nil. + + • ‘:setup-function’ + + When this function is specified, then it is used instead of + ‘magit-popup-default-setup’. + + • ‘:refresh-function’ + + When this function is specified, then it is used instead of + calling ‘magit-popup-insert-section’ three times with symbols + ‘magit-popup-switch-button’, ‘magit-popup-option-button’, and + finally ‘magit-popup-action-button’ as argument. + + • ‘:man-page’ + + The name of the manpage to be displayed when the user requests + help for an argument. + + +File: magit-popup.info, Node: Defining Suffix Commands, Prev: Defining Prefix Commands, Up: Defining Prefix and Suffix Commands + +3.2 Defining Suffix Commands +============================ + +Commands intended to be invoked from a particular popup should determine +the currently effective arguments by calling the function +‘SHORTNAME-arguments’ inside their ‘interactive’ form. This function is +created by the ‘magit-define-popup’ macro. For a popup named +‘prefix-foo-popup’ the name of this function is ‘prefix-foo-arguments’. + + When the command was invoked as an action in the respective popup, +then this function returns the arguments that were set in the popup. +Otherwise when the command was invoked as the default of the popup (by +calling the popup command with a prefix argument), or without using the +popup command at all, then this function returns the buffer-local or +global value of the variable ‘SHORTNAME-arguments’. + + Internally arguments are handled as a list of strings. This might +not be appropriate for the intended use inside commands, or it might be +necessary to manipulate that list somehow, i.e. to split "–ARG=VAL" +into "–ARG""VAL". This should be done by advising or redefining the +function ‘SHORTNAME-arguments’. + + Internally ‘SHORNAME-arguments’ used following variables and +function. Except when redefining the former, you should not use these +directly. + + -- Variable: magit-current-popup + + The popup from which this editing command was invoked. + + -- Variable: magit-current-popup-args + + The value of the popup arguments for this editing command. + + If the current command was invoked from a popup, then this is a + list of strings of all the set switches and options. This includes + arguments which are set by default not only those explicitly set + during this invocation. + + When the value is nil, then that can be because no argument is set, + or because the current command wasn’t invoked from a popup at all. + + -- Function: magit-current-popup-args &rest args + + This function returns the value of the popup arguments for this + editing command. The value is the same as that of the variable by + the same name, except that FILTER is applied. FILTER is a list of + regexps; only arguments that match one of them are returned. The + first element of FILTER may also be ‘:not’ in which case only + arguments that don’t match any of the regexps are returned, or + ‘:only’ which doesn’t change the behavior. + + + +Tag Table: +Node: Top768 +Node: Introduction2013 +Node: Usage4712 +Node: Customizing Existing Popups9409 +Node: Other Options15155 +Node: Defining Prefix and Suffix Commands16698 +Node: Defining Prefix Commands18850 +Node: Defining Suffix Commands27548 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: -- 2.47.3