From 66e22ee382b8d4970b749b8b0371644e464377d4 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 28 Aug 2018 20:17:28 +0200 Subject: [PATCH] Update magit to 20180828.1055 Signed-off-by: Andreas Gerler --- elpa/magit-20180404.1428/magit-blame.el | 570 ----------- elpa/magit-20180404.1428/magit-obsolete.el | 159 --- elpa/magit-20180404.1428/magit-pkg.el | 12 - elpa/magit-20180404.1428/magit.info | 181 ---- .../AUTHORS.md | 14 + .../LICENSE | 0 .../dir | 2 +- .../git-rebase.el | 22 +- .../magit-apply.el | 33 +- .../magit-autoloads.el | 336 +++++-- .../magit-autorevert.el | 28 +- .../magit-bisect.el | 0 elpa/magit-20180828.1055/magit-blame.el | 926 ++++++++++++++++++ .../magit-bookmark.el | 14 +- .../magit-branch.el | 100 +- .../magit-collab.el | 30 +- .../magit-commit.el | 131 ++- .../magit-core.el | 0 .../magit-diff.el | 224 +++-- .../magit-ediff.el | 26 +- .../magit-extras.el | 117 ++- .../magit-files.el | 53 +- .../magit-git.el | 145 ++- .../magit-imenu.el | 6 +- .../magit-log.el | 249 +++-- .../magit-margin.el | 22 +- .../magit-merge.el | 15 +- .../magit-mode.el | 128 ++- .../magit-notes.el | 0 elpa/magit-20180828.1055/magit-obsolete.el | 33 + elpa/magit-20180828.1055/magit-pkg.el | 11 + .../magit-process.el | 120 ++- .../magit-refs.el | 45 +- .../magit-remote.el | 30 +- .../magit-repos.el | 37 +- .../magit-reset.el | 71 +- .../magit-section.el | 245 +++-- .../magit-sequence.el | 75 +- .../magit-stash.el | 13 +- .../magit-status.el | 89 +- .../magit-submodule.el | 10 +- .../magit-subtree.el | 0 .../magit-tag.el | 33 + .../magit-utils.el | 179 ++-- .../magit-wip.el | 162 ++- .../magit-worktree.el | 44 +- .../magit.el | 56 +- elpa/magit-20180828.1055/magit.info | 184 ++++ .../magit.info-1 | 719 ++++++++------ .../magit.info-2 | 603 +++++++++--- 50 files changed, 3943 insertions(+), 2359 deletions(-) delete mode 100644 elpa/magit-20180404.1428/magit-blame.el delete mode 100644 elpa/magit-20180404.1428/magit-obsolete.el delete mode 100644 elpa/magit-20180404.1428/magit-pkg.el delete mode 100644 elpa/magit-20180404.1428/magit.info rename elpa/{magit-20180404.1428 => magit-20180828.1055}/AUTHORS.md (95%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/LICENSE (100%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/dir (89%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/git-rebase.el (97%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-apply.el (95%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-autoloads.el (88%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-autorevert.el (92%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-bisect.el (100%) create mode 100644 elpa/magit-20180828.1055/magit-blame.el rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-bookmark.el (97%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-branch.el (93%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-collab.el (86%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-commit.el (80%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-core.el (100%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-diff.el (94%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-ediff.el (97%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-extras.el (84%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-files.el (90%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-git.el (94%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-imenu.el (98%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-log.el (89%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-margin.el (93%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-merge.el (95%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-mode.el (93%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-notes.el (100%) create mode 100644 elpa/magit-20180828.1055/magit-obsolete.el create mode 100644 elpa/magit-20180828.1055/magit-pkg.el rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-process.el (91%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-refs.el (96%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-remote.el (98%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-repos.el (90%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-reset.el (58%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-section.el (87%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-sequence.el (92%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-stash.el (97%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-status.el (88%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-submodule.el (98%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-subtree.el (100%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-tag.el (74%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-utils.el (86%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-wip.el (63%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit-worktree.el (74%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit.el (94%) create mode 100644 elpa/magit-20180828.1055/magit.info rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit.info-1 (94%) rename elpa/{magit-20180404.1428 => magit-20180828.1055}/magit.info-2 (86%) diff --git a/elpa/magit-20180404.1428/magit-blame.el b/elpa/magit-20180404.1428/magit-blame.el deleted file mode 100644 index e1bf447c..00000000 --- a/elpa/magit-20180404.1428/magit-blame.el +++ /dev/null @@ -1,570 +0,0 @@ -;;; magit-blame.el --- blame support for Magit -*- lexical-binding: t -*- - -;; Copyright (C) 2012-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: - -;; Annotates each line in file-visiting buffer with information from -;; the revision which last modified the line. - -;;; Code: - -(require 'magit) - -;;; Options - -(defgroup magit-blame nil - "Blame support for Magit." - :link '(info-link "(magit)Blaming") - :group 'magit-modes) - -(defcustom magit-blame-heading-format "%-20a %C %s" - "Format string used for blame headings. - -The following placeholders are recognized: - - %H hash - %s summary - %a author - %A author time - %c committer - %C committer time - -The author and committer time formats can be specified with -`magit-blame-time-format'." - :group 'magit-blame - :type 'string) - -(defcustom magit-blame-time-format "%F %H:%M" - "Format for time strings in blame headings." - :group 'magit-blame - :type 'string) - -(defcustom magit-blame-show-headings t - "Whether to initially show blame block headings. -The headings can also be toggled locally using command -`magit-blame-toggle-headings'." - :group 'magit-blame - :type 'boolean) - -(defcustom magit-blame-disable-modes '(fci-mode yascroll-bar-mode) - "List of modes not compatible with Magit-Blame mode. -This modes are turned off when Magit-Blame mode is turned on, -and then turned on again when turning off the latter." - :group 'magit-blame - :type '(repeat (symbol :tag "Mode"))) - -(defcustom magit-blame-mode-lighter " Blame" - "The mode-line lighter of the Magit-Blame mode." - :group 'magit-blame - :type '(choice (const :tag "No lighter" "") string)) - -(defcustom magit-blame-goto-chunk-hook '(magit-blame-maybe-update-revision-buffer) - "Hook run by `magit-blame-next-chunk' and `magit-blame-previous-chunk'." - :package-version '(magit . "2.1.0") - :group 'magit-blame - :type 'hook - :get 'magit-hook-custom-get - :options '(magit-blame-maybe-update-revision-buffer)) - -(defface magit-blame-heading - '((((class color) (background light)) - :background "grey80" - :foreground "black") - (((class color) (background dark)) - :background "grey25" - :foreground "white")) - "Face for blame headings." - :group 'magit-faces) - -(defface magit-blame-summary - '((t :inherit magit-blame-heading)) - "Face for commit summary in blame headings." - :group 'magit-faces) - -(defface magit-blame-hash - '((t :inherit magit-blame-heading)) - "Face for commit hash in blame headings." - :group 'magit-faces) - -(defface magit-blame-name - '((t :inherit magit-blame-heading)) - "Face for author and committer names in blame headings." - :group 'magit-faces) - -(defface magit-blame-date - '((t :inherit magit-blame-heading)) - "Face for dates in blame headings." - :group 'magit-faces) - -;;; Mode - -(defvar magit-blame-mode-map - (let ((map (make-sparse-keymap))) - (cond ((featurep 'jkl) - (define-key map [return] 'magit-show-commit) - (define-key map (kbd "i") 'magit-blame-previous-chunk) - (define-key map (kbd "I") 'magit-blame-previous-chunk-same-commit) - (define-key map (kbd "k") 'magit-blame-next-chunk) - (define-key map (kbd "K") 'magit-blame-next-chunk-same-commit) - (define-key map (kbd "j") 'magit-blame) - (define-key map (kbd "l") 'magit-blame-reverse) - (define-key map (kbd "b") 'magit-blame-popup)) - (t - (define-key map (kbd "C-m") 'magit-show-commit) - (define-key map (kbd "p") 'magit-blame-previous-chunk) - (define-key map (kbd "P") 'magit-blame-previous-chunk-same-commit) - (define-key map (kbd "n") 'magit-blame-next-chunk) - (define-key map (kbd "N") 'magit-blame-next-chunk-same-commit) - (define-key map (kbd "b") 'magit-blame) - (define-key map (kbd "f") 'magit-blame-reverse) - (define-key map (kbd "B") 'magit-blame-popup))) - (define-key map (kbd "t") 'magit-blame-toggle-headings) - (define-key map (kbd "q") 'magit-blame-quit) - (define-key map (kbd "M-w") 'magit-blame-copy-hash) - (define-key map (kbd "SPC") 'magit-diff-show-or-scroll-up) - (define-key map (kbd "DEL") 'magit-diff-show-or-scroll-down) - map) - "Keymap for `magit-blame-mode'.") - -(defun magit-blame-put-keymap-before-view-mode () - "Put `magit-blame-mode' ahead of `view-mode' in `minor-mode-map-alist'." - (--when-let (assq 'magit-blame-mode - (cl-member 'view-mode minor-mode-map-alist :key #'car)) - (setq minor-mode-map-alist - (cons it (delq it minor-mode-map-alist)))) - (remove-hook 'view-mode-hook #'magit-blame-put-keymap-before-view-mode)) - -(add-hook 'view-mode-hook #'magit-blame-put-keymap-before-view-mode) - -(defvar-local magit-blame-buffer-read-only nil) -(defvar-local magit-blame-cache nil) -(defvar-local magit-blame-disabled-modes nil) -(defvar-local magit-blame-process nil) -(defvar-local magit-blame-recursive-p nil) -(defvar-local magit-blame-reverse-p nil) -(defvar-local magit-blame-separator nil) - -(define-minor-mode magit-blame-mode - "Display blame information inline. -\n\\{magit-blame-mode-map}" - :lighter magit-blame-mode-lighter - (cond (magit-blame-mode - (when (called-interactively-p 'any) - (setq magit-blame-mode nil) - (user-error - (concat "Don't call `magit-blame-mode' directly; " - "instead use `magit-blame' or `magit-blame-popup'"))) - (setq magit-blame-buffer-read-only buffer-read-only) - (read-only-mode 1) - (dolist (mode magit-blame-disable-modes) - (when (and (boundp mode) (symbol-value mode)) - (funcall mode -1) - (push mode magit-blame-disabled-modes))) - (setq magit-blame-separator (magit-blame-format-separator))) - (t - (unless magit-blame-buffer-read-only - (read-only-mode -1)) - (dolist (mode magit-blame-disabled-modes) - (funcall mode 1)) - (when (process-live-p magit-blame-process) - (kill-process magit-blame-process)) - (save-excursion - (save-restriction - (widen) - (dolist (ov (overlays-in (point-min) (point-max))) - (when (overlay-get ov 'magit-blame) - (delete-overlay ov)))))))) - -(defun auto-revert-handler--unless-magit-blame-mode () - "If Magit-Blame mode is on, then do nothing. See #1731." - magit-blame-mode) - -(advice-add 'auto-revert-handler :before-until - 'auto-revert-handler--unless-magit-blame-mode) - -;;; Popup - -;;;###autoload (autoload 'magit-blame-popup "magit-blame" nil t) -(magit-define-popup magit-blame-popup - "Popup console for blame commands." - :man-page "git-blame" - :switches '((?w "Ignore whitespace" "-w") - (?r "Do not treat root commits as boundaries" "--root")) - :options '((?M "Detect lines moved or copied within a file" "-M") - (?C "Detect lines moved or copied between files" "-C")) - :actions '((?b "Show blob touching these lines" magit-blame) - (?r (lambda () - (with-current-buffer magit-pre-popup-buffer - (and (not buffer-file-name) - (propertize "Show last blob with these lines" - 'face 'default)))) - magit-blame-reverse)) - :default-arguments '("-w") - :max-action-columns 1 - :default-action 'magit-blame) - -;;; Process - -(defun magit-blame-arguments* (reverse) - (let ((args (magit-blame-arguments))) - (when (and reverse buffer-file-name) - (user-error "Only blob buffers can be blamed in reverse")) - (if (and magit-blame-mode - (or (and reverse magit-blame-reverse-p) - (and (not reverse) - (not magit-blame-reverse-p)))) - (--if-let (magit-blame-chunk-get :previous-hash) - (list it (magit-blame-chunk-get :previous-file) - args (magit-blame-chunk-get :previous-start)) - (user-error "Block has no further history")) - (--if-let (magit-file-relative-name nil (not magit-buffer-file-name)) - (list (or magit-buffer-refname magit-buffer-revision) it args) - (if buffer-file-name - (user-error "Buffer isn't visiting a tracked file") - (user-error "Buffer isn't visiting a file")))))) - -;;;###autoload -(defun magit-blame-reverse (revision file &optional args line) - "For each line show the last revision in which a line still existed. -\n(fn REVISION FILE &optional ARGS)" ; LINE is for internal use - (interactive (magit-blame-arguments* t)) - (magit-blame revision file (cons "--reverse" args) line)) - -;;;###autoload -(defun magit-blame (revision file &optional args line) - "For each line show the revision that last touched it. - -Interactively blame the file being visited in the current buffer. -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 a parent of the revision that added the lines at -point. - -ARGS is a list of additional arguments to pass to `git blame'; -only arguments available from `magit-blame-popup' should be used. -\n(fn REVISION FILE &optional ARGS)" ; LINE is for internal use - (interactive (magit-blame-arguments* nil)) - (let ((toplevel (or (magit-toplevel) - (user-error "Not in git repository")))) - (let ((default-directory toplevel)) - (if revision - (magit-find-file revision file) - (--if-let (find-buffer-visiting file) - (progn (switch-to-buffer it) - (save-buffer)) - (find-file file)))) - (let ((default-directory toplevel) - (reverse (and (member "--reverse" args) t))) - (widen) - (when line - (setq magit-blame-recursive-p t) - (goto-char (point-min)) - (forward-line (1- line))) - (when (or (not magit-blame-mode) - (and reverse (not magit-blame-reverse-p)) - (and (not reverse) magit-blame-reverse-p)) - (setq magit-blame-reverse-p reverse) - (setq magit-blame-cache (make-hash-table :test 'equal)) - (let ((show-headings magit-blame-show-headings)) - (magit-blame-mode 1) - (setq-local magit-blame-show-headings show-headings)) - (message "Blaming...") - (let ((magit-process-popup-time -1) - (inhibit-magit-refresh t)) - (magit-run-git-async - "blame" "--incremental" args - "-L" (format "%s,%s" - (line-number-at-pos (window-start)) - (line-number-at-pos (1- (window-end nil t)))) - revision "--" file)) - (setq magit-blame-process magit-this-process) - (set-process-filter magit-this-process 'magit-blame-process-filter) - (set-process-sentinel - magit-this-process - `(lambda (process event) - (when (memq (process-status process) '(exit signal)) - (magit-process-sentinel process event) - (magit-blame-assert-buffer process) - (with-current-buffer (process-get process 'command-buf) - (when magit-blame-mode - (let ((magit-process-popup-time -1) - (inhibit-magit-refresh t) - (default-directory ,default-directory)) - (magit-run-git-async "blame" "--incremental" ,@args - ,revision "--" ,file)) - (setq magit-blame-process magit-this-process) - (set-process-filter - magit-this-process 'magit-blame-process-filter) - (set-process-sentinel - magit-this-process 'magit-blame-process-sentinel)))))))))) - -(defun magit-blame-process-sentinel (process event) - (let ((status (process-status process))) - (when (memq status '(exit signal)) - (magit-process-sentinel process event) - (if (and (eq status 'exit) - (zerop (process-exit-status process))) - (message "Blaming...done") - (magit-blame-assert-buffer process) - (with-current-buffer (process-get process 'command-buf) - (magit-blame-mode -1)) - (message "Blaming...failed"))))) - -(defvar magit-blame-log nil - "Whether to log blame output to the process buffer. -This is intended for debugging purposes.") - -(defun magit-blame-process-filter (process string) - (when magit-blame-log - (magit-process-filter process string)) - (--when-let (process-get process 'partial-line) - (setq string (concat it string)) - (setf (process-get process 'partial-line) nil)) - (magit-blame-assert-buffer process) - (with-current-buffer (process-get process 'command-buf) - (when (and magit-blame-mode - (zerop (process-exit-status process))) - (let ((chunk (process-get process 'chunk)) - (lines (split-string string "\n" t))) - (unless (string-match-p "\n\\'" string) - (process-put process 'chunk chunk) - (process-put process 'partial-line (car (last lines))) - (setq lines (butlast lines))) - (dolist (line lines) - (cond - ((equal line "")) - ((not chunk) - (string-match - "^\\(.\\{40\\}\\) \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\)" line) - (setq chunk - (list :hash (let ((hash (match-string 1 line))) - (unless (equal hash (make-string 40 ?0)) - hash)) - :previous-start (string-to-number (match-string 2 line)) - :start (string-to-number (match-string 3 line)) - :lines (string-to-number (match-string 4 line))))) - ((string-match "^filename \\(.+\\)" line) - (let* ((hash (plist-get chunk :hash)) - (file (match-string 1 line))) - (--if-let (gethash hash magit-blame-cache) - (setq chunk (nconc chunk it)) - (plist-put chunk :filename file) - (puthash hash chunk magit-blame-cache))) - (magit-blame-make-overlay chunk) - (setq chunk nil)) - ((string-match "^previous \\(.\\{40\\}\\) \\(.+\\)" line) - (plist-put chunk :previous-hash (match-string 1 line)) - (plist-put chunk :previous-file (match-string 2 line))) - ((string-match "^\\([^ ]+?-mail\\) <\\([^>]+\\)>" line) - (plist-put chunk (intern (concat ":" (match-string 1 line))) - (string-to-number (match-string 2 line)))) - ((string-match "^\\([^ ]+?-\\(?:time\\|tz\\)\\) \\(.+\\)" line) - (plist-put chunk (intern (concat ":" (match-string 1 line))) - (string-to-number (match-string 2 line)))) - ((string-match "^\\([^ ]+\\) \\(.+\\)" line) - (plist-put chunk (intern (concat ":" (match-string 1 line))) - (match-string 2 line)))) - (process-put process 'chunk chunk)))))) - -(defun magit-blame-assert-buffer (process) - (unless (buffer-live-p (process-get process 'command-buf)) - (kill-process process) - (user-error "Buffer being blamed has been killed"))) - -;;; Display - -(defun magit-blame-make-overlay (chunk) - (let ((ov (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (forward-line (1- (plist-get chunk :start))) - (--when-let (--first (overlay-get it 'magit-blame) - (overlays-at (point))) - (delete-overlay it)) - (make-overlay (point) - (progn (forward-line - (plist-get chunk :lines)) - (point)))))) - (heading (magit-blame-format-heading chunk))) - (overlay-put ov 'magit-blame chunk) - (overlay-put ov 'magit-blame-heading heading) - (overlay-put ov 'before-string - (if magit-blame-show-headings - heading - magit-blame-separator)))) - -(defun magit-blame-format-separator () - (propertize - (concat (propertize " " 'display '(space :height (2))) - (propertize "\n" 'line-height t)) - 'face (list :background (face-attribute 'magit-blame-heading :background)))) - -(defun magit-blame-format-heading (chunk) - (with-temp-buffer - (insert (format-spec - (concat magit-blame-heading-format "\n") - `((?H . ,(propertize (or (plist-get chunk :hash) "") - 'face 'magit-blame-hash)) - (?s . ,(propertize (or (plist-get chunk :summary) "") - 'face 'magit-blame-summary)) - (?a . ,(propertize (or (plist-get chunk :author) "") - 'face 'magit-blame-name)) - (?A . ,(propertize (magit-blame-format-time-string - magit-blame-time-format - (plist-get chunk :author-time) - (plist-get chunk :author-tz)) - 'face 'magit-blame-date)) - (?c . ,(propertize (or (plist-get chunk :committer) "") - 'face 'magit-blame-name)) - (?C . ,(propertize (magit-blame-format-time-string - magit-blame-time-format - (plist-get chunk :committer-time) - (plist-get chunk :committer-tz)) - 'face 'magit-blame-date))))) - (goto-char (point-min)) - (while (not (eobp)) - (let ((face (get-text-property (point) 'face)) - (next (or (next-single-property-change (point) 'face) - (point-max)))) - (unless face - (put-text-property (point) next 'face 'magit-blame-heading)) - (goto-char next))) - (buffer-string))) - -(defun magit-blame-format-time-string (format time tz) - (format-time-string - format (seconds-to-time (+ time (* (/ tz 100) 60 60) (* (% tz 100) 60))))) - -;;; Commands - -(defun magit-blame-quit () - "Turn off Magit-Blame mode. -If the buffer was created during a recursive blame, -then also kill the buffer." - (interactive) - (kill-local-variable 'magit-blame-reverse-p) - (if magit-blame-recursive-p - (kill-buffer) - (magit-blame-mode -1))) - -(defun magit-blame-next-chunk () - "Move to the next chunk." - (interactive) - (--if-let (next-single-char-property-change (point) 'magit-blame) - (progn (goto-char it) - (run-hooks 'magit-blame-goto-chunk-hook)) - (user-error "No more chunks"))) - -(defun magit-blame-previous-chunk () - "Move to the previous chunk." - (interactive) - (--if-let (previous-single-char-property-change (point) 'magit-blame) - (progn (goto-char it) - (run-hooks 'magit-blame-goto-chunk-hook)) - (user-error "No more chunks"))) - -(defun magit-blame-next-chunk-same-commit (&optional previous) - "Move to the next chunk from the same commit.\n\n(fn)" - (interactive) - (-if-let (hash (magit-blame-chunk-get :hash)) - (let ((pos (point)) ov) - (save-excursion - (while (and (not ov) - (not (= pos (if previous (point-min) (point-max)))) - (setq pos (funcall - (if previous - 'previous-single-char-property-change - 'next-single-char-property-change) - pos 'magit-blame))) - (--when-let (magit-blame-overlay-at pos) - (when (equal (magit-blame-chunk-get :hash pos) hash) - (setq ov it))))) - (if ov - (goto-char (overlay-start ov)) - (user-error "No more chunks from same commit"))) - (user-error "This chunk hasn't been blamed yet"))) - -(defun magit-blame-previous-chunk-same-commit () - "Move to the previous chunk from the same commit." - (interactive) - (magit-blame-next-chunk-same-commit 'previous-single-char-property-change)) - -(defun magit-blame-toggle-headings () - "Show or hide blame chunk headings." - (interactive) - (setq-local magit-blame-show-headings (not magit-blame-show-headings)) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (not (eobp)) - (let ((next (next-single-char-property-change (point) 'magit-blame))) - (--when-let (magit-blame-overlay-at (point)) - (overlay-put it 'before-string - (if magit-blame-show-headings - (overlay-get it 'magit-blame-heading) - magit-blame-separator))) - (goto-char (or next (point-max)))))))) - -(defun magit-blame-copy-hash () - "Save hash of the current chunk's commit to the kill ring. - -When the region is active, then save the region's content -instead of the hash, like `kill-ring-save' would." - (interactive) - (if (use-region-p) - (copy-region-as-kill nil nil 'region) - (kill-new (message "%s" (magit-blame-chunk-get :hash))))) - -;;; Utilities - -(defun magit-blame-chunk-get (key &optional pos) - (--when-let (magit-blame-overlay-at pos) - (plist-get (overlay-get it 'magit-blame) key))) - -(defun magit-blame-overlay-at (&optional pos) - (--first (overlay-get it 'magit-blame) - (overlays-at (or pos (point))))) - -(defun magit-blame-maybe-update-revision-buffer () - (unless magit--update-revision-buffer - (setq magit--update-revision-buffer nil) - (-when-let* ((commit (magit-blame-chunk-get :hash)) - (buffer (magit-mode-get-buffer 'magit-revision-mode nil t))) - (setq magit--update-revision-buffer (list commit buffer)) - (run-with-idle-timer - magit-update-other-window-delay nil - (lambda () - (-let [(rev buf) magit--update-revision-buffer] - (setq magit--update-revision-buffer nil) - (when (buffer-live-p buf) - (let ((magit-display-buffer-noselect t)) - (apply #'magit-show-commit rev (magit-diff-arguments)))))))))) - -(provide 'magit-blame) -;;; magit-blame.el ends here diff --git a/elpa/magit-20180404.1428/magit-obsolete.el b/elpa/magit-20180404.1428/magit-obsolete.el deleted file mode 100644 index 25f666b6..00000000 --- a/elpa/magit-20180404.1428/magit-obsolete.el +++ /dev/null @@ -1,159 +0,0 @@ -;;; magit-obsolete.el --- obsolete definitions -*- 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 defines aliases for obsolete variables and functions. - -;;; Code: - -(require 'magit) - -;;; Obsolete since v2.1.0 - -(define-obsolete-variable-alias 'magit-git-standard-options - 'magit-git-global-arguments "Magit 2.1.0") - -;;; Obsolete since v2.2.0 - -(define-obsolete-variable-alias 'magit-log-section-args - 'magit-log-section-arguments "Magit 2.2.0") - -;;; Obsolete since v2.3.0 - -(define-obsolete-function-alias 'global-magit-file-buffer-mode - 'global-magit-file-mode "Magit 2.3.0") - -;;; Obsolete since v2.4.0 - -(define-obsolete-function-alias 'magit-get-tracked-ref - 'magit-get-upstream-ref "Magit 2.4.0") - -(define-obsolete-function-alias 'magit-get-tracked-branch - 'magit-get-upstream-branch "Magit 2.4.0") - -(define-obsolete-function-alias 'magit-get-tracked-remote - 'magit-get-upstream-remote "Magit 2.4.0") - -(define-obsolete-function-alias 'magit-insert-head-header - 'magit-insert-head-branch-header "Magit 2.4.0") - -(define-obsolete-function-alias 'magit-insert-pull-branch-header - 'magit-insert-upstream-branch-header "Magit 2.4.0") - -(define-obsolete-function-alias 'magit-insert-unpulled-or-recent-commits - 'magit-insert-unpulled-from-upstream-or-recent "Magit 2.4.0") - -(define-obsolete-function-alias 'magit-insert-upstream-header - 'magit-insert-upstream-branch-header "Magit 2.4.0") - -(make-obsolete-variable 'magit-revert-buffers - 'magit-auto-revert-mode - "Magit 2.4.0") - -(make-obsolete-variable 'magit-status-refresh-hook "\ -use `magit-pre-refresh-hook', `magit-post-refresh-hook', - `magit-refresh-buffer-hook', or `magit-status-mode-hook' instead. - - If you want to run a function every time the status buffer is - refreshed, in order to do something with that buffer, then use: - - (add-hook 'magit-refresh-buffer-hook - (lambda () - (when (derived-mode-p 'magit-status-mode) - ...))) - - If your hook function should run regardless of whether the - status buffer exists or not, then use `magit-pre-refresh-hook' - or `magit-post-refresh-hook'. - - If your hook function only has to be run once, when the buffer - is first created, then `magit-status-mode-hook' instead. -" "Magit 2.4.0") - -;;; Obsolete since v2.6.0 - -(define-obsolete-function-alias 'magit-insert-unpulled-module-commits - 'magit-insert-modules-unpulled-from-upstream "Magit 2.6.0") - -(define-obsolete-function-alias 'magit-insert-unpushed-module-commits - 'magit-insert-modules-unpushed-to-upstream "Magit 2.6.0") - -;;; Obsolete since v2.8.0 - -(make-obsolete-variable 'magit-repository-directories-depth - 'magit-repository-directories "Magit 2.8.0") - -;;; Obsolete since v2.9.0 - -(define-obsolete-variable-alias 'magit-duration-spec - 'magit--age-spec "Magit 2.9.0") - -(make-obsolete-variable 'magit-diff-show-lines-boundary - 'magit-diff-highlight-hunk-region-functions - "Magit 2.9.0") - -(define-obsolete-variable-alias 'magit-log-output-coding-system - 'magit-git-output-coding-system "Magit 2.9.0") - -;;; Obsolete since v2.9.1 - -(define-obsolete-function-alias 'magit-checkout-file - 'magit-file-checkout "Magit 2.9.1") - -;;; Obsolete since v2.11.0 - -(define-obsolete-function-alias 'magit-modified-files - 'magit-unstaged-files "Magit 2.11.0") - -(define-obsolete-function-alias 'magit-insert-submodules - 'magit-insert-modules-overview "Magit 2.11.0") - -;;; Obsolete since v2.12.0 - -(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") - -(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") -(make-obsolete 'magit-section-start "use (oref ... start) instead" "Magit 2.12.0") -(make-obsolete 'magit-section-content "use (oref ... content) instead" "Magit 2.12.0") -(make-obsolete 'magit-section-end "use (oref ... end) instead" "Magit 2.12.0") -(make-obsolete 'magit-section-hidden "use (oref ... hidden) instead" "Magit 2.12.0") -(make-obsolete 'magit-section-washer "use (oref ... washer) instead" "Magit 2.12.0") -(make-obsolete 'magit-section-parent "use (oref ... parent) instead" "Magit 2.12.0") -(make-obsolete 'magit-section-children "use (oref ... children) instead" "Magit 2.12.0") - -(provide 'magit-obsolete) -;;; magit-obsolete.el ends here diff --git a/elpa/magit-20180404.1428/magit-pkg.el b/elpa/magit-20180404.1428/magit-pkg.el deleted file mode 100644 index 991eafe3..00000000 --- a/elpa/magit-20180404.1428/magit-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(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-20180404.1428/magit.info b/elpa/magit-20180404.1428/magit.info deleted file mode 100644 index 548a2920..00000000 --- a/elpa/magit-20180404.1428/magit.info +++ /dev/null @@ -1,181 +0,0 @@ -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-20180404.1428/AUTHORS.md b/elpa/magit-20180828.1055/AUTHORS.md similarity index 95% rename from elpa/magit-20180404.1428/AUTHORS.md rename to elpa/magit-20180828.1055/AUTHORS.md index a3cff499..cf23aca2 100644 --- a/elpa/magit-20180404.1428/AUTHORS.md +++ b/elpa/magit-20180828.1055/AUTHORS.md @@ -39,6 +39,7 @@ Contributors ------------ - Aaron Culich +- Aaron Madlon-Kay - Abdo Roig-Maranges - Adam Benanti <0entropy@protonmail.com> - Adam Porter @@ -46,6 +47,7 @@ Contributors - Adeodato Simó - Ævar Arnfjörð Bjarmason - Alan Falloon +- Alban Gruin - Aleksey Uimanov - Alexander Gramiak - Alex Dunn @@ -63,17 +65,21 @@ Contributors - Andrey Smirnov - Andriy Kmit' - Andy Sawyer +- Aria Edmonds - Barak A. Pearlmutter - Bar Magal - Bart Bakker - Basil L. Contovounesios - Bastian Beischer +- Benjamin Motz - Ben North - Ben Walton +- Bob Uhl - Bradley Wright - Brandon W Maister - Brian Warner - Bryan Shell +- Buster Copley - Carl Lieberman - Chillar Anand - Chris Bernard @@ -84,6 +90,7 @@ Contributors - Chris Shoemaker - Christian Dietrich - Christian Kluge +- Christophe Junke - Christopher Monsanto - Cornelius Mika - Craig Andera @@ -110,12 +117,14 @@ Contributors - Duianto Vebotci - Eli Barzilay - Eric Davis +- Eric Prud'hommeaux - Eric Schulte - Erik Anderson - Evgkeni Sampelnikof - Eyal Lotem - Fabian Wiget - Felix Geller +- Felix Yan - Feng Li - Florian Ragwitz - Fritz Grabo @@ -146,7 +155,9 @@ Contributors - John Mastro - John Wiegley - Jonas Bernoulli +- Jonathan Leech-Pepin - Jonathan Roes +- Jon Vanderwijk - Jordan Greenberg - Josiah Schwab - Julien Danjou @@ -167,6 +178,7 @@ Contributors - Leo Liu - Leonardo Etcheverry - Lingchao Xin +- Li-Yun Chang - Lluís Vilanova - Loic Dachary - Luís Oliveira @@ -191,6 +203,7 @@ Contributors - Michael Griffiths - Michael Heerdegen - Michal Sojka +- Miciah Masters - Miles Bader - Miloš Mošić - Mitchel Humpherys @@ -224,6 +237,7 @@ Contributors - Philip Weaver - Phil Jackson - Phil Sainty +- Pierre Neidhardt - Pieter Praet - Prathamesh Sonpatki - rabio diff --git a/elpa/magit-20180404.1428/LICENSE b/elpa/magit-20180828.1055/LICENSE similarity index 100% rename from elpa/magit-20180404.1428/LICENSE rename to elpa/magit-20180828.1055/LICENSE diff --git a/elpa/magit-20180404.1428/dir b/elpa/magit-20180828.1055/dir similarity index 89% rename from elpa/magit-20180404.1428/dir rename to elpa/magit-20180828.1055/dir index 5fec5439..dfdbd715 100644 --- a/elpa/magit-20180404.1428/dir +++ b/elpa/magit-20180828.1055/dir @@ -5,7 +5,7 @@ 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, + Typing "q" exits, "H" lists all Info commands, "d" returns here, "h" gives a primer for first-timers, "mEmacs" visits the Emacs manual, etc. diff --git a/elpa/magit-20180404.1428/git-rebase.el b/elpa/magit-20180828.1055/git-rebase.el similarity index 97% rename from elpa/magit-20180404.1428/git-rebase.el rename to elpa/magit-20180828.1055/git-rebase.el index 010b3a19..63f50a8a 100644 --- a/elpa/magit-20180404.1428/git-rebase.el +++ b/elpa/magit-20180828.1055/git-rebase.el @@ -191,6 +191,7 @@ ["Squash" git-rebase-squash t] ["Fixup" git-rebase-fixup t] ["Kill" git-rebase-kill-line t] + ["Noop" git-rebase-noop t] ["Execute" git-rebase-exec t] ["Move Down" git-rebase-move-line-down t] ["Move Up" git-rebase-move-line-up t] @@ -275,11 +276,12 @@ If N is negative, move the commit up instead. With an active region, move all the lines that the region touches, not just the current line." (interactive "p") - (-let* (((beg end) (or (git-rebase-region-bounds) - (list (line-beginning-position) - (1+ (line-end-position))))) - (pt-offset (- (point) beg)) - (mark-offset (and mark-active (- (mark) beg)))) + (pcase-let* ((`(,beg ,end) + (or (git-rebase-region-bounds) + (list (line-beginning-position) + (1+ (line-end-position))))) + (pt-offset (- (point) beg)) + (mark-offset (and mark-active (- (mark) beg)))) (save-restriction (narrow-to-region (point-min) @@ -518,6 +520,8 @@ running 'man git-rebase' at the command line) for details." ("^\\(exec\\) \\(.*\\)" (1 'font-lock-keyword-face) (2 'git-rebase-description)) + ("^\\(noop\\)" + (1 'font-lock-keyword-face)) (git-rebase-match-comment-line 0 'font-lock-comment-face) (,(concat git-rebase-comment-re " *" action-re) 0 'git-rebase-killed-action t) @@ -539,14 +543,14 @@ By default, this is the same except for the \"pick\" command." (goto-char (point-min)) (when (and git-rebase-show-instructions (re-search-forward - (concat git-rebase-comment-re " p, pick") + (concat git-rebase-comment-re "\\s-+p, pick") nil t)) (goto-char (line-beginning-position)) - (--each git-rebase-command-descriptions + (pcase-dolist (`(,cmd . ,desc) git-rebase-command-descriptions) (insert (format "%s %-8s %s\n" comment-start - (substitute-command-keys (format "\\[%s]" (car it))) - (cdr it)))) + (substitute-command-keys (format "\\[%s]" cmd)) + desc))) (while (re-search-forward (concat git-rebase-comment-re "\\( ?\\)\\([^\n,],\\) " "\\([^\n ]+\\) ") diff --git a/elpa/magit-20180404.1428/magit-apply.el b/elpa/magit-20180828.1055/magit-apply.el similarity index 95% rename from elpa/magit-20180404.1428/magit-apply.el rename to elpa/magit-20180828.1055/magit-apply.el index b4a35969..fde59e85 100644 --- a/elpa/magit-20180404.1428/magit-apply.el +++ b/elpa/magit-20180828.1055/magit-apply.el @@ -457,8 +457,8 @@ without requiring confirmation." (`unstaged ?Y) (`untracked ?Z)) (cddr (assoc file status))) - (`(?Z) (--each (magit-untracked-files nil file) - (push it delete))) + (`(?Z) (dolist (f (magit-untracked-files nil file)) + (push f delete))) ((or `(?Z ?? ??) `(?Z ?! ?!)) (push file delete)) ((or `(?Z ?D ? ) `(,_ ?D ?D)) (push file delete)) ((or `(,_ ?U ,_) `(,_ ,_ ?U)) (push file resolve)) @@ -476,8 +476,7 @@ without requiring confirmation." (let ((inhibit-magit-refresh t)) (magit-wip-commit-before-change files " before discard") (when resolve - (dolist (file (nreverse resolve)) - (magit-checkout-stage file (magit-checkout-read-stage file)))) + (magit-discard-files--resolve (nreverse resolve))) (when resurrect (magit-discard-files--resurrect (nreverse resurrect))) (when delete @@ -490,6 +489,24 @@ without requiring confirmation." (magit-wip-commit-after-apply files " after discard")) (magit-refresh)))) +(defun magit-discard-files--resolve (files) + (if-let ((arg (and (cdr files) + (magit-read-char-case + (format "For these %i files\n%s\ncheckout:\n" + (length files) + (mapconcat (lambda (file) + (concat " " file)) + files "\n")) + t + (?o "[o]ur stage" "--ours") + (?t "[t]heir stage" "--theirs") + (?c "[c]onflict" "--merge") + (?i "decide [i]ndividually" nil))))) + (dolist (file files) + (magit-checkout-stage file arg)) + (dolist (file files) + (magit-checkout-stage file (magit-checkout-read-stage file))))) + (defun magit-discard-files--resurrect (files) (magit-confirm-files 'resurrect files) (if (eq (magit-diff-type) 'staged) @@ -601,10 +618,10 @@ so causes the change to be applied to the index as well." (magit-reverse-files (list section) args)) (defun magit-reverse-files (sections args) - (-let [(binaries sections) - (let ((bs (magit-staged-binary-files))) - (--separate (member (oref it value) bs) - sections))] + (pcase-let ((`(,binaries ,sections) + (let ((bs (magit-staged-binary-files))) + (--separate (member (oref it value) bs) + sections)))) (magit-confirm-files 'reverse (--map (oref it value) sections)) (if (= (length sections) 1) (magit-reverse-apply (car sections) 'magit-apply-diff args) diff --git a/elpa/magit-20180404.1428/magit-autoloads.el b/elpa/magit-20180828.1055/magit-autoloads.el similarity index 88% rename from elpa/magit-20180404.1428/magit-autoloads.el rename to elpa/magit-20180828.1055/magit-autoloads.el index cd4132df..d07a8ecb 100644 --- a/elpa/magit-20180404.1428/magit-autoloads.el +++ b/elpa/magit-20180828.1055/magit-autoloads.el @@ -1,10 +1,12 @@ ;;; magit-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + -;;;### (autoloads nil "git-rebase" "git-rebase.el" (23238 5904 70048 -;;;;;; 74000)) +;;;### (autoloads nil "git-rebase" "git-rebase.el" (0 0 0 0)) ;;; Generated autoloads from git-rebase.el (autoload 'git-rebase-mode "git-rebase" "\ @@ -21,9 +23,11 @@ running 'man git-rebase' at the command line) for details. (add-to-list 'auto-mode-alist (cons git-rebase-filename-regexp 'git-rebase-mode)) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "git-rebase" '("git-rebase-"))) + ;;;*** -;;;### (autoloads nil "magit" "magit.el" (23238 5904 100293 75000)) +;;;### (autoloads nil "magit" "magit.el" (0 0 0 0)) ;;; Generated autoloads from magit.el (autoload 'magit-dispatch-popup "magit" nil t) (autoload 'magit-run-popup "magit" nil t) @@ -76,10 +80,11 @@ and Emacs to it. \(fn &optional PRINT-DEST)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-apply" "magit-apply.el" (23238 5904 -;;;;;; 79183 226000)) +;;;### (autoloads nil "magit-apply" "magit-apply.el" (0 0 0 0)) ;;; Generated autoloads from magit-apply.el (autoload 'magit-stage-file "magit-apply" "\ @@ -112,15 +117,15 @@ Remove all changes from the staging area. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-apply" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (23238 -;;;;;; 5904 60696 186000)) +;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (0 +;;;;;; 0 0 0)) ;;; Generated autoloads from magit-autorevert.el -(defvar magit-revert-buffers t) - -(defvar magit-auto-revert-mode (and (with-no-warnings magit-revert-buffers) (not global-auto-revert-mode) (not noninteractive)) "\ +(defvar magit-auto-revert-mode (and (not global-auto-revert-mode) (not noninteractive)) "\ Non-nil if Magit-Auto-Revert mode is enabled. See the `magit-auto-revert-mode' command for a description of this minor mode. @@ -142,10 +147,11 @@ See `auto-revert-mode' for more information on Auto-Revert mode. \(fn &optional ARG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-autorevert" '("auto-revert-buffer" "magit-"))) + ;;;*** -;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (23238 5904 -;;;;;; 78245 837000)) +;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (0 0 0 0)) ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect-popup "magit-bisect" nil t) @@ -194,40 +200,43 @@ bisect run'. \(fn CMDLINE &optional BAD GOOD)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-bisect" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-blame" "magit-blame.el" (23238 5904 -;;;;;; 98278 743000)) +;;;### (autoloads nil "magit-blame" "magit-blame.el" (0 0 0 0)) ;;; Generated autoloads from magit-blame.el - (autoload 'magit-blame-popup "magit-blame" nil t) -(autoload 'magit-blame-reverse "magit-blame" "\ -For each line show the last revision in which a line still existed. +(autoload 'magit-blame-echo "magit-blame" "\ +For each line show the revision in which it was added. +Show the information about the chunk at point in the echo area +when moving between chunks. Unlike other blaming commands, do +not turn on `read-only-mode'. -\(fn REVISION FILE &optional ARGS)" t nil) +\(fn)" t nil) (autoload 'magit-blame "magit-blame" "\ -For each line show the revision that last touched it. +For each line show the revision in which it was added. -Interactively blame the file being visited in the current buffer. -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. +\(fn)" t nil) -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. +(autoload 'magit-blame-removal "magit-blame" "\ +For each line show the revision in which it was removed. -ARGS is a list of additional arguments to pass to `git blame'; -only arguments available from `magit-blame-popup' should be used. +\(fn)" t nil) -\(fn REVISION FILE &optional ARGS)" t nil) +(autoload 'magit-blame-reverse "magit-blame" "\ +For each line show the last revision in which it still exists. + +\(fn)" t nil) + (autoload 'magit-blame-popup "magit-blame" nil t) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-blame" '("magit-"))) ;;;*** -;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (23238 -;;;;;; 5904 72174 306000)) +;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (0 0 0 +;;;;;; 0)) ;;; Generated autoloads from magit-bookmark.el (autoload 'magit-bookmark--status-jump "magit-bookmark" "\ @@ -330,10 +339,11 @@ Create a Magit submodule list bookmark. \(fn)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-bookmark" '("magit-bookmark--"))) + ;;;*** -;;;### (autoloads nil "magit-branch" "magit-branch.el" (23238 5904 -;;;;;; 77221 552000)) +;;;### (autoloads nil "magit-branch" "magit-branch.el" (0 0 0 0)) ;;; Generated autoloads from magit-branch.el (autoload 'magit-branch-popup "magit" nil t) @@ -623,10 +633,11 @@ When `never' (the default) then the variable is never set. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-branch" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-collab" "magit-collab.el" (23238 5904 -;;;;;; 93109 446000)) +;;;### (autoloads nil "magit-collab" "magit-collab.el" (0 0 0 0)) ;;; Generated autoloads from magit-collab.el (autoload 'magit-browse-pull-request "magit-collab" "\ @@ -637,10 +648,11 @@ be lifted eventually to support other Git forges. \(fn PR)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-collab" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-commit" "magit-commit.el" (23238 5904 -;;;;;; 61640 672000)) +;;;### (autoloads nil "magit-commit" "magit-commit.el" (0 0 0 0)) ;;; Generated autoloads from magit-commit.el (autoload 'magit-commit "magit-commit" "\ @@ -730,11 +742,13 @@ that is you) or committer date is available as the previous history element. \(fn DATE)" t nil) + (autoload 'magit-commit-absorb-popup "magit-commit" nil t) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-commit" '("magit-"))) ;;;*** -;;;### (autoloads nil "magit-diff" "magit-diff.el" (23238 5904 96972 -;;;;;; 454000)) +;;;### (autoloads nil "magit-diff" "magit-diff.el" (0 0 0 0)) ;;; Generated autoloads from magit-diff.el (autoload 'magit-diff-popup "magit-diff" "\ @@ -821,10 +835,11 @@ for a revision. \(fn REV &optional ARGS FILES MODULE)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-diff" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (23238 5904 -;;;;;; 89544 993000)) +;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (0 0 0 0)) ;;; Generated autoloads from magit-ediff.el (autoload 'magit-ediff-popup "magit-ediff" nil t) @@ -910,10 +925,11 @@ stash that were staged. \(fn STASH)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-ediff" '("magit-ediff-"))) + ;;;*** -;;;### (autoloads nil "magit-extras" "magit-extras.el" (23238 5904 -;;;;;; 62671 280000)) +;;;### (autoloads nil "magit-extras" "magit-extras.el" (0 0 0 0)) ;;; Generated autoloads from magit-extras.el (autoload 'magit-run-git-gui "magit-extras" "\ @@ -960,7 +976,7 @@ 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) + (kbd \"C-x g\") \\='ido-enter-magit-status) \(fn)" t nil) @@ -1020,6 +1036,7 @@ with two prefix arguments remove ignored files only. \(git clean -f -d [-x|-X]) \(fn &optional ARG)" t nil) + (autoload 'magit-gitignore-popup "magit-extras" nil t) (autoload 'magit-gitignore "magit-extras" "\ Instruct Git to ignore FILE-OR-PATTERN. @@ -1048,6 +1065,17 @@ on a position in a file-visiting buffer. \(fn &optional WHOAMI FILE-NAME)" t nil) +(autoload 'magit-edit-line-commit "magit-extras" "\ +Edit the commit that added the current line. + +With a prefix argument edit the commit that removes the line, +if any. The commit is determined using `git blame' and made +editable using `git rebase --interactive' if it is reachable +from `HEAD', or by checking out the commit (or a branch that +points at it) otherwise. + +\(fn &optional TYPE)" t nil) + (autoload 'magit-reshelve-since "magit-extras" "\ Change the author and committer dates of the commits since REV. @@ -1111,10 +1139,11 @@ patch application, a cherry-pick, a revert, or a bisect. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-extras" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-files" "magit-files.el" (23238 5904 -;;;;;; 71120 342000)) +;;;### (autoloads nil "magit-files" "magit-files.el" (0 0 0 0)) ;;; Generated autoloads from magit-files.el (autoload 'magit-find-file "magit-files" "\ @@ -1132,7 +1161,7 @@ existing one. \(fn REV FILE)" t nil) (autoload 'magit-file-popup "magit" nil t) -(defvar global-magit-file-mode nil "\ +(defvar global-magit-file-mode t "\ Non-nil if Global Magit-File mode is enabled. See the `global-magit-file-mode' command for a description of this minor mode. @@ -1159,10 +1188,18 @@ Checkout FILE from REV. \(fn REV FILE)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-files" '("magit-"))) + +;;;*** + +;;;### (autoloads nil "magit-git" "magit-git.el" (0 0 0 0)) +;;; Generated autoloads from magit-git.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-git" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (23238 5904 -;;;;;; 88357 305000)) +;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (0 0 0 0)) ;;; Generated autoloads from magit-imenu.el (autoload 'magit-imenu--log-prev-index-position-function "magit-imenu" "\ @@ -1276,10 +1313,11 @@ beginning of the line. \(fn)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-imenu" '("magit-imenu--index-function"))) + ;;;*** -;;;### (autoloads nil "magit-log" "magit-log.el" (23238 5904 90471 -;;;;;; 712000)) +;;;### (autoloads nil "magit-log" "magit-log.el" (0 0 0 0)) ;;; Generated autoloads from magit-log.el (autoload 'magit-log-buffer-file-popup "magit-log" "\ @@ -1335,6 +1373,11 @@ active, restrict the log to the lines that the region touches. \(fn &optional FOLLOW BEG END)" t nil) +(autoload 'magit-log-trace-definition "magit-log" "\ +Show log for the definition at point. + +\(fn FILE FN REV)" t nil) + (autoload 'magit-reflog-current "magit-log" "\ Display the reflog of the current branch. @@ -1360,10 +1403,18 @@ Show commits in a branch that are not merged in the upstream branch. \(fn HEAD UPSTREAM)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-log" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-merge" "magit-merge.el" (23238 5904 -;;;;;; 85985 140000)) +;;;### (autoloads nil "magit-margin" "magit-margin.el" (0 0 0 0)) +;;; Generated autoloads from magit-margin.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-margin" '("magit-"))) + +;;;*** + +;;;### (autoloads nil "magit-merge" "magit-merge.el" (0 0 0 0)) ;;; Generated autoloads from magit-merge.el (autoload 'magit-merge-popup "magit" nil t) @@ -1441,17 +1492,33 @@ Abort the current merge operation. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-merge" '("magit-"))) + +;;;*** + +;;;### (autoloads nil "magit-mode" "magit-mode.el" (0 0 0 0)) +;;; Generated autoloads from magit-mode.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-mode" '("magit-" "disable-magit-save-buffers" "inhibit-magit-refresh"))) + ;;;*** -;;;### (autoloads nil "magit-notes" "magit-notes.el" (23238 5904 -;;;;;; 109938 714000)) +;;;### (autoloads nil "magit-notes" "magit-notes.el" (0 0 0 0)) ;;; Generated autoloads from magit-notes.el (autoload 'magit-notes-popup "magit" nil t) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-notes" '("magit-"))) + +;;;*** + +;;;### (autoloads nil "magit-process" "magit-process.el" (0 0 0 0)) +;;; Generated autoloads from magit-process.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-process" '("magit-" "tramp-sh-handle-"))) + ;;;*** -;;;### (autoloads nil "magit-refs" "magit-refs.el" (23238 5904 63680 -;;;;;; 22000)) +;;;### (autoloads nil "magit-refs" "magit-refs.el" (0 0 0 0)) ;;; Generated autoloads from magit-refs.el (autoload 'magit-show-refs-popup "magit-refs" "\ @@ -1478,10 +1545,11 @@ Refs are compared with a branch read from the user. \(fn &optional REF ARGS)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-refs" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-remote" "magit-remote.el" (23238 5904 -;;;;;; 104814 209000)) +;;;### (autoloads nil "magit-remote" "magit-remote.el" (0 0 0 0)) ;;; Generated autoloads from magit-remote.el (autoload 'magit-clone "magit-remote" "\ @@ -1742,39 +1810,31 @@ is asked to pull. START has to be reachable from that commit. \(fn URL START END)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-remote" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-repos" "magit-repos.el" (23238 5904 -;;;;;; 95744 285000)) +;;;### (autoloads nil "magit-repos" "magit-repos.el" (0 0 0 0)) ;;; Generated autoloads from magit-repos.el (autoload 'magit-list-repositories "magit-repos" "\ Display a list of repositories. -Use the options `magit-repository-directories' -and `magit-repository-directories-depth' to -control which repositories are displayed. +Use the options `magit-repository-directories' to control which +repositories are displayed. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-repos" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-reset" "magit-reset.el" (23238 5904 -;;;;;; 94293 154000)) +;;;### (autoloads nil "magit-reset" "magit-reset.el" (0 0 0 0)) ;;; 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. +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) @@ -1782,30 +1842,54 @@ With a prefix argument also reset the working tree. \(fn COMMIT &optional HARD)" t nil) (autoload 'magit-reset-head "magit-reset" "\ -Reset the head and index to COMMIT, but not the working tree. +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. +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. +Reset the `HEAD', index, and working tree to COMMIT. \(git reset --hard REVISION) \(fn COMMIT)" t nil) +(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-worktree "magit-reset" "\ +Reset the worktree to COMMIT. +Keep the `HEAD' and index as-is. + +\(fn COMMIT)" t nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-reset" '("magit-reset-"))) + ;;;*** -;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (23238 -;;;;;; 5904 102328 994000)) +;;;### (autoloads nil "magit-section" "magit-section.el" (0 0 0 0)) +;;; Generated autoloads from magit-section.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-section" '("magit-"))) + +;;;*** + +;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (0 0 0 +;;;;;; 0)) ;;; Generated autoloads from magit-sequence.el (autoload 'magit-sequencer-continue "magit-sequence" "\ @@ -1990,10 +2074,11 @@ Abort the current rebase operation, restoring the original branch. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-sequence" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-stash" "magit-stash.el" (23238 5904 -;;;;;; 84720 792000)) +;;;### (autoloads nil "magit-stash" "magit-stash.el" (0 0 0 0)) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash-popup "magit-stash" nil t) @@ -2097,10 +2182,11 @@ Show all diffs of a stash in a buffer. \(fn STASH &optional ARGS FILES)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-stash" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-status" "magit-status.el" (23238 5904 -;;;;;; 91797 296000)) +;;;### (autoloads nil "magit-status" "magit-status.el" (0 0 0 0)) ;;; Generated autoloads from magit-status.el (autoload 'magit-init "magit-status" "\ @@ -2129,10 +2215,12 @@ then offer to initialize it as a new repository. \(fn DIRECTORY)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-status" '("magit"))) + ;;;*** -;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (23238 -;;;;;; 5904 111806 568000)) +;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (0 0 +;;;;;; 0 0)) ;;; Generated autoloads from magit-submodule.el (autoload 'magit-submodule-popup "magit-submodule" nil t) @@ -2245,10 +2333,11 @@ Display a list of the current repository's submodules. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-submodule" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (23238 5904 -;;;;;; 73316 479000)) +;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (0 0 0 0)) ;;; Generated autoloads from magit-subtree.el (autoload 'magit-subtree-popup "magit-subtree" nil t) @@ -2282,10 +2371,11 @@ Extract the history of the subtree PREFIX. \(fn PREFIX COMMIT ARGS)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-subtree" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-tag" "magit-tag.el" (23238 5904 83258 -;;;;;; 341000)) +;;;### (autoloads nil "magit-tag" "magit-tag.el" (0 0 0 0)) ;;; Generated autoloads from magit-tag.el (autoload 'magit-tag-popup "magit" nil t) @@ -2307,10 +2397,29 @@ defaulting to the tag at point. \(fn TAGS)" t nil) +(autoload 'magit-tag-prune "magit-tag" "\ +Offer to delete tags missing locally from REMOTE, and vice versa. + +\(fn TAGS REMOTE-TAGS REMOTE)" t nil) + +(autoload 'magit-tag-release "magit-tag" "\ +Create an opinionated release tag. + +Assume version tags that match \"\\\\`v?[0-9]\\\\(\\\\.[0-9]\\\\)*\\\\'\". +Prompt for the name of the new tag using the highest existing tag +as initial input and call \"git tag --annotate --sign -m MSG\" TAG, +regardless of whether these arguments are enabled in the popup. +Given a TAG \"v1.2.3\" and a repository \"/path/to/foo-bar\", the +MESSAGE would be \"Foo-Bar 1.2.3\". + +Because it is so opinionated, this command is not available from +the tag popup by default. + +\(fn TAG)" t nil) + ;;;*** -;;;### (autoloads nil "magit-utils" "magit-utils.el" (23238 5904 -;;;;;; 59686 267000)) +;;;### (autoloads nil "magit-utils" "magit-utils.el" (0 0 0 0)) ;;; Generated autoloads from magit-utils.el (autoload 'magit-emacs-Q-command "magit-utils" "\ @@ -2333,10 +2442,11 @@ See info node `(magit)Debugging Tools' for more information. (advice-add 'org-man-export :around 'org-man-export--magit-gitman) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-utils" '("magit-" "whitespace-dont-turn-on-in-magit-mode"))) + ;;;*** -;;;### (autoloads nil "magit-wip" "magit-wip.el" (23238 5904 66508 -;;;;;; 461000)) +;;;### (autoloads nil "magit-wip" "magit-wip.el" (0 0 0 0)) ;;; Generated autoloads from magit-wip.el (defvar magit-wip-after-save-mode nil "\ @@ -2402,10 +2512,30 @@ command which is about to be called are committed. \(fn &optional ARG)" t nil) +(autoload 'magit-wip-commit-initial-backup "magit-wip" "\ +Before saving, commit current file to a worktree wip ref. + +The user has to add this function to `before-save-hook'. + +Commit the current state of the visited file before saving the +current buffer to that file. This backs up the same version of +the file as `backup-buffer' would, but stores the backup in the +worktree wip ref, which is also used by the various Magit Wip +modes, instead of in a backup file as `backup-buffer' would. + +This function ignores the variables that affect `backup-buffer' +and can be used along-side that function, which is recommended +because this function only backs up files that are tracked in +a Git repository. + +\(fn)" nil nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-wip" '("magit-"))) + ;;;*** -;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (23238 -;;;;;; 5904 107352 870000)) +;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (0 0 0 +;;;;;; 0)) ;;; Generated autoloads from magit-worktree.el (autoload 'magit-worktree-popup "magit-worktree" nil t) @@ -2419,11 +2549,12 @@ Create a new BRANCH and check it out in a new worktree at PATH. \(fn PATH BRANCH START-POINT &optional FORCE)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit-worktree" '("magit-"))) + ;;;*** -;;;### (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") (23238 5904 106157 387000)) +;;;### (autoloads nil nil ("magit-core.el" "magit-obsolete.el" "magit-pkg.el") +;;;;;; (0 0 0 0)) ;;;*** @@ -2431,5 +2562,6 @@ Create a new BRANCH and check it out in a new worktree at PATH. ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; magit-autoloads.el ends here diff --git a/elpa/magit-20180404.1428/magit-autorevert.el b/elpa/magit-20180828.1055/magit-autorevert.el similarity index 92% rename from elpa/magit-20180404.1428/magit-autorevert.el rename to elpa/magit-20180828.1055/magit-autorevert.el index c4681ae7..4a5fd619 100644 --- a/elpa/magit-20180404.1428/magit-autorevert.el +++ b/elpa/magit-20180828.1055/magit-autorevert.el @@ -111,12 +111,10 @@ seconds of user inactivity. That is not desirable." (magit-toplevel) (or (not magit-auto-revert-tracked-only) (magit-file-tracked-p buffer-file-name)) - (not auto-revert-mode)) ; see #3014 + (not auto-revert-mode) ; see #3014 + (not global-auto-revert-mode)) ; see #3460 (auto-revert-mode 1)))) -;;;###autoload -(defvar magit-revert-buffers t) ; obsolete - ;;;###autoload (define-globalized-minor-mode magit-auto-revert-mode auto-revert-mode magit-turn-on-auto-revert-mode-if-desired @@ -124,14 +122,16 @@ seconds of user inactivity. That is not desirable." :link '(info-link "(magit)Automatic Reverting of File-Visiting Buffers") :group 'magit-auto-revert :group 'magit-essentials - ;; When `global-auto-revert-mode' is enabled, then this mode is - ;; redundant. When `magit-revert-buffers' is nil, then the user has - ;; opted out of the automatic reverts while the old implementation - ;; was still in use. In all other cases enable the mode because if - ;; buffers are not automatically reverted that would make many very - ;; common tasks much more cumbersome. - :init-value (and (with-no-warnings magit-revert-buffers) - (not global-auto-revert-mode) + ;; - When `global-auto-revert-mode' is enabled, then this mode is + ;; redundant. + ;; - In all other cases enable the mode because if buffers are not + ;; automatically reverted that would make many very common tasks + ;; much more cumbersome. + ;; - When `magit-revert-buffers' is nil, then the user has opted out + ;; of the automatic reverts while a very old implementation was + ;; still in use. We continued to respect that setting for another + ;; two and a half years, but no longer do so now. + :init-value (and (not global-auto-revert-mode) (not noninteractive))) ;; - Unfortunately `:init-value t' only sets the value of the mode ;; variable but does not cause the mode function to be called. @@ -151,9 +151,7 @@ seconds of user inactivity. That is not desirable." Do not use this function elsewhere, and don't remove it from the `after-init-hook'. For more information see the comments and code surrounding the definition of this function." - ;; `magit-revert-buffers' may have been set to nil before the alias - ;; had been established, so consult the value of both variables. - (if (and magit-auto-revert-mode (with-no-warnings magit-revert-buffers)) + (if magit-auto-revert-mode (let ((start (current-time))) (magit-message "Turning on magit-auto-revert-mode...") (magit-auto-revert-mode 1) diff --git a/elpa/magit-20180404.1428/magit-bisect.el b/elpa/magit-20180828.1055/magit-bisect.el similarity index 100% rename from elpa/magit-20180404.1428/magit-bisect.el rename to elpa/magit-20180828.1055/magit-bisect.el diff --git a/elpa/magit-20180828.1055/magit-blame.el b/elpa/magit-20180828.1055/magit-blame.el new file mode 100644 index 00000000..223a171b --- /dev/null +++ b/elpa/magit-20180828.1055/magit-blame.el @@ -0,0 +1,926 @@ +;;; magit-blame.el --- blame support for Magit -*- lexical-binding: t -*- + +;; Copyright (C) 2012-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: + +;; Annotates each line in file-visiting buffer with information from +;; the revision which last modified the line. + +;;; Code: + +(require 'magit) + +;;; Options + +(defgroup magit-blame nil + "Blame support for Magit." + :link '(info-link "(magit)Blaming") + :group 'magit-modes) + +(defcustom magit-blame-styles + '((headings + (heading-format . "%-20a %C %s\n")) + (margin + (margin-format . (" %s%f" " %C %a" " %H")) + (margin-width . 42) + (margin-face . magit-blame-margin) + (margin-body-face . (magit-blame-dimmed))) + (highlight + (highlight-face . magit-blame-highlight)) + (lines + (show-lines . t))) + "List of styles used to visualize blame information. + +Each entry has the form (IDENT (KEY . VALUE)...). IDENT has +to be a symbol uniquely identifing the style. The following +KEYs are recognized: + + `show-lines' + Whether to prefix each chunk of lines with a thin line. + This has no effect if `heading-format' is non-nil. + `highlight-face' + Face used to highlight the first line of each chunk. + If this is nil, then those lines are not highlighted. + `heading-format' + String specifing the information to be shown above each + chunk of lines. It must end with a newline character. + `margin-format' + String specifing the information to be shown in the left + buffer margin. It must NOT end with a newline character. + This can also be a list of formats used for the lines at + the same positions within the chunk. If the chunk has + more lines than formats are specified, then the last is + repeated. + `margin-width' + Width of the margin, provided `margin-format' is non-nil. + `margin-face' + Face used in the margin, provided `margin-format' is + non-nil. This face is used in combination with the faces + that are specific to the used %-specs. If this is nil, + then `magit-blame-margin' is used. + `margin-body-face' + Face used in the margin for all but first line of a chunk. + This face is used in combination with the faces that are + specific to the used %-specs. This can also be a list of + faces (usually one face), in which case only these faces + are used and the %-spec faces are ignored. A good value + might be `(magit-blame-dimmed)'. If this is nil, then + the same face as for the first line is used. + +The following %-specs can be used in `heading-format' and +`margin-format': + + %H hash using face `magit-blame-hash' + %s summary using face `magit-blame-summary' + %a author using face `magit-blame-name' + %A author time using face `magit-blame-date' + %c committer using face `magit-blame-name' + %C committer time using face `magit-blame-date' + +Additionally if `margin-format' ends with %f, then the string +that is displayed in the margin is made at least `margin-width' +characters wide, which may be desirable if the used face sets +the background color. + +The style used in the current buffer can be cycled from the blame +popup. Blame commands (except `magit-blame-echo') use the first +style as the initial style when beginning to blame in a buffer." + :package-version '(magit . "2.13.0") + :group 'magit-blame + :type 'string) + +(defcustom magit-blame-echo-style 'lines + "The blame visualization style used by `magit-blame-echo'. +A symbol that has to be used as the identifier for one of the +styles defined in `magit-blame-styles'." + :package-version '(magit . "2.13.0") + :group 'magit-blame + :type 'symbol) + +(defcustom magit-blame-time-format "%F %H:%M" + "Format for time strings in blame headings." + :group 'magit-blame + :type 'string) + +(defcustom magit-blame-read-only t + "Whether to initially make the blamed buffer read-only." + :package-version '(magit . "2.13.0") + :group 'magit-blame + :type 'boolean) + +(defcustom magit-blame-disable-modes '(fci-mode yascroll-bar-mode) + "List of modes not compatible with Magit-Blame mode. +This modes are turned off when Magit-Blame mode is turned on, +and then turned on again when turning off the latter." + :group 'magit-blame + :type '(repeat (symbol :tag "Mode"))) + +(defcustom magit-blame-mode-lighter " Blame" + "The mode-line lighter of the Magit-Blame mode." + :group 'magit-blame + :type '(choice (const :tag "No lighter" "") string)) + +(defcustom magit-blame-goto-chunk-hook + '(magit-blame-maybe-update-revision-buffer + magit-blame-maybe-show-message) + "Hook run after point entered another chunk." + :package-version '(magit . "2.13.0") + :group 'magit-blame + :type 'hook + :get 'magit-hook-custom-get + :options '(magit-blame-maybe-update-revision-buffer + magit-blame-maybe-show-message)) + +;;; Faces + +(defface magit-blame-highlight + '((((class color) (background light)) + :background "grey80" + :foreground "black") + (((class color) (background dark)) + :background "grey25" + :foreground "white")) + "Face used for highlighting when blaming. +Also see option `magit-blame-styles'." + :group 'magit-faces) + +(defface magit-blame-margin + '((t :inherit magit-blame-highlight + :weight normal + :slant normal)) + "Face used for the blame margin by default when blaming. +Also see option `magit-blame-styles'." + :group 'magit-faces) + +(defface magit-blame-dimmed + '((t :inherit magit-dimmed + :weight normal + :slant normal)) + "Face used for the blame margin in some cases when blaming. +Also see option `magit-blame-styles'." + :group 'magit-faces) + +(defface magit-blame-heading + '((t :inherit magit-blame-highlight + :weight normal + :slant normal)) + "Face used for blame headings by default when blaming. +Also see option `magit-blame-styles'." + :group 'magit-faces) + +(defface magit-blame-summary nil + "Face used for commit summaries when blaming." + :group 'magit-faces) + +(defface magit-blame-hash nil + "Face used for commit hashes when blaming." + :group 'magit-faces) + +(defface magit-blame-name nil + "Face used for author and committer names when blaming." + :group 'magit-faces) + +(defface magit-blame-date nil + "Face used for dates when blaming." + :group 'magit-faces) + +;;; Chunks + +(defclass magit-blame-chunk () + (;; + (orig-rev :initarg :orig-rev) + (orig-line :initarg :orig-line) + (final-line :initarg :final-line) + (num-lines :initarg :num-lines) + ;; previous + (prev-rev :initform nil) + (prev-file :initform nil) + ;; filename + (orig-file))) + +(defun magit-current-blame-chunk (&optional type) + (or (and (not (and type (not (eq type magit-blame-type)))) + (magit-blame-chunk-at (point))) + (and type + (let ((rev (or magit-buffer-refname magit-buffer-revision)) + (file (magit-file-relative-name nil (not magit-buffer-file-name))) + (line (format "%i,+1" (line-number-at-pos)))) + (unless file + (error "Buffer does not visit a tracked file")) + (with-temp-buffer + (magit-with-toplevel + (magit-git-insert + "blame" "--porcelain" + (if (memq magit-blame-type '(final removal)) + (cons "--reverse" (magit-blame-arguments)) + (magit-blame-arguments)) + "-L" line rev "--" file) + (goto-char (point-min)) + (car (magit-blame--parse-chunk type)))))))) + +(defun magit-blame-chunk-at (pos) + (--some (overlay-get it 'magit-blame-chunk) + (overlays-at pos))) + +(defun magit-blame--overlay-at (&optional pos key) + (unless pos + (setq pos (point))) + (--first (overlay-get it (or key 'magit-blame-chunk)) + (nconc (overlays-at pos) + (overlays-in pos pos)))) + +;;; Keymaps + +(defvar magit-blame-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-c C-q") 'magit-blame-quit) + map) + "Keymap for `magit-blame-mode'. +Note that most blaming key bindings are defined +in `magit-blame-read-only-mode-map' instead.") + +(defvar magit-blame-read-only-mode-map + (let ((map (make-sparse-keymap))) + (cond ((featurep 'jkl) + (define-key map [return] 'magit-show-commit) + (define-key map (kbd "i") 'magit-blame-previous-chunk) + (define-key map (kbd "I") 'magit-blame-previous-chunk-same-commit) + (define-key map (kbd "k") 'magit-blame-next-chunk) + (define-key map (kbd "K") 'magit-blame-next-chunk-same-commit) + (define-key map (kbd "j") 'magit-blame) + (define-key map (kbd "l") 'magit-blame-removal) + (define-key map (kbd "f") 'magit-blame-reverse) + (define-key map (kbd "b") 'magit-blame-popup)) + (t + (define-key map (kbd "C-m") 'magit-show-commit) + (define-key map (kbd "p") 'magit-blame-previous-chunk) + (define-key map (kbd "P") 'magit-blame-previous-chunk-same-commit) + (define-key map (kbd "n") 'magit-blame-next-chunk) + (define-key map (kbd "N") 'magit-blame-next-chunk-same-commit) + (define-key map (kbd "b") 'magit-blame) + (define-key map (kbd "r") 'magit-blame-removal) + (define-key map (kbd "f") 'magit-blame-reverse) + (define-key map (kbd "B") 'magit-blame-popup))) + (define-key map (kbd "c") 'magit-blame-cycle-style) + (define-key map (kbd "q") 'magit-blame-quit) + (define-key map (kbd "M-w") 'magit-blame-copy-hash) + (define-key map (kbd "SPC") 'magit-diff-show-or-scroll-up) + (define-key map (kbd "DEL") 'magit-diff-show-or-scroll-down) + map) + "Keymap for `magit-blame-read-only-mode'.") + +;;; Modes +;;;; Variables + +(defvar-local magit-blame-buffer-read-only nil) +(defvar-local magit-blame-cache nil) +(defvar-local magit-blame-disabled-modes nil) +(defvar-local magit-blame-process nil) +(defvar-local magit-blame-recursive-p nil) +(defvar-local magit-blame-type nil) +(defvar-local magit-blame-separator nil) +(defvar-local magit-blame-previous-chunk nil) + +(defvar-local magit-blame--style nil) + +(defsubst magit-blame--style-get (key) + (cdr (assoc key (cdr magit-blame--style)))) + +;;;; Base Mode + +(define-minor-mode magit-blame-mode + "Display blame information inline." + :lighter magit-blame-mode-lighter + (cond (magit-blame-mode + (when (called-interactively-p 'any) + (setq magit-blame-mode nil) + (user-error + (concat "Don't call `magit-blame-mode' directly; " + "instead use `magit-blame' or `magit-blame-popup'"))) + (add-hook 'after-save-hook 'magit-blame--run t t) + (add-hook 'post-command-hook 'magit-blame-goto-chunk-hook t t) + (add-hook 'before-revert-hook 'magit-blame--remove-overlays t t) + (add-hook 'after-revert-hook 'magit-blame--run t t) + (add-hook 'read-only-mode-hook 'magit-blame-toggle-read-only t t) + (setq magit-blame-buffer-read-only buffer-read-only) + (when (or magit-blame-read-only magit-buffer-file-name) + (read-only-mode 1)) + (dolist (mode magit-blame-disable-modes) + (when (and (boundp mode) (symbol-value mode)) + (funcall mode -1) + (push mode magit-blame-disabled-modes))) + (setq magit-blame-separator (magit-blame--format-separator)) + (unless magit-blame--style + (setq magit-blame--style (car magit-blame-styles))) + (magit-blame--update-margin)) + (t + (when (process-live-p magit-blame-process) + (kill-process magit-blame-process) + (while magit-blame-process + (sit-for 0.01))) ; avoid racing the sentinal + (remove-hook 'after-save-hook 'magit-blame--run t) + (remove-hook 'post-command-hook 'magit-blame-goto-chunk-hook t) + (remove-hook 'before-revert-hook 'magit-blame--remove-overlays t) + (remove-hook 'after-revert-hook 'magit-blame--run t) + (remove-hook 'read-only-mode-hook 'magit-blame-toggle-read-only t) + (unless magit-blame-buffer-read-only + (read-only-mode -1)) + (magit-blame-read-only-mode -1) + (dolist (mode magit-blame-disabled-modes) + (funcall mode 1)) + (kill-local-variable 'magit-blame-disabled-modes) + (kill-local-variable 'magit-blame-type) + (kill-local-variable 'magit-blame--style) + (magit-blame--update-margin) + (magit-blame--remove-overlays)))) + +(defun magit-blame-goto-chunk-hook () + (let ((chunk (magit-blame-chunk-at (point)))) + (when (cl-typep chunk 'magit-blame-chunk) + (unless (eq chunk magit-blame-previous-chunk) + (run-hooks 'magit-blame-goto-chunk-hook)) + (setq magit-blame-previous-chunk chunk)))) + +(defun magit-blame-toggle-read-only () + (magit-blame-read-only-mode (if buffer-read-only 1 -1))) + +;;;; Read-Only Mode + +(define-minor-mode magit-blame-read-only-mode + "Provide keybindings for Magit-Blame mode. + +This minor-mode provides the key bindings for Magit-Blame mode, +but only when Read-Only mode is also enabled because these key +bindings would otherwise conflict badly with regular bindings. + +When both Magit-Blame mode and Read-Only mode are enabled, then +this mode gets automatically enabled too and when one of these +modes is toggled, then this mode also gets toggled automatically. + +\\{magit-blame-read-only-mode-map}") + +;;;; Kludges + +(defun magit-blame-put-keymap-before-view-mode () + "Put `magit-blame-read-only-mode' ahead of `view-mode' in `minor-mode-map-alist'." + (--when-let (assq 'magit-blame-read-only-mode + (cl-member 'view-mode minor-mode-map-alist :key #'car)) + (setq minor-mode-map-alist + (cons it (delq it minor-mode-map-alist)))) + (remove-hook 'view-mode-hook #'magit-blame-put-keymap-before-view-mode)) + +(add-hook 'view-mode-hook #'magit-blame-put-keymap-before-view-mode) + +;;; Process + +(defun magit-blame--run () + (magit-with-toplevel + (unless magit-blame-mode + (magit-blame-mode 1)) + (message "Blaming...") + (magit-blame-run-process + (or magit-buffer-refname magit-buffer-revision) + (magit-file-relative-name nil (not magit-buffer-file-name)) + (if (memq magit-blame-type '(final removal)) + (cons "--reverse" (magit-blame-arguments)) + (magit-blame-arguments)) + (list (line-number-at-pos (window-start)) + (line-number-at-pos (1- (window-end nil t))))) + (set-process-sentinel magit-this-process + 'magit-blame-process-quickstart-sentinel))) + +(defun magit-blame-run-process (revision file args &optional lines) + (let ((process (magit-parse-git-async + "blame" "--incremental" args + (and lines (list "-L" (apply #'format "%s,%s" lines))) + revision "--" file))) + (set-process-filter process 'magit-blame-process-filter) + (set-process-sentinel process 'magit-blame-process-sentinel) + (process-put process 'arguments (list revision file args)) + (setq magit-blame-cache (make-hash-table :test 'equal)) + (setq magit-blame-process process))) + +(defun magit-blame-process-quickstart-sentinel (process event) + (when (memq (process-status process) '(exit signal)) + (magit-blame-process-sentinel process event t) + (magit-blame-assert-buffer process) + (with-current-buffer (process-get process 'command-buf) + (when magit-blame-mode + (let ((default-directory (magit-toplevel))) + (apply #'magit-blame-run-process + (process-get process 'arguments))))))) + +(defun magit-blame-process-sentinel (process _event &optional quiet) + (let ((status (process-status process))) + (when (memq status '(exit signal)) + (kill-buffer (process-buffer process)) + (if (and (eq status 'exit) + (zerop (process-exit-status process))) + (unless quiet + (message "Blaming...done")) + (magit-blame-assert-buffer process) + (with-current-buffer (process-get process 'command-buf) + (if magit-blame-mode + (progn (magit-blame-mode -1) + (message "Blaming...failed")) + (message "Blaming...aborted")))) + (kill-local-variable 'magit-blame-process)))) + +(defun magit-blame-process-filter (process string) + (internal-default-process-filter process string) + (let ((buf (process-get process 'command-buf)) + (pos (process-get process 'parsed)) + (mark (process-mark process)) + type cache) + (with-current-buffer buf + (setq type magit-blame-type) + (setq cache magit-blame-cache)) + (with-current-buffer (process-buffer process) + (goto-char pos) + (while (and (< (point) mark) + (save-excursion (re-search-forward "^filename .+\n" nil t))) + (pcase-let* ((`(,chunk ,revinfo) + (magit-blame--parse-chunk type)) + (rev (oref chunk orig-rev))) + (if revinfo + (puthash rev revinfo cache) + (setq revinfo + (or (gethash rev cache) + (puthash rev (magit-blame--commit-alist rev) cache)))) + (magit-blame--make-overlays buf chunk revinfo)) + (process-put process 'parsed (point)))))) + +(defun magit-blame--parse-chunk (type) + (let (chunk revinfo) + (looking-at "^\\(.\\{40\\}\\) \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\)") + (with-slots (orig-rev orig-file prev-rev prev-file) + (setq chunk (magit-blame-chunk + :orig-rev (match-string 1) + :orig-line (string-to-number (match-string 2)) + :final-line (string-to-number (match-string 3)) + :num-lines (string-to-number (match-string 4)))) + (forward-line) + (let (done) + (while (not done) + (cond ((looking-at "^filename \\(.+\\)") + (setq done t) + (setf orig-file (match-string 1))) + ((looking-at "^previous \\(.\\{40\\}\\) \\(.+\\)") + (setf prev-rev (match-string 1)) + (setf prev-file (match-string 2))) + ((looking-at "^\\([^ ]+\\) \\(.+\\)") + (push (cons (match-string 1) + (match-string 2)) revinfo))) + (forward-line))) + (when (and (eq type 'removal) prev-rev) + (cl-rotatef orig-rev prev-rev) + (cl-rotatef orig-file prev-file) + (setq revinfo nil))) + (list chunk revinfo))) + +(defun magit-blame--commit-alist (rev) + (cl-mapcar 'cons + '("summary" + "author" "author-time" "author-tz" + "committer" "committer-time" "committer-tz") + (split-string (magit-rev-format "%s\v%an\v%ad\v%cn\v%cd" rev + "--date=format:%s\v%z") + "\v"))) + +(defun magit-blame-assert-buffer (process) + (unless (buffer-live-p (process-get process 'command-buf)) + (kill-process process) + (user-error "Buffer being blamed has been killed"))) + +;;; Display + +(defun magit-blame--make-overlays (buf chunk revinfo) + (with-current-buffer buf + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (forward-line (1- (oref chunk final-line))) + (let ((beg (point)) + (end (save-excursion + (forward-line (oref chunk num-lines)) + (point)))) + (magit-blame--remove-overlays beg end) + (magit-blame--make-margin-overlays chunk revinfo beg end) + (magit-blame--make-heading-overlay chunk revinfo beg end) + (magit-blame--make-highlight-overlay chunk beg)))))) + +(defun magit-blame--make-margin-overlays (chunk revinfo _beg end) + (save-excursion + (let ((line 0)) + (while (< (point) end) + (magit-blame--make-margin-overlay chunk revinfo line) + (forward-line) + (cl-incf line))))) + +(defun magit-blame--make-margin-overlay (chunk revinfo line) + (let* ((end (line-end-position)) + ;; If possible avoid putting this on the first character + ;; of the line to avoid a conflict with the line overlay. + (beg (min (1+ (line-beginning-position)) end)) + (ov (make-overlay beg end))) + (overlay-put ov 'magit-blame-chunk chunk) + (overlay-put ov 'magit-blame-revinfo revinfo) + (overlay-put ov 'magit-blame-margin line) + (magit-blame--update-margin-overlay ov))) + +(defun magit-blame--make-heading-overlay (chunk revinfo beg end) + (let ((ov (make-overlay beg end))) + (overlay-put ov 'magit-blame-chunk chunk) + (overlay-put ov 'magit-blame-revinfo revinfo) + (overlay-put ov 'magit-blame-heading t) + (magit-blame--update-heading-overlay ov))) + +(defun magit-blame--make-highlight-overlay (chunk beg) + (let ((ov (make-overlay beg (1+ (line-end-position))))) + (overlay-put ov 'magit-blame-chunk chunk) + (overlay-put ov 'magit-blame-highlight t) + (magit-blame--update-highlight-overlay ov))) + +(defun magit-blame--update-margin () + (setq left-margin-width (or (magit-blame--style-get 'margin-width) 0)) + (set-window-buffer (selected-window) (current-buffer))) + +(defun magit-blame--update-overlays () + (save-restriction + (widen) + (dolist (ov (overlays-in (point-min) (point-max))) + (cond ((overlay-get ov 'magit-blame-heading) + (magit-blame--update-heading-overlay ov)) + ((overlay-get ov 'magit-blame-margin) + (magit-blame--update-margin-overlay ov)) + ((overlay-get ov 'magit-blame-highlight) + (magit-blame--update-highlight-overlay ov)))))) + +(defun magit-blame--update-margin-overlay (ov) + (overlay-put + ov 'before-string + (and (magit-blame--style-get 'margin-width) + (propertize + "o" 'display + (list (list 'margin 'left-margin) + (let ((line (overlay-get ov 'magit-blame-margin)) + (format (magit-blame--style-get 'margin-format)) + (face (magit-blame--style-get 'margin-face))) + (magit-blame--format-string + ov + (or (and (atom format) + format) + (nth line format) + (car (last format))) + (or (and (not (zerop line)) + (magit-blame--style-get 'margin-body-face)) + face + 'magit-blame-margin)))))))) + +(defun magit-blame--update-heading-overlay (ov) + (overlay-put + ov 'before-string + (--if-let (magit-blame--style-get 'heading-format) + (magit-blame--format-string ov it 'magit-blame-heading) + (and (magit-blame--style-get 'show-lines) + (or (not (magit-blame--style-get 'margin-format)) + (save-excursion + (goto-char (overlay-start ov)) + ;; Special case of the special case described in + ;; `magit-blame--make-margin-overlay'. For empty + ;; lines it is not possible to show both overlays + ;; without the line being to high. + (not (= (point) (line-end-position))))) + magit-blame-separator)))) + +(defun magit-blame--update-highlight-overlay (ov) + (overlay-put ov 'face (magit-blame--style-get 'highlight-face))) + +(defun magit-blame--format-string (ov format face) + (let* ((chunk (overlay-get ov 'magit-blame-chunk)) + (revinfo (overlay-get ov 'magit-blame-revinfo)) + (key (list format face)) + (string (cdr (assoc key revinfo)))) + (unless string + (setq string + (and format + (magit-blame--format-string-1 (oref chunk orig-rev) + revinfo format face))) + (nconc revinfo (list (cons key string)))) + string)) + +(defun magit-blame--format-string-1 (rev revinfo format face) + (let ((str + (if (equal rev "0000000000000000000000000000000000000000") + (propertize (concat (if (string-prefix-p "\s" format) "\s" "") + "Not Yet Committed" + (if (string-suffix-p "\n" format) "\n" "")) + 'face face) + (magit--format-spec + (propertize format 'face face) + (cl-flet* ((p0 (s f) + (propertize s 'face (if face + (if (listp face) + face + (list f face)) + f))) + (p1 (k f) + (p0 (cdr (assoc k revinfo)) f)) + (p2 (k1 k2 f) + (p0 (magit-blame--format-time-string + (cdr (assoc k1 revinfo)) + (cdr (assoc k2 revinfo))) + f))) + `((?H . ,(p0 rev 'magit-blame-hash)) + (?s . ,(p1 "summary" 'magit-blame-summary)) + (?a . ,(p1 "author" 'magit-blame-name)) + (?c . ,(p1 "committer" 'magit-blame-name)) + (?A . ,(p2 "author-time" "author-tz" 'magit-blame-date)) + (?C . ,(p2 "committer-time" "committer-tz" 'magit-blame-date)) + (?f . ""))))))) + (if-let ((width (and (string-suffix-p "%f" format) + (magit-blame--style-get 'margin-width)))) + (concat str + (propertize (make-string (max 0 (- width (length str))) ?\s) + 'face face)) + str))) + +(defun magit-blame--format-separator () + (propertize + (concat (propertize "\s" 'display '(space :height (2))) + (propertize "\n" 'line-height t)) + 'face (list :background + (face-attribute 'magit-blame-heading :background nil t)))) + +(defun magit-blame--format-time-string (time tz) + (let* ((time-format (or (magit-blame--style-get 'time-format) + magit-blame-time-format)) + (tz-in-second (and (not (version< emacs-version "25")) + (string-match "%z" time-format) + (car (last (parse-time-string tz)))))) + (format-time-string time-format + (seconds-to-time (string-to-number time)) + tz-in-second))) + +(defun magit-blame--remove-overlays (&optional beg end) + (save-restriction + (widen) + (dolist (ov (overlays-in (or beg (point-min)) + (or end (point-max)))) + (when (overlay-get ov 'magit-blame-chunk) + (delete-overlay ov))))) + +(defun magit-blame-maybe-show-message () + (when (magit-blame--style-get 'show-message) + (let ((message-log-max 0)) + (if-let ((msg (cdr (assq 'heading + (gethash (oref (magit-current-blame-chunk) + orig-rev) + magit-blame-cache))))) + (progn (setq msg (substring msg 0 -1)) + (set-text-properties 0 (length msg) nil msg) + (message msg)) + (message "Commit data not available yet. Still blaming."))))) + +;;; Commands + +;;;###autoload +(defun magit-blame-echo () + "For each line show the revision in which it was added. +Show the information about the chunk at point in the echo area +when moving between chunks. Unlike other blaming commands, do +not turn on `read-only-mode'." + (interactive) + (when magit-buffer-file-name + (user-error "Blob buffers aren't supported")) + (setq-local magit-blame--style + (assq magit-blame-echo-style magit-blame-styles)) + (setq-local magit-blame-disable-modes + (cons 'eldoc-mode magit-blame-disable-modes)) + (if (not magit-blame-mode) + (let ((magit-blame-read-only nil)) + (magit-blame)) + (read-only-mode -1) + (magit-blame--update-overlays))) + +;;;###autoload +(defun magit-blame () + "For each line show the revision in which it was added." + (interactive) + (magit-blame--pre-blame-assert 'addition) + (magit-blame--pre-blame-setup 'addition) + (magit-blame--run)) + +;;;###autoload +(defun magit-blame-removal () + "For each line show the revision in which it was removed." + (interactive) + (unless magit-buffer-file-name + (user-error "Only blob buffers can be blamed in reverse")) + (magit-blame--pre-blame-assert 'removal) + (magit-blame--pre-blame-setup 'removal) + (magit-blame--run)) + +;;;###autoload +(defun magit-blame-reverse () + "For each line show the last revision in which it still exists." + (interactive) + (unless magit-buffer-file-name + (user-error "Only blob buffers can be blamed in reverse")) + (magit-blame--pre-blame-assert 'final) + (magit-blame--pre-blame-setup 'final) + (magit-blame--run)) + +(defun magit-blame--pre-blame-assert (type) + (unless (magit-toplevel) + (magit--not-inside-repository-error)) + (if (and magit-blame-mode + (eq type magit-blame-type)) + (if-let ((chunk (magit-current-blame-chunk))) + (unless (oref chunk prev-rev) + (user-error "Chunk has no further history")) + (user-error "Commit data not available yet. Still blaming.")) + (unless (magit-file-relative-name nil (not magit-buffer-file-name)) + (if buffer-file-name + (user-error "Buffer isn't visiting a tracked file") + (user-error "Buffer isn't visiting a file"))))) + +(defun magit-blame--pre-blame-setup (type) + (when magit-blame-mode + (if (eq type magit-blame-type) + (let ((style magit-blame--style)) + (magit-blame-visit-other-file) + (setq-local magit-blame--style style) + (setq-local magit-blame-recursive-p t) + ;; Set window-start for the benefit of quickstart. + (redisplay)) + (magit-blame--remove-overlays))) + (setq magit-blame-type type)) + +(defun magit-blame-visit-other-file () + "Visit another blob related to the current chunk." + (interactive) + (with-slots (prev-rev prev-file orig-line) + (magit-current-blame-chunk) + (unless prev-rev + (user-error "Chunk has no further history")) + (magit-with-toplevel + (magit-find-file prev-rev prev-file)) + ;; TODO Adjust line like magit-diff-visit-file. + (goto-char (point-min)) + (forward-line (1- orig-line)))) + +(defun magit-blame-visit-file () + "Visit the blob related to the current chunk." + (interactive) + (with-slots (orig-rev orig-file orig-line) + (magit-current-blame-chunk) + (magit-with-toplevel + (magit-find-file orig-rev orig-file)) + (goto-char (point-min)) + (forward-line (1- orig-line)))) + +(defun magit-blame-quit () + "Turn off Magit-Blame mode. +If the buffer was created during a recursive blame, +then also kill the buffer." + (interactive) + (magit-blame-mode -1) + (when magit-blame-recursive-p + (kill-buffer))) + +(defun magit-blame-next-chunk () + "Move to the next chunk." + (interactive) + (--if-let (next-single-char-property-change (point) 'magit-blame-chunk) + (goto-char it) + (user-error "No more chunks"))) + +(defun magit-blame-previous-chunk () + "Move to the previous chunk." + (interactive) + (--if-let (previous-single-char-property-change (point) 'magit-blame-chunk) + (goto-char it) + (user-error "No more chunks"))) + +(defun magit-blame-next-chunk-same-commit (&optional previous) + "Move to the next chunk from the same commit.\n\n(fn)" + (interactive) + (if-let ((rev (oref (magit-current-blame-chunk) orig-rev))) + (let ((pos (point)) ov) + (save-excursion + (while (and (not ov) + (not (= pos (if previous (point-min) (point-max)))) + (setq pos (funcall + (if previous + 'previous-single-char-property-change + 'next-single-char-property-change) + pos 'magit-blame-chunk))) + (--when-let (magit-blame--overlay-at pos) + (when (equal (oref (magit-blame-chunk-at pos) orig-rev) rev) + (setq ov it))))) + (if ov + (goto-char (overlay-start ov)) + (user-error "No more chunks from same commit"))) + (user-error "This chunk hasn't been blamed yet"))) + +(defun magit-blame-previous-chunk-same-commit () + "Move to the previous chunk from the same commit." + (interactive) + (magit-blame-next-chunk-same-commit 'previous-single-char-property-change)) + +(defun magit-blame-cycle-style () + "Change how blame information is visualized. +Cycle through the elements of option `magit-blame-styles'." + (interactive) + (setq magit-blame--style + (or (cadr (cl-member (car magit-blame--style) + magit-blame-styles :key #'car)) + (car magit-blame-styles))) + (magit-blame--update-margin) + (magit-blame--update-overlays)) + +(defun magit-blame-copy-hash () + "Save hash of the current chunk's commit to the kill ring. + +When the region is active, then save the region's content +instead of the hash, like `kill-ring-save' would." + (interactive) + (if (use-region-p) + (copy-region-as-kill nil nil 'region) + (kill-new (message "%s" (oref (magit-current-blame-chunk) orig-rev))))) + +;;; Popup + +;;;###autoload (autoload 'magit-blame-popup "magit-blame" nil t) +(magit-define-popup magit-blame-popup + "Popup console for blame commands." + :man-page "git-blame" + :switches '((?w "Ignore whitespace" "-w") + (?r "Do not treat root commits as boundaries" "--root")) + :options '((?M "Detect lines moved or copied within a file" "-M") + (?C "Detect lines moved or copied between files" "-C")) + :actions '("Actions" + (?b "Show commits adding lines" magit-blame) + (?r (lambda () + (with-current-buffer magit-pre-popup-buffer + (and (not buffer-file-name) + (propertize "Show commits removing lines" + 'face 'default)))) + magit-blame-removal) + (?f (lambda () + (with-current-buffer magit-pre-popup-buffer + (and (not buffer-file-name) + (propertize "Show last commits that still have lines" + 'face 'default)))) + magit-blame-reverse) + (lambda () + (and (with-current-buffer magit-pre-popup-buffer + magit-blame-mode) + (propertize "Refresh" 'face 'magit-popup-heading))) + (?c "Cycle style" magit-blame-cycle-style)) + :default-arguments '("-w") + :max-action-columns 1 + :default-action 'magit-blame) + +;;; Utilities + +(defun magit-blame-maybe-update-revision-buffer () + (unless magit--update-revision-buffer + (setq magit--update-revision-buffer nil) + (when-let ((chunk (magit-current-blame-chunk)) + (commit (oref chunk orig-rev)) + (buffer (magit-mode-get-buffer 'magit-revision-mode nil t))) + (setq magit--update-revision-buffer (list commit buffer)) + (run-with-idle-timer + magit-update-other-window-delay nil + (lambda () + (pcase-let ((`(,rev ,buf) magit--update-revision-buffer)) + (setq magit--update-revision-buffer nil) + (when (buffer-live-p buf) + (let ((magit-display-buffer-noselect t)) + (apply #'magit-show-commit rev (magit-diff-arguments)))))))))) + +(provide 'magit-blame) +;;; magit-blame.el ends here diff --git a/elpa/magit-20180404.1428/magit-bookmark.el b/elpa/magit-20180828.1055/magit-bookmark.el similarity index 97% rename from elpa/magit-20180404.1428/magit-bookmark.el rename to elpa/magit-20180828.1055/magit-bookmark.el index 174ab59a..a2156a41 100644 --- a/elpa/magit-20180404.1428/magit-bookmark.el +++ b/elpa/magit-20180828.1055/magit-bookmark.el @@ -49,14 +49,14 @@ This function will: (apply fn args) (signal 'bookmark-error-no-filename (list 'stringp default-directory))) (when (derived-mode-p 'magit-mode) - (-when-let (hidden-sections (bookmark-prop-get bookmark - 'magit-hidden-sections)) - (--each (oref magit-root-section children) - (if (member (cons (oref it type) - (oref it value)) + (when-let ((hidden-sections (bookmark-prop-get bookmark + 'magit-hidden-sections))) + (dolist (child (oref magit-root-section children)) + (if (member (cons (oref child type) + (oref child value)) hidden-sections) - (magit-section-hide it) - (magit-section-show it))))) + (magit-section-hide child) + (magit-section-show child))))) (--when-let (bookmark-get-position bookmark) (goto-char it)) (--when-let (bookmark-get-front-context-string bookmark) diff --git a/elpa/magit-20180404.1428/magit-branch.el b/elpa/magit-20180828.1055/magit-branch.el similarity index 93% rename from elpa/magit-20180404.1428/magit-branch.el rename to elpa/magit-20180828.1055/magit-branch.el index 804baeb0..b346db8f 100644 --- a/elpa/magit-20180404.1428/magit-branch.el +++ b/elpa/magit-20180828.1055/magit-branch.el @@ -136,8 +136,8 @@ at least in some repositories, then a good value could be: Of course you can also fine-tune: - ((\"origin/maint\" . \"\\`hotfix/\") - (\"origin/master\" . \"\\`feature/\")) + ((\"origin/maint\" . \"\\\\\\=`hotfix/\") + (\"origin/master\" . \"\\\\\\=`feature/\")) If you use remote branches as UPSTREAM, then you might also want to set `magit-branch-prefer-remote-upstream' to a non-nil value. @@ -167,14 +167,19 @@ When t, then rename the branch named OLD on the remote specified by `branch.OLD.pushRemote' to NEW, provided OLD exists on that remote and unless NEW already exists on the remote. -When `github-only', then behave like `t' if the remote points to - a repository on Github, otherwise like `local-only'." +When `forge-only' and the `forge' package is available, then + behave like `t' if the remote points to a repository on a forge + (currently Github or Gitlab), otherwise like `local-only'. + +Another supported but obsolete value is `github-only'. It is a + misnomer because it now treated as an alias for `forge-only'." + :package-version '(magit . "2.90.0") :group 'magit-commands :type '(choice (const :tag "Don't preserve push-remote setup" nil) (const :tag "Preserve push-remote setup" local-only) (const :tag "... and rename corresponding branch on remote" t) - (const :tag "... but only if remote is on Github" github-only))) + (const :tag "... but only if remote is on a forge" forge-only))) (defcustom magit-branch-popup-show-variables t "Whether the `magit-branch-popup' shows Git variables. @@ -186,6 +191,12 @@ and change branch related variables." :group 'magit-commands :type 'boolean) +(defcustom magit-published-branches '("origin/master") + "List of branches that are considered to be published." + :package-version '(magit . "2.13.0") + :group 'magit-commands + :type '(repeat string)) + ;;; Branch Popup (defvar magit-branch-config-variables) @@ -197,7 +208,7 @@ and change branch related variables." :variables (lambda () (and magit-branch-popup-show-variables magit-branch-config-variables)) - :actions '((?b "Checkout" magit-checkout) nil + :actions `((?b "Checkout" magit-checkout) nil (?C "Configure..." magit-branch-config-popup) (?l "Checkout local branch" magit-branch-checkout) (?s "Create new spin-off" magit-branch-spinoff) @@ -205,11 +216,12 @@ and change branch related variables." (?c "Checkout new branch" magit-branch-and-checkout) (?n "Create new branch" magit-branch) (?x "Reset" magit-branch-reset) - (?y "Checkout pull-request" magit-checkout-pull-request) - (?Y "Create from pull-request" magit-branch-pull-request) - (?k "Delete" magit-branch-delete) (?w "Checkout new worktree" magit-worktree-checkout) - (?W "Create new worktree" magit-worktree-branch)) + (?W "Create new worktree" magit-worktree-branch) + (?k "Delete" magit-branch-delete) + ,@(and (not (require (quote forge) nil t)) + '((?y "Checkout pull-request" magit-checkout-pull-request) + (?Y "Create from pull-request" magit-branch-pull-request)))) :default-action 'magit-checkout :max-action-columns 3 :setup-function 'magit-branch-popup-setup) @@ -374,17 +386,16 @@ Please see the manual for more information." .base.repo.ssh_url))) (upstream-url (magit-get "remote" upstream "url")) (remote .head.repo.owner.login) - (branch .head.ref) - (pr-branch 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)) - (if (equal .head.repo.full_name - .base.repo.full_name) - (let ((inhibit-magit-refresh t)) - (magit-branch branch (concat upstream "/" pr-branch))) + (branch (magit--pullreq-branch pr t)) + (pr-branch .head.ref)) + (if (magit--pullreq-from-upstream-p pr) + (let ((tracking (concat upstream "/" pr-branch))) + (unless (magit-branch-p tracking) + (magit-call-git "fetch" upstream)) + (let ((inhibit-magit-refresh t)) + (magit-branch branch tracking)) + (magit-set upstream "branch" branch "pushRemote") + (magit-set upstream "branch" branch "pullRequestRemote")) (if (magit-remote-p remote) (let ((url (magit-get "remote" remote "url")) (fetch (magit-get-all "remote" remote "fetch"))) @@ -408,18 +419,17 @@ Please see the manual for more information." ((string-prefix-p "git://" upstream-url) .head.repo.git_url) (t (error "%s has an unexpected format" upstream-url))))) - (magit-call-git "branch" branch - (concat remote "/" pr-branch)) - (magit-call-git "branch" branch - (concat "--set-upstream-to=" - (if magit-branch-prefer-remote-upstream - (concat upstream "/" .base.ref) - .base.ref))) - (magit-set "true" "branch" branch "rebase") + (magit-call-git "branch" branch (concat remote "/" pr-branch)) (if (or .locked (not (equal branch pr-branch))) (magit-set upstream "branch" branch "pushRemote") (magit-set remote "branch" branch "pushRemote")) (magit-set remote "branch" branch "pullRequestRemote")) + (magit-set "true" "branch" branch "rebase") + (magit-call-git "branch" branch + (concat "--set-upstream-to=" + (if magit-branch-prefer-remote-upstream + (concat upstream "/" .base.ref) + .base.ref))) (magit-set (number-to-string .number) "branch" branch "pullRequest") (magit-set .title "branch" branch "description") (magit-refresh) @@ -454,9 +464,7 @@ Please see the manual for more information." (user-error "Not a valid starting-point: %s" choice)))) (let ((branch (magit-read-string-ns (concat prompt " named")))) (list branch - (with-no-warnings - (let ((magit-no-confirm-default nil)) - (magit-read-starting-point prompt branch))) + (magit-read-starting-point prompt branch) args))))) ;;;###autoload @@ -494,7 +502,7 @@ from the source branch's upstream, then an error is raised." (magit-branch-arguments))) (when (magit-branch-p branch) (user-error "Cannot spin off %s. It already exists" branch)) - (-if-let (current (magit-get-current-branch)) + (if-let ((current (magit-get-current-branch))) (let ((tracked (magit-get-upstream-branch current)) base) (when from @@ -575,7 +583,7 @@ defaulting to the branch at point." (list (magit-read-branch-prefer-other (if force "Force delete branch" "Delete branch"))))) (unless force - (-when-let (unmerged (-remove #'magit-branch-merged-p branches)) + (when-let ((unmerged (-remove #'magit-branch-merged-p branches))) (if (magit-confirm 'delete-unmerged-branch "Delete unmerged branch %s" "Delete %i unmerged branches" @@ -584,7 +592,7 @@ defaulting to the branch at point." (or (setq branches (-difference branches unmerged)) (user-error "Abort"))))) (list branches force))) - (let* ((refs (-map #'magit-ref-fullname branches)) + (let* ((refs (mapcar #'magit-ref-fullname branches)) (ambiguous (--remove it refs))) (when ambiguous (user-error @@ -649,7 +657,7 @@ defaulting to the branch at point." (put 'magit-branch-delete 'interactive-only t) (defun magit-branch-maybe-delete-pr-remote (branch) - (-when-let (remote (magit-get "branch" branch "pullRequestRemote")) + (when-let ((remote (magit-get "branch" branch "pullRequestRemote"))) (let* ((variable (format "remote.%s.fetch" remote)) (refspecs (magit-get-all variable))) (unless (member (format "+refs/heads/*:refs/remotes/%s/*" remote) @@ -680,14 +688,15 @@ defaulting to the branch at point." (when (memq (process-status process) '(exit signal)) (if (= (process-exit-status process) 0) (magit-process-sentinel process event) - (-if-let (rest (-filter #'magit-ref-exists-p refs)) + (if-let ((rest (-filter #'magit-ref-exists-p refs))) (progn (process-put process 'inhibit-refresh t) (magit-process-sentinel process event) (setq magit-this-error nil) (message "Some remote branches no longer exist. %s" "Deleting just the local tracking refs instead...") - (--each rest (magit-call-git "update-ref" "-d" it)) + (dolist (ref rest) + (magit-call-git "update-ref" "-d" ref)) (magit-refresh) (message "Deleting local remote-tracking refs...done")) (magit-process-sentinel process event))))) @@ -728,8 +737,11 @@ the remote." (when (and (equal (magit-get-push-remote new) remote) ;; ...and if it does not, then we must abort. (not (eq magit-branch-rename-push-target 'local-only)) - (or (not (eq magit-branch-rename-push-target 'github-only)) - (magit--github-remote-p remote))) + (or (not (memq magit-branch-rename-push-target + '(forge-only github-only))) + (and (require (quote forge) nil t) + (fboundp 'forge--forge-remote-p) + (forge--forge-remote-p remote)))) (let ((old-target (magit-get-push-branch old t)) (new-target (magit-get-push-branch new t))) (when (and old-target (not new-target)) @@ -882,7 +894,7 @@ variable `branch..description'." (width (+ (length branch) 19)) (var (format "branch.%s.description" branch))) (concat var " " (make-string (- width (length var)) ?\s) - (-if-let (value (magit-get var)) + (if-let ((value (magit-get var))) (propertize (car (split-string value "\n")) 'face 'magit-popup-option-value) (propertize "unset" 'face 'magit-popup-disabled-argument))))) @@ -909,7 +921,7 @@ already set. When nil, then always unset." (list branch (and (not (magit-get-upstream-branch branch)) (magit-read-upstream-branch branch))))) (if upstream - (-let (((remote . merge) (magit-split-branch-name upstream))) + (pcase-let ((`(,remote . ,merge) (magit-split-branch-name upstream))) (setf (magit-get (format "branch.%s.remote" branch)) remote) (setf (magit-get (format "branch.%s.merge" branch)) (concat "refs/heads/" merge))) @@ -926,11 +938,11 @@ already set. When nil, then always unset." 'magit-branch-local 'magit-branch-remote))) (concat varM (make-string (- width (length varM)) ?\s) - (-if-let (value (magit-get varM)) + (if-let ((value (magit-get varM))) (propertize value 'face face) (propertize "unset" 'face 'magit-popup-disabled-argument)) "\n " varR (make-string (- width (length varR)) ?\s) - (-if-let (value (magit-get varR)) + (if-let ((value (magit-get varR))) (propertize value 'face face) (propertize "unset" 'face 'magit-popup-disabled-argument))))) diff --git a/elpa/magit-20180404.1428/magit-collab.el b/elpa/magit-20180828.1055/magit-collab.el similarity index 86% rename from elpa/magit-20180404.1428/magit-collab.el rename to elpa/magit-20180828.1055/magit-collab.el index ee350431..7c4b1a26 100644 --- a/elpa/magit-20180404.1428/magit-collab.el +++ b/elpa/magit-20180828.1055/magit-collab.el @@ -67,12 +67,10 @@ Currently this only supports Github, but that restriction will be lifted eventually to support other Git forges." (interactive (list (magit-read-pull-request "Visit pull request"))) (browse-url (format "https://github.com/%s/pull/%s" - ;; Cannot use --> yet. See #3134. - (let* ((it pr) - (it (cdr (assq 'base it))) - (it (cdr (assq 'repo it))) - (it (cdr (assq 'full_name it)))) - it) + (--> pr + (cdr (assq 'base it)) + (cdr (assq 'repo it)) + (cdr (assq 'full_name it))) (cdr (assq 'number pr))))) ;;; Utilities @@ -139,9 +137,9 @@ exist, then raise an error." host))))) (defun magit--github-remote-p (remote) - (or (--when-let (magit-get "remote" remote "pushurl") + (or (--when-let (magit-git-string "remote" "get-url" "--push" remote) (magit--github-url-p it)) - (--when-let (magit-get "remote" remote "url") + (--when-let (magit-git-string "remote" "get-url" "--all" remote) (magit--github-url-p it)))) (defun magit--github-url-equal (r1 r2) @@ -153,5 +151,21 @@ exist, then raise an error." (match-string 2 r2)))) (and n1 n2 (equal n1 n2)))))) +(defun magit--pullreq-from-upstream-p (pr) + (let-alist pr + (equal .head.repo.full_name + .base.repo.full_name))) + +(defun magit--pullreq-branch (pr &optional assert-new) + (let-alist pr + (let ((branch .head.ref)) + (when (and (not (magit--pullreq-from-upstream-p pr)) + (or (not .maintainer_can_modify) + (magit-branch-p branch))) + (setq branch (format "pr-%s" .number))) + (when (and assert-new (magit-branch-p branch)) + (user-error "Branch `%s' already exists" branch)) + branch))) + (provide 'magit-collab) ;;; magit-collab.el ends here diff --git a/elpa/magit-20180404.1428/magit-commit.el b/elpa/magit-20180828.1055/magit-commit.el similarity index 80% rename from elpa/magit-20180404.1428/magit-commit.el rename to elpa/magit-20180828.1055/magit-commit.el index 5defecaa..9eba71b4 100644 --- a/elpa/magit-20180404.1428/magit-commit.el +++ b/elpa/magit-20180828.1055/magit-commit.el @@ -43,7 +43,7 @@ :type '(repeat (string :tag "Argument"))) (defcustom magit-commit-ask-to-stage 'verbose - "Whether to ask to stage everything when committing and nothing is staged." + "Whether to ask to stage all unstaged changes when committing and nothing is staged." :package-version '(magit . "2.3.0") :group 'magit-commands :type '(choice (const :tag "Ask showing diff" verbose) @@ -126,8 +126,8 @@ an error while using those is harder to recover from." (require 'epa) (let ((keys (--map (concat (epg-sub-key-id (car (epg-key-sub-key-list it))) " " - (-when-let (id-obj (car (epg-key-user-id-list it))) - (let ((id-str (epg-user-id-string id-obj))) + (when-let ((id-obj (car (epg-key-user-id-list it)))) + (let ((id-str (epg-user-id-string id-obj))) (if (stringp id-str) id-str (epg-decode-dn id-obj))))) @@ -165,6 +165,7 @@ With a prefix argument, amend to the commit at `HEAD' instead. "Amend the last commit. \n(git commit --amend ARGS)" (interactive (list (magit-commit-arguments))) + (magit-commit-amend-assert) (magit-run-git-with-editor "commit" "--amend" args)) ;;;###autoload @@ -180,6 +181,7 @@ to inverse the meaning of the prefix argument. \n(git commit (not magit-commit-extend-override-date) magit-commit-extend-override-date))) (when (setq args (magit-commit-assert args (not override-date))) + (magit-commit-amend-assert) (let ((process-environment process-environment)) (unless override-date (push (magit-rev-format "GIT_COMMITTER_DATE=%cD") process-environment)) @@ -200,6 +202,7 @@ and ignore the option. (if current-prefix-arg (not magit-commit-reword-override-date) magit-commit-reword-override-date))) + (magit-commit-amend-assert) (let ((process-environment process-environment)) (unless override-date (push (magit-rev-format "GIT_COMMITTER_DATE=%cD") process-environment)) @@ -254,7 +257,7 @@ depending on the value of option `magit-commit-squash-confirm'." (defun magit-commit-squash-internal (option commit &optional args rebase edit confirmed) - (-when-let (args (magit-commit-assert args t)) + (when-let ((args (magit-commit-assert args t))) (when commit (when (and rebase (not (magit-rev-ancestor-p commit "HEAD"))) (magit-read-char-case @@ -263,7 +266,7 @@ depending on the value of option `magit-commit-squash-confirm'." (?s "[s]elect other" (setq commit nil)) (?a "[a]bort" (user-error "Quit"))))) (when commit - (setq commit (magit-rebase-interactive-assert commit))) + (setq commit (magit-rebase-interactive-assert commit t))) (if (and commit (or confirmed (not (or rebase @@ -287,9 +290,10 @@ depending on the value of option `magit-commit-squash-confirm'." (when (and (magit-commit-squash-internal option commit args rebase edit t) rebase) + (magit-commit-amend-assert commit) (magit-rebase-interactive-1 commit (list "--autosquash" "--autostash") - "" "true" t))) + "" "true" nil t))) (format "Type %%p on a commit to %s into it," (substring option 2)) nil nil (list "--graph")) @@ -297,6 +301,15 @@ depending on the value of option `magit-commit-squash-confirm'." (let ((magit-display-buffer-noselect t)) (apply #'magit-diff-staged nil (magit-diff-arguments))))))) +(defun magit-commit-amend-assert (&optional commit) + (--when-let (magit-list-publishing-branches commit) + (let ((m1 "This commit has already been published to ") + (m2 ".\nDo you really want to modify it")) + (magit-confirm 'amend-published + (concat m1 "%s" m2) + (concat m1 "%i public branches" m2) + nil it)))) + (defun magit-commit-assert (args &optional strict) (cond ((or (magit-anything-staged-p) @@ -321,7 +334,7 @@ depending on the value of option `magit-commit-squash-confirm'." (magit-commit-ask-to-stage (when (eq magit-commit-ask-to-stage 'verbose) (magit-diff-unstaged)) - (prog1 (when (y-or-n-p "Nothing staged. Stage and commit everything? ") + (prog1 (when (y-or-n-p "Nothing staged. Stage and commit all unstaged changes? ") (magit-run-git "add" "-u" ".") (or args (list "--"))) (when (and (eq magit-commit-ask-to-stage 'verbose) @@ -330,7 +343,7 @@ depending on the value of option `magit-commit-squash-confirm'." (t (user-error "Nothing staged")))) -(defvar magit--reselve-history nil) +(defvar magit--reshelve-history nil) ;;;###autoload (defun magit-commit-reshelve (date) @@ -345,23 +358,57 @@ history element." (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) + magit--reshelve-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)))) + 'magit--reshelve-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))))) +;;;###autoload (autoload 'magit-commit-absorb-popup "magit-commit" nil t) +(magit-define-popup magit-commit-absorb-popup + "Spread unstaged changes across recent commits. +Without a prefix argument just call `magit-commit-absorb'. +With a prefix argument use a popup buffer to select arguments." + :man-page "git-bisect" + :options '((?c "Diff context lines" "--context=") + (?s "Strictness" "--strict=")) + :actions '((?x "Absorb" magit-commit-absorb)) + :default-action 'magit-commit-absorb + :use-prefix 'popup) + +(defun magit-commit-absorb (&optional commit args confirmed) + "Spread unstaged changes across recent commits. +This command requires the git-autofixup script, which is +available from https://github.com/torbiak/git-autofixup." + (interactive (list (magit-get-upstream-branch) + (magit-commit-absorb-arguments))) + (unless (executable-find "git-autofixup") + (user-error "This command requires the git-autofixup script, which %s" + "is available from https://github.com/torbiak/git-autofixup")) + (when (magit-anything-staged-p) + (user-error "Cannot absorb when there are staged changes")) + (unless (magit-anything-unstaged-p) + (user-error "There are no unstaged changes that could be absorbed")) + (when commit + (setq commit (magit-rebase-interactive-assert commit t))) + (if (and commit confirmed) + (progn (magit-run-git-async "autofixup" "-vv" args commit) t) + (magit-log-select + (lambda (commit) + (magit-commit-absorb commit args t)) + nil nil nil nil commit))) + ;;; Pending Diff (defun magit-commit-diff () (when (and git-commit-mode magit-commit-show-diff) - (-when-let (diff-buffer (magit-mode-get-buffer 'magit-diff-mode)) + (when-let ((diff-buffer (magit-mode-get-buffer 'magit-diff-mode))) ;; This window just started displaying the commit message ;; buffer. Without this that buffer would immediately be ;; replaced with the diff buffer. See #2632. @@ -372,7 +419,7 @@ history element." (magit-display-buffer-noselect t) (inhibit-quit nil)) (message "Diffing changes to be committed (C-g to abort diffing)") - (-if-let (fn (cl-case last-command + (if-let ((fn (cl-case last-command (magit-commit (apply-partially 'magit-diff-staged nil)) (magit-commit-all @@ -380,7 +427,7 @@ history element." ((magit-commit-amend magit-commit-reword magit-rebase-reword-commit) - 'magit-diff-while-amending))) + 'magit-diff-while-amending)))) (funcall fn args) (if (magit-anything-staged-p) (magit-diff-staged nil args) @@ -437,34 +484,36 @@ actually insert the entry." (undo-boundary) (goto-char (point-max)) (while (re-search-backward (concat "^" comment-start) nil t)) - (cond ((re-search-backward (format "* %s\\(?: (\\([^)]+\\))\\)?: " file) - nil t) - (when (equal (match-string 1) defun) - (setq defun nil)) - (re-search-forward ": ")) - (t - (when (re-search-backward "^[\\*(].+\n" nil t) - (goto-char (match-end 0))) - (while (re-search-forward "^[^\\*#\n].*\n" nil t)) - (if defun - (progn (insert (format "* %s (%s): \n" file defun)) - (setq defun nil)) - (insert (format "* %s: \n" file))) - (backward-char) - (unless (looking-at "\n[\n\\']") - (insert ?\n) - (backward-char)))) - (when defun - (forward-line) - (let ((limit (save-excursion - (and (re-search-forward "^\\*" nil t) - (point))))) - (unless (or (looking-back (format "(%s): " defun) - (line-beginning-position)) - (re-search-forward (format "^(%s): " defun) limit t)) - (while (re-search-forward "^[^\\*#\n].*\n" limit t)) - (insert (format "(%s): \n" defun)) - (backward-char)))))) + (save-restriction + (narrow-to-region (point-min) (point)) + (cond ((re-search-backward (format "* %s\\(?: (\\([^)]+\\))\\)?: " file) + nil t) + (when (equal (match-string 1) defun) + (setq defun nil)) + (re-search-forward ": ")) + (t + (when (re-search-backward "^[\\*(].+\n" nil t) + (goto-char (match-end 0))) + (while (re-search-forward "^[^\\*\n].*\n" nil t)) + (if defun + (progn (insert (format "* %s (%s): \n" file defun)) + (setq defun nil)) + (insert (format "* %s: \n" file))) + (backward-char) + (unless (looking-at "\n[\n\\']") + (insert ?\n) + (backward-char)))) + (when defun + (forward-line) + (let ((limit (save-excursion + (and (re-search-forward "^\\*" nil t) + (point))))) + (unless (or (looking-back (format "(%s): " defun) + (line-beginning-position)) + (re-search-forward (format "^(%s): " defun) limit t)) + (while (re-search-forward "^[^\\*\n].*\n" limit t)) + (insert (format "(%s): \n" defun)) + (backward-char))))))) (provide 'magit-commit) ;;; magit-commit.el ends here diff --git a/elpa/magit-20180404.1428/magit-core.el b/elpa/magit-20180828.1055/magit-core.el similarity index 100% rename from elpa/magit-20180404.1428/magit-core.el rename to elpa/magit-20180828.1055/magit-core.el diff --git a/elpa/magit-20180404.1428/magit-diff.el b/elpa/magit-20180828.1055/magit-diff.el similarity index 94% rename from elpa/magit-20180404.1428/magit-diff.el rename to elpa/magit-20180828.1055/magit-diff.el index b4c7e70e..57f4ed7b 100644 --- a/elpa/magit-20180404.1428/magit-diff.el +++ b/elpa/magit-20180828.1055/magit-diff.el @@ -42,7 +42,9 @@ ;; 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" (key &optional pos)) +(declare-function magit-current-blame-chunk "magit-blame" ()) +(eval-when-compile + (cl-pushnew 'orig-rev eieio--known-slot-names)) (declare-function magit-blame-mode "magit-blame" (&optional arg)) (defvar magit-blame-mode) (defvar git-rebase-line) @@ -108,14 +110,6 @@ member of `magit-section-highlight-hook', which see." :group 'magit-diff :type 'boolean) -(defcustom magit-diff-show-lines-boundary t - "This option is obsolete. -If you have set this to nil, then remove that customization, and -instead customize `magit-diff-highlight-hunk-region-functions'." - :package-version '(magit . "2.1.0") - :group 'magit-diff - :type 'boolean) - (defcustom magit-diff-highlight-hunk-region-functions '(magit-diff-highlight-hunk-region-dim-outside magit-diff-highlight-hunk-region-using-overlays) @@ -129,9 +123,9 @@ This function should not be removed from the value of this option. `magit-diff-highlight-hunk-region-using-overlays' and `magit-diff-highlight-hunk-region-using-underline' emphasize the region by placing delimiting horizonal lines before and after it. -Both of these functions have glitches which cannot be fixed due -to limitations of Emacs' display engine. For more information -see https://github.com/magit/magit/issues/2758 ff. +The underline variant was implemented because Eli said that is +how we should do it. However the overlay variant actually works +better. Also see https://github.com/magit/magit/issues/2758. Instead of, or in addition to, using delimiting horizontal lines, to emphasize the boundaries, you may which to emphasize the text @@ -724,10 +718,10 @@ This is a variant of `magit-diff-popup' which shows the same popup but which limits the diff to the file being visited in the current buffer." (interactive) - (-if-let (file (magit-file-relative-name)) + (if-let ((file (magit-file-relative-name))) (let ((magit-diff-arguments (magit-popup-import-file-args - (-if-let (buffer (magit-mode-get-buffer 'magit-diff-mode)) + (if-let ((buffer (magit-mode-get-buffer 'magit-diff-mode))) (with-current-buffer buffer (nth 3 magit-refresh-args)) (default-value 'magit-diff-arguments)) @@ -970,7 +964,7 @@ be committed." "Show diff for the blob or file visited in the current buffer." (interactive) (require 'magit) - (-if-let (file (magit-file-relative-name)) + (if-let ((file (magit-file-relative-name))) (magit-mode-setup-internal #'magit-diff-mode (list (or magit-buffer-refname (magit-get-current-branch) @@ -995,7 +989,7 @@ be committed." (defvar-local magit-buffer-revision-hash nil) (defun magit-show-commit--arguments () - (-let [(args diff-files) (magit-diff-arguments)] + (pcase-let ((`(,args ,diff-files) (magit-diff-arguments))) (list args (if (derived-mode-p 'magit-log-mode) (and (not (member "--follow" (nth 1 magit-refresh-args))) (nth 2 magit-refresh-args)) @@ -1007,16 +1001,18 @@ be committed." If there is no revision at point or with a prefix argument prompt for a revision." (interactive - (let* ((mcommit (magit-section-when module-commit)) - (atpoint (or (and (bound-and-true-p magit-blame-mode) - (magit-blame-chunk-get :hash)) - mcommit - (magit-branch-or-commit-at-point)))) - (nconc (cons (or (and (not current-prefix-arg) atpoint) - (magit-read-branch-or-commit "Show commit" atpoint)) - (magit-show-commit--arguments)) - (and mcommit (list (magit-section-parent-value - (magit-current-section))))))) + (pcase-let* ((mcommit (magit-section-when module-commit)) + (atpoint (or (and (bound-and-true-p magit-blame-mode) + (oref (magit-current-blame-chunk) orig-rev)) + mcommit + (magit-branch-or-commit-at-point))) + (`(,args ,files) (magit-show-commit--arguments))) + (list (or (and (not current-prefix-arg) atpoint) + (magit-read-branch-or-commit "Show commit" atpoint)) + args + files + (and mcommit (list (magit-section-parent-value + (magit-current-section))))))) (require 'magit) (magit-with-toplevel (when module @@ -1182,7 +1178,8 @@ Customize variable `magit-diff-refine-hunk' to change the default mode." ;;;; Visit commands -(defun magit-diff-visit-file (file &optional other-window force-worktree) +(defun magit-diff-visit-file + (file &optional other-window force-worktree display-fn) "From a diff, visit the corresponding file at the appropriate position. If the diff shows changes in the worktree, the index, or `HEAD', @@ -1199,8 +1196,11 @@ being displayed in another window of the same frame, then just select that window and adjust point. Otherwise, or with a prefix argument, display the buffer in another window. The meaning of the prefix argument can be inverted or further modified using the -option `magit-display-file-buffer-function'. Non-interactively -the optional OTHER-WINDOW argument is taken literally. +option `magit-display-file-buffer-function'. + +Non-interactively the optional OTHER-WINDOW argument is taken +literally. DISPLAY-FN can be used to specify the display +function explicitly, in which case OTHER-WINDOW is ignored. The optional FORCE-WORKTREE means to force visiting the worktree version of the file. To do this interactively use the command @@ -1230,6 +1230,8 @@ version of the file. To do this interactively use the command (find-file-noselect file))))) (cond ((called-interactively-p 'any) (magit-display-file-buffer buf)) + (display-fn + (funcall display-fn buf)) ((or other-window (get-buffer-window buf)) (switch-to-buffer-other-window buf)) (t @@ -1348,7 +1350,7 @@ or `HEAD'." rev)))) (defun magit-diff-visit--hunk () - (-when-let (scope (magit-diff-scope)) + (when-let ((scope (magit-diff-scope))) (let ((section (magit-current-section))) (cl-case scope ((file files) @@ -1476,7 +1478,7 @@ commit or stash at point, then prompt for a commit." (let (rev cmd buf win) (cond (magit-blame-mode - (setq rev (magit-blame-chunk-get :hash)) + (setq rev (oref (magit-current-blame-chunk) orig-rev)) (setq cmd 'magit-show-commit) (setq buf (magit-mode-get-buffer 'magit-revision-mode))) ((derived-mode-p 'git-rebase-mode) @@ -1591,7 +1593,7 @@ is set in `magit-mode-setup'." (_ (concat " in files " (mapconcat #'identity files ", "))))))) (magit-insert-section (diffbuf) - (run-hook-with-args 'magit-diff-sections-hook rev-or-range))) + (magit-run-section-hook 'magit-diff-sections-hook rev-or-range))) (defun magit-insert-diff (rev-or-range) "Insert the diff into this `magit-diff-mode' buffer." @@ -1617,6 +1619,8 @@ is set in `magit-mode-setup'." (define-key map "s" 'magit-stage) (define-key map "u" 'magit-unstage) (define-key map "&" 'magit-do-async-shell-command) + (define-key map "\C-c\C-t" 'magit-diff-trace-definition) + (define-key map "\C-c\C-e" 'magit-diff-edit-hunk-commit) map) "Keymap for `file' sections.") @@ -1633,6 +1637,8 @@ is set in `magit-mode-setup'." (define-key map "s" 'magit-stage) (define-key map "u" 'magit-unstage) (define-key map "&" 'magit-do-async-shell-command) + (define-key map "\C-c\C-t" 'magit-diff-trace-definition) + (define-key map "\C-c\C-e" 'magit-diff-edit-hunk-commit) map) "Keymap for `hunk' sections.") @@ -1683,7 +1689,12 @@ section or a child thereof." (magit-insert-heading) (let (files) (while (looking-at "^[-0-9]+\t[-0-9]+\t\\(.+\\)$") - (push (magit-decode-git-path (match-string 1)) files) + (push (magit-decode-git-path + (let ((f (match-string 1))) + (if (string-match " => " f) + (substring f (match-end 0)) + f))) + files) (magit-delete-line)) (setq files (nreverse files)) (while (looking-at magit-diff-statline-re) @@ -1935,7 +1946,7 @@ Staging and applying changes is documented in info node (mapconcat #'identity files ", ")))))) (setq magit-buffer-revision-hash (magit-rev-parse rev)) (magit-insert-section (commitbuf) - (run-hook-with-args 'magit-revision-sections-hook rev))) + (magit-run-section-hook 'magit-revision-sections-hook rev))) (defun magit-insert-revision-diff (rev) "Insert the diff into this `magit-revision-mode' buffer." @@ -1996,9 +2007,13 @@ or a ref which is not a branch, then it inserts nothing." (defun magit-insert-revision-message (rev) "Insert the commit message into a revision buffer." - (magit-insert-section (commit-message) + (magit-insert-section section (commit-message) + (oset section heading-highlight-face 'magit-diff-hunk-heading-highlight) (let ((beg (point))) - (magit-rev-insert-format "%B" rev) + (insert (save-excursion ; The risky var query can move point. + (with-temp-buffer + (magit-rev-insert-format "%B" rev) + (magit-revision--wash-message)))) (if (= (point) (+ beg 2)) (progn (backward-delete-char 2) (insert "(no message)\n")) @@ -2035,14 +2050,18 @@ or a ref which is not a branch, then it inserts nothing." (goto-char end)))))))))) (save-excursion (forward-line) - (put-text-property beg (point) 'face 'magit-section-secondary-heading) + (add-face-text-property beg (point) 'magit-diff-hunk-heading) (magit-insert-heading)) (when magit-diff-highlight-keywords (save-excursion (while (re-search-forward "\\[[^[]*\\]" nil t) - (put-text-property (match-beginning 0) - (match-end 0) - 'face 'magit-keyword)))) + (let ((beg (match-beginning 0)) + (end (match-end 0))) + (put-text-property + beg end 'face + (if-let ((face (get-text-property beg 'face))) + (list face 'magit-keyword) + 'magit-keyword)))))) (goto-char (point-max)))))) (defun magit-insert-revision-notes (rev) @@ -2050,24 +2069,37 @@ or a ref which is not a branch, then it inserts nothing." (let* ((var "core.notesRef") (def (or (magit-get var) "refs/notes/commits"))) (dolist (ref (or (magit-list-active-notes-refs))) - (magit-insert-section (notes ref (not (equal ref def))) + (magit-insert-section section (notes ref (not (equal ref def))) + (oset section heading-highlight-face 'magit-diff-hunk-heading-highlight) (let ((beg (point))) - (magit-git-insert "-c" (concat "core.notesRef=" ref) - "notes" "show" rev) + (insert (with-temp-buffer + (magit-git-insert "-c" (concat "core.notesRef=" ref) + "notes" "show" rev) + (magit-revision--wash-message))) (if (= (point) beg) (magit-cancel-section) (goto-char beg) (end-of-line) - (put-text-property beg (point) 'face 'magit-section-secondary-heading) (insert (format " (%s)" (propertize (if (string-prefix-p "refs/notes/" ref) (substring ref 11) ref) 'face 'magit-refname))) + (forward-char) + (add-face-text-property beg (point) 'magit-diff-hunk-heading) (magit-insert-heading) (goto-char (point-max)) (insert ?\n))))))) +(defun magit-revision--wash-message () + (let ((major-mode 'git-commit-mode)) + (hack-dir-local-variables) + (hack-local-variables-apply)) + (unless (memq git-commit-major-mode '(nil text-mode)) + (funcall git-commit-major-mode) + (font-lock-ensure)) + (buffer-string)) + (defun magit-insert-revision-headers (rev) "Insert headers about the commit into a revision buffer." (magit-insert-section (headers) @@ -2089,7 +2121,7 @@ or a ref which is not a branch, then it inserts nothing." (insert "Parent: ") (insert (propertize hash 'face 'magit-hash)) (insert " " msg "\n"))))) - (-when-let (merged (magit-list-merged-branches rev)) + (when-let ((merged (magit-list-merged-branches rev))) (insert "Merged: ") (let (branch) (while (and (< (+ (- (point) (line-beginning-position)) @@ -2102,7 +2134,7 @@ or a ref which is not a branch, then it inserts nothing." (when merged (insert (format " (%s more)" (length merged)))) (insert ?\n)) - (-when-let (containing (magit-list-containing-branches rev)) + (when-let ((containing (magit-list-containing-branches rev))) (insert "Containing:") (let (branch) (while (and (< (+ (- (point) (line-beginning-position)) @@ -2115,7 +2147,7 @@ or a ref which is not a branch, then it inserts nothing." (when containing (insert (format " (%s more)" (length containing)))) (insert ?\n)) - (-when-let (follows (magit-get-current-tag rev t)) + (when-let ((follows (magit-get-current-tag rev t))) (let ((tag (car follows)) (cnt (cadr follows))) (magit-insert-section (tag tag) @@ -2123,7 +2155,7 @@ or a ref which is not a branch, then it inserts nothing." (propertize tag 'face 'magit-tag) (propertize (number-to-string cnt) 'face 'magit-branch-local)))))) - (-when-let (precedes (magit-get-next-tag rev t)) + (when-let ((precedes (magit-get-next-tag rev t))) (let ((tag (car precedes)) (cnt (cadr precedes))) (magit-insert-section (tag tag) @@ -2134,38 +2166,58 @@ or a ref which is not a branch, then it inserts nothing." (insert ?\n)))) (defun magit-insert-revision-gravatars (rev beg) - (when (and magit-revision-show-gravatars (window-system)) + (when (and magit-revision-show-gravatars + (window-system)) (require 'gravatar) - (magit-insert-revision-gravatar beg (magit-rev-format "%aE" rev) - (car magit-revision-show-gravatars)) - (magit-insert-revision-gravatar beg (magit-rev-format "%cE" rev) - (cdr magit-revision-show-gravatars)) - (goto-char (point-max)))) - -(defun magit-insert-revision-gravatar (beg email regexp) - (when (and email (goto-char beg) (re-search-forward regexp nil t)) - (ignore-errors - (let* ((offset (length (match-string 0))) + (pcase-let ((`(,author . ,committer) magit-revision-show-gravatars)) + (--when-let (magit-rev-format "%aE" rev) + (magit-insert-revision-gravatar beg rev it author)) + (--when-let (magit-rev-format "%cE" rev) + (magit-insert-revision-gravatar beg rev it committer))))) + +(defun magit-insert-revision-gravatar (beg rev email regexp) + (save-excursion + (goto-char beg) + (when (re-search-forward regexp nil t) + (let* ((column (length (match-string 0))) (font-obj (query-font (font-at (point) (get-buffer-window)))) - (size (* 2 (+ (aref font-obj 4) (aref font-obj 5)))) - (align-to (+ offset (ceiling (/ size (aref font-obj 7) 1.0)))) - (gravatar-size (- size 2)) - (slice1 '(slice .0 .0 1.0 0.5)) - (slice2 '(slice .0 .5 1.0 1.0)) - (image (gravatar-retrieve-synchronously email))) - (unless (eq image 'error) - (when magit-revision-use-gravatar-kludge - (cl-rotatef slice1 slice2)) - (insert (propertize " " 'display `((,@image :ascent center :relief 1) - ,slice1))) - (insert (propertize " " 'display `((space :align-to ,align-to)))) - (insert " ") - (forward-line) - (forward-char offset) - (insert (propertize " " 'display `((,@image :ascent center :relief 1) - ,slice2))) - (insert (propertize " " 'display `((space :align-to ,align-to)))) - (insert " ")))))) + (size (* 2 (+ (aref font-obj 4) + (aref font-obj 5)))) + (align-to (+ column + (ceiling (/ size (aref font-obj 7) 1.0)) + 1)) + (gravatar-size (- size 2))) + (gravatar-retrieve email 'magit-insert-revision-gravatar-cb + (list rev (point-marker) align-to column)))))) + +(defun magit-insert-revision-gravatar-cb (image rev marker align-to column) + (unless (eq image 'error) + (when-let ((buffer (marker-buffer marker))) + (with-current-buffer buffer + (save-excursion + (goto-char marker) + ;; The buffer might display another revision by now or + ;; it might have been refreshed, in which case another + ;; process might already have inserted the image. + (when (and (equal rev (car magit-refresh-args)) + (not (eq (car-safe + (car-safe + (get-text-property (point) 'display))) + 'image))) + (let ((top `((,@image :ascent center :relief 1) + (slice 0.0 0.0 1.0 0.5))) + (bot `((,@image :ascent center :relief 1) + (slice 0.0 0.5 1.0 1.0))) + (align `((space :align-to ,align-to)))) + (when magit-revision-use-gravatar-kludge + (cl-rotatef top bot)) + (let ((inhibit-read-only t)) + (insert (propertize " " 'display top)) + (insert (propertize " " 'display align)) + (forward-line) + (forward-char column) + (insert (propertize " " 'display bot)) + (insert (propertize " " 'display align)))))))))) ;;; Diff Sections @@ -2349,7 +2401,7 @@ are highlighted." (magit-diff-highlight-list section selection)) (magit-diff-highlight-list section)) t) - (-when-let (scope (magit-diff-scope section t)) + (when-let ((scope (magit-diff-scope section t))) (cond ((eq scope 'region) (magit-diff-paint-hunk section selection t)) (selection @@ -2558,8 +2610,8 @@ are highlighted." (cl-labels ((recurse (section) (if (magit-section-match 'hunk section) (magit-diff-update-hunk-refinement section) - (--each (oref section children) - (recurse it))))) + (dolist (child (oref section children)) + (recurse child))))) (recurse magit-root-section)))) @@ -2614,10 +2666,7 @@ face." (defun magit-diff-highlight-hunk-region-using-overlays (section) "Emphasize the hunk-internal region using delimiting horizontal lines. -This is implemented as single-pixel newlines places inside overlays. -Although creating overlays containing newlines is discouraged, -this version turns out to be less glitchy on Emacs 24 than the -other method." +This is implemented as single-pixel newlines places inside overlays." (if (window-system) (let ((beg (magit-diff-hunk-region-beginning)) (end (magit-diff-hunk-region-end)) @@ -2632,10 +2681,7 @@ other method." (defun magit-diff-highlight-hunk-region-using-underline (section) "Emphasize the hunk-internal region using delimiting horizontal lines. This is implemented by overlining and underlining the first and -last (visual) lines of the region. In Emacs 24, using this -method causes `move-end-of-line' to jump to the next line, so -we only use it in Emacs 25 where that glitch was fixed (see -https://github.com/magit/magit/pull/2293 for more details)." +last (visual) lines of the region." (if (window-system) (let* ((beg (magit-diff-hunk-region-beginning)) (end (magit-diff-hunk-region-end)) diff --git a/elpa/magit-20180404.1428/magit-ediff.el b/elpa/magit-20180828.1055/magit-ediff.el similarity index 97% rename from elpa/magit-20180404.1428/magit-ediff.el rename to elpa/magit-20180828.1055/magit-ediff.el index 317bc3e1..7e0716be 100644 --- a/elpa/magit-20180404.1428/magit-ediff.el +++ b/elpa/magit-20180828.1055/magit-ediff.el @@ -214,10 +214,11 @@ 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)." - (interactive (-let [(revA revB) (magit-ediff-compare--read-revisions - nil current-prefix-arg)] - (nconc (list revA revB) - (magit-ediff-read-files revA revB)))) + (interactive + (pcase-let ((`(,revA ,revB) (magit-ediff-compare--read-revisions + nil current-prefix-arg))) + (nconc (list revA revB) + (magit-ediff-read-files revA revB)))) (magit-with-toplevel (let ((conf (current-window-configuration)) (bufA (if revA @@ -306,15 +307,16 @@ mind at all, then it asks the user for a command to run." (setq command #'magit-ediff-show-stash) (setq revB value)) ((pred stringp) - (-let [(a b) (magit-ediff-compare--read-revisions range)] + (pcase-let ((`(,a ,b) (magit-ediff-compare--read-revisions range))) (setq command #'magit-ediff-compare) (setq revA a) (setq revB b))) (_ (when (derived-mode-p 'magit-diff-mode) (pcase (magit-diff-type) - (`committed (-let [(a b) (magit-ediff-compare--read-revisions - (car magit-refresh-args))] + (`committed (pcase-let ((`(,a ,b) + (magit-ediff-compare--read-revisions + (car magit-refresh-args)))) (setq revA a) (setq revB b))) ((guard (not magit-ediff-dwim-show-on-hunks)) @@ -442,11 +444,11 @@ FILE must be relative to the top directory of the repository." three-buffer Ediff is used in order to distinguish changes in the stash that were staged." (interactive (list (magit-read-stash "Stash"))) - (-let* ((revA (concat stash "^1")) - (revB (concat stash "^2")) - (revC stash) - ((fileA fileC) (magit-ediff-read-files revA revC)) - (fileB fileC)) + (pcase-let* ((revA (concat stash "^1")) + (revB (concat stash "^2")) + (revC stash) + (`(,fileA ,fileC) (magit-ediff-read-files revA revC)) + (fileB fileC)) (if (and magit-ediff-show-stash-with-index (member fileA (magit-changed-files revB revA))) (let ((conf (current-window-configuration)) diff --git a/elpa/magit-20180404.1428/magit-extras.el b/elpa/magit-20180828.1055/magit-extras.el similarity index 84% rename from elpa/magit-20180404.1428/magit-extras.el rename to elpa/magit-20180828.1055/magit-extras.el index bf07ffe0..a9e04948 100644 --- a/elpa/magit-20180404.1428/magit-extras.el +++ b/elpa/magit-20180828.1055/magit-extras.el @@ -36,9 +36,10 @@ (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))) + (let ((exe (magit-git-string + "-c" "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" + "X" "gitk.exe"))) + (and exe (file-executable-p exe) exe))) (executable-find "gitk") "gitk") "The Gitk executable." :group 'magit-extras @@ -113,7 +114,7 @@ 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)" + (kbd \"C-x g\") \\='ido-enter-magit-status)" (interactive) (with-no-warnings ; FIXME these are internal variables (setq ido-exit 'fallback fallback 'magit-status)) @@ -125,18 +126,17 @@ like pretty much every other keymap: 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 "/.")))) + (dired-jump other-window + (when-let ((file (magit-file-at-point))) + (expand-file-name (if (file-directory-p file) + (file-name-as-directory file) + file))))) ;;;###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)) + (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 @@ -240,6 +240,14 @@ with two prefix arguments remove ignored files only. ;;; Gitignore +;;;###autoload (autoload 'magit-gitignore-popup "magit-extras" nil t) +(magit-define-popup magit-gitignore-popup + "Popup console for gitignore commands." + :man-page "gitignore" + :actions '((?l "ignore locally" magit-gitignore-locally) + (?g "ignore globally" magit-gitignore)) + :max-action-columns 1) + ;;;###autoload (defun magit-gitignore (file-or-pattern &optional local) "Instruct Git to ignore FILE-OR-PATTERN. @@ -276,7 +284,7 @@ With a prefix argument only ignore locally." (delete-dups (--mapcat (cons (concat "/" it) - (-when-let (ext (file-name-extension it)) + (when-let ((ext (file-name-extension it))) (list (concat "/" (file-name-directory "foo") "*." ext) (concat "*." ext)))) (magit-untracked-files))))) @@ -321,6 +329,76 @@ on a position in a file-visiting buffer." (prompt-for-change-log-name)))) (magit-add-change-log-entry whoami file-name t)) +;;; Edit Line Commit + +;;;###autoload +(defun magit-edit-line-commit (&optional type) + "Edit the commit that added the current line. + +With a prefix argument edit the commit that removes the line, +if any. The commit is determined using `git blame' and made +editable using `git rebase --interactive' if it is reachable +from `HEAD', or by checking out the commit (or a branch that +points at it) otherwise." + (interactive (list (and current-prefix-arg 'removal))) + (let* ((chunk (magit-current-blame-chunk (or type 'addition))) + (rev (oref chunk orig-rev))) + (if (equal rev "0000000000000000000000000000000000000000") + (message "This line has not been committed yet") + (let ((rebase (magit-rev-ancestor-p rev "HEAD")) + (file (expand-file-name (oref chunk orig-file) + (magit-toplevel)))) + (if rebase + (let ((magit--rebase-published-symbol 'edit-published)) + (magit-rebase-edit-commit rev (magit-rebase-arguments))) + (magit-checkout (or (magit-rev-branch rev) rev))) + (unless (and buffer-file-name + (file-equal-p file buffer-file-name)) + (let ((blame-type (and magit-blame-mode magit-blame-type))) + (if rebase + (set-process-sentinel + magit-this-process + (lambda (process event) + (magit-sequencer-process-sentinel process event) + (when (eq (process-status process) 'exit) + (find-file file) + (when blame-type + (magit-blame--pre-blame-setup blame-type) + (magit-blame--run))))) + (find-file file) + (when blame-type + (magit-blame--pre-blame-setup blame-type) + (magit-blame--run))))))))) + +(put 'magit-edit-line-commit 'disabled t) + +(defun magit-diff-edit-hunk-commit () + "From a hunk, edit the respective commit and visit the file. + +First visit the file being modified by the hunk at the correct +location using `magit-diff-visit-file'. This actually visits a +blob. When point is on a diff header, not within an individual +hunk, then this visits the blob the first hunk is about. + +Then invoke `magit-edit-line-commit', which uses an interactive +rebase to make the commit editable, or if that is not possible +because the commit is not reachable from `HEAD' by checking out +that commit directly. This also causes the actual worktree file +to be visited. + +Neither the blob nor the file buffer are killed when finishing +the rebase. If that is undesirable, then it might be better to +use `magit-rebase-edit-command' instead of this command." + (interactive) + (let ((magit-diff-visit-previous-blob nil)) + (magit-diff-visit-file (--if-let (magit-file-at-point) + (expand-file-name it) + (user-error "No file at point")) + nil 'switch-to-buffer)) + (magit-edit-line-commit)) + +(put 'magit-diff-edit-hunk-commit 'disabled t) + ;;; Reshelve ;;;###autoload @@ -362,12 +440,12 @@ be used on highly rearranged and unpublished history." (- (string-to-number (magit-git-string "rev-list" "--count" range)))))) - (push time-rev magit--reselve-history) + (push time-rev magit--reshelve-history) (let ((date (floor (float-time (date-to-time (read-string "Date for first commit: " - time-now 'magit--reselve-history)))))) + time-now 'magit--reshelve-history)))))) (magit-with-toplevel (magit-run-git-async "filter-branch" "--force" "--env-filter" @@ -477,7 +555,8 @@ the minibuffer too." (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] + (pcase-let ((`(,pnt-format ,eob-format ,idx-format) + magit-pop-revision-stack-format)) (let ((default-directory toplevel) (idx (and idx-format (save-excursion @@ -539,8 +618,8 @@ above." (interactive) (if (use-region-p) (copy-region-as-kill nil nil 'region) - (-when-let* ((section (magit-current-section)) - (value (oref section value))) + (when-let ((section (magit-current-section)) + (value (oref section value))) (magit-section-case ((branch commit module-commit tag) (let ((default-directory default-directory) ref) @@ -583,7 +662,7 @@ above." (interactive) (if (use-region-p) (copy-region-as-kill nil nil 'region) - (-when-let (rev (cond ((memq major-mode '(magit-cherry-mode + (when-let ((rev (cond ((memq major-mode '(magit-cherry-mode magit-log-select-mode magit-reflog-mode magit-refs-mode @@ -597,7 +676,7 @@ above." (if (string-match "\\.\\.\\.?\\(.+\\)" r) (match-string 1 r) r))) - ((eq major-mode 'magit-status-mode) "HEAD"))) + ((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) diff --git a/elpa/magit-20180404.1428/magit-files.el b/elpa/magit-20180828.1055/magit-files.el similarity index 90% rename from elpa/magit-20180404.1428/magit-files.el rename to elpa/magit-20180828.1055/magit-files.el index a985a1b4..b77791a9 100644 --- a/elpa/magit-20180404.1428/magit-files.el +++ b/elpa/magit-20180828.1055/magit-files.el @@ -226,7 +226,31 @@ 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 magit-file-popup-actions + :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 + (?t "Trace" magit-log-trace-definition) + (?r (lambda () + (with-current-buffer magit-pre-popup-buffer + (and (not buffer-file-name) + (propertize "...removal" 'face 'default)))) + magit-blame-removal) + (?n "Next blob" magit-blob-next) + (?e "Edit line" magit-edit-line-commit) + nil nil + (?f (lambda () + (with-current-buffer magit-pre-popup-buffer + (and (not buffer-file-name) + (propertize "...reverse" 'face 'default)))) + magit-blame-reverse) + nil) :max-action-columns 5) (defvar magit-file-mode-lighter "") @@ -248,10 +272,18 @@ Currently this only adds the following key bindings. ;;;###autoload (define-globalized-minor-mode global-magit-file-mode magit-file-mode magit-file-mode-turn-on - :package-version '(magit . "2.2.0") + :package-version '(magit . "2.13.0") :link '(info-link "(magit)Minor Mode for Buffers Visiting Files") :group 'magit-essentials - :group 'magit-modes) + :group 'magit-modes + :init-value t) +;; Unfortunately `:init-value t' only sets the value of the mode +;; variable but does not cause the mode function to be called, and we +;; cannot use `:initialize' to call that explicitly because the option +;; is defined before the functions, so we have to do it here. +(cl-eval-when (load) + (when global-magit-file-mode + (global-magit-file-mode 1))) ;;; Blob Mode @@ -261,11 +293,13 @@ Currently this only adds the following key bindings. (define-key map "i" 'magit-blob-previous) (define-key map "k" 'magit-blob-next) (define-key map "j" 'magit-blame) - (define-key map "l" 'magit-blame-reverse)) + (define-key map "l" 'magit-blame-removal) + (define-key map "f" 'magit-blame-reverse)) (t (define-key map "p" 'magit-blob-previous) (define-key map "n" 'magit-blob-next) (define-key map "b" 'magit-blame) + (define-key map "r" 'magit-blame-removal) (define-key map "f" 'magit-blame-reverse))) (define-key map "q" 'magit-kill-this-buffer) map) @@ -293,8 +327,8 @@ Currently this only adds the following key bindings. (defun magit-blob-previous () "Visit the previous blob which modified the current file." (interactive) - (-if-let (file (or magit-buffer-file-name - (buffer-file-name (buffer-base-buffer)))) + (if-let ((file (or magit-buffer-file-name + (buffer-file-name (buffer-base-buffer))))) (--if-let (magit-blob-ancestor magit-buffer-revision file) (magit-blob-visit it (line-number-at-pos)) (user-error "You have reached the beginning of time")) @@ -303,7 +337,7 @@ Currently this only adds the following key bindings. (defun magit-blob-visit (blob-or-file line) (if (stringp blob-or-file) (find-file blob-or-file) - (-let [(rev file) blob-or-file] + (pcase-let ((`(,rev ,file) blob-or-file)) (magit-find-file rev file) (apply #'message "%s (%s %s ago)" (magit-rev-format "%s" rev) @@ -334,7 +368,8 @@ Currently this only adds the following key bindings. If FILE isn't tracked in Git, fallback to using `rename-file'." (interactive (let* ((file (magit-read-file "Rename file")) - (newname (read-file-name (format "Rename %s to file: " file)))) + (newname (read-file-name (format "Rename %s to file: " file) + (expand-file-name (file-name-directory file))))) (list (expand-file-name file (magit-toplevel)) (expand-file-name newname)))) (if (magit-file-tracked-p (magit-convert-filename-for-git file)) @@ -493,7 +528,7 @@ If the value is the symbol `buffer', then use the same arguments as the buffer. With a prefix argument use no arguments. If the value is a list beginning with the symbol `exclude', then -use the arguments as the buffer except for those matched by +use the same arguments as the buffer except for those matched by entries in the cdr of the list. The comparison is done using `string-prefix-p'. With a prefix argument use the same arguments as the buffer. diff --git a/elpa/magit-20180404.1428/magit-git.el b/elpa/magit-20180828.1055/magit-git.el similarity index 94% rename from elpa/magit-20180404.1428/magit-git.el rename to elpa/magit-20180828.1055/magit-git.el index 9d9e0ce3..150abfc2 100644 --- a/elpa/magit-20180404.1428/magit-git.el +++ b/elpa/magit-20180828.1055/magit-git.el @@ -44,6 +44,7 @@ (defvar magit-process-error-message-regexps) (defvar magit-refresh-args) ; from `magit-mode' for `magit-current-file' (defvar magit-branch-prefer-remote-upstream) +(defvar magit-published-branches) (defvar magit-tramp-process-environment nil) @@ -435,7 +436,7 @@ call function WASHER with ARGS as its sole argument." (defmacro magit--with-safe-default-directory (file &rest body) (declare (indent 1) (debug (form body))) - `(-when-let (default-directory (magit--safe-default-directory ,file)) + `(when-let ((default-directory (magit--safe-default-directory ,file))) ,@body)) (defun magit-git-dir (&optional path) @@ -446,7 +447,7 @@ it has to be a path relative to the control directory and its absolute path is returned." (magit--with-refresh-cache (list default-directory 'magit-git-dir path) (magit--with-safe-default-directory nil - (-when-let (dir (magit-rev-parse-safe "--git-dir")) + (when-let ((dir (magit-rev-parse-safe "--git-dir"))) (setq dir (file-name-as-directory (magit-expand-git-file-name dir))) (unless (file-remote-p dir) (setq dir (concat (file-remote-p default-directory) dir))) @@ -489,7 +490,7 @@ returning the truename." (magit--with-refresh-cache (cons (or directory default-directory) 'magit-toplevel) (magit--with-safe-default-directory directory - (-if-let (topdir (magit-rev-parse-safe "--show-toplevel")) + (if-let ((topdir (magit-rev-parse-safe "--show-toplevel"))) (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (if (and @@ -519,7 +520,7 @@ returning the truename." updir (concat (file-remote-p default-directory) (file-name-as-directory topdir)))) - (-when-let (gitdir (magit-rev-parse-safe "--git-dir")) + (when-let ((gitdir (magit-rev-parse-safe "--git-dir"))) (setq gitdir (file-name-as-directory (if (file-name-absolute-p gitdir) ;; We might have followed a symlink. @@ -684,6 +685,10 @@ tracked file." (defun magit-unmerged-files () (magit-git-items "diff-files" "-z" "--name-only" "--diff-filter=U")) +(defun magit-ignored-files () + (magit-git-items "ls-files" "-z" "--others" "--ignored" + "--exclude-standard" "--directory")) + (defun magit-revision-files (rev) (magit-with-toplevel (magit-git-items "ls-tree" "-z" "-r" "--name-only" rev))) @@ -737,7 +742,7 @@ range. Otherwise, it can be any revision or range accepted by (car (process-lines magit-git-executable "--exec-path")))) (ignore-errors (process-lines "mount"))))) - #'> :key (-lambda ((cyg . _win)) (length cyg)))) + #'> :key (pcase-lambda (`(,cyg . ,_win)) (length cyg)))) "Alist of (CYGWIN . WIN32) directory names. Sorted from longest to shortest CYGWIN name." :package-version '(magit . "2.3.0") @@ -917,7 +922,7 @@ corresponds to a ref outside of the namespace." (defun magit-rev-branch (rev) (--when-let (magit-rev-name rev "refs/heads/*") - (unless (string-match-p "~" it) it))) + (unless (string-match-p "[~^]" it) it))) (defun magit-get-shortname (rev) (let* ((fn (apply-partially 'magit-rev-name rev)) @@ -1004,21 +1009,37 @@ to, or to some other symbolic-ref that points to the same ref." (defun magit-branch-at-point () (magit-section-case (branch (oref it value)) - (commit (magit-name-branch (oref it value))))) + (commit (or (magit--painted-branch-at-point) + (magit-name-branch (oref it value)))))) + +(defun magit--painted-branch-at-point (&optional type) + (or (and (not (eq type 'remote)) + (memq (get-text-property (point) 'face) + (list 'magit-branch-local + 'magit-branch-current)) + (cdr (magit-split-branch-name + (thing-at-point 'git-revision t)))) + (and (not (eq type 'local)) + (memq (get-text-property (point) 'face) + (list 'magit-branch-remote + 'magit-branch-remote-head)) + (thing-at-point 'git-revision t)))) (defun magit-local-branch-at-point () (magit-section-case (branch (let ((branch (magit-ref-maybe-qualify (oref it value)))) (when (member branch (magit-list-local-branch-names)) branch))) - (commit (magit-name-local-branch (oref it value))))) + (commit (or (magit--painted-branch-at-point 'local) + (magit-name-local-branch (oref it value)))))) (defun magit-remote-branch-at-point () (magit-section-case (branch (let ((branch (oref it value))) (when (member branch (magit-list-remote-branch-names)) branch))) - (commit (magit-name-remote-branch (oref it value))))) + (commit (or (magit--painted-branch-at-point 'remote) + (magit-name-remote-branch (oref it value)))))) (defun magit-commit-at-point () (or (magit-section-when commit) @@ -1029,10 +1050,11 @@ to, or to some other symbolic-ref that points to the same ref." (or magit-buffer-refname (magit-section-case (branch (magit-ref-maybe-qualify (oref it value))) - (commit (let ((rev (oref it value))) - (or (magit-name-branch rev) - (magit-get-shortname rev) - rev))) + (commit (or (magit--painted-branch-at-point) + (let ((rev (oref it value))) + (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 @@ -1069,15 +1091,24 @@ to, or to some other symbolic-ref that points to the same ref." Return nil if no branch is currently checked out." (magit-git-string "symbolic-ref" "--short" "HEAD")) +(defvar magit-get-previous-branch-timeout 0.5 + "Maximum time to spend in `magit-get-previous-branch'. +Given as a number of seconds.") + (defun magit-get-previous-branch () "Return the refname of the previously checked out branch. Return nil if no branch can be found in the `HEAD' reflog -which is different from the current branch and still exists." - (let ((current (magit-get-current-branch)) +which is different from the current branch and still exists. +The amount of time spent searching is limited by +`magit-get-previous-branch-timeout'." + (let ((t0 (float-time)) + (current (magit-get-current-branch)) (i 1) prev) - (while (and (setq prev (magit-rev-verify (format "@{-%i}" i))) - (or (not (setq prev (magit-rev-branch prev))) - (equal prev current))) + (while (if (> (- (float-time) t0) magit-get-previous-branch-timeout) + (setq prev nil) ;; Timed out. + (and (setq prev (magit-rev-verify (format "@{-%i}" i))) + (or (not (setq prev (magit-rev-branch prev))) + (equal prev current)))) (cl-incf i)) prev)) @@ -1092,8 +1123,8 @@ which is different from the current branch and still exists." (defun magit-get-upstream-branch (&optional branch verify) (and (or branch (setq branch (magit-get-current-branch))) - (-when-let* ((remote (magit-get "branch" branch "remote")) - (merge (magit-get "branch" branch "merge"))) + (when-let ((remote (magit-get "branch" branch "remote")) + (merge (magit-get "branch" branch "merge"))) (and (string-prefix-p "refs/heads/" merge) (let* ((upstream (substring merge 11)) (upstream @@ -1114,10 +1145,10 @@ which is different from the current branch and still exists." (and remote (not (equal remote ".")) ;; The user has opted in... (or force - (--any (if (magit-git-success "check-ref-format" "--branch" it) - (equal it branch) - (string-match-p it branch)) - magit-branch-prefer-remote-upstream)) + (--some (if (magit-git-success "check-ref-format" "--branch" it) + (equal it branch) + (string-match-p it branch)) + magit-branch-prefer-remote-upstream)) ;; and local BRANCH tracks a remote branch... (let ((upstream (magit-get-upstream-branch branch))) ;; whose upstream... @@ -1139,8 +1170,8 @@ which is different from the current branch and still exists." (defun magit-get-push-branch (&optional branch verify) (and (or branch (setq branch (magit-get-current-branch))) - (-when-let* ((remote (magit-get-push-remote branch)) - (push-branch (concat remote "/" branch))) + (when-let ((remote (magit-get-push-remote branch)) + (push-branch (concat remote "/" branch))) (and (or (not verify) (magit-rev-verify push-branch)) push-branch)))) @@ -1271,23 +1302,26 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (defun magit-list-remote-branches (&optional remote) (magit-list-refs (concat "refs/remotes/" remote))) -(defun magit-list-containing-branches (&optional commit) - (--remove (string-match-p "\\`(HEAD" it) +(defun magit-list-related-branches (relation &optional commit arg) + (--remove (string-match-p "\\(\\`(HEAD\\|HEAD -> \\)" it) (--map (substring it 2) - (magit-git-lines "branch" "--contains" commit)))) + (magit-git-lines "branch" arg relation commit)))) -(defun magit-list-merged-branches (&optional commit) - (--remove (string-match-p "\\`(HEAD" it) - (--map (substring it 2) - (magit-git-lines "branch" "--merged" commit)))) +(defun magit-list-containing-branches (&optional commit arg) + (magit-list-related-branches "--contains" commit arg)) -(defun magit-list-unmerged-branches (&optional commit) - (--remove (string-match-p "\\`(HEAD" it) - (--map (substring it 2) - (magit-git-lines "branch" "--no-merged" commit)))) +(defun magit-list-publishing-branches (&optional commit) + (--filter (magit-rev-ancestor-p commit it) + magit-published-branches)) + +(defun magit-list-merged-branches (&optional commit arg) + (magit-list-related-branches "--merged" commit arg)) + +(defun magit-list-unmerged-branches (&optional commit arg) + (magit-list-related-branches "--no-merged" commit arg)) (defun magit-list-unmerged-to-upstream-branches () - (--filter (-when-let (upstream (magit-get-upstream-branch it)) + (--filter (when-let ((upstream (magit-get-upstream-branch it))) (member it (magit-list-unmerged-branches upstream))) (magit-list-local-branch-names))) @@ -1457,13 +1491,13 @@ Return a list of two integers: (A>B B>A)." (magit-rev-parse (magit-abbrev-arg "short") rev)) (defun magit-commit-children (commit &optional args) - (-map #'car - (--filter (member commit (cdr it)) - (--map (split-string it " ") - (magit-git-lines - "log" "--format=%H %P" - (or args (list "--branches" "--tags" "--remotes")) - "--not" commit))))) + (mapcar #'car + (--filter (member commit (cdr it)) + (--map (split-string it " ") + (magit-git-lines + "log" "--format=%H %P" + (or args (list "--branches" "--tags" "--remotes")) + "--not" commit))))) (defun magit-commit-parents (commit) (--when-let (magit-git-string "rev-list" "-1" "--parents" commit) @@ -1505,6 +1539,7 @@ Return a list of two integers: (A>B B>A)." ("\\`refs/bisect/\\(good.*\\)" . magit-bisect-good) ("\\`refs/stash$" . magit-refname-stash) ("\\`refs/wip/\\(.+\\)" . magit-refname-wip) + ("\\`refs/pullreqs/\\(.+\\)" . magit-refname-pullreq) ("\\`\\(bad\\):" . magit-bisect-bad) ("\\`\\(skip\\):" . magit-bisect-skip) ("\\`\\(good\\):" . magit-bisect-good) @@ -1825,14 +1860,16 @@ the reference is used. The first regexp submatch becomes the (defun magit-read-branch-prefer-other (prompt) (let* ((current (magit-get-current-branch)) (commit (magit-commit-at-point)) - (atpoint (and commit (magit-list-branches-pointing-at commit)))) + (atrev (and commit (magit-list-branches-pointing-at commit))) + (atpoint (magit--painted-branch-at-point))) (magit-completing-read prompt (magit-list-branch-names) nil t nil 'magit-revision-history (or (magit-section-when 'branch) - (and (not (cdr atpoint)) (car atpoint)) - (--first (not (equal it current)) atpoint) + atpoint + (and (not (cdr atrev)) (car atrev)) + (--first (not (equal it current)) atrev) (magit-get-previous-branch) - (car atpoint))))) + (car atrev))))) (cl-defun magit-read-upstream-branch (&optional (branch (magit-get-current-branch)) prompt) @@ -1864,7 +1901,9 @@ the reference is used. The first regexp submatch becomes the (concat " " (propertize branch 'face 'magit-branch-local)))) " starting at") - (cons "HEAD" (magit-list-refnames)) + (nconc (list "HEAD") + (magit-list-refnames) + (directory-files (magit-git-dir) nil "_HEAD\\'")) nil nil nil 'magit-revision-history (magit--default-starting-point)) (user-error "Nothing selected"))) @@ -1946,7 +1985,7 @@ the reference is used. The first regexp submatch becomes the (--> key (replace-regexp-in-string "\\`[^.]+" #'downcase it t t) (replace-regexp-in-string "[^.]+\\'" #'downcase it t t)) - (magit--with-refresh-cache (list 'config (magit-toplevel)) + (magit--with-refresh-cache (cons (magit-toplevel) 'config) (let ((configs (make-hash-table :test 'equal))) (dolist (conf (magit-git-items "config" "--list" "-z")) (let* ((nl-pos (cl-position ?\n conf)) @@ -2007,14 +2046,14 @@ the reference is used. The first regexp submatch becomes the (defun magit--format-popup-variable:value (variable width &optional global) (concat variable (make-string (max 1 (- width 3 (length variable))) ?\s) - (-if-let (value (magit-get (and global "--global") variable)) + (if-let ((value (magit-get (and global "--global") variable))) (propertize value 'face 'magit-popup-option-value) (propertize "unset" 'face 'magit-popup-disabled-argument)))) (defun magit--format-popup-variable:values (variable width &optional global) (concat variable (make-string (max 1 (- width 3 (length variable))) ?\s) - (-if-let (values (magit-get-all (and global "--global") variable)) + (if-let ((values (magit-get-all (and global "--global") variable))) (concat (propertize (car values) 'face 'magit-popup-option-value) (mapconcat diff --git a/elpa/magit-20180404.1428/magit-imenu.el b/elpa/magit-20180828.1055/magit-imenu.el similarity index 98% rename from elpa/magit-20180404.1428/magit-imenu.el rename to elpa/magit-20180828.1055/magit-imenu.el index 77b27e9f..6434f9f3 100644 --- a/elpa/magit-20180404.1428/magit-imenu.el +++ b/elpa/magit-20180828.1055/magit-imenu.el @@ -72,9 +72,9 @@ This function is used as a helper for functions set as (cons (cons name (point)) (gethash parent-title entries (list))) entries))) - (-map (lambda (menu-title) - (cons menu-title (gethash menu-title entries))) - (hash-table-keys entries)))) + (mapcar (lambda (menu-title) + (cons menu-title (gethash menu-title entries))) + (hash-table-keys entries)))) ;;; Log mode diff --git a/elpa/magit-20180404.1428/magit-log.el b/elpa/magit-20180828.1055/magit-log.el similarity index 89% rename from elpa/magit-20180404.1428/magit-log.el rename to elpa/magit-20180828.1055/magit-log.el index 39f55518..63e4f33f 100644 --- a/elpa/magit-20180404.1428/magit-log.el +++ b/elpa/magit-20180828.1055/magit-log.el @@ -50,6 +50,8 @@ (require 'ansi-color) (require 'crm) +(require 'which-func) + (defvar bookmark-make-record-function) ;;; Options @@ -165,7 +167,7 @@ This is useful if you use really long branch names." ;;;; File Log (defcustom magit-log-buffer-file-locked t - "Whether `magit-log-buffer-file' uses a decicated buffer." + "Whether `magit-log-buffer-file' uses a dedicated buffer." :package-version '(magit . "2.7.0") :group 'magit-commands :group 'magit-log @@ -440,10 +442,7 @@ the upstream isn't ahead of the current branch) show." (defun magit-read-file-trace (&rest _ignored) (let ((file (magit-read-file-from-rev "HEAD" "File")) (trace (magit-read-string "Trace"))) - (if (string-match - "^\\(/.+/\\|:[^:]+\\|[0-9]+,[-+]?[0-9]+\\)\\(:\\)?$" trace) - (concat trace (or (match-string 2 trace) ":") file) - (user-error "Trace is invalid, see man git-log")))) + (concat trace (or (match-string 2 trace) ":") file))) (defun magit-log-select-order (&rest _ignored) "Set one `---order' option in Git log. @@ -502,10 +501,10 @@ This is a variant of `magit-log-popup' which shows the same popup but which limits the log to the file being visited in the current buffer." (interactive) - (-if-let (file (magit-file-relative-name)) + (if-let ((file (magit-file-relative-name))) (let ((magit-log-arguments (magit-popup-import-file-args - (-if-let (buffer (magit-mode-get-buffer 'magit-log-mode)) + (if-let ((buffer (magit-mode-get-buffer 'magit-log-mode))) (with-current-buffer buffer (nth 2 magit-refresh-args)) (default-value 'magit-log-arguments)) @@ -686,7 +685,7 @@ active, restrict the log to the lines that the region touches." ;; of a trailing newline. (1- end))))))))) (require 'magit) - (-if-let (file (magit-file-relative-name)) + (if-let ((file (magit-file-relative-name))) (magit-mode-setup-internal #'magit-log-mode (list (list (or magit-buffer-refname @@ -695,7 +694,9 @@ 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 (file-regular-p file) beg end) + (when (and (file-regular-p + (expand-file-name file (magit-toplevel))) + beg end) (setq args (cons (format "-L%s,%s:%s" beg end file) (cl-delete "-L" args :test 'string-prefix-p))) @@ -706,6 +707,39 @@ active, restrict the log to the lines that the region touches." (user-error "Buffer isn't visiting a file")) (magit-log-goto-same-commit)) +;;;###autoload +(defun magit-log-trace-definition (file fn rev) + "Show log for the definition at point." + (interactive (list (or (magit-file-relative-name) + (user-error "Buffer isn't visiting a file")) + (which-function) + (or magit-buffer-refname + (magit-get-current-branch) + "HEAD"))) + (require 'magit) + (magit-mode-setup-internal + #'magit-log-mode + (list (list rev) + (cons (format "-L:%s:%s" (regexp-quote fn) file) + (cl-delete "-L" (car (magit-log-arguments)) + :test 'string-prefix-p)) + nil) + magit-log-buffer-file-locked) + (magit-log-goto-same-commit)) + +(defun magit-diff-trace-definition () + "Show log for the definition at point in a diff." + (interactive) + (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) + (call-interactively #'magit-log-trace-definition))))) + ;;;###autoload (defun magit-reflog-current () "Display the reflog of the current branch." @@ -786,10 +820,10 @@ is displayed in the current frame." (when (derived-mode-p 'magit-log-mode) (magit-section-when commit (let ((parent-rev (format "%s^%s" (oref it value) (or n 1)))) - (-if-let (parent-hash (magit-rev-parse "--short" parent-rev)) - (-if-let (section (--first (equal (oref it value) + (if-let ((parent-hash (magit-rev-parse "--short" parent-rev))) + (if-let ((section (--first (equal (oref it value) parent-hash) - (magit-section-siblings it 'next))) + (magit-section-siblings it 'next)))) (magit-section-goto section) (user-error (substitute-command-keys @@ -854,19 +888,19 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (setq args (remove "--graph" args))) (unless (member "--graph" args) (setq args (remove "--color" args))) - (-when-let* ((limit (magit-log-get-commit-limit)) - (limit (* 2 limit)) ; increase odds for complete graph - (count (and (= (length revs) 1) - (> limit 1024) ; otherwise it's fast enough - (setq revs (car revs)) - (not (string-match-p "\\.\\." revs)) - (not (member revs '("--all" "--branches"))) - (-none-p (lambda (arg) - (--any-p (string-prefix-p it arg) - magit-log-disable-graph-hack-args)) - args) - (magit-git-string "rev-list" "--count" - "--first-parent" args revs)))) + (when-let ((limit (magit-log-get-commit-limit)) + (limit (* 2 limit)) ; increase odds for complete graph + (count (and (= (length revs) 1) + (> limit 1024) ; otherwise it's fast enough + (setq revs (car revs)) + (not (string-match-p "\\.\\." revs)) + (not (member revs '("--all" "--branches"))) + (-none-p (lambda (arg) + (--any-p (string-prefix-p it arg) + magit-log-disable-graph-hack-args)) + args) + (magit-git-string "rev-list" "--count" + "--first-parent" args revs)))) (setq revs (if (< (string-to-number count) limit) revs (format "%s~%s..%s" revs limit revs)))) @@ -1038,7 +1072,8 @@ Do not add this to a hook variable." (setq msg (substring-no-properties msg)) (when refs (setq refs (substring-no-properties refs))) - (let ((align (not (member "--stat" (cadr magit-refresh-args)))) + (let ((align (or (eq style 'cherry) + (not (member "--stat" (cadr magit-refresh-args))))) (non-graph-re (if (eq style 'bisect-vis) magit-log-bisect-vis-re magit-log-heading-re))) @@ -1104,12 +1139,12 @@ Do not add this to a hook variable." (* (string-to-number (match-string 3 date)) 60)))) (save-excursion (backward-char) - (magit-log-format-margin author date))) + (magit-log-format-margin hash author date))) (when (and (eq style 'cherry) (magit-buffer-margin-p)) (save-excursion (backward-char) - (apply #'magit-log-format-margin + (apply #'magit-log-format-margin hash (split-string (magit-rev-format "%aN%x00%ct" hash) "\0")))) (when (and graph (not (eobp)) @@ -1156,6 +1191,11 @@ Do not add this to a hook variable." (defun magit-log-propertize-keywords (_rev msg) (let ((start 0)) + (when (string-match "^\\(squash\\|fixup\\)! " msg start) + (setq start (match-end 0)) + (put-text-property (match-beginning 0) + (match-end 0) + 'face 'magit-keyword-squash msg)) (while (string-match "\\[[^[]*\\]" msg start) (setq start (match-end 0)) (when magit-log-highlight-keywords @@ -1190,14 +1230,14 @@ If there is no revision buffer in the same frame, then do nothing." (defun magit-log-maybe-update-revision-buffer-1 () (unless magit--update-revision-buffer - (-when-let* ((commit (magit-section-when 'commit)) - (buffer (magit-mode-get-buffer 'magit-revision-mode nil t))) + (when-let ((commit (magit-section-when 'commit)) + (buffer (magit-mode-get-buffer 'magit-revision-mode nil t))) (setq magit--update-revision-buffer (list commit buffer)) (run-with-idle-timer magit-update-other-window-delay nil (let ((args (magit-show-commit--arguments))) (lambda () - (-let [(rev buf) magit--update-revision-buffer] + (pcase-let ((`(,rev ,buf) magit--update-revision-buffer)) (setq magit--update-revision-buffer nil) (when (buffer-live-p buf) (let ((magit-display-buffer-noselect t)) @@ -1214,14 +1254,14 @@ If there is no blob buffer in the same frame, then do nothing." (defun magit-log-maybe-update-blob-buffer-1 () (unless magit--update-revision-buffer - (-when-let* ((commit (magit-section-when 'commit)) - (buffer (--first (with-current-buffer it magit-buffer-revision) - (-map #'window-buffer (window-list))))) + (when-let ((commit (magit-section-when 'commit)) + (buffer (--first (with-current-buffer it magit-buffer-revision) + (mapcar #'window-buffer (window-list))))) (setq magit--update-blob-buffer (list commit buffer)) (run-with-idle-timer magit-update-other-window-delay nil (lambda () - (-let [(rev buf) magit--update-blob-buffer] + (pcase-let ((`(,rev ,buf) magit--update-blob-buffer)) (setq magit--update-blob-buffer nil) (when (buffer-live-p buf) (save-excursion @@ -1232,42 +1272,76 @@ If there is no blob buffer in the same frame, then do nothing." magit-buffer-file-name)) (line-number-at-pos)))))))))))) -(defun magit-log-goto-same-commit () - (-when-let* ((prev magit-previous-section) - (rev (cond ((magit-section-match 'commit prev) - (oref prev value)) - ((magit-section-match 'branch prev) - (magit-rev-format "%h" (oref prev value))))) +(defun magit-log-goto-same-commit (&optional default) + (let ((prev magit-previous-section)) + (when-let ((rev (cond ((and prev (magit-section-match 'commit prev)) + (oref prev value)) + ((and prev (magit-section-match 'branch prev)) + (magit-rev-format "%h" (oref prev value))) + (default (magit-rev-format "%h" default)))) (same (--first (equal (oref it value) rev) (oref magit-root-section children)))) - (goto-char (oref same start)))) + (goto-char (oref same start))))) ;;; Log Margin -(defun magit-log-format-margin (author date) - (-when-let (option (magit-margin-option)) - (-let [(_ style width details details-width) - (or magit-buffer-margin - (symbol-value option))] - (magit-make-margin-overlay - (concat (and details - (concat (propertize (truncate-string-to-width - (or author "") - details-width - nil ?\s (make-string 1 magit-ellipsis)) - 'face 'magit-log-author) - " ")) - (propertize - (if (stringp style) - (format-time-string - style - (seconds-to-time (string-to-number date))) - (-let* ((abbr (eq style 'age-abbreviated)) - ((cnt unit) (magit--age date abbr))) - (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is") - (- width (if details (1+ details-width) 0))) - cnt unit))) - 'face 'magit-log-date)))))) +(defvar-local magit-log-margin-show-shortstat nil) + +(defun magit-toggle-log-margin-style () + "Toggle between the regular and the shortstat margin style. +The shortstat style is experimental and rather slow." + (interactive) + (setq magit-log-margin-show-shortstat + (not magit-log-margin-show-shortstat)) + (magit-set-buffer-margin nil t)) + +(defun magit-log-format-margin (rev author date) + (when-let ((option (magit-margin-option))) + (if magit-log-margin-show-shortstat + (magit-log-format-shortstat-margin rev) + (pcase-let ((`(,_ ,style ,width ,details ,details-width) + (or magit-buffer-margin + (symbol-value option)))) + (magit-make-margin-overlay + (concat (and details + (concat (propertize (truncate-string-to-width + (or author "") + details-width + nil ?\s (make-string 1 magit-ellipsis)) + 'face 'magit-log-author) + " ")) + (propertize + (if (stringp style) + (format-time-string + style + (seconds-to-time (string-to-number date))) + (pcase-let* ((abbr (eq style 'age-abbreviated)) + (`(,cnt ,unit) (magit--age date abbr))) + (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is") + (- width (if details (1+ details-width) 0))) + cnt unit))) + 'face 'magit-log-date))))))) + +(defun magit-log-format-shortstat-margin (rev) + (magit-make-margin-overlay + (if-let ((line (and rev (magit-git-string + "show" "--format=" "--shortstat" rev)))) + (if (string-match "\ +\\([0-9]+\\) files? changed, \ +\\(?:\\([0-9]+\\) insertions?(\\+)\\)?\ +\\(?:\\(?:, \\)?\\([0-9]+\\) deletions?(-)\\)?\\'" line) + (magit-bind-match-strings (files add del) line + (format + "%5s %5s%4s" + (if add + (propertize (format "%s+" add) 'face 'magit-diffstat-added) + "") + (if del + (propertize (format "%s-" del) 'face 'magit-diffstat-removed) + "") + files)) + "") + ""))) (defun magit-log-margin-width (style details details-width) (+ (if details (1+ details-width) 0) @@ -1323,12 +1397,12 @@ Type \\[magit-log-select-quit] to abort without selecting a commit." (defvar-local magit-log-select-pick-function nil) (defvar-local magit-log-select-quit-function nil) -(defun magit-log-select (pick &optional msg quit branch args) +(defun magit-log-select (pick &optional msg quit branch args initial) (declare (indent defun)) (magit-mode-setup #'magit-log-select-mode (or branch (magit-get-current-branch) "HEAD") (append args magit-log-select-arguments)) - (magit-log-goto-same-commit) + (magit-log-goto-same-commit initial) (setq magit-log-select-pick-function pick) (setq magit-log-select-quit-function quit) (when magit-log-select-show-usage @@ -1411,7 +1485,7 @@ Type \\[magit-cherry-pick-popup] to apply the commit at point. (defun magit-cherry-refresh-buffer (_upstream _head) (magit-insert-section (cherry) - (run-hooks 'magit-cherry-sections-hook))) + (magit-run-section-hook 'magit-cherry-sections-hook))) (defun magit-insert-cherry-headers () "Insert headers appropriate for `magit-cherry-mode' buffers." @@ -1511,7 +1585,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (defun magit-insert-unpulled-from-upstream () "Insert commits that haven't been pulled from the upstream yet." (when (magit-git-success "rev-parse" "@{upstream}") - (magit-insert-section (unpulled "..@{upstream}") + (magit-insert-section (unpulled "..@{upstream}" t) (magit-insert-heading (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) (magit-get-upstream-branch))) @@ -1530,7 +1604,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. magit-status-sections-hook) (memq 'magit-insert-unpulled-from-upstream-or-recent magit-status-sections-hook))) - (magit-insert-section (unpulled (concat ".." it)) + (magit-insert-section (unpulled (concat ".." it) t) (magit-insert-heading (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) (propertize it 'face 'magit-branch-remote))) @@ -1555,40 +1629,27 @@ then show the last `magit-log-section-commit-count' commits." (let ((upstream (magit-rev-parse "@{upstream}"))) (if (or (not upstream) (magit-rev-ancestor-p "HEAD" upstream)) - (magit-insert-recent-commits - (--if-let (and magit-insert-section--oldroot - (magit-get-section - '((unpushed . "@{upstream}..") - (status)) - magit-insert-section--oldroot)) - (oref it hidden) - nil)) - (magit-insert-unpushed-to-upstream - (--if-let (and magit-insert-section--oldroot - (magit-get-section - `((recent . ,(format "HEAD~%s..HEAD" - magit-log-section-commit-count)) - (status)) - magit-insert-section--oldroot)) - (oref it hidden) - t))))) - -(defun magit-insert-unpushed-to-upstream (&optional collapse) + (magit-insert-recent-commits 'unpushed "@{upstream}..") + (magit-insert-unpushed-to-upstream)))) + +(defun magit-insert-unpushed-to-upstream () "Insert commits that haven't been pushed to the upstream yet." (when (magit-git-success "rev-parse" "@{upstream}") - (magit-insert-section (unpushed "@{upstream}.." collapse) + (magit-insert-section (unpushed "@{upstream}..") (magit-insert-heading (format (propertize "Unmerged into %s:" 'face 'magit-section-heading) (magit-get-upstream-branch))) (magit-insert-log "@{upstream}.." magit-log-section-arguments)))) -(defun magit-insert-recent-commits (&optional collapse) +(defun magit-insert-recent-commits (&optional type value) "Insert section showing recent commits. Show the last `magit-log-section-commit-count' commits." (let* ((start (format "HEAD~%s" magit-log-section-commit-count)) (range (and (magit-rev-verify start) (concat start "..HEAD")))) - (magit-insert-section (recent range collapse) + (magit-insert-section ((eval (or type 'recent)) + (or value range) + t) (magit-insert-heading "Recent commits") (magit-insert-log range (cons (format "-n%d" magit-log-section-commit-count) @@ -1608,7 +1669,7 @@ Show the last `magit-log-section-commit-count' commits." magit-status-sections-hook) (memq 'magit-insert-unpushed-to-upstream-or-recent magit-status-sections-hook))) - (magit-insert-section (unpushed (concat it "..")) + (magit-insert-section (unpushed (concat it "..") t) (magit-insert-heading (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) (propertize it 'face 'magit-branch-remote))) diff --git a/elpa/magit-20180404.1428/magit-margin.el b/elpa/magit-20180828.1055/magit-margin.el similarity index 93% rename from elpa/magit-20180404.1428/magit-margin.el rename to elpa/magit-20180828.1055/magit-margin.el index 9e80e78b..a52c18f4 100644 --- a/elpa/magit-20180404.1428/magit-margin.el +++ b/elpa/magit-20180828.1055/magit-margin.el @@ -119,13 +119,13 @@ does not carry to other options." (`magit-status-mode 'magit-status-margin))) (defun magit-set-buffer-margin (&optional reset refresh) - (-when-let (option (magit-margin-option)) + (when-let ((option (magit-margin-option))) (let* ((default (symbol-value option)) (default-width (nth 2 default))) (when (or reset (not magit-buffer-margin)) (setq magit-buffer-margin (copy-sequence default))) - (-let [(enable style _width details details-width) - magit-buffer-margin] + (pcase-let ((`(,enable ,style ,_width ,details ,details-width) + magit-buffer-margin)) (when (functionp default-width) (setf (nth 2 magit-buffer-margin) (funcall default-width style details details-width))) @@ -143,9 +143,12 @@ does not carry to other options." (defun magit-set-window-margin (&optional window) (when (or window (setq window (get-buffer-window))) (with-selected-window window - (set-window-margins nil (car (window-margins)) - (and (magit-buffer-margin-p) - (nth 2 magit-buffer-margin)))))) + (set-window-margins + nil (car (window-margins)) + (and (magit-buffer-margin-p) + (if (bound-and-true-p magit-log-margin-show-shortstat) + 16 ; kludge + (nth 2 magit-buffer-margin))))))) (defun magit-make-margin-overlay (&optional string previous-line) (if previous-line @@ -219,7 +222,7 @@ English.") (defun magit--age (date &optional abbreviate) (cl-labels ((fn (age spec) - (-let [(char unit units weight) (car spec)] + (pcase-let ((`(,char ,unit ,units ,weight) (car spec))) (let ((cnt (round (/ age weight 1.0)))) (if (or (not (cdr spec)) (>= (/ age weight) 1)) @@ -227,7 +230,10 @@ English.") ((= cnt 1) unit) (t units))) (fn age (cdr spec))))))) - (fn (abs (- (float-time) (string-to-number date))) + (fn (abs (- (float-time) + (if (stringp date) + (string-to-number date) + date))) magit--age-spec))) (provide 'magit-margin) diff --git a/elpa/magit-20180404.1428/magit-merge.el b/elpa/magit-20180828.1055/magit-merge.el similarity index 95% rename from elpa/magit-20180404.1428/magit-merge.el rename to elpa/magit-20180828.1055/magit-merge.el index 3715721f..dc243418 100644 --- a/elpa/magit-20180404.1428/magit-merge.el +++ b/elpa/magit-20180828.1055/magit-merge.el @@ -103,9 +103,14 @@ 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))) + (interactive + (list (magit-read-other-local-branch + (format "Merge `%s' into" (magit-get-current-branch)) + nil + (when-let* ((upstream (magit-get-upstream-branch)) + (upstream (cdr (magit-split-branch-name upstream)))) + (and (magit-branch-p upstream) upstream))) + (magit-merge-arguments))) (let ((current (magit-get-current-branch))) (when (zerop (magit-call-git "checkout" branch)) (magit--merge-absort current args)))) @@ -127,9 +132,9 @@ branch, then also remove the respective remote branch." (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? ") + "Do you really want to to merge `master' into another branch? ") (user-error "Abort"))) - (-if-let (target (magit-get-push-branch branch t)) + (if-let ((target (magit-get-push-branch branch t))) (progn (magit-git-push branch target (list "--force-with-lease")) (set-process-sentinel diff --git a/elpa/magit-20180404.1428/magit-mode.el b/elpa/magit-20180828.1055/magit-mode.el similarity index 93% rename from elpa/magit-20180404.1428/magit-mode.el rename to elpa/magit-20180828.1055/magit-mode.el index be9a5bc5..7f483e42 100644 --- a/elpa/magit-20180404.1428/magit-mode.el +++ b/elpa/magit-20180828.1055/magit-mode.el @@ -250,11 +250,12 @@ then fall back to regular region highlighting." :type 'hook :options '(magit-section-update-region magit-diff-update-hunk-region)) -(defcustom magit-refresh-verbose nil - "Whether to revert Magit buffers verbosely." - :package-version '(magit . "2.1.0") +(defcustom magit-create-buffer-hook '(magit-status-goto-commits) + "Normal hook run after creating a new `magit-mode' buffer." + :package-version '(magit . "2.90.0") :group 'magit-refresh - :type 'boolean) + :type 'hook + :options '(magit-status-goto-commits)) (defcustom magit-refresh-buffer-hook nil "Normal hook for `magit-refresh-buffer' to run after refreshing." @@ -276,6 +277,12 @@ improve performance." :group 'magit-status :type 'boolean) +(defcustom magit-refresh-verbose nil + "Whether to revert Magit buffers verbosely." + :package-version '(magit . "2.1.0") + :group 'magit-refresh + :type 'boolean) + (defcustom magit-save-repository-buffers t "Whether to save file-visiting buffers when appropriate. @@ -360,8 +367,7 @@ starts complicating other things, then it will be removed." (define-key map (kbd "p") 'magit-push-popup) (define-key map (kbd ",") 'magit-delete-thing) (define-key map (kbd ";") 'magit-file-untrack) - (define-key map (kbd "C-c C-i") 'magit-gitignore) - (define-key map (kbd "C-c i") 'magit-gitignore-locally)) + (define-key map (kbd "C-c C-i") 'magit-gitignore-popup)) (t (define-key map [C-return] 'magit-visit-thing) (define-key map (kbd "C-m") 'magit-visit-thing) @@ -380,7 +386,7 @@ starts complicating other things, then it will be removed." (define-key map (kbd "k") 'magit-delete-thing) (define-key map (kbd "K") 'magit-file-untrack) (define-key map (kbd "i") 'magit-gitignore) - (define-key map (kbd "I") 'magit-gitignore-locally))) + (define-key map (kbd "I") 'magit-gitignore-popup))) (define-key map (kbd "SPC") 'magit-diff-show-or-scroll-up) (define-key map (kbd "DEL") 'magit-diff-show-or-scroll-down) (define-key map "+" 'magit-diff-more-context) @@ -438,6 +444,7 @@ starts complicating other things, then it will be removed." (define-key map "Z" 'magit-stash-popup) (define-key map ":" 'magit-git-command) (define-key map "!" 'magit-run-popup) + (define-key map (kbd "C-c C-b") 'magit-browse-thing) (define-key map (kbd "C-c C-c") 'magit-dispatch-popup) (define-key map (kbd "C-c C-e") 'magit-dispatch-popup) (define-key map (kbd "C-x a") 'magit-add-change-log-entry) @@ -466,6 +473,23 @@ which visits the thing at point." (call-interactively (key-binding (this-command-keys)))) (user-error "There is no thing at point that could be visited"))) +(defun magit-edit-thing () + "This is a placeholder command. +Where applicable, section-specific keymaps bind another command +which lets you edit the thing at point, likely in another buffer." + (interactive) + (if (eq magit-current-popup 'magit-dispatch-popup) + (progn (setq magit-current-popup nil) + (call-interactively (key-binding (this-command-keys)))) + (user-error "There is no thing at point that could be visited"))) + +(defun magit-browse-thing () + "This is a placeholder command. +Where applicable, section-specific keymaps bind another command +which visits the thing at point using `browse-url'." + (interactive) + (user-error "There is no thing at point that could be browsed")) + (easy-menu-define magit-mode-menu magit-mode-map "Magit menu" '("Magit" @@ -546,6 +570,9 @@ Magit is documented in info node `(magit)'." (when (and (fboundp 'nlinum-mode) (bound-and-true-p global-nlinum-mode)) (nlinum-mode -1)) + (when (and (fboundp 'display-line-numbers-mode) + (bound-and-true-p global-display-line-numbers-mode)) + (display-line-numbers-mode -1)) (add-hook 'kill-buffer-hook 'magit-preserve-section-visibility-cache)) (defvar-local magit-region-overlays nil) @@ -587,14 +614,19 @@ Magit is documented in info node `(magit)'." "Setup up a MODE buffer using ARGS to generate its content. When optional LOCKED is non-nil, then create a buffer that is locked to its value, which is derived from MODE and ARGS." - (let ((buffer (magit-mode-get-buffer - mode t nil - (and locked (magit-buffer-lock-value mode args)))) - (section (magit-current-section))) + (let* ((value (and locked (magit-buffer-lock-value mode args))) + (buffer (magit-mode-get-buffer mode nil nil value)) + (section (and buffer (magit-current-section))) + (created (not buffer))) + (unless buffer + (setq buffer (magit-with-toplevel + (magit-generate-new-buffer mode value)))) (with-current-buffer buffer (setq magit-previous-section section) (setq magit-refresh-args args) - (funcall mode)) + (funcall mode) + (when created + (run-hooks 'magit-create-buffer-hook))) (magit-display-buffer buffer) (with-current-buffer buffer (run-hooks 'magit-mode-setup-hook) @@ -647,10 +679,10 @@ other buffers in the selected window." '(display-buffer-same-window)))) (defun magit--display-buffer-fullframe (buffer alist) - (-when-let (window (or (display-buffer-reuse-window buffer alist) + (when-let ((window (or (display-buffer-reuse-window buffer alist) (display-buffer-same-window buffer alist) (display-buffer-pop-up-window buffer alist) - (display-buffer-use-some-window buffer alist))) + (display-buffer-use-some-window buffer alist)))) (delete-other-windows window) window)) @@ -664,7 +696,7 @@ Otherwise, behave like `magit-display-buffer-traditional'." (defun magit--display-buffer-topleft (buffer alist) (or (display-buffer-reuse-window buffer alist) - (-when-let (window2 (display-buffer-pop-up-window buffer alist)) + (when-let ((window2 (display-buffer-pop-up-window buffer alist))) (let ((window1 (get-buffer-window)) (buffer1 (current-buffer)) (buffer2 (window-buffer window2)) @@ -706,9 +738,9 @@ split is made vertically or horizontally is determined by '(display-buffer-same-window))))) (defun magit--display-buffer-fullcolumn (buffer alist) - (-when-let (window (or (display-buffer-reuse-window buffer alist) + (when-let ((window (or (display-buffer-reuse-window buffer alist) (display-buffer-same-window buffer alist) - (display-buffer-below-selected buffer alist))) + (display-buffer-below-selected buffer alist)))) (delete-other-windows-vertically window) window)) @@ -765,21 +797,20 @@ thinking a buffer belongs to a repo that it doesn't.") (put 'magit-buffer-locked-p 'permanent-local t) (defun magit-mode-get-buffer (mode &optional create frame value) - (-if-let (topdir (magit-toplevel)) - (or (--first (with-current-buffer it - (and (eq major-mode mode) - (equal magit--default-directory topdir) - (if value - (and magit-buffer-locked-p - (equal (magit-buffer-lock-value) value)) - (not magit-buffer-locked-p)))) - (if frame - (-map #'window-buffer - (window-list (unless (eq frame t) frame))) - (buffer-list))) - (and create - (let ((default-directory topdir)) - (magit-generate-new-buffer mode value)))) + (when create + (error "`magit-mode-get-buffer's CREATE argument is obsolete")) + (if-let ((topdir (magit-toplevel))) + (--first (with-current-buffer it + (and (eq major-mode mode) + (equal magit--default-directory topdir) + (if value + (and magit-buffer-locked-p + (equal (magit-buffer-lock-value) value)) + (not magit-buffer-locked-p)))) + (if frame + (mapcar #'window-buffer + (window-list (unless (eq frame t) frame))) + (buffer-list))) (magit--not-inside-repository-error))) (defun magit-generate-new-buffer (mode &optional value) @@ -841,15 +872,15 @@ repository, then the former buffer is instead deleted and the latter is displayed in its place." (interactive) (if magit-buffer-locked-p - (-if-let (unlocked (magit-mode-get-buffer major-mode)) + (if-let ((unlocked (magit-mode-get-buffer major-mode))) (let ((locked (current-buffer))) (switch-to-buffer unlocked nil t) (kill-buffer locked)) (setq magit-buffer-locked-p nil) (rename-buffer (funcall magit-generate-buffer-name-function major-mode))) - (-if-let (value (magit-buffer-lock-value)) - (-if-let (locked (magit-mode-get-buffer major-mode nil nil value)) + (if-let ((value (magit-buffer-lock-value))) + (if-let ((locked (magit-mode-get-buffer major-mode nil nil value))) (let ((unlocked (current-buffer))) (switch-to-buffer locked nil t) (kill-buffer unlocked)) @@ -864,15 +895,16 @@ An alist of symbols to functions. The symbol must be the major-mode the locked buffer will have. -The function must take a list of arguments and return a value -that identifies the buffer (i.e., its 'lock value'). If the -third-party mode is invoked as +The function must take a single argument, a list of refresh +arguments (the value of `magit-refresh-args') and return a +value that identifies the buffer (i.e., its 'lock value'). +If the third-party mode is invoked as (magit-mode-setup-internal #\\='my-mode \\='(1 2 3) t) the function will be invoked as - (apply lock-func \\='(1 2 3)) + (funcall lock-func \\='(1 2 3)) if the cons (my-mode . lock-func) is in this list. @@ -888,10 +920,10 @@ See also `magit-toggle-buffer-lock'.") See also `magit-buffer-lock-functions'." (cl-case mode (magit-cherry-mode - (-let [(upstream head) args] + (pcase-let ((`(,upstream ,head) args)) (concat head ".." upstream))) (magit-diff-mode - (-let [(rev-or-range const _args files) args] + (pcase-let ((`(,rev-or-range ,const ,_args ,files) args)) (nconc (cons (or rev-or-range (if (member "--cached" const) (progn (setq const (delete "--cached" const)) @@ -900,15 +932,15 @@ See also `magit-buffer-lock-functions'." const) (and files (cons "--" files))))) (magit-log-mode - (-let [(revs _args files) args] + (pcase-let ((`(,revs ,_args ,files) args)) (if (and revs files) (append revs (cons "--" files)) (append revs files)))) (magit-refs-mode - (-let [(ref args) args] + (pcase-let ((`(,ref ,args) args)) (cons (or ref "HEAD") args))) (magit-revision-mode - (-let [(rev __const _args files) args] + (pcase-let ((`(,rev ,_const ,_args ,files) args)) (if files (cons rev files) (list rev)))) ((magit-reflog-mode ; (ref ~args) magit-stash-mode ; (stash _const _args _files) @@ -916,7 +948,7 @@ See also `magit-buffer-lock-functions'." (car args)) (t (--when-let (cdr (assq mode magit-buffer-lock-functions)) - (apply it args))))) + (funcall it args))))) (defun magit-mode-bury-buffer (&optional kill-buffer) "Bury the current buffer. @@ -1015,7 +1047,7 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (windows (--mapcat (with-selected-window it (with-current-buffer buffer - (-when-let (section (magit-current-section)) + (when-let ((section (magit-current-section))) (list (nconc (list it section) (magit-refresh-get-relative-position)))))) @@ -1044,7 +1076,7 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." magit-refresh-start-time))))))) (defun magit-refresh-get-relative-position () - (-when-let (section (magit-current-section)) + (when-let ((section (magit-current-section))) (let ((start (oref section start))) (list (count-lines start (point)) (- (point) (line-beginning-position)) @@ -1129,7 +1161,7 @@ is saved without asking, the user is asked about each modified 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")) + (when-let ((topdir (magit-rev-parse-safe "--show-toplevel"))) (let ((remote (file-remote-p topdir)) (save-some-buffers-action-alist `((?Y (lambda (buffer) diff --git a/elpa/magit-20180404.1428/magit-notes.el b/elpa/magit-20180828.1055/magit-notes.el similarity index 100% rename from elpa/magit-20180404.1428/magit-notes.el rename to elpa/magit-20180828.1055/magit-notes.el diff --git a/elpa/magit-20180828.1055/magit-obsolete.el b/elpa/magit-20180828.1055/magit-obsolete.el new file mode 100644 index 00000000..57ab7c09 --- /dev/null +++ b/elpa/magit-20180828.1055/magit-obsolete.el @@ -0,0 +1,33 @@ +;;; magit-obsolete.el --- obsolete definitions -*- 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 defines aliases for obsolete variables and functions. + +;;; Code: + +(require 'magit) + +(provide 'magit-obsolete) +;;; magit-obsolete.el ends here diff --git a/elpa/magit-20180828.1055/magit-pkg.el b/elpa/magit-20180828.1055/magit-pkg.el new file mode 100644 index 00000000..9430562f --- /dev/null +++ b/elpa/magit-20180828.1055/magit-pkg.el @@ -0,0 +1,11 @@ +(define-package "magit" "20180828.1055" "A Git porcelain inside Emacs." + '((emacs "25.1") + (async "20180527") + (dash "20180413") + (ghub "20180417") + (git-commit "20180602") + (magit-popup "20180509") + (with-editor "20180414"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/magit-20180404.1428/magit-process.el b/elpa/magit-20180828.1055/magit-process.el similarity index 91% rename from elpa/magit-20180404.1428/magit-process.el rename to elpa/magit-20180828.1055/magit-process.el index 1356c2b2..5daa0c28 100644 --- a/elpa/magit-20180404.1428/magit-process.el +++ b/elpa/magit-20180828.1055/magit-process.el @@ -109,7 +109,7 @@ displays the text of `magit-process-error-summary' instead." integer)) (defcustom magit-credential-cache-daemon-socket - (--some (-let [(prog . args) (split-string it)] + (--some (pcase-let ((`(,prog . ,args) (split-string it))) (if (and prog (string-match-p "\\`\\(?:\\(?:/.*/\\)?git-credential-\\)?cache\\'" prog)) @@ -347,20 +347,21 @@ Process output goes into a new section in the buffer returned by "Call PROGRAM synchronously in a separate process. Process output goes into a new section in the buffer returned by `magit-process-buffer'." - (-let [(process-buf . section) (magit-process-setup program args)] + (pcase-let ((`(,process-buf . ,section) + (magit-process-setup program args))) (magit-process-finish (let ((inhibit-read-only t)) (apply #'magit-process-file program nil process-buf nil args)) process-buf (current-buffer) default-directory section))) -(defun magit-process-file (&rest args) +(defun magit-process-file (process &optional infile buffer display &rest args) "Process files synchronously in a separate process. Identical to `process-file' but temporarily enable Cygwin's \"noglob\" option during the call and ensure unix eol conversion." (let ((process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system))) - (apply #'process-file args))) + (apply #'process-file process infile buffer display args))) (defun magit-process-environment () ;; The various w32 hacks are only applicable when running on the @@ -407,12 +408,12 @@ flattened before use." (eq (process-status magit-this-process) 'run)) (sleep-for 0.005))) (run-hooks 'magit-pre-call-git-hook) - (-let* ((process-environment (magit-process-environment)) - (default-process-coding-system (magit--process-coding-system)) - (flat-args (magit-process-git-arguments args)) - ((process-buf . section) - (magit-process-setup magit-git-executable flat-args)) - (inhibit-read-only t)) + (pcase-let* ((process-environment (magit-process-environment)) + (default-process-coding-system (magit--process-coding-system)) + (flat-args (magit-process-git-arguments args)) + (`(,process-buf . ,section) + (magit-process-setup magit-git-executable flat-args)) + (inhibit-read-only t)) (magit-process-finish (apply #'call-process-region (point-min) (point-max) magit-git-executable nil process-buf nil flat-args) @@ -519,18 +520,19 @@ 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." - (-let* (((process-buf . section) - (magit-process-setup program args)) - (process - (let ((process-connection-type - ;; 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 (magit-process-environment)) - (default-process-coding-system (magit--process-coding-system))) - (apply #'start-file-process - (file-name-nondirectory program) - process-buf program args)))) + (pcase-let* + ((`(,process-buf . ,section) + (magit-process-setup program args)) + (process + (let ((process-connection-type + ;; 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 (magit-process-environment)) + (default-process-coding-system (magit--process-coding-system))) + (apply #'start-file-process + (file-name-nondirectory program) + process-buf program args)))) (with-editor-set-process-filter process #'magit-process-filter) (set-process-sentinel process #'magit-process-sentinel) (set-process-buffer process process-buf) @@ -555,6 +557,25 @@ Magit status buffer." (magit-process-display-buffer process) process)) +(defun magit-parse-git-async (&rest args) + (setq args (magit-process-git-arguments args)) + (let ((command-buf (current-buffer)) + (process-buf (generate-new-buffer " *temp*")) + (toplevel (magit-toplevel))) + (with-current-buffer process-buf + (setq default-directory toplevel) + (let ((process + (let ((process-connection-type nil) + (process-environment (magit-process-environment)) + (default-process-coding-system + (magit--process-coding-system))) + (apply #'start-file-process "git" process-buf + magit-git-executable args)))) + (process-put process 'command-buf command-buf) + (process-put process 'parsed (point)) + (setq magit-this-process process) + process)))) + ;;; Process Internals (defun magit-process-setup (program args) @@ -581,7 +602,8 @@ Magit status buffer." (cond ((and args (equal program magit-git-executable)) (setq args (-split-at (length magit-git-global-arguments) args)) - (insert (propertize program 'face 'magit-section-heading) " ") + (insert (propertize (file-name-nondirectory program) + 'face 'magit-section-heading) " ") (insert (propertize (char-to-string magit-ellipsis) 'face 'magit-section-heading 'help-echo (mapconcat #'identity (car args) " "))) @@ -591,7 +613,8 @@ Magit status buffer." ((and args (equal program shell-file-name)) (insert (propertize (cadr args) 'face 'magit-section-heading))) (t - (insert (propertize program 'face 'magit-section-heading) " ") + (insert (propertize (file-name-nondirectory program) + 'face 'magit-section-heading) " ") (insert (propertize (mapconcat #'shell-quote-argument args " ") 'face 'magit-section-heading)))) (magit-insert-heading) @@ -643,10 +666,10 @@ Magit status buffer." "Special sentinel used by `magit-run-git-sequencer'." (when (memq (process-status process) '(exit signal)) (magit-process-sentinel process event) - (-when-let (process-buf (process-buffer process)) + (when-let ((process-buf (process-buffer process))) (when (buffer-live-p process-buf) - (-when-let (status-buf (with-current-buffer process-buf - (magit-mode-get-buffer 'magit-status-mode))) + (when-let ((status-buf (with-current-buffer process-buf + (magit-mode-get-buffer 'magit-status-mode)))) (with-current-buffer status-buf (--when-let (magit-get-section @@ -696,7 +719,7 @@ Magit status buffer." (defun magit-process-yes-or-no-prompt (process string) "Forward Yes-or-No prompts to the user." - (-when-let (beg (string-match magit-process-yes-or-no-prompt-regexp string)) + (when-let ((beg (string-match magit-process-yes-or-no-prompt-regexp string))) (let ((max-mini-window-height 30)) (process-send-string process @@ -711,11 +734,30 @@ Magit status buffer." (defun magit-process-password-auth-source (key) "Use `auth-source-search' to get a password. -If found, return the password. Otherwise, return nil." +If found, return the password. Otherwise, return nil. + +To use this function add it to the appropriate hook + (add-hook 'magit-process-find-password-functions + 'magit-process-password-auth-source) + +KEY typically derives from a prompt such as: + Password for 'https://tarsius@bitbucket.org' +in which case it would be the string + tarsius@bitbucket.org +which matches the ~/.authinfo.gpg entry + machine bitbucket.org login tarsius password 12345 +or iff that is undefined, for backward compatibility + machine tarsius@bitbucket.org password 12345" + (message "key: %S" key) (require 'auth-source) - (let ((secret (plist-get (car (auth-source-search :max 1 :host key - :require '(:host))) - :secret))) + (let ((secret + (plist-get + (car (or (and (string-match "\\([^@]+\\)@\\([^@]+\\)" key) + (auth-source-search :max 1 + :host (match-string 2 key) + :login (match-string 1 key))) + (auth-source-search :max 1 :host key))) + :secret))) (if (functionp secret) (funcall secret) secret))) @@ -780,8 +822,9 @@ as argument." (memq magit-credential-cache-daemon-process (list-system-processes))) (setq magit-credential-cache-daemon-process - (or (--first (-let (((&alist 'comm comm 'user user) - (process-attributes it))) + (or (--first (let* ((attr (process-attributes it)) + (comm (cdr (assq 'comm attr))) + (user (cdr (assq 'user attr)))) (and (string= comm "git-credential-cache--daemon") (string= user user-login-name))) (list-system-processes)) @@ -834,7 +877,8 @@ as argument." (when (equal program magit-git-executable) (setq args (nthcdr (length magit-git-global-arguments) args))) (let ((str (concat " " (propertize - (concat program (and args (concat " " (car args)))) + (concat (file-name-nondirectory program) + (and args (concat " " (car args)))) 'mouse-face 'highlight 'keymap magit-mode-line-process-map 'help-echo "mouse-1: Show process buffer" @@ -1021,14 +1065,14 @@ Limited by `magit-process-error-tooltip-max-lines'." ((not (eq msg 'suppressed)) (when (buffer-live-p process-buf) (with-current-buffer process-buf - (-when-let (status-buf (magit-mode-get-buffer 'magit-status-mode)) + (when-let ((status-buf (magit-mode-get-buffer 'magit-status-mode))) (with-current-buffer status-buf (setq magit-this-error msg))))) (message "%s ... [%s buffer %s for details]" msg - (-if-let (key (and (buffer-live-p command-buf) + (if-let ((key (and (buffer-live-p command-buf) (with-current-buffer command-buf (car (where-is-internal - 'magit-process-buffer))))) + 'magit-process-buffer)))))) (format "Hit %s to see" (key-description key)) "See") (buffer-name process-buf)))))) diff --git a/elpa/magit-20180404.1428/magit-refs.el b/elpa/magit-20180828.1055/magit-refs.el similarity index 96% rename from elpa/magit-20180404.1428/magit-refs.el rename to elpa/magit-20180828.1055/magit-refs.el index 2149a81b..b18cc27c 100644 --- a/elpa/magit-20180404.1428/magit-refs.el +++ b/elpa/magit-20180828.1055/magit-refs.el @@ -308,7 +308,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (magit-set-header-line-format (format "%s %s" ref (mapconcat #'identity args " "))) (magit-insert-section (branchbuf) - (run-hooks 'magit-refs-sections-hook)) + (magit-run-section-hook 'magit-refs-sections-hook)) (add-hook 'kill-buffer-hook 'magit-preserve-section-visibility-cache)) ;;; Commands @@ -490,9 +490,9 @@ Insert a header line with the name and description of the current branch. The description is taken from the Git variable `branch..description'; if that is undefined then no header line is inserted at all." - (-when-let* ((branch (magit-get-current-branch)) - (desc (magit-get "branch" branch "description")) - (desc (split-string desc "\n"))) + (when-let ((branch (magit-get-current-branch)) + (desc (magit-get "branch" branch "description")) + (desc (split-string desc "\n"))) (when (equal (car (last desc)) "") (setq desc (butlast desc))) (magit-insert-section (branchdesc branch t) @@ -503,8 +503,8 @@ line is inserted at all." (defun magit-insert-tags () "Insert sections showing all tags." - (-when-let (tags (magit-git-lines "tag" "--list" "-n" - (cadr magit-refresh-args))) + (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:") @@ -562,7 +562,7 @@ line is inserted at all." (make-string (max 1 (- magit-refs-primary-column-width (length abbrev))) ?\s) - (magit-log-propertize-keywords nil msg))) + (and msg (magit-log-propertize-keywords nil msg)))) (when (magit-buffer-margin-p) (magit-refs--format-margin branch)) (magit-refs--insert-cherry-commits branch section))))))) @@ -608,20 +608,18 @@ line is inserted at all." 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))) + (mapcar (pcase-lambda (`(,_ ,branch ,focus ,branch-desc ,u:ahead ,p:ahead + ,u:behind ,upstream ,p:behind ,push ,msg)) + (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 @@ -714,7 +712,7 @@ line is inserted at all." (t ""))))) (defun magit-refs--insert-refname-p (refname) - (--if-let (-first (-lambda ((key . _)) + (--if-let (-first (pcase-lambda (`(,key . ,_)) (if (functionp key) (funcall key refname) (string-match-p key refname))) @@ -742,7 +740,8 @@ line is inserted at all." (save-excursion (goto-char (line-beginning-position 0)) (let ((line (magit-rev-format "%ct%cN" commit))) - (magit-log-format-margin (substring line 10) + (magit-log-format-margin commit + (substring line 10) (substring line 0 10))))) (provide 'magit-refs) diff --git a/elpa/magit-20180404.1428/magit-remote.el b/elpa/magit-20180828.1055/magit-remote.el similarity index 98% rename from elpa/magit-20180404.1428/magit-remote.el rename to elpa/magit-20180828.1055/magit-remote.el index 777058fc..7541f6e2 100644 --- a/elpa/magit-20180404.1428/magit-remote.el +++ b/elpa/magit-20180828.1055/magit-remote.el @@ -260,11 +260,11 @@ the now stale refspecs. Other stale branches are not removed." (length (cl-mapcan (lambda (s) (copy-sequence (cdr s))) stale))) nil - (--map (pcase-let ((`(,refspec . ,refs) it)) - (concat refspec "\n" - (mapconcat (lambda (b) (concat " " b)) - refs "\n"))) - stale))) + (mapcar (pcase-lambda (`(,refspec . ,refs)) + (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)) @@ -637,8 +637,8 @@ missing. To add them use something like: (defun magit-git-pull (source args) (run-hooks 'magit-credential-hook) - (-let [(remote . branch) - (magit-split-branch-name source)] + (pcase-let ((`(,remote . ,branch) + (magit-split-branch-name source))) (magit-run-git-with-editor "pull" args remote branch))) ;;;###autoload @@ -730,8 +730,8 @@ removed after restarting Emacs." (defun magit-git-push (branch target args) (run-hooks 'magit-credential-hook) - (-let [(remote . target) - (magit-split-branch-name target)] + (pcase-let ((`(,remote . ,target) + (magit-split-branch-name target))) (magit-run-git-async "push" "-v" args remote (format "%s:refs/heads/%s" branch target)))) @@ -759,7 +759,7 @@ the push-remote can be changed before pushed to it." "remote.pushDefault" (format "branch.%s.pushRemote" it))) push-remote)) - (-if-let (remote (magit-get-push-remote it)) + (if-let ((remote (magit-get-push-remote it))) (if (member remote (magit-list-remotes)) (magit-git-push it (concat remote "/" it) args) (user-error "Remote `%s' doesn't exist" remote)) @@ -799,7 +799,7 @@ upstream can be changed before pushed to it." (progn (when upstream (magit-set-branch*merge/remote it upstream)) - (-if-let (target (magit-get-upstream-branch it)) + (if-let ((target (magit-get-upstream-branch it))) (magit-git-push it target args) (user-error "No upstream is configured for %s" it))) (user-error "No branch is checked out"))) @@ -926,9 +926,9 @@ the popup buffer." (defun magit-push-implicitly--desc () (let ((default (magit-get "push.default"))) (unless (equal default "nothing") - (or (-when-let* ((remote (or (magit-get-remote) - (magit-remote-p "origin"))) - (refspec (magit-get "remote" remote "push"))) + (or (when-let ((remote (or (magit-get-remote) + (magit-remote-p "origin"))) + (refspec (magit-get "remote" remote "push"))) (format "%s using %s" (propertize remote 'face 'magit-branch-remote) (propertize refspec 'face 'bold))) @@ -1010,7 +1010,7 @@ changes introduced by that commit (unlike 'git format-patch' which creates patches for all commits that are reachable from `HEAD' but not from the specified commit)." (interactive - (list (-if-let (revs (magit-region-values 'commit t)) + (list (if-let ((revs (magit-region-values 'commit t))) (concat (car (last revs)) "^.." (car revs)) (let ((range (magit-read-range-or-commit "Format range or commit"))) (if (string-match-p "\\.\\." range) diff --git a/elpa/magit-20180404.1428/magit-repos.el b/elpa/magit-20180828.1055/magit-repos.el similarity index 90% rename from elpa/magit-20180404.1428/magit-repos.el rename to elpa/magit-20180828.1055/magit-repos.el index 7fb5e2f3..39b4d095 100644 --- a/elpa/magit-20180404.1428/magit-repos.el +++ b/elpa/magit-20180828.1055/magit-repos.el @@ -40,24 +40,13 @@ (defcustom magit-repository-directories nil "List of directories that are or contain Git repositories. -Each element has the form (DIRECTORY . DEPTH) or, for backward -compatibility, just DIRECTORY. DIRECTORY has to be a directory -or a directory file-name, a string. DEPTH, an integer, specifies -the maximum depth to look for Git repositories. If it is 0, then -only add DIRECTORY itself. - -For backward compatibility reasons an element may be a string, -instead of a cons-cell, in which case the value of the obsolete -option `magit-repository-directories-depth' specifies the depth." +Each element has the form (DIRECTORY . DEPTH). DIRECTORY has +to be a directory or a directory file-name, a string. DEPTH, +an integer, specifies the maximum depth to look for Git +repositories. If it is 0, then only add DIRECTORY itself." :package-version '(magit . "2.8.0") :group 'magit-essentials - :type '(repeat (choice (cons directory (integer :tag "Depth")) directory))) - -(defvar magit-repository-directories-depth 3 - "The maximum depth to look for Git repositories. -This variable is obsolete and only used for elements of the -option `magit-repository-directories' (which see) that don't -specify the depth directly.") + :type '(repeat (cons directory (integer :tag "Depth")))) (defgroup magit-repolist nil "List repositories in a buffer." @@ -114,9 +103,8 @@ actually support that yet." (defun magit-list-repositories () "Display a list of repositories. -Use the options `magit-repository-directories' -and `magit-repository-directories-depth' to -control which repositories are displayed." +Use the options `magit-repository-directories' to control which +repositories are displayed." (interactive) (if magit-repository-directories (with-current-buffer (get-buffer-create "*Magit Repositories*") @@ -150,7 +138,7 @@ control which repositories are displayed." (setq tabulated-list-padding 0) (setq tabulated-list-sort-key (cons "Path" nil)) (setq tabulated-list-format - (vconcat (mapcar (-lambda ((title width _fn props)) + (vconcat (mapcar (pcase-lambda (`(,title ,width ,_fn ,props)) (nconc (list title width t) (-flatten props))) magit-repolist-columns))) @@ -163,7 +151,7 @@ control which repositories are displayed." (defun magit-repolist-refresh () (setq tabulated-list-entries - (mapcar (-lambda ((id . path)) + (mapcar (pcase-lambda (`(,id . ,path)) (let ((default-directory path)) (list path (vconcat (--map (or (funcall (nth 2 it) id) "") @@ -278,10 +266,9 @@ With prefix argument simply read a directory name using (or (magit-toplevel) default-directory))))) (defun magit-list-repos () - (--mapcat (if (consp it) - (magit-list-repos-1 (car it) (cdr it)) - (magit-list-repos-1 it magit-repository-directories-depth)) - magit-repository-directories)) + (cl-mapcan (pcase-lambda (`(,dir . ,depth)) + (magit-list-repos-1 dir depth)) + magit-repository-directories)) (defun magit-list-repos-1 (directory depth) (cond ((file-readable-p (expand-file-name ".git" directory)) diff --git a/elpa/magit-20180404.1428/magit-reset.el b/elpa/magit-20180828.1055/magit-reset.el similarity index 58% rename from elpa/magit-20180404.1428/magit-reset.el rename to elpa/magit-20180828.1055/magit-reset.el index 3dba6219..59b6ab98 100644 --- a/elpa/magit-20180404.1428/magit-reset.el +++ b/elpa/magit-20180828.1055/magit-reset.el @@ -33,55 +33,78 @@ (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)) + :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 (only)" magit-reset-index) + (?w "reset worktree (only)" magit-reset-worktree) + 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. + "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 + (interactive (list (magit-reset-read-branch-or-commit (if current-prefix-arg - "Hard reset to" - "Reset head to")) + (concat (propertize "Hard" 'face 'bold) + " reset %s to") + "Reset %s 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. + "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"))) + (interactive (list (magit-reset-read-branch-or-commit "Reset %s to"))) (magit-reset-internal "--mixed" commit)) ;;;###autoload (defun magit-reset-soft (commit) - "Reset the head to COMMIT, but not the index and working tree. + "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"))) + (interactive (list (magit-reset-read-branch-or-commit "Soft reset %s to"))) (magit-reset-internal "--soft" commit)) ;;;###autoload (defun magit-reset-hard (commit) - "Reset the head, index, and working tree to 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"))) + (interactive (list (magit-reset-read-branch-or-commit + (concat (propertize "Hard" 'face 'bold) + " reset %s to")))) (magit-reset-internal "--hard" commit)) +;;;###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-worktree (commit) + "Reset the worktree to COMMIT. +Keep the `HEAD' and index as-is." + (interactive (list (magit-read-branch-or-commit "Reset worktree to"))) + (magit-with-temp-index commit nil + (magit-wip-commit-before-change nil " before reset") + (magit-run-git "checkout-index" "--all" "--force") + (magit-wip-commit-after-apply nil " after reset"))) + +(defun magit-reset-read-branch-or-commit (prompt) + "Prompt for and return a ref to reset HEAD to. + +PROMPT is a format string, where either the current branch name +or \"detached head\" will be substituted for %s." + (magit-read-branch-or-commit + (format prompt (or (magit-get-current-branch) "detached head")))) + (defun magit-reset-internal (arg commit &optional path) (when (and (not (member arg '("--hard" nil))) (equal (magit-rev-parse commit) diff --git a/elpa/magit-20180404.1428/magit-section.el b/elpa/magit-20180828.1055/magit-section.el similarity index 87% rename from elpa/magit-20180404.1428/magit-section.el rename to elpa/magit-20180828.1055/magit-section.el index 67e032c6..3dc1988e 100644 --- a/elpa/magit-20180404.1428/magit-section.el +++ b/elpa/magit-20180828.1055/magit-section.el @@ -175,17 +175,22 @@ but in the future it will also be used set the defaults." ;;; Core +(defvar magit--current-section-hook nil + "Internal variable used for `magit-explain-section'.") + (defclass magit-section () - ((type :initform nil :accessor magit-section-type :initarg :type) - (value :initform nil :accessor magit-section-value :initarg :value) - (start :initform nil :accessor magit-section-start :initarg :start) - (content :initform nil :accessor magit-section-content) - (end :initform nil :accessor magit-section-end) - (hidden :initform nil :accessor magit-section-hidden) - (washer :initform nil :accessor magit-section-washer) + ((type :initform nil :initarg :type) + (value :initform nil :initarg :value) + (start :initform nil :initarg :start) + (content :initform nil) + (end :initform nil) + (hidden :initform nil) + (washer :initform nil) (process :initform nil) - (parent :initform nil :accessor magit-section-parent :initarg :parent) - (children :initform nil :accessor magit-section-children))) + (heading-highlight-face :initform nil) + (inserter :initform (symbol-value 'magit--current-section-hook)) + (parent :initform nil :initarg :parent) + (children :initform nil))) (defclass magit-file-section (magit-section) ((source :initform nil) @@ -380,7 +385,7 @@ With a prefix argument also expand it." heading) "Show the body of the current section." (interactive (list (magit-current-section))) (oset section hidden nil) - (-when-let (washer (oref section washer)) + (when-let ((washer (oref section washer))) (oset section washer nil) (let ((inhibit-read-only t) (magit-insert-section--parent section) @@ -393,7 +398,7 @@ With a prefix argument also expand it." heading) (funcall washer) (oset section end (point-marker))))) (magit-section-update-highlight)) - (-when-let (beg (oref section content)) + (when-let ((beg (oref section content))) (remove-overlays beg (oref section end) 'invisible t)) (magit-section-maybe-cache-visibility section) (dolist (child (oref section children)) @@ -407,7 +412,7 @@ With a prefix argument also expand it." heading) (if (eq section magit-root-section) (user-error "Cannot hide root section") (oset section hidden t) - (-when-let (beg (oref section content)) + (when-let ((beg (oref section content))) (let ((end (oref section end))) (remove-overlays beg end 'invisible t) (let ((o (make-overlay beg end))) @@ -444,13 +449,13 @@ children." (magit-section-show section)) (defun magit-section-show-children-1 (section &optional depth) - (--each (oref section children) - (oset it hidden nil) + (dolist (child (oref section children)) + (oset child hidden nil) (if depth (if (> depth 0) - (magit-section-show-children-1 it (1- depth)) - (magit-section-hide it)) - (magit-section-show-children-1 it)))) + (magit-section-show-children-1 child (1- depth)) + (magit-section-hide child)) + (magit-section-show-children-1 child)))) (defun magit-section-hide-children (section) "Recursively hide the bodies of children of the current section." @@ -466,11 +471,11 @@ hidden." (magit-section-show section)) (defun magit-section-show-headings-1 (section) - (--each (oref section children) - (oset it hidden nil) - (when (or (oref it children) - (not (oref it content))) - (magit-section-show-headings-1 it)))) + (dolist (child (oref section children)) + (oset child hidden nil) + (when (or (oref child children) + (not (oref child content))) + (magit-section-show-headings-1 child)))) (defun magit-section-cycle (section) "Cycle visibility of current section and its children." @@ -503,7 +508,7 @@ hidden." (defun magit-section-cycle-diffs () "Cycle visibility of diff-related sections in the current buffer." (interactive) - (-when-let (sections + (when-let ((sections (cond ((derived-mode-p 'magit-status-mode) (--mapcat (when it @@ -514,7 +519,7 @@ hidden." (magit-get-section '((unstaged) (status)))))) ((derived-mode-p 'magit-diff-mode) (-filter #'magit-file-section-p - (oref magit-root-section children))))) + (oref magit-root-section children)))))) (if (--any-p (oref it hidden) sections) (dolist (s sections) (magit-section-show s) @@ -603,16 +608,67 @@ Sections at higher levels are hidden." ;;;; Auxiliary -(defun magit-describe-section () +(defun magit-describe-section-briefly (section &optional message) "Show information about the section at point. This command is intended for debugging purposes." - (interactive) - (let ((section (magit-current-section))) - (message "%S %S %s-%s" - (oref section value) - (magit-section-lineage section) - (marker-position (oref section start)) - (marker-position (oref section end))))) + (interactive (list (magit-current-section) t)) + (let ((str (format "#" + (let ((val (oref section value))) + (if (stringp val) + (substring-no-properties val) + val)) + (magit-section-lineage section) + (when-let ((m (oref section start))) + (marker-position m)) + (when-let ((m (oref section end))) + (marker-position m))))) + (if message (message "%s" str) str))) + +(cl-defmethod cl-print-object ((section magit-section) stream) + "Print `magit-describe-section' result of SECTION." + ;; Used by debug and edebug as of Emacs 26. + (princ (magit-describe-section-briefly section) stream)) + +(defun magit-describe-section (section &optional interactive-p) + "Show information about the section at point." + (interactive (list (magit-current-section) t)) + (let ((inserter-section section)) + (while (and inserter-section (not (oref inserter-section inserter))) + (setq inserter-section (oref inserter-section parent))) + (when (and inserter-section (oref inserter-section inserter)) + (setq section inserter-section))) + (pcase (oref section inserter) + (`((,hook ,fun) . ,src-src) + (help-setup-xref `(magit-describe-section ,section) interactive-p) + (with-help-window (help-buffer) + (with-current-buffer standard-output + (insert (format-message + "%s\n is inserted by `%s'\n from `%s'" + (magit-describe-section-briefly section) + (make-text-button (symbol-name fun) nil + :type 'help-function + 'help-args (list fun)) + (make-text-button (symbol-name hook) nil + :type 'help-variable + 'help-args (list hook)))) + (pcase-dolist (`(,hook ,fun) src-src) + (insert (format-message + ",\n called by `%s'\n from `%s'" + (make-text-button (symbol-name fun) nil + :type 'help-function + 'help-args (list fun)) + (make-text-button (symbol-name hook) nil + :type 'help-variable + 'help-args (list hook))))) + (insert ".\n\n") + (insert + (format-message + "`%s' is " + (make-text-button (symbol-name fun) nil + :type 'help-function 'help-args (list fun)))) + (describe-function-1 fun)))) + (_ (message "%s, inserter unknown" + (magit-describe-section-briefly section))))) ;;; Match @@ -710,9 +766,9 @@ at point." (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))) + (-some (pcase-lambda (`(,key . ,val)) + (and (magit-section-match-1 key ident) val)) + alist))) ;;; Create @@ -777,22 +833,21 @@ anything this time around. (`file 'magit-file-section) (`hunk 'magit-hunk-section) (_ 'magit-section)) - "" :type ,tp :value ,(nth 1 (car args)) :start (point-marker) :parent magit-insert-section--parent))) (oset ,s hidden - (-if-let (value (run-hook-with-args-until-success - 'magit-section-set-visibility-hook ,s)) + (if-let ((value (run-hook-with-args-until-success + 'magit-section-set-visibility-hook ,s))) (eq value 'hide) - (-if-let (incarnation (and magit-insert-section--oldroot + (if-let ((incarnation (and magit-insert-section--oldroot (magit-get-section (magit-section-ident ,s) - magit-insert-section--oldroot))) + magit-insert-section--oldroot)))) (oref incarnation hidden) - (-if-let (value (magit-section-match-assoc - ,s magit-section-initial-visibility-alist)) + (if-let ((value (magit-section-match-assoc + ,s magit-section-initial-visibility-alist))) (progn (when (functionp value) (setq value (funcall value ,s))) @@ -810,6 +865,9 @@ anything this time around. `((let ((,s* ,s)) ,@(cdr args))) (cdr args)) + ;; `magit-insert-section-hook' should *not* be run with + ;; `magit-run-section-hook' because it's a hook that runs + ;; on section insertion, not a section inserting hook. (run-hooks 'magit-insert-section-hook) (magit-insert-child-count ,s) (set-marker-insertion-type (oref ,s start) t) @@ -882,29 +940,29 @@ insert a newline character if necessary." (magit-maybe-make-margin-overlay) (oset magit-insert-section--current content (point-marker))) -(defvar magit-insert-headers--hook nil "For internal use only.") -(defvar magit-insert-headers--beginning nil "For internal use only.") - -(defun magit-insert-headers (hooks) - (let ((magit-insert-section-hook - (cons 'magit-insert-remaining-headers - (if (listp magit-insert-section-hook) - magit-insert-section-hook - (list magit-insert-section-hook)))) - (magit-insert-headers--hook hooks) - wrapper) - (setq magit-insert-headers--beginning (point)) - (while (and (setq wrapper (pop magit-insert-headers--hook)) - (= (point) magit-insert-headers--beginning)) - (funcall wrapper)))) - -(defun magit-insert-remaining-headers () - (if (= (point) magit-insert-headers--beginning) - (magit-cancel-section) - (magit-insert-heading) - (remove-hook 'magit-insert-section-hook 'magit-insert-remaining-headers) - (mapc #'funcall magit-insert-headers--hook) - (insert "\n"))) +(defun magit-insert-headers (hook) + (let* ((header-sections nil) + (magit-insert-section-hook + (cons (lambda () + (push magit-insert-section--current + header-sections)) + (if (listp magit-insert-section-hook) + magit-insert-section-hook + (list magit-insert-section-hook))))) + (magit-run-section-hook hook) + (when header-sections + (insert "\n") + ;; Make the first header into the parent of the rest. + (when (cdr header-sections) + (cl-callf nreverse header-sections) + (let* ((1st-header (pop header-sections)) + (header-parent (oref 1st-header parent))) + (oset header-parent children (list 1st-header)) + (oset 1st-header children header-sections) + (oset 1st-header content (oref (car header-sections) start)) + (oset 1st-header end (oref (car (last header-sections)) end)) + (dolist (sub-header header-sections) + (oset sub-header parent 1st-header))))))) (defun magit-insert-child-count (section) "Modify SECTION's heading to contain number of child sections. @@ -956,9 +1014,9 @@ evaluated its BODY. Admittedly that's a bit of a hack." (unless (eq section magit-root-section) (run-hook-with-args-until-success 'magit-section-highlight-hook section selection)) - (--each magit-section-unhighlight-sections + (dolist (s magit-section-unhighlight-sections) (run-hook-with-args-until-success - 'magit-section-unhighlight-hook it selection)) + 'magit-section-unhighlight-hook s selection)) (restore-buffer-modified-p nil) (unless (eq magit-section-highlighted-section section) (setq magit-section-highlighted-section @@ -972,6 +1030,13 @@ evaluated its BODY. Admittedly that's a bit of a hack." This function works for any section but produces undesirable effects for diff related sections, which by default are highlighted using `magit-diff-highlight'. Return t." + (when-let ((face (oref section heading-highlight-face))) + (dolist (section (or selection (list section))) + (magit-section-make-overlay + (oref section start) + (or (oref section content) + (oref section end)) + face))) (cond (selection (magit-section-make-overlay (oref (car selection) start) (oref (car (last selection)) end) @@ -998,10 +1063,10 @@ part of the hook variable, then such a region would be invisible." (when (and selection (not (and (eq this-command 'mouse-drag-region)))) - (--each selection - (magit-section-make-overlay (oref it start) - (or (oref it content) - (oref it end)) + (dolist (section selection) + (magit-section-make-overlay (oref section start) + (or (oref section content) + (oref section end)) 'magit-section-heading-selection)) t)) @@ -1031,9 +1096,9 @@ invisible." (unless (eq (magit-current-section) it) (goto-char start)))) (or (and (magit-hunk-section-p section) - (-when-let (parent (magit-get-section + (when-let ((parent (magit-get-section (magit-section-ident - (oref section parent)))) + (oref section parent))))) (let* ((children (oref parent children)) (siblings (magit-section-siblings section 'prev)) (previous (nth (length siblings) children))) @@ -1084,7 +1149,7 @@ invisible." (cl-defun magit-section-cache-visibility (&optional (section magit-insert-section--current)) - ;; Emacs 24 doesn't have `alist-get'. + ;; Emacs 25's `alist-get' lacks TESTFN. (let* ((id (magit-section-ident section)) (elt (assoc id magit-section-visibility-cache)) (val (if (oref section hidden) 'hide 'show))) @@ -1122,7 +1187,7 @@ invisible." (magit-section-selected-p it selection))))) (defun magit-section-parent-value (section) - (-when-let (parent (oref section parent)) + (when-let ((parent (oref section parent))) (oref parent value))) (defun magit-section-siblings (section &optional direction) @@ -1132,7 +1197,7 @@ If optional DIRECTION is `prev', then return siblings that come before SECTION. If it is `next', then return siblings that come after SECTION. For all other values, return all siblings excluding SECTION itself." - (-when-let (parent (oref section parent)) + (when-let ((parent (oref section parent))) (let ((siblings (oref parent children))) (pcase direction (`prev (cdr (member section (reverse siblings)))) @@ -1309,20 +1374,22 @@ again use `remove-hook'." (set hook value) (set-default hook value)))) -(defun magit-run-section-hook (hook) - "Run HOOK, warning about invalid entries." - (--if-let (-remove #'functionp (symbol-value hook)) - (progn - (message "`%s' contains entries that are no longer valid. +(defun magit-run-section-hook (hook &rest args) + "Run HOOK with ARGS, warning about invalid entries." + (let ((entries (symbol-value hook))) + (unless (listp entries) + (setq entries (list entries))) + (--when-let (-remove #'functionp entries) + (message "`%s' contains entries that are no longer valid. %s\nUsing standard value instead. Please re-configure hook variable." - hook - (mapconcat (lambda (sym) (format " `%s'" sym)) it "\n")) - (sit-for 5) - (defvar magit--hook-standard-value nil) - (let ((magit--hook-standard-value - (eval (car (get hook 'standard-value))))) - (run-hooks 'magit---hook-standard-value))) - (run-hooks hook))) + hook + (mapconcat (lambda (sym) (format " `%s'" sym)) it "\n")) + (sit-for 5) + (setq entries (eval (car (get hook 'standard-value))))) + (dolist (entry entries) + (let ((magit--current-section-hook (cons (list hook entry) + magit--current-section-hook))) + (apply entry args))))) (provide 'magit-section) ;;; magit-section.el ends here diff --git a/elpa/magit-20180404.1428/magit-sequence.el b/elpa/magit-20180828.1055/magit-sequence.el similarity index 92% rename from elpa/magit-20180404.1428/magit-sequence.el rename to elpa/magit-20180828.1055/magit-sequence.el index cd43d9fd..bf98f355 100644 --- a/elpa/magit-20180404.1428/magit-sequence.el +++ b/elpa/magit-20180828.1055/magit-sequence.el @@ -116,6 +116,9 @@ This discards all changes made since the sequence started." ;;; Cherry-Pick +(defvar magit-perl-executable "perl" + "The Perl executable.") + ;;;###autoload (autoload 'magit-cherry-pick-popup "magit-sequence" nil t) (magit-define-popup magit-cherry-pick-popup "Popup console for cherry-pick commands." @@ -273,10 +276,11 @@ the process manually." (magit-run-git "checkout" src) (magit-refresh))) (t - (magit-call-git "checkout" src) + (magit-git "checkout" src) (let ((process-environment process-environment)) - (push (format "%s=perl -i -ne '/^pick (%s)/ or print'" + (push (format "%s=%s -i -ne '/^pick (%s)/ or print'" "GIT_SEQUENCE_EDITOR" + magit-perl-executable (mapconcat #'magit-rev-abbrev commits "|")) process-environment) (magit-run-git-sequencer "rebase" "-i" keep)) @@ -495,7 +499,7 @@ This discards all changes made since the sequence started." If that variable is unset, then rebase onto `remote.pushDefault'." (interactive (list (magit-rebase-arguments))) (--if-let (magit-get-current-branch) - (-if-let (remote (magit-get-push-remote it)) + (if-let ((remote (magit-get-push-remote it))) (if (member remote (magit-list-remotes)) (magit-git-rebase (concat remote "/" it) args) (user-error "Remote `%s' doesn't exist" remote)) @@ -507,7 +511,7 @@ If that variable is unset, then rebase onto `remote.pushDefault'." "Rebase the current branch onto its upstream branch." (interactive (list (magit-rebase-arguments))) (--if-let (magit-get-current-branch) - (-if-let (target (magit-get-upstream-branch it)) + (if-let ((target (magit-get-upstream-branch it))) (magit-git-rebase target args) (user-error "No upstream is configured for %s" it)) (user-error "No branch is checked out"))) @@ -544,7 +548,7 @@ START has to be selected from a list of recent commits." "and commits above it onto " newbase ",")))) (defun magit-rebase-interactive-1 - (commit args message &optional editor noassert confirm) + (commit args message &optional editor delay-edit-confirm noassert confirm) (declare (indent 2)) (when commit (if (eq commit :merge-base) @@ -557,7 +561,7 @@ START has to be selected from a list of recent commits." (setq commit (concat commit "^")) (setq args (cons "--root" args))))) (when (and commit (not noassert)) - (setq commit (magit-rebase-interactive-assert commit))) + (setq commit (magit-rebase-interactive-assert commit delay-edit-confirm))) (if (and commit (not confirm)) (let ((process-environment process-environment)) (when editor @@ -567,10 +571,37 @@ START has to be selected from a list of recent commits." (magit-log-select `(lambda (commit) (magit-rebase-interactive-1 commit (list ,@args) - ,message ,editor ,noassert)) + ,message ,editor ,delay-edit-confirm ,noassert)) message))) -(defun magit-rebase-interactive-assert (since) +(defvar magit--rebase-published-symbol nil) +(defvar magit--rebase-public-edit-confirmed nil) + +(defun magit-rebase-interactive-assert (since &optional delay-edit-confirm) + (let* ((commit (if (string-suffix-p "^" since) + ;; If SINCE is "REV^", then the user selected + ;; "REV", which is the first commit that will + ;; be replaced. (from^..to] <=> [from..to]. + (substring since 0 -1) + ;; The "--root" argument is being used. + since)) + (branches (magit-list-publishing-branches commit))) + (setq magit--rebase-public-edit-confirmed + (delete (magit-toplevel) magit--rebase-public-edit-confirmed)) + (when (and branches + (or (not delay-edit-confirm) + ;; The user might have stopped at a published commit + ;; merely to add new commits *after* it. Try not to + ;; ask users whether they really want to edit public + ;; commits, when they don't actually intend to do so. + (not (--all-p (magit-rev-equal it commit) branches)))) + (let ((m1 "Some of these commits have already been published to ") + (m2 ".\nDo you really want to modify them")) + (magit-confirm (or magit--rebase-published-symbol 'rebase-published) + (concat m1 "%s" m2) + (concat m1 "%i public branches" m2) + nil branches)) + (push (magit-toplevel) magit--rebase-public-edit-confirmed))) (if (magit-git-lines "rev-list" "--merges" (concat since "..HEAD")) (magit-read-char-case "Proceed despite merge in rebase range? " nil (?c "[c]ontinue" since) @@ -584,7 +615,8 @@ START has to be selected from a list of recent commits." (interactive (list (magit-commit-at-point) (magit-rebase-arguments))) (magit-rebase-interactive-1 commit args - "Type %p on a commit to rebase it and all commits above it,")) + "Type %p on a commit to rebase it and all commits above it," + nil t)) ;;;###autoload (defun magit-rebase-autosquash (args) @@ -592,7 +624,7 @@ START has to be selected from a list of recent commits." (interactive (list (magit-rebase-arguments))) (magit-rebase-interactive-1 :merge-base (cons "--autosquash" args) "Type %p on a commit to squash into it and then rebase as necessary," - "true")) + "true" nil t)) ;;;###autoload (defun magit-rebase-edit-commit (commit args) @@ -601,7 +633,9 @@ START has to be selected from a list of recent commits." (magit-rebase-arguments))) (magit-rebase-interactive-1 commit args "Type %p on a commit to edit it," - "perl -i -p -e '++$x if not $x and s/^pick/edit/'")) + (concat magit-perl-executable + " -i -p -e '++$x if not $x and s/^pick/edit/'") + t)) ;;;###autoload (defun magit-rebase-reword-commit (commit args) @@ -610,7 +644,8 @@ START has to be selected from a list of recent commits." (magit-rebase-arguments))) (magit-rebase-interactive-1 commit args "Type %p on a commit to reword its message," - "perl -i -p -e '++$x if not $x and s/^pick/reword/'")) + (concat magit-perl-executable + " -i -p -e '++$x if not $x and s/^pick/reword/'"))) ;;;###autoload (defun magit-rebase-remove-commit (commit args) @@ -619,8 +654,9 @@ START has to be selected from a list of recent commits." (magit-rebase-arguments))) (magit-rebase-interactive-1 commit args "Type %p on a commit to remove it," - "perl -i -p -e '++$x if not $x and s/^pick/# pick/'" - nil t)) + (concat magit-perl-executable + " -i -p -e '++$x if not $x and s/^pick/# pick/'") + nil nil t)) ;;;###autoload (defun magit-rebase-continue (&optional noedit) @@ -631,6 +667,11 @@ edit. With a prefix argument the old message is reused as-is." (if (magit-rebase-in-progress-p) (if (magit-anything-unstaged-p t) (user-error "Cannot continue rebase with unstaged changes") + (when (and (magit-anything-staged-p) + (file-exists-p (magit-git-dir "rebase-merge")) + (not (member (magit-toplevel) + magit--rebase-public-edit-confirmed))) + (magit-commit-amend-assert)) (if noedit (let ((process-environment process-environment)) (push "GIT_EDITOR=true" process-environment) @@ -680,9 +721,11 @@ If no such sequence is in progress, do nothing." (when (or picking (magit-revert-in-progress-p)) (magit-insert-section (sequence) (magit-insert-heading (if picking "Cherry Picking" "Reverting")) - (-when-let (lines (cdr (magit-file-lines (magit-git-dir "sequencer/todo")))) + (when-let ((lines + (cdr (magit-file-lines (magit-git-dir "sequencer/todo"))))) (dolist (line (nreverse lines)) - (when (string-match "^\\(pick\\|revert\\) \\([^ ]+\\) \\(.*\\)$" line) + (when (string-match + "^\\(pick\\|revert\\) \\([^ ]+\\) \\(.*\\)$" line) (magit-bind-match-strings (cmd hash msg) line (magit-insert-section (commit hash) (insert (propertize cmd 'face 'magit-sequence-pick) diff --git a/elpa/magit-20180404.1428/magit-stash.el b/elpa/magit-20180828.1055/magit-stash.el similarity index 97% rename from elpa/magit-20180404.1428/magit-stash.el rename to elpa/magit-20180828.1055/magit-stash.el index 5f56dfd6..3b17e075 100644 --- a/elpa/magit-20180404.1428/magit-stash.el +++ b/elpa/magit-20180828.1055/magit-stash.el @@ -227,8 +227,8 @@ When the region is active offer to drop all contained stashes." (magit-rev-parse "--short" stash)) (magit-call-git "rev-parse" stash) (magit-call-git "reflog" "delete" "--updateref" "--rewrite" stash)) - (-when-let (ref (and (string-match "\\(.+\\)@{[0-9]+}$" stash) - (match-string 1 stash))) + (when-let ((ref (and (string-match "\\(.+\\)@{[0-9]+}$" stash) + (match-string 1 stash)))) (unless (string-match "^refs/" ref) (setq ref (concat "refs/" ref))) (unless (magit-rev-verify (concat ref "@{0}")) @@ -369,8 +369,7 @@ instead of \"Stashes:\"." "rebase-merge/autostash" "rebase-apply/autostash"))))))) (when (or autostash verified) - (magit-insert-section (stashes ref (with-no-warnings - (not magit-status-expand-stashes))) + (magit-insert-section (stashes ref) (magit-insert-heading heading) (when autostash (pcase-let ((`(,author ,date ,msg) @@ -384,7 +383,7 @@ instead of \"Stashes:\"." (insert " " msg "\n") (save-excursion (backward-char) - (magit-log-format-margin author date))))) + (magit-log-format-margin autostash author date))))) (if verified (magit-git-wash (apply-partially 'magit-log-wash-log 'stash) "reflog" "--format=%gd%x00%aN%x00%at%x00%gs" ref) @@ -424,7 +423,7 @@ instead of \"Stashes:\"." (interactive (cons (or (and (not current-prefix-arg) (magit-stash-at-point)) (magit-read-stash "Show stash")) - (-let [(args files) (magit-diff-arguments)] + (pcase-let ((`(,args ,files) (magit-diff-arguments))) (list (delete "--stat" args) files)))) (magit-mode-setup #'magit-stash-mode stash nil args files)) @@ -442,7 +441,7 @@ instead of \"Stashes:\"." (magit-rev-format "%s" stash))) (setq magit-buffer-revision-hash (magit-rev-parse stash)) (magit-insert-section (stash) - (run-hooks 'magit-stash-sections-hook))) + (magit-run-section-hook 'magit-stash-sections-hook))) (defun magit-stash-insert-section (commit range message &optional files) (magit-insert-section (commit commit) diff --git a/elpa/magit-20180404.1428/magit-status.el b/elpa/magit-20180828.1055/magit-status.el similarity index 88% rename from elpa/magit-20180404.1428/magit-status.el rename to elpa/magit-20180828.1055/magit-status.el index 286e117e..a68aff43 100644 --- a/elpa/magit-20180404.1428/magit-status.el +++ b/elpa/magit-20180828.1055/magit-status.el @@ -82,22 +82,15 @@ all." magit-insert-unstaged-changes magit-insert-staged-changes magit-insert-stashes - magit-insert-unpulled-from-upstream - magit-insert-unpulled-from-pushremote + magit-insert-unpushed-to-pushremote magit-insert-unpushed-to-upstream-or-recent - magit-insert-unpushed-to-pushremote) + magit-insert-unpulled-from-pushremote + magit-insert-unpulled-from-upstream) "Hook run to insert sections into a status buffer." :package-version '(magit . "2.12.0") :group 'magit-status :type 'hook) -(defcustom magit-status-expand-stashes t - "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) - (defcustom magit-status-show-hashes-in-headers nil "Whether headers in the status buffer show hashes. The functions which respect this option are @@ -152,7 +145,7 @@ Non-interactively DIRECTORY is (re-)initialized unconditionally." (let ((directory (file-name-as-directory (expand-file-name (read-directory-name "Create repository in: "))))) - (-when-let (toplevel (magit-toplevel directory)) + (when-let ((toplevel (magit-toplevel directory))) (setq toplevel (expand-file-name toplevel)) (unless (y-or-n-p (if (file-equal-p toplevel directory) (format "Reinitialize existing repository %s? " @@ -216,10 +209,10 @@ also contains other useful hints.") (defvar magit--remotes-using-recent-git nil) (defun magit--tramp-asserts (directory) - (-when-let (remote (file-remote-p directory)) + (when-let ((remote (file-remote-p directory))) (unless (member remote magit--remotes-using-recent-git) - (-if-let (version (let ((default-directory directory)) - (magit-git-version))) + (if-let ((version (let ((default-directory directory)) + (magit-git-version)))) (if (version<= magit--minimal-git version) (push version magit--remotes-using-recent-git) (display-warning 'magit (format "\ @@ -302,8 +295,25 @@ Type \\[magit-commit-popup] to create a commit. (defun magit-status-refresh-buffer () (magit-git-exit-code "update-index" "--refresh") (magit-insert-section (status) - (magit-run-section-hook 'magit-status-sections-hook)) - (run-hooks 'magit-status-refresh-hook)) + (magit-run-section-hook 'magit-status-sections-hook))) + +(defun magit-status-goto-commits () + "In a `magit-status-mode' buffer, jump to some log. +Actually doing so is deferred until `magit-refresh-buffer-hook' +runs `magit-status-goto-commits-1'. That function then removes +itself from the hook, so that this only happens when the status +buffer is first created." + (when (derived-mode-p 'magit-status-mode) + (add-hook 'magit-refresh-buffer-hook 'magit-status-goto-commits-1 nil t))) + +(defun magit-status-goto-commits-1 () + "In a `magit-status-mode' buffer, jump to some log. +This function removes itself from `magit-refresh-buffer-hook'." + (when-let + ((s (or (magit-get-section '((unpulled . "..@{upstream}") (status))) + (magit-get-section '((unpushed . "@{upstream}..") (status)))))) + (goto-char (oref s start))) + (remove-hook 'magit-refresh-buffer-hook 'magit-status-goto-commits-1 t)) (defun magit-status-maybe-update-revision-buffer (&optional _) "When moving in the status buffer, update the revision buffer. @@ -325,7 +335,7 @@ If there is no blob buffer in the same frame, then do nothing." The sections are inserted by running the functions on the hook `magit-status-headers-hook'." (if (magit-rev-verify "HEAD") - (magit-insert-headers magit-status-headers-hook) + (magit-insert-headers 'magit-status-headers-hook) (insert "In the beginning there was darkness\n\n"))) (defvar magit-error-section-map @@ -346,7 +356,7 @@ the status buffer causes this section to disappear again." (insert (propertize (format "%-10s" "GitError! ") 'face 'magit-section-heading)) (insert (propertize magit-this-error 'face 'font-lock-warning-face)) - (-when-let (key (car (where-is-internal 'magit-process-buffer))) + (when-let ((key (car (where-is-internal 'magit-process-buffer)))) (insert (format " [Type `%s' for details]" (key-description key)))) (insert ?\n)) (setq magit-this-error nil))) @@ -476,10 +486,10 @@ detached `HEAD'." If no remote is configured for the current branch, then fall back showing the \"origin\" remote, or if that does not exist the first remote in alphabetic order." - (-when-let* ((name (magit-get-some-remote)) - ;; Under certain configurations it's possible for url - ;; to be nil, when name is not, see #2858. - (url (magit-get "remote" name "url"))) + (when-let ((name (magit-get-some-remote)) + ;; Under certain configurations it's possible for url + ;; to be nil, when name is not, see #2858. + (url (magit-get "remote" name "url"))) (magit-insert-section (remote name) (insert (format "%-10s" "Remote: ")) (insert (propertize name 'face 'magit-branch-remote) ?\s) @@ -512,16 +522,15 @@ value of that variable can be set using \"D = f DIRECTORY RET g\"." (base (and base (file-directory-p base) base))) (unless (equal show "no") (if (equal show "all") - (-when-let (files (magit-untracked-files nil base)) + (when-let ((files (magit-untracked-files nil base))) (magit-insert-section (untracked) (magit-insert-heading "Untracked files:") - (magit-insert-un/tracked-files-1 files base) + (magit-insert-files files base) (insert ?\n))) - (-when-let - (files (--mapcat (and (eq (aref it 0) ??) - (list (substring it 3))) - (magit-git-items "status" "-z" "--porcelain" - "--" base))) + (when-let ((files (--mapcat (and (eq (aref it 0) ??) + (list (substring it 3))) + (magit-git-items "status" "-z" "--porcelain" + "--" base)))) (magit-insert-section (untracked) (magit-insert-heading "Untracked files:") (dolist (file files) @@ -537,15 +546,29 @@ value of that variable can be set using \"D = f DIRECTORY RET g\"." 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)) + (when-let ((files (magit-list-files))) (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) + (magit-insert-files files base) + (insert ?\n))))) + +(defun magit-insert-ignored-files () + "Insert a tree of ignored files. + +If the first element of `magit-diff-section-arguments' is a +directory, then limit the list to files below that. The value +of that variable can be set using \"D = f DIRECTORY RET g\"." + (when-let ((files (magit-ignored-files))) + (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 "Ignored files:") + (magit-insert-files files base) (insert ?\n))))) -(defun magit-insert-un/tracked-files-1 (files directory) +(defun magit-insert-files (files directory) (while (and files (string-prefix-p (or directory "") (car files))) (let ((dir (file-name-directory (car files)))) (if (equal dir directory) @@ -555,7 +578,7 @@ value of that variable can be set using \"D = f DIRECTORY RET g\"." (magit-insert-section (file dir t) (insert (propertize dir 'file 'magit-filename) ?\n) (magit-insert-heading) - (setq files (magit-insert-un/tracked-files-1 files dir)))))) + (setq files (magit-insert-files files dir)))))) files) (provide 'magit-status) diff --git a/elpa/magit-20180404.1428/magit-submodule.el b/elpa/magit-20180828.1055/magit-submodule.el similarity index 98% rename from elpa/magit-20180404.1428/magit-submodule.el rename to elpa/magit-20180828.1055/magit-submodule.el index a83d4777..875b6294 100644 --- a/elpa/magit-20180404.1428/magit-submodule.el +++ b/elpa/magit-20180828.1055/magit-submodule.el @@ -175,7 +175,7 @@ it is nil, then PATH also becomes the name." (push (if prefer-short path name) minibuffer-history) (magit-read-string-ns "Submodule name" nil (cons 'minibuffer-history 2) - (or (--keep (-let [(var val) (split-string it "=")] + (or (--keep (pcase-let ((`(,var ,val) (split-string it "="))) (and (equal val path) (cadr (split-string var "\\.")))) (magit-git-lines "config" "--list" "-f" ".gitmodules")) @@ -278,7 +278,7 @@ single module from the user." 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-list-module-paths)) + (when-let ((modules (magit-list-module-paths))) (if magit-module-sections-nested (magit-insert-section section (submodules nil t) (magit-insert-heading @@ -298,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-list-module-paths)) + (when-let ((modules (magit-list-module-paths))) (magit-insert-section section (submodules nil t) (magit-insert-heading (format "%s (%s)" @@ -415,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-list-module-paths)) + (when-let ((modules (magit-list-module-paths))) (magit-insert-section section ((eval type) nil t) (string-match "\\`\\(.+\\) \\([^ ]+\\)\\'" heading) (magit-insert-heading @@ -465,7 +465,7 @@ These sections can be expanded to show the respective commits." (setq tabulated-list-padding 0) (setq tabulated-list-sort-key (cons "Path" nil)) (setq tabulated-list-format - (vconcat (mapcar (-lambda ((title width _fn props)) + (vconcat (mapcar (pcase-lambda (`(,title ,width ,_fn ,props)) (nconc (list title width t) (-flatten props))) magit-submodule-list-columns))) diff --git a/elpa/magit-20180404.1428/magit-subtree.el b/elpa/magit-20180828.1055/magit-subtree.el similarity index 100% rename from elpa/magit-20180404.1428/magit-subtree.el rename to elpa/magit-20180828.1055/magit-subtree.el diff --git a/elpa/magit-20180404.1428/magit-tag.el b/elpa/magit-20180828.1055/magit-tag.el similarity index 74% rename from elpa/magit-20180404.1428/magit-tag.el rename to elpa/magit-20180828.1055/magit-tag.el index f2f48b03..1153e2ca 100644 --- a/elpa/magit-20180404.1428/magit-tag.el +++ b/elpa/magit-20180828.1055/magit-tag.el @@ -67,6 +67,7 @@ defaulting to the tag at point. (magit-read-tag "Delete tag" t)))) (magit-run-git "tag" "-d" tags)) +;;;###autoload (defun magit-tag-prune (tags remote-tags remote) "Offer to delete tags missing locally from REMOTE, and vice versa." (interactive @@ -95,5 +96,37 @@ defaulting to the tag at point. (when remote-tags (magit-run-git-async "push" remote (--map (concat ":" it) remote-tags)))) +;;;###autoload +(defun magit-tag-release (tag) + "Create an opinionated release tag. + +Assume version tags that match \"\\\\`v?[0-9]\\\\(\\\\.[0-9]\\\\)*\\\\'\". +Prompt for the name of the new tag using the highest existing tag +as initial input and call \"git tag --annotate --sign -m MSG\" TAG, +regardless of whether these arguments are enabled in the popup. +Given a TAG \"v1.2.3\" and a repository \"/path/to/foo-bar\", the +MESSAGE would be \"Foo-Bar 1.2.3\". + +Because it is so opinionated, this command is not available from +the tag popup by default." + (interactive + (list (read-string "Create tag: " + (car (nreverse + (cl-sort (magit-list-tags) #'version< + :key (lambda (tag) + (if (string-prefix-p "v" tag) + (substring tag 1) + tag)))))))) + (magit-run-git + "tag" "--annotate" "--sign" + "-m" (format "%s %s" + (capitalize (file-name-nondirectory + (directory-file-name (magit-toplevel)))) + (if (string-prefix-p "v" tag) + (substring tag 1) + tag)) + tag) + (magit-show-refs)) + (provide 'magit-tag) ;;; magit-tag.el ends here diff --git a/elpa/magit-20180404.1428/magit-utils.el b/elpa/magit-20180828.1055/magit-utils.el similarity index 86% rename from elpa/magit-20180404.1428/magit-utils.el rename to elpa/magit-20180828.1055/magit-utils.el index aa0f1655..02bdf311 100644 --- a/elpa/magit-20180404.1428/magit-utils.el +++ b/elpa/magit-20180828.1055/magit-utils.el @@ -40,6 +40,7 @@ (require 'cl-lib) (require 'dash) +(require 'subr-x) (require 'crm) @@ -68,8 +69,10 @@ less well behaved than the former, more modern alternatives. If you would like to use Ivy or Helm completion with Magit but not enable the respective modes globally, then customize this -option to use `ivy-completing-read' -or `helm--completing-read-default'." +option to use `ivy-completing-read' or +`helm--completing-read-default'. If you choose to use +`ivy-completing-read', note that the items may always be shown in +alphabetical order, depending on your version of Ivy." :group 'magit-essentials :type '(radio (function-item magit-builtin-completing-read) (function-item magit-ido-completing-read) @@ -77,31 +80,20 @@ or `helm--completing-read-default'." (function-item helm--completing-read-default) (function :tag "Other function"))) -(defvar magit-no-confirm-default nil - "A list of commands which should just use the default choice. - -Many commands let the user choose the target they act on offering -a sensible default as default choice. If you think that that -default is so sensible that it should always be used without even -offering other choices, then add that command here. - -Only the following commands support this option: - `magit-branch' - `magit-branch-and-checkout' - `magit-branch-orphan' - `magit-worktree-branch' - For these four commands `magit-branch-read-upstream-first' - must be non-nil, or adding them here has no effect. - `magit-branch-rename' - `magit-tag'") - (defcustom magit-dwim-selection '((magit-stash-apply nil t) (magit-stash-branch nil t) (magit-stash-branch-here nil t) (magit-stash-format-patch nil t) (magit-stash-drop nil ask) - (magit-stash-pop nil ask)) + (magit-stash-pop nil ask) + (forge-browse-commit nil t) + (forge-browse-branch nil t) + (forge-browse-remote nil t) + (forge-browse-issue nil t) + (forge-browse-pullreq nil t) + (forge-visit-issue nil t) + (forge-visit-pullreq nil t)) "When not to offer alternatives and ask for confirmation. Many commands by default ask the user to select from a list of @@ -131,11 +123,13 @@ The value has the form ((COMMAND nil|PROMPT DEFAULT)...). entry has no effect." :package-version '(magit . "2.12.0") :group 'magit-commands - :type '(repeat (list command - (regexp :tag "Prompt regexp") - (choice (const "Offer other choices" nil) - (const "Require confirmation" ask) - (const "Use default without confirmation" t))))) + :type '(repeat + (list (symbol :tag "Command") ; It might not be fboundp yet. + (choice (const :tag "for all prompts" nil) + (regexp :tag "for prompts matching regexp")) + (choice (const :tag "offer other choices" nil) + (const :tag "require confirmation" ask) + (const :tag "use default without confirmation" t))))) (defconst magit--confirm-actions '((const reverse) (const discard) @@ -232,6 +226,28 @@ References: This action only concerns the deletion of multiple stashes at once. +Edit published history: + + Without adding these symbols here, you will be warned before + editing commits that have already been pushed to one of the + branches listed in `magit-published-branches'. + + `amend-published' Affects most commands that amend to \"HEAD\". + + `rebase-published' Affects commands that perform interactive + rebases. This includes commands from the commit popup that + modify a commit other than \"HEAD\", namely the various fixup + and squash variants. + + `edit-published' Affects the commands `magit-edit-line-commit' + and `magit-diff-edit-hunk-commit'. These two commands make + it quite easy to accidentally edit a published commit, so you + should think twice before configuring them not to ask for + confirmation. + + To disable confirmation completely, add all three symbols here + or set `magit-published-branches' to nil. + Various: `kill-process' There seldom is a reason to kill a process. @@ -256,7 +272,7 @@ Global settings: :group 'magit-commands :type `(choice (const :tag "Always require confirmation" nil) (const :tag "Never require confirmation" t) - (set :tag "Require confirmation only for" + (set :tag "Require confirmation except for" ,@magit--confirm-actions))) (defcustom magit-slow-confirm '(drop-stashes) @@ -310,9 +326,10 @@ and in process buffers to elide `magit-git-global-arguments'." (defcustom magit-update-other-window-delay 0.2 "Delay before automatically updating the other window. -When moving around in certain buffers certain other buffers, -which are being displayed in another window, may optionally be -updated to display information about the section at point. +When moving around in certain buffers, then certain other +buffers, which are being displayed in another window, may +optionally be updated to display information about the +section at point. When holding down a key to move by more than just one section, then that would update that buffer for each section on the way. @@ -343,6 +360,9 @@ and delay of your graphical environment or operating system." ;;; User Input +(defvar helm-completion-in-region-default-sort-fn) +(defvar ivy-sort-functions-alist) + (defvar magit-completing-read--silent-default nil) (defun magit-completing-read (prompt collection &optional @@ -389,15 +409,12 @@ acts similarly to `completing-read', except for the following: `magit-completing-read-function' is set to its default value of `magit-builtin-completing-read'." (setq magit-completing-read--silent-default nil) - (-if-let (dwim (and def - (or (nth 2 (-first (lambda (arg) - (pcase-let ((`(,cmd ,re ,_) arg)) - (and (eq this-command cmd) - (or (not re) - (string-match-p re prompt))))) - magit-dwim-selection)) - (memq this-command - (with-no-warnings magit-no-confirm-default))))) + (if-let ((dwim (and def + (nth 2 (-first (pcase-lambda (`(,cmd ,re ,_)) + (and (eq this-command cmd) + (or (not re) + (string-match-p re prompt)))) + magit-dwim-selection))))) (if (eq dwim 'ask) (if (y-or-n-p (format "%s %s? " prompt def)) def @@ -406,13 +423,15 @@ acts similarly to `completing-read', except for the following: def) (unless def (setq def fallback)) - (let ((reply (funcall magit-completing-read-function + (let ((command this-command) + (reply (funcall magit-completing-read-function (concat prompt ": ") (if (and def (not (member def collection))) (cons def collection) collection) predicate require-match initial-input hist def))) + (setq this-command command) (if (string= reply "") (if require-match (user-error "Nothing selected") @@ -425,20 +444,21 @@ acts similarly to `completing-read', except for the following: '(metadata (display-sort-function . identity)) (complete-with-action action collection string pred)))) +(defvar ivy-sort-functions-alist) + (defun magit-builtin-completing-read (prompt choices &optional predicate require-match initial-input hist def) "Magit wrapper for standard `completing-read' function." + (unless (or (bound-and-true-p helm-mode) + (bound-and-true-p ivy-mode)) + (setq prompt (magit-prompt-with-default prompt def)) + (setq choices (magit--completion-table choices))) (cl-letf (((symbol-function 'completion-pcm--all-completions) #'magit-completion-pcm--all-completions)) - (completing-read (if (or (bound-and-true-p helm-mode) - (bound-and-true-p ivy-mode)) - prompt - (magit-prompt-with-default prompt def)) - (magit--completion-table choices) - predicate require-match - initial-input hist def))) - -(defvar helm-completion-in-region-default-sort-fn) + (let ((ivy-sort-functions-alist nil)) + (completing-read prompt choices + predicate require-match + initial-input hist def)))) (defun magit-completing-read-multiple (prompt choices &optional sep default hist keymap) @@ -575,6 +595,10 @@ ACTION is a member of option `magit-slow-confirm'." (yes-or-no-p prompt) (y-or-n-p prompt))) +(defvar magit--no-confirm-alist + '((safe-with-wip magit-wip-before-change-mode + discard reverse stage-all-changes unstage-all-changes))) + (cl-defun magit-confirm (action &optional prompt prompt-n noabort (items nil sitems)) (declare (indent defun)) @@ -584,13 +608,14 @@ ACTION is a member of option `magit-slow-confirm'." (car items))) (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)))))) + (memq action magit-no-confirm) + (cl-member-if (pcase-lambda (`(,key ,var . ,sub)) + (and (memq key magit-no-confirm) + (memq action sub) + (or (not var) + (and (boundp var) + (symbol-value var))))) + magit--no-confirm-alist))) (or (not sitems) items)) ((not sitems) (magit-y-or-n-p prompt action)) @@ -726,6 +751,42 @@ that it will align with the text area." (eq face current)) return nil)) +(defun magit--format-spec (format specification) + "Like `format-spec' but preserve text properties in SPECIFICATION." + (with-temp-buffer + (insert format) + (goto-char (point-min)) + (while (search-forward "%" nil t) + (cond + ;; Quoted percent sign. + ((eq (char-after) ?%) + (delete-char 1)) + ;; Valid format spec. + ((looking-at "\\([-0-9.]*\\)\\([a-zA-Z]\\)") + (let* ((num (match-string 1)) + (spec (string-to-char (match-string 2))) + (val (assq spec specification))) + (unless val + (error "Invalid format character: `%%%c'" spec)) + (setq val (cdr val)) + ;; Pad result to desired length. + (let ((text (format (concat "%" num "s") val))) + ;; Insert first, to preserve text properties. + (if (next-property-change 0 (concat " " text)) + ;; If the inserted text has properties, then preserve those. + (insert text) + ;; Otherwise preserve FORMAT's properties, like `format-spec'. + (insert-and-inherit text)) + ;; Delete the specifier body. + (delete-region (+ (match-beginning 0) (length text)) + (+ (match-end 0) (length text))) + ;; Delete the percent sign. + (delete-region (1- (match-beginning 0)) (match-beginning 0))))) + ;; Signal an error on bogus format strings. + (t + (error "Invalid format string")))) + (buffer-string))) + ;;; Missing from Emacs (defun magit-kill-this-buffer () @@ -909,5 +970,11 @@ FORMAT-STRING to be displayed, then don't." (unless (--first (string-prefix-p it format-string) magit-no-message) (apply #'message format-string args))) +(defun magit-msg (format-string &rest args) + "Display a message at the bottom of the screen, but don't log it. +Like `message', except that `message-log-max' is bound to nil." + (let ((message-log-max nil)) + (apply #'message format-string args))) + (provide 'magit-utils) ;;; magit-utils.el ends here diff --git a/elpa/magit-20180404.1428/magit-wip.el b/elpa/magit-20180828.1055/magit-wip.el similarity index 63% rename from elpa/magit-20180404.1428/magit-wip.el rename to elpa/magit-20180828.1055/magit-wip.el index 257b45b5..0bb7efc5 100644 --- a/elpa/magit-20180404.1428/magit-wip.el +++ b/elpa/magit-20180828.1055/magit-wip.el @@ -59,6 +59,22 @@ :group 'magit-wip :type 'string) +(defcustom magit-wip-merge-branch nil + "Whether to merge the current branch into its wip ref. + +If non-nil and the current branch has new commits, then it is +merged into the wip ref before creating a new wip commit. This +makes it easier to inspect wip history and the wip commits are +never garbage collected. + +If nil and the current branch has new commits, then the wip ref +is reset to the tip of the branch before creating a new wip +commit. With this setting wip commits are eventually garbage +collected." + :package-version '(magit . "2.90.0") + :group 'magit-wip + :type 'boolean) + (defcustom magit-wip-namespace "refs/wip/" "Namespace used for work-in-progress refs. The wip refs are named \"index/\" @@ -101,7 +117,7 @@ variant `magit-wip-after-save-mode'." :package-version '(magit . "2.1.0") :group 'magit-wip) -(defun magit-wip-commit-buffer-file () +(defun magit-wip-commit-buffer-file (&optional msg) "Commit visited file to a worktree work-in-progress ref. Also see `magit-wip-after-save-mode' which calls this function @@ -111,9 +127,13 @@ automatically whenever a buffer visiting a tracked file is saved." (magit-with-toplevel (let ((file (file-relative-name buffer-file-name))) (magit-wip-commit-worktree - it (list file) (if (called-interactively-p 'any) - (format "wip-save %s after save" file) - (format "autosave %s after save" file))))))) + it (list file) + (format (cond (msg) + ((called-interactively-p 'any) + "wip-save %s after save") + (t + "autosave %s after save")) + file)))))) ;;;###autoload (define-minor-mode magit-wip-after-apply-mode @@ -157,6 +177,35 @@ command which is about to be called are committed." (magit-with-toplevel (magit-wip-commit files msg)))) +;;; Extras + +(defvar-local magit-wip-buffer-backed-up nil) +(put 'magit-wip-buffer-backed-up 'permanent-local t) + +;;;###autoload +(defun magit-wip-commit-initial-backup () + "Before saving, commit current file to a worktree wip ref. + +The user has to add this function to `before-save-hook'. + +Commit the current state of the visited file before saving the +current buffer to that file. This backs up the same version of +the file as `backup-buffer' would, but stores the backup in the +worktree wip ref, which is also used by the various Magit Wip +modes, instead of in a backup file as `backup-buffer' would. + +This function ignores the variables that affect `backup-buffer' +and can be used along-side that function, which is recommended +because this function only backs up files that are tracked in +a Git repository." + (when (and (not magit-wip-buffer-backed-up) + buffer-file-name + (magit-inside-worktree-p t) + (magit-file-tracked-p buffer-file-name)) + (let ((magit-save-repository-buffers nil)) + (magit-wip-commit-buffer-file "autosave %s before save")) + (setq magit-wip-buffer-backed-up t))) + ;;; Core (defun magit-wip-commit (&optional files msg) @@ -175,17 +224,14 @@ commit message." (magit-wip-commit-index it files msg) (magit-wip-commit-worktree it files msg))) -(defun magit-wip-commit-index (ref files msg &optional cached-only) - (let* ((wipref (concat magit-wip-namespace "index/" ref)) - (parent (magit-wip-get-parent ref wipref))) - (when (magit-git-failure "diff-index" "--quiet" - (and cached-only "--cached") - parent "--" files) - (magit-wip-update-wipref wipref (magit-git-string "write-tree") - parent files msg "index")))) +(defun magit-wip-commit-index (ref files msg) + (let* ((wipref (magit--wip-index-ref ref)) + (parent (magit-wip-get-parent ref wipref)) + (tree (magit-git-string "write-tree"))) + (magit-wip-update-wipref ref wipref tree parent files msg "index"))) (defun magit-wip-commit-worktree (ref files msg) - (let* ((wipref (concat magit-wip-namespace "wtree/" ref)) + (let* ((wipref (magit--wip-wtree-ref ref)) (parent (magit-wip-get-parent ref wipref)) (tree (magit-with-temp-index parent "--reset" (if files @@ -193,34 +239,51 @@ commit message." (magit-with-toplevel (magit-call-git "add" "-u" "."))) (magit-git-string "write-tree")))) - (when (magit-git-failure "diff-tree" "--quiet" parent tree "--" files) - (magit-wip-update-wipref wipref tree parent files msg "worktree")))) - -(defun magit-wip-update-wipref (wipref tree parent files msg start-msg) - (let ((len (length files))) + (magit-wip-update-wipref ref wipref tree parent files msg "worktree"))) + +(defun magit-wip-update-wipref (ref wipref tree parent files msg start-msg) + (cond + ((and (not (equal parent wipref)) + (or (not magit-wip-merge-branch) + (not (magit-rev-verify wipref)))) + (setq start-msg (concat "start autosaving " start-msg)) + (magit-update-ref wipref start-msg + (magit-git-string "commit-tree" "--no-gpg-sign" + "-p" parent "-m" start-msg + (concat parent "^{tree}"))) + (setq parent wipref)) + ((and magit-wip-merge-branch + (or (not (magit-rev-ancestor-p ref wipref)) + (not (magit-rev-ancestor-p + (concat (magit-git-string "log" "--format=%H" + "-1" "--merges" wipref) + "^2") + ref)))) + (setq start-msg (format "merge %s into %s" ref start-msg)) + (magit-update-ref wipref start-msg + (magit-git-string "commit-tree" "--no-gpg-sign" + "-p" wipref "-p" ref + "-m" start-msg + (concat ref "^{tree}"))) + (setq parent wipref))) + (when (magit-git-failure "diff-tree" "--quiet" parent tree "--" files) (unless (and msg (not (= (aref msg 0) ?\s))) - (setq msg (concat - (cond ((= len 0) "autosave tracked files") - ((> len 1) (format "autosave %s files" len)) - (t (concat "autosave " - (file-relative-name (car files) - (magit-toplevel))))) - msg))) - (unless (equal parent wipref) - (setq start-msg (concat "restart autosaving " start-msg)) - (magit-update-ref wipref start-msg - (magit-git-string "commit-tree" "--no-gpg-sign" - "-p" parent "-m" start-msg - (concat parent "^{tree}"))) - (setq parent wipref)) + (let ((len (length files))) + (setq msg (concat + (cond ((= len 0) "autosave tracked files") + ((> len 1) (format "autosave %s files" len)) + (t (concat "autosave " + (file-relative-name (car files) + (magit-toplevel))))) + msg)))) (magit-update-ref wipref msg (magit-git-string "commit-tree" "--no-gpg-sign" "-p" parent "-m" msg tree)))) (defun magit-wip-get-ref () (let ((ref (or (magit-git-string "symbolic-ref" "HEAD") "HEAD"))) - (when (magit-rev-verify ref) - ref))) + (and (magit-rev-verify ref) + ref))) (defun magit-wip-get-parent (ref wipref) (if (and (magit-rev-verify wipref) @@ -229,8 +292,31 @@ commit message." wipref ref)) +(defun magit--wip-index-ref (&optional ref) + (magit--wip-ref "index/" ref)) + +(defun magit--wip-wtree-ref (&optional ref) + (magit--wip-ref "wtree/" ref)) + +(defun magit--wip-ref (namespace &optional ref) + (concat magit-wip-namespace namespace + (or (and ref (string-prefix-p "refs/" ref) ref) + (when-let ((branch (or ref (magit-get-current-branch)))) + (concat "refs/heads/" branch)) + "HEAD"))) + ;;; Log +(defun magit-wip-log-index (args files) + "Show log for the index wip ref of the current branch." + (interactive (magit-log-arguments)) + (magit-log (list (magit--wip-index-ref)) args files)) + +(defun magit-wip-log-worktree (args files) + "Show log for the worktree wip ref of the current branch." + (interactive (magit-log-arguments)) + (magit-log (list (magit--wip-wtree-ref)) args files)) + (defun magit-wip-log-current (branch args files count) "Show log for the current branch and its wip refs. With a negative prefix argument only show the worktree wip ref. @@ -257,20 +343,18 @@ many \"branches\" of each wip ref are shown." "HEAD"))) (magit-log-arguments) (list (prefix-numeric-value current-prefix-arg)))) - (unless (equal branch "HEAD") - (setq branch (concat "refs/heads/" branch))) (magit-log (nconc (list branch) (magit-wip-log-get-tips - (concat magit-wip-namespace "wtree/" branch) + (magit--wip-wtree-ref branch) (abs count)) (and (>= count 0) (magit-wip-log-get-tips - (concat magit-wip-namespace "index/" branch) + (magit--wip-index-ref branch) (abs count)))) args files)) (defun magit-wip-log-get-tips (wipref count) - (-when-let (reflog (magit-git-lines "reflog" wipref)) + (when-let ((reflog (magit-git-lines "reflog" wipref))) (let (tips) (while (and reflog (> count 1)) (setq reflog (cl-member "^[^ ]+ [^:]+: restart autosaving" diff --git a/elpa/magit-20180404.1428/magit-worktree.el b/elpa/magit-20180828.1055/magit-worktree.el similarity index 74% rename from elpa/magit-20180404.1428/magit-worktree.el rename to elpa/magit-20180828.1055/magit-worktree.el index 07179cda..107e2cb7 100644 --- a/elpa/magit-20180404.1428/magit-worktree.el +++ b/elpa/magit-20180828.1055/magit-worktree.el @@ -27,9 +27,6 @@ ;;; Code: -(eval-when-compile - '(require 'pcase)) ; `pcase-dolist' isn't autoloaded by v24.4 - (require 'magit) ;;; Commands @@ -38,8 +35,11 @@ (magit-define-popup magit-worktree-popup "Popup console for worktree commands." :man-page "git-worktree" - :actions '((?b "Create new worktree" magit-worktree-checkout) + :actions `((?b "Create new worktree" magit-worktree-checkout) (?c "Create new branch and worktree" magit-worktree-branch) + ,@(and (not (require (quote forge) nil t)) + '((?p "Create new worktree from pull-request" + magit-worktree-checkout-pull-request))) (?k "Delete worktree" magit-worktree-delete) (?g "Show status for worktree" magit-worktree-status)) :max-action-columns 1) @@ -54,6 +54,35 @@ (magit-run-git "worktree" "add" (expand-file-name path) branch) (magit-diff-visit-directory path)) +(defun magit-worktree-checkout-pull-request (path pr) + "Create, configure and checkout a new worktree from a pull-request. +This is like `magit-checkout-pull-request', except that it +also creates a new worktree. Please see the manual for more +information." + (interactive + (let ((pr (magit-read-pull-request "Checkout pull request"))) + (let-alist pr + (let ((path (let ((branch (magit--pullreq-branch pr t))) + (read-directory-name + (format "Checkout #%s as `%s' in new worktree: " + .number branch) + (file-name-directory + (directory-file-name default-directory)) + nil nil + (if (string-match-p "\\`pr-[0-9]+\\'" branch) + (number-to-string .number) + (format "%s-%s" .number .head.ref)))))) + (when (equal path "") + (user-error "The empty string isn't a valid path")) + (list path pr))))) + (when (and (file-exists-p path) + (not (and (file-directory-p path) + (= (length (directory-files "/tmp/testing/")) 2)))) + (user-error "%s already exists and isn't empty" path)) + (magit-worktree-checkout path + (let ((inhibit-magit-refresh t)) + (magit-branch-pull-request pr)))) + ;;;###autoload (defun magit-worktree-branch (path branch start-point &optional force) "Create a new BRANCH and check it out in a new worktree at PATH." @@ -84,7 +113,10 @@ The primary worktree cannot be deleted." (if (file-exists-p default-directory) (magit-run-git "worktree" "prune") (let ((default-directory primary)) - (magit-run-git "worktree" "prune")))))) + (magit-run-git "worktree" "prune")) + (when (derived-mode-p 'magit-status-mode) + (kill-buffer) + (magit-status-internal primary)))))) (defun magit-worktree-status (worktree) "Show the status for the worktree at point. @@ -118,7 +150,7 @@ If there is only one worktree, then insert nothing." (magit-insert-section (worktrees) (magit-insert-heading "Worktrees:") (let* ((cols - (mapcar (-lambda ((path barep commit branch)) + (mapcar (pcase-lambda (`(,path ,barep ,commit ,branch)) (cons (cond (branch (propertize branch 'face 'magit-branch-local)) diff --git a/elpa/magit-20180404.1428/magit.el b/elpa/magit-20180828.1055/magit.el similarity index 94% rename from elpa/magit-20180404.1428/magit.el rename to elpa/magit-20180828.1055/magit.el index 0e25e543..b25cb4b5 100644 --- a/elpa/magit-20180404.1428/magit.el +++ b/elpa/magit-20180828.1055/magit.el @@ -19,7 +19,7 @@ ;; Keywords: git tools vc ;; Homepage: https://github.com/magit/magit -;; Magit requires at least GNU Emacs 24.4 and Git 1.9.4. +;; Magit requires at least GNU Emacs 25.1 and Git 2.0.0. ;; Magit is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by @@ -61,8 +61,8 @@ (require 'format-spec) (require 'package nil t) ; used in `magit-version' -(defconst magit--minimal-git "1.9.4") -(defconst magit--minimal-emacs "24.4") +(defconst magit--minimal-git "2.0.0") +(defconst magit--minimal-emacs "25.1") ;;; Faces @@ -135,7 +135,7 @@ own faces for the `header-line', or for parts of the (defface magit-refname-stash '((t :inherit magit-refname)) - "Face for wip refnames." + "Face for stash refnames." :group 'magit-faces) (defface magit-refname-wip @@ -143,11 +143,21 @@ own faces for the `header-line', or for parts of the "Face for wip refnames." :group 'magit-faces) +(defface magit-refname-pullreq + '((t :inherit magit-refname)) + "Face for pullreq refnames." + :group 'magit-faces) + (defface magit-keyword '((t :inherit font-lock-string-face)) "Face for parts of commit messages inside brackets." :group 'magit-faces) +(defface magit-keyword-squash + '((t :inherit font-lock-warning-face)) + "Face for squash! and fixup! keywords in commit messages." + :group 'magit-faces) + (defface magit-signature-good '((t :foreground "green")) "Face for good signatures." @@ -200,28 +210,10 @@ own faces for the `header-line', or for parts of the ;;; 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) @@ -271,19 +263,13 @@ own faces for the `header-line', or for parts of the (?\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) - (lambda () - (and (with-current-buffer magit-pre-popup-buffer - buffer-file-name) - (propertize "File commands" 'face 'magit-popup-heading))) - ,@magit-file-popup-actions) + ("C-h m" "show all key bindings" describe-mode)) :setup-function 'magit-dispatch-popup-setup :max-action-columns (lambda (heading) (pcase heading ("Popup and dwim commands" 4) ("Applying changes" 3) - ("Essential commands" 1) - ("File commands" 5)))) + ("Essential commands" 1)))) (defvar magit-dispatch-popup-map (let ((map (make-sparse-keymap))) @@ -545,6 +531,14 @@ See info node `(magit)Debugging Tools' for more information." ;;; Startup Asserts (defun magit-startup-asserts () + (when-let ((val (getenv "GIT_DIR"))) + (setenv "GIT_DIR") + (message "Magit unset $GIT_DIR (was %S). See \ +https://github.com/magit/magit/wiki/Don't-set-$GIT_DIR-and-alike" val)) + (when-let ((val (getenv "GIT_WORK_TREE"))) + (setenv "GIT_WORK_TREE") + (message "Magit unset $GIT_WORK_TREE (was %S). See \ +https://github.com/magit/magit/wiki/Don't-set-$GIT_DIR-and-alike" val)) (let ((version (magit-git-version))) (when (and version (version< version magit--minimal-git) diff --git a/elpa/magit-20180828.1055/magit.info b/elpa/magit-20180828.1055/magit.info new file mode 100644 index 00000000..33e80620 --- /dev/null +++ b/elpa/magit-20180828.1055/magit.info @@ -0,0 +1,184 @@ +This is magit.info, produced by makeinfo version 6.5 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: 753 +magit.info-2: 305278 + +Tag Table: +(Indirect) +Node: Top753 +Node: Introduction6268 +Node: Installation10991 +Node: Installing from an Elpa Archive11331 +Node: Installing from the Git Repository12434 +Node: Post-Installation Tasks15187 +Node: Getting Started16472 +Node: Interface Concepts21819 +Node: Modes and Buffers22150 +Node: Switching Buffers23895 +Node: Naming Buffers28438 +Node: Quitting Windows31745 +Node: Automatic Refreshing of Magit Buffers33377 +Node: Automatic Saving of File-Visiting Buffers36145 +Node: Automatic Reverting of File-Visiting Buffers37330 +Node: Risk of Reverting Automatically42326 +Node: Sections44709 +Node: Section Movement45650 +Node: Section Visibility49747 +Node: Section Hooks54606 +Node: Section Types and Values57013 +Node: Section Options58316 +Node: Popup Buffers and Prefix Commands58788 +Node: Completion Confirmation and the Selection61169 +Node: Action Confirmation61606 +Node: Completion and Confirmation68952 +Node: The Selection72138 +Node: The hunk-internal region75037 +Node: Support for Completion Frameworks76126 +Node: Additional Completion Options80942 +Node: Running Git81541 +Node: Viewing Git Output81814 +Node: Git Process Status82947 +Node: Running Git Manually83912 +Node: Git Executable86314 +Node: Global Git Arguments88596 +Node: Inspecting89402 +Node: Status Buffer90549 +Node: Status Sections93313 +Node: Status Header Sections98116 +Node: Status Module Sections100746 +Node: Status Options103251 +Node: Repository List105005 +Node: Logging107163 +Node: Refreshing Logs109610 +Node: Log Buffer110995 +Node: Log Margin114790 +Node: Select from Log117430 +Node: Reflog119534 +Node: Cherries121051 +Node: Diffing122778 +Node: Refreshing Diffs125725 +Node: Diff Buffer129216 +Node: Diff Options133554 +Node: Revision Buffer137829 +Node: Ediffing140367 +Node: References Buffer143963 +Node: References Sections153728 +Node: Bisecting154589 +Node: Visiting Blobs156327 +Node: Blaming156837 +Node: Manipulating162612 +Node: Repository Setup162928 +Node: Staging and Unstaging163968 +Node: Staging from File-Visiting Buffers168049 +Node: Applying169217 +Node: Committing171110 +Node: Initiating a Commit171693 +Node: Editing Commit Messages175014 +Node: Branching185410 +Node: The Two Remotes185640 +Node: The Branch Popup188257 +Node: The Branch Config Popup205310 +Node: Auxillary Branch Commands211251 +Node: Merging212354 +Node: Resolving Conflicts216279 +Node: Rebasing221280 +Node: Editing Rebase Sequences225437 +Node: Information About In-Progress Rebase228467 +Ref: Information About In-Progress Rebase-Footnote-1237216 +Node: Cherry Picking237812 +Node: Reverting242064 +Node: Resetting243427 +Node: Stashing245038 +Node: Transferring249551 +Node: Remotes249789 +Node: The Remote Popup249945 +Node: The Remote Config Popup253413 +Node: Fetching255069 +Node: Pulling256425 +Node: Pushing257261 +Node: Creating and Sending Patches261996 +Node: Applying Patches262833 +Node: Miscellaneous264419 +Node: Tagging264735 +Node: Notes266076 +Node: Submodules268387 +Node: Listing Submodules268601 +Node: Submodule Popup270525 +Node: Subtree272978 +Node: Worktree274218 +Node: Common Commands275428 +Node: Wip Modes277175 +Node: Minor Mode for Buffers Visiting Files286050 +Node: Minor Mode for Buffers Visiting Blobs291457 +Node: Customizing292270 +Node: Per-Repository Configuration293938 +Node: Essential Settings295587 +Node: Safety295911 +Node: Performance297676 +Node: Microsoft Windows Performance305278 +Node: MacOS Performance306469 +Ref: MacOS Performance-Footnote-1307705 +Ref: MacOS Performance-Footnote-2307787 +Ref: MacOS Performance-Footnote-3307847 +Node: Plumbing308013 +Node: Calling Git308836 +Node: Getting a Value from Git310361 +Node: Calling Git for Effect313447 +Node: Section Plumbing319967 +Node: Creating Sections320195 +Node: Section Selection324095 +Node: Matching Sections325775 +Node: Refreshing Buffers331227 +Node: Conventions334369 +Node: Theming Faces334561 +Node: FAQ342676 +Node: FAQ - How to ...?343118 +Node: How to show git's output?343478 +Node: How to install the gitman info manual?344232 +Node: How to show diffs for gpg-encrypted files?345202 +Node: How does branching and pushing work?345798 +Node: Can Magit be used as ediff-version-control-package?346161 +Node: FAQ - Issues and Errors348150 +Node: Magit is slow349082 +Node: I changed several thousand files at once and now Magit is unusable349296 +Node: I am having problems committing350025 +Node: I am using MS Windows and cannot push with Magit350506 +Node: I am using OS X and SOMETHING works in shell but not in Magit351123 +Node: Diffs contain control sequences351929 +Node: Expanding a file to show the diff causes it to disappear353003 +Node: Point is wrong in the COMMIT_EDITMSG buffer353554 +Node: The mode-line information isn't always up-to-date354600 +Node: A branch and tag sharing the same name breaks SOMETHING355682 +Node: My Git hooks work on the command-line but not inside Magit356570 +Node: git-commit-mode isn't used when committing from the command-line357407 +Node: Point ends up inside invisible text when jumping to a file-visiting buffer359674 +Node: Debugging Tools360472 +Node: Keystroke Index362349 +Node: Command Index394362 +Node: Function Index429235 +Node: Variable Index444689 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20180404.1428/magit.info-1 b/elpa/magit-20180828.1055/magit.info-1 similarity index 94% rename from elpa/magit-20180404.1428/magit.info-1 rename to elpa/magit-20180828.1055/magit.info-1 index 7c49b187..12e4ff66 100644 --- a/elpa/magit-20180404.1428/magit.info-1 +++ b/elpa/magit-20180828.1055/magit.info-1 @@ -1,4 +1,4 @@ -This is magit.info, produced by makeinfo version 6.1 from magit.texi. +This is magit.info, produced by makeinfo version 6.5 from magit.texi. Copyright (C) 2015-2018 Jonas Bernoulli @@ -9,7 +9,7 @@ This is magit.info, produced by makeinfo version 6.1 from magit.texi. 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 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY @@ -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.12.1 (2.12.1-9-g9453a96ff+1). +This manual is for Magit version 2.13.0 (2.13.0-166-g1a7f5440+1). Copyright (C) 2015-2018 Jonas Bernoulli @@ -41,7 +41,7 @@ This manual is for Magit version 2.12.1 (2.12.1-9-g9453a96ff+1). 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 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * Menu: @@ -76,7 +76,7 @@ Interface Concepts * Modes and Buffers:: * Sections:: * Popup Buffers and Prefix Commands:: -* Completion, Confirmation and the Selection: Completion Confirmation and the Selection. +* Completion, Confirmation and the Selection: Completion Confirmation and the Selection. * Running Git:: Modes and Buffers @@ -225,6 +225,7 @@ Miscellaneous * Notes:: * Submodules:: * Subtree:: +* Worktree:: * Common Commands:: * Wip Modes:: * Minor Mode for Buffers Visiting Files:: @@ -292,13 +293,15 @@ FAQ - Issues and Errors * I changed several thousand files at once and now Magit is unusable:: * I am having problems committing:: * I am using MS Windows and cannot push with Magit:: -* 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. +* 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:: * 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:: +* My Git hooks work on the command-line but not inside Magit:: +* git-commit-mode isn't used when committing from the command-line:: +* Point ends up inside invisible text when jumping to a file-visiting buffer:: @@ -659,7 +662,7 @@ File: magit.info, Node: Interface Concepts, Next: Inspecting, Prev: Getting S * Modes and Buffers:: * Sections:: * Popup Buffers and Prefix Commands:: -* Completion, Confirmation and the Selection: Completion Confirmation and the Selection. +* Completion, Confirmation and the Selection: Completion Confirmation and the Selection. * Running Git::  @@ -783,8 +786,8 @@ File: magit.info, Node: Switching Buffers, Next: Naming Buffers, Up: Modes an This function displays most buffers so that they fill the entire height of the frame. However, the buffer is displayed in another - window if 1) the buffer’s mode derives from ‘magit-process-mode’, - or 2) the buffer’s mode derives from ‘magit-diff-mode’, provided + window if (1) the buffer’s mode derives from ‘magit-process-mode’, + or (2) the buffer’s mode derives from ‘magit-diff-mode’, provided that the mode of the current buffer derives from ‘magit-log-mode’ or ‘magit-cherry-mode’. @@ -1312,9 +1315,9 @@ Any of the functions listed below can be used as members of this hook. Delay before automatically updating the other window. - When moving around in certain buffers certain other buffers, which - are being displayed in another window, may optionally be updated to - display information about the section at point. + When moving around in certain buffers, then certain other buffers, + which are being displayed in another window, may optionally be + updated to display information about the section at point. When holding down a key to move by more than just one section, then that would update that buffer for each section on the way. To @@ -1413,10 +1416,10 @@ certain sections can also be overwritten using the hook 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’. + Use the command ‘magit-describe-section-briefly’ 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 @@ -1455,7 +1458,9 @@ File: magit.info, Node: Section Hooks, Next: Section Types and Values, Prev: Which sections are inserted into certain buffers is controlled with hooks. This includes the status and the refs buffers. For other -buffers, e.g. log, diff, and revision buffers, this is not possible. +buffers, e.g. log and diff buffers, this is not possible. The command +‘magit-describe-section’ can be used to see which hook (if any) was +responsible for inserting the section at point. For buffers whose sections can be customized by the user, a hook variable called ‘magit-TYPE-sections-hook’ exists. This hook should be @@ -1476,11 +1481,11 @@ this manual along with the appropriate "section inserter functions". If optional AT is non-nil and a member of the hook list, then add FUNCTION next to that instead. Add before or after AT, or replace - AT with FUNCTION depending on APPEND. If APPEND is the symbol - ‘replace’, then replace AT with FUNCTION. For any other non-nil - value place FUNCTION right after AT. If nil, then place FUNCTION - right before AT. If FUNCTION already is a member of the list but AT - is not, then leave FUNCTION where ever it already is. + AT with FUNCTION depending on APPEND. If APPEND is the symbol + ‘replace’, then replace AT with FUNCTION. For any other non-nil + value place FUNCTION right after AT. If nil, then place FUNCTION + right before AT. If FUNCTION already is a member of the list but + AT is not, then leave FUNCTION where ever it already is. If optional LOCAL is non-nil, then modify the hook’s buffer-local value rather than its global value. This makes the hook local by @@ -1508,10 +1513,10 @@ section of type ‘file’, for example, is a file name. Users usually do not have to worry about a section’s type and value, but knowing them can be handy at times. -‘M-x magit-describe-section’ (‘magit-describe-section’) +‘M-x magit-describe-section-briefly’ (‘magit-describe-section-briefly’) Show information about the section at point in the echo area, as - "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 @@ -1719,6 +1724,30 @@ telling Magit to ask fewer questions. default (or selecting another). This action only concerns the deletion of multiple stashes at once. + • Edit published history: + + Without adding these symbols here, you will be warned before + editing commits that have already been pushed to one of the + branches listed in ‘magit-published-branches’. + + • ‘amend-published’ Affects most commands that amend to + "HEAD". + + • ‘rebase-published’ Affects commands that perform + interactive rebases. This includes commands from the + commit popup that modify a commit other than "HEAD", + namely the various fixup and squash variants. + + • ‘edit-published’ Affects the commands + ‘magit-edit-line-commit’ and + ‘magit-diff-edit-hunk-commit’. These two commands make + it quite easy to accidentally edit a published commit, so + you should think twice before configuring them not to ask + for confirmation. + + To disable confirmation completely, add all three symbols here + or set ‘magit-published-branches’ to ‘nil’. + • Various: • ‘kill-process’ There seldom is a reason to kill a @@ -2276,13 +2305,13 @@ that it should be bound globally. We recommend using ‘C-x g’: -- User Option: magit-repository-directories - List of directories that are or contain Git repositories. Each - element has the form ‘(DIRECTORY . DEPTH)’ or, for backward - compatibility, just DIRECTORY. DIRECTORY has to be a directory or a - directory file-name, a string. DEPTH, an integer, specifies the - maximum depth to look for Git repositories. If it is 0, then only - add DIRECTORY itself. For elements that are strings, the value of - option ‘magit-repository-directories-depth’ specifies the depth. + List of directories that are Git repositories or contain Git + repositories. + + Each element has the form ‘(DIRECTORY . DEPTH)’. DIRECTORY has to + be a directory or a directory file-name, a string. DEPTH, an + integer, specifies the maximum depth to look for Git repositories. + If it is 0, then only add DIRECTORY itself. -- User Option: magit-repository-directories-depth @@ -2418,6 +2447,14 @@ default the following functions are also members of that hook: Insert a tree of tracked files. + -- Function: magit-insert-ignored-files + + Insert a tree of ignored files. + + If the first element of ‘magit-diff-section-arguments’ is a + directory, then limit the list to files below that. The value of + that variable can be set using ‘D = f RET g’. + -- Function: magit-insert-unpulled-or-recent-commits Insert section showing unpulled or recent commits. If an upstream @@ -3347,6 +3384,8 @@ File: magit.info, Node: Diff Buffer, Next: Diff Options, Prev: Refreshing Dif 5.4.2 Diff Buffer ----------------- +These commands are available in diff buffers. + ‘RET’ (‘magit-diff-visit-file’) From a diff, visit the corresponding file at the appropriate @@ -3361,10 +3400,20 @@ File: magit.info, Node: Diff Buffer, Next: Diff Options, Prev: Refreshing Dif where that line still existed. Otherwise visit the blob for the commit whose changes are being shown. - When the file or blob to be displayed is already being displayed in - another window of the same frame, then just select that window and - adjust point. Otherwise, or with a prefix argument, display the - buffer in another window. + Interactively, when the file or blob to be displayed is already + being displayed in another window of the same frame, then just + select that window and adjust point. Otherwise, or with a prefix + argument, display the buffer in another window. The meaning of the + prefix argument can be inverted or further modified using the + option ‘magit-display-file-buffer-function’. + + Non-interactively the optional OTHER-WINDOW argument is taken + literally. DISPLAY-FN can be used to specify the display function + explicitly, in which case OTHER-WINDOW is ignored. + + The optional FORCE-WORKTREE means to force visiting the worktree + version of the file. To do this interactively use the command + ‘magit-diff-visit-file-worktree’ instead. -- User Option: magit-diff-visit-previous-blob @@ -3399,6 +3448,29 @@ File: magit.info, Node: Diff Buffer, Next: Diff Options, Prev: Refreshing Dif From a diff, visit the corresponding file at the appropriate position in another window. +‘C-c C-t’ (‘magit-diff-trace-definition’) + + From a diff, show log for the definition at point. + +‘C-c C-e’ (‘magit-diff-edit-hunk-commit’) + + From a hunk, edit the respective commit and visit the file. + + First visit the file being modified by the hunk at the correct + location using ‘magit-diff-visit-file’. This actually visits a + blob. When point is on a diff header, not within an individual + hunk, then this visits the blob the first hunk is about. + + Then invoke ‘magit-edit-line-commit’, which uses an interactive + rebase to make the commit editable, or if that is not possible + because the commit is not reachable from ‘HEAD’ by checking out + that commit directly. This also causes the actual worktree file to + be visited. + + Neither the blob nor the file buffer are killed when finishing the + rebase. If that is undesirable, then it might be better to use + ‘magit-rebase-edit-command’ instead of this command. + ‘j’ (‘magit-jump-to-diffstat-or-diff’) Jump to the diffstat or diff. When point is on a file inside the @@ -4020,7 +4092,7 @@ File: magit.info, Node: Visiting Blobs, Next: Blaming, Prev: Bisecting, Up: ‘M-x magit-find-file’ (‘magit-find-file’) - View FILE from REV. Switch to a buffer visiting blob REV:FILE, + View FILE from REV. Switch to a buffer visiting blob REV:FILE, creating one if none already exists. ‘M-x magit-find-file-other-window’ (‘magit-find-file-other-window’) @@ -4036,13 +4108,16 @@ File: magit.info, Node: Blaming, Prev: Visiting Blobs, Up: Inspecting Also see *note (gitman)git-blame::. - To start blaming use ‘M-x’ in a file-visiting buffer to invoke one of -the next tree commands. In a blob-visiting buffer you can also use the -key bindings described below, and when Magit-File mode is enabled, then -you can at least use ‘C-c M-g’ to enter the blaming popup instead of -having to type out the command name. + To start blaming you can use ‘M-x’ in a file-visiting buffer to +invoke one of the following commands. You can also invoke these +commands using the blame popup, which is available on ‘b’ in +file-visiting buffers that already contain blame information and, also +on ‘b’, in all blob-visiting buffers. You can also enter the blame +popup from the file popup, which is available on ‘C-c M-g’, provided +‘magit-file-mode’ is enabled, see *note Minor Mode for Buffers Visiting +Files::. -‘M-x magit-blame’ (‘magit-blame’) + -- Command: magit-blame This command augments each line or chunk of lines in the current file- or blob-visiting buffer with information about what commits @@ -4057,31 +4132,32 @@ having to type out the command name. ‘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’) + -- Command: magit-blame-echo + + This command is like ‘magit-blame’ except that it doesn’t turn on + ‘read-only-mode’ and that it initially uses the visualization style + specified by option ‘magit-blame-echo-style’. + + -- Command: magit-blame-removal This command augments each line or chunk of lines in the current - file- or blob-visiting buffer with information about the last - revision in which a line still existed. + blob-visiting buffer with information about the revision that + removes it. It cannot be used in file-visiting buffers. Like ‘magit-blame’, this command can be used recursively. -‘M-x magit-blame-popup’ (‘magit-blame-popup’) + -- Command: magit-blame-reverse - This prefix command shows the above suffix command along with the - appropriate infix arguments in a popup buffer. + This command augments each line or chunk of lines in the current + file- or blob-visiting buffer with information about the last + revision in which a line still existed. - The above commands are also bound in the keymaps -‘magit-blame-mode-map’ and ‘magit-blob-mode-map’, and in the popup -‘magit-file-popup’. Once Magit-Blame mode is enabled in a file-visiting -buffer, you can use ‘B’ to show the blaming popup, ‘b’ to blame -recursively going backward in time, and ‘f’ to blame recursively going -forward in time (i.e. blame in reverse). These bindings are always -available in blob-visiting buffers. + Like ‘magit-blame’, this command can be used recursively. - Additionally the following key bindings are available when -Magit-Blame mode is enabled. These commands are also available in other -buffers; here only the behavior is described that is relevant in -file-visiting buffers that are being blamed. + The following key bindings are available when Magit-Blame mode is +enabled and Read-Only mode is not enabled. These commands are also +available in other buffers; here only the behavior is described that is +relevant in file-visiting buffers that are being blamed. ‘RET’ (‘magit-show-commit’) @@ -4107,6 +4183,14 @@ file-visiting buffers that are being blamed. information about that commit, then the buffer is scrolled down instead. + The following key bindings are available when Magit-Blame mode is +enabled and Read-Only mode is not enabled. + +‘b’ (‘magit-blame-popup’) + + This prefix command shows the above suffix command along with the + appropriate infix arguments in a popup buffer. + ‘n’ (‘magit-blame-next-chunk’) This command moves to the next chunk. @@ -4136,28 +4220,45 @@ file-visiting buffers that are being blamed. When the region is active, the command saves the region’s content instead of the hash, like ‘kill-ring-save’ would. -‘t’ (‘magit-blame-toggle-headings’) +‘c’ (‘magit-blame-cycle-style’) + + This command changes how blame information is visualized in the + current buffer by cycling through the styles specified using the + option ‘magit-blame-styles’. + + Blaming is also controlled using the following options. - This command shows or hides blame chunk headings. + -- User Option: magit-blame-styles - -- User Option: magit-blame-heading-format + This option defines a list of styles used to visualize blame + information. For now see its doc-string to learn more. - The format string used for blame headings. + -- User Option: magit-blame-echo-style + + This option specifies the blame visualization style used by the + command ‘magit-blame-echo’. This must be a symbol that is used as + the identifier for one of the styles defined in + ‘magit-blame-styles’. -- User Option: magit-blame-time-format - The format string used for time strings in blame headings. + This option specifies the format string used to display times when + showing blame information. + + -- User Option: magit-blame-read-only + + This option controls whether blaming a buffer also makes + temporarily read-only. - -- User Option: magit-blame-show-headings + -- User Option: magit-blame-disable-modes - This option controls whether blame block headings are initially - shown. The headings can also be toggled locally using the command - ‘magit-blame-toggle-headings’. + This option lists incompatible minor-modes that should be disabled + temporarily when a buffer contains blame information. They are + enabled again when the buffer no longer shows blame information. -- User Option: magit-blame-goto-chunk-hook - This hook is run by ‘magit-blame-next-chunk’ and - ‘magit-blame-previous-chunk’. + This hook is run when moving between chunks.  File: magit.info, Node: Manipulating, Next: Transferring, Prev: Inspecting, Up: Top @@ -4480,8 +4581,8 @@ Also see *note (gitman)git-commit::. -- User Option: magit-commit-ask-to-stage - Whether to ask to stage everything when committing and nothing is - staged. + Whether to ask to stage all unstaged changes when committing and + nothing is staged. -- User Option: magit-commit-extend-override-date @@ -4948,6 +5049,13 @@ features are available from separate popups. • ‘branch..pullRequest’ is set to the pull-request number. + • ‘branch..pullRequestRemote’ is set to the remote on + which the pull-request branch is located. + + • ‘branch..pushRemote’ is set to the same remote as + ‘branch..pullRequestRemote’ if that is possible, + otherwise it is set to the upstream remote. + • ‘branch..description’ is set to the pull-request title. • ‘branch..rebase’ is set to ‘true’ because there should @@ -4975,17 +5083,13 @@ features are available from separate popups. fork/new-feature". • If the pull-request branch is located in the upstream - repository, then it is not necessary to configure the - push-target. - - (If you have push access to the upstream repository, then it - is usually a good idea to configure that as the push-remote - using ‘remote.pushDefault’. However even if you are not using - that recommended setting, then it is still easy enough to set - ‘branch..pushRemote’ while pushing using ‘P p’.) + repository, then you probably have set ‘remote.pushDefault’ to + that repository. However some users like to set that variable + to their personal fork, even if they have push access to the + upstream, so ‘branch..pushRemote’ is set anyway. • If the pull-request branch is located inside a fork, then you - usually are able to push to that branch, because Github by + are usually able to push to that branch, because Github by default allows the recipient of a pull-request to push to the remote pull-request branch even if it is located in a fork. The contributor has to explicitly disable this. @@ -5002,8 +5106,8 @@ features are available from separate popups. merge something like "fork/master" into "origin/master". The special push permission mentioned above is never granted for the branch that is the repository’s default - branch, and that is almost certainly be the case in this - scenario. + branch, and that would almost certainly be the case in + this scenario. To enable you to easily push somewhere anyway, the local branch is named "pr-N" (where ‘N’ is the pull-request @@ -5019,8 +5123,8 @@ features are available from separate popups. ‘branch..pushRemote’, even if the used value is identical to that of ‘remote.pushDefault’, just in case you change the value of the latter later on. Additionally the - variable ‘branch..pullRequestRemote’ is set to the fork - remote. + variable ‘branch..pullRequestRemote’ is set to the + remote on which the pull-request branch is located. When you later delete the local pull-request branch, then you are offered to also delete the corresponding remote, provided it is not @@ -5137,10 +5241,10 @@ features are available from separate popups. element is used, the following elements are ignored. UPSTREAM is the branch to be used as the upstream for branches - specified by RULE. It can be a local or a remote branch. + specified by RULE. It can be a local or a remote branch. RULE can either be a regular expression, matching branches whose - upstream should be the one specified by UPSTREAM. Or it can be a + upstream should be the one specified by UPSTREAM. Or it can be a list of the only branches that should *not* use UPSTREAM; all other branches will. Matching is done after stripping the remote part of the name of the branch that is being branched from. @@ -5213,13 +5317,13 @@ prefix argument. -- Variable: branch.NAME.merge Together with ‘branch.NAME.remote’ this variable defines the - upstream branch of the local branch named NAME. The value of this + upstream branch of the local branch named NAME. The value of this variable is the full reference of the upstream _branch_. -- Variable: branch.NAME.remote Together with ‘branch.NAME.merge’ this variable defines the - upstream branch of the local branch named NAME. The value of this + upstream branch of the local branch named NAME. The value of this variable is the name of the upstream _remote_. -- Variable: branch.NAME.rebase @@ -5250,7 +5354,7 @@ prefix argument. -- Variable: branch.NAME.description - This variable can be used to describe the branch named NAME. That + This variable can be used to describe the branch named NAME. That description is used e.g. when turning the branch into a series of patches. @@ -5614,8 +5718,8 @@ See *note Information About In-Progress Rebase::. ‘r s’ (‘magit-rebase-subset’) Start a non-interactive rebase sequence with commits from START to - ‘HEAD’ onto NEWBASE. START has to be selected from a list of recent - commits. + ‘HEAD’ onto NEWBASE. START has to be selected from a list of + recent commits. By default Magit uses the ‘--autostash’ argument, which causes uncommitted changes to be stored in a stash before the rebase begins. @@ -5827,7 +5931,7 @@ shown in different colors to indicate the status of the commits. • The green commit is the commit the rebase sequence stopped at. If this is the same commit as ‘HEAD’ (e.g. because you haven’t done anything yet after rebase stopped at the commit, then this commit - is shown in blue, not green. There can only be a green *and* a + is shown in blue, not green). There can only be a green *and* a blue commit at the same time, if you create one or more new commits after rebase stops at a commit. @@ -6159,6 +6263,12 @@ Also see *note (gitman)git-reset::. the commit refers to the ‘HEAD’, then this effectively unstages all changes. +‘X w’ (‘magit-reset-worktree’) + + Reset the working tree to some commit read from the user and + defaulting to the commit at point. Keep the ‘HEAD’ and index + as-is. + ‘X f’ (‘magit-file-checkout’) Update file in the working tree and index to the contents from a @@ -6246,7 +6356,7 @@ Also see *note (gitman)git-stash::. ‘z b’ (‘magit-stash-branch’) - Create and checkout a new BRANCH from STASH. The branch starts at + Create and checkout a new BRANCH from STASH. The branch starts at the commit that was current when the stash was created. ‘z B’ (‘magit-stash-branch-here’) @@ -6430,24 +6540,24 @@ branch. To change the value for another remote invoke -- Variable: remote.NAME.url - This variable specifies the url of the remote named NAME. It can + This variable specifies the url of the remote named NAME. It can have multiple values. -- Variable: remote.NAME.fetch - The refspec used when fetching from the remote named NAME. It can + The refspec used when fetching from the remote named NAME. It can have multiple values. -- Variable: remote.NAME.pushurl This variable specifies the url used for fetching from the remote - named NAME. If it is not specified, then ‘remote.NAME.url’ is used + named NAME. If it is not specified, then ‘remote.NAME.url’ is used instead. It can have multiple values. -- Variable: remote.NAME.push - The refspec used when pushing to the remote named NAME. It can have - multiple values. + The refspec used when pushing to the remote named NAME. It can + have multiple values. -- Variable: remote.NAME.tagOpts @@ -6746,6 +6856,7 @@ File: magit.info, Node: Miscellaneous, Next: Customizing, Prev: Transferring, * Notes:: * Submodules:: * Subtree:: +* Worktree:: * Common Commands:: * Wip Modes:: * Minor Mode for Buffers Visiting Files:: @@ -6766,8 +6877,8 @@ Also see *note (gitman)git-tag::. ‘t t’ (‘magit-tag’) - Create a new tag with the given NAME at REV. With a prefix argument - annotate the tag. + Create a new tag with the given NAME at REV. With a prefix + argument annotate the tag. ‘t k’ (‘magit-tag-delete’) @@ -6779,6 +6890,20 @@ Also see *note (gitman)git-tag::. Offer to delete tags missing locally from REMOTE, and vice versa. + -- Command: magit-tag-release + + Create an opinionated release tag. + + Assume version tags that match "\\‘v?[0-9]\*\\’". Prompt for the + name of the new tag using the highest existing tag as initial input + and call "git tag –annotate –sign -m MSG" TAG, regardless of + whether these arguments are enabled in the popup. Given a TAG + "v1.2.3" and a repository "/path/to/foo-bar", the MESSAGE would be + "Foo-Bar 1.2.3". + + Because it is so opinionated, this command is not available from + the tag popup by default. +  File: magit.info, Node: Notes, Next: Submodules, Prev: Tagging, Up: Miscellaneous @@ -6976,7 +7101,7 @@ modules. argument fetch all remotes.  -File: magit.info, Node: Subtree, Next: Common Commands, Prev: Submodules, Up: Miscellaneous +File: magit.info, Node: Subtree, Next: Worktree, Prev: Submodules, Up: Miscellaneous 8.4 Subtree =========== @@ -7021,9 +7146,50 @@ used. Otherwise the prefix is read in the minibuffer. Extract the history of the subtree PREFIX.  -File: magit.info, Node: Common Commands, Next: Wip Modes, Prev: Subtree, Up: Miscellaneous +File: magit.info, Node: Worktree, Next: Common Commands, Prev: Subtree, Up: Miscellaneous + +8.5 Worktree +============ + +Also see *note (gitman)git-worktree::. + +‘%’ (‘magit-worktree-popup’) + + This prefix command shows the following suffix commands in a popup + buffer. + +‘% b’ (‘magit-worktree-checkout’) + + Checkout BRANCH in a new worktree at PATH. + +‘% c’ (‘magit-worktree-branch’) + + Create a new BRANCH and check it out in a new worktree at PATH. + +‘% p’ (‘magit-worktree-checkout-pull-request’) + + Create, configure and checkout a new worktree from a pull-request. + + This is like ‘magit-checkout-pull-request’ (which see) except that + it also creates a new worktree. + +‘% k’ (‘magit-worktree-delete’) + + Delete a worktree, defaulting to the worktree at point. The + primary worktree cannot be deleted. + +‘% g’ (‘magit-worktree-status’) + + Show the status for the worktree at point. + + If there is no worktree at point, then read one in the minibuffer. + If the worktree at point is the one whose status is already being + displayed in the current buffer, then show it in Dired instead. + + +File: magit.info, Node: Common Commands, Next: Wip Modes, Prev: Worktree, Up: Miscellaneous -8.5 Common Commands +8.6 Common Commands =================== These are some of the commands that can be used in all buffers whose @@ -7063,7 +7229,7 @@ above.  File: magit.info, Node: Wip Modes, Next: Minor Mode for Buffers Visiting Files, Prev: Common Commands, Up: Miscellaneous -8.6 Wip Modes +8.7 Wip Modes ============= Git keeps *committed* changes around long enough for users to recover @@ -7123,6 +7289,22 @@ commit does not change the fork-point of the working tree wip ref. The fork-points are not adjusted until there actually is a change that should be committed to the respective wip ref. + -- User Option: magit-wip-merge-branch + + This option controls whether the current branch is merged into the + wip refs after a new commit was created on the branch. If nil + (currently the default), then no merge is perfomed and wip refs are + reset as described above. + + If this is non-nil and the current branch has new commits, then it + is merged into the wip ref before creating a new wip commit. This + makes it easier to inspect wip history and the wip commits are + never garbage collected. + + *--*--*--*--*--* refs/wip/index/refs/heads/master + / / / + A-----B-----C refs/heads/master + To view the log for a branch and its wip refs use the commands ‘magit-wip-log’ and ‘magit-wip-log-current’. You should use ‘--graph’ when using these commands. Alternatively you can use the reflog to show @@ -7145,6 +7327,17 @@ changes from the commits shown in the log or reflog. The absolute numeric value of the prefix argument controls how many "branches" of each wip ref are shown. +‘X w’ (‘magit-reset-worktree’) + + This command resets the working tree to some commit read from the + user and defaulting to the commit at point, while keeping the + ‘HEAD’ and index as-is. + + This can be used to restore files to the state committed to a wip + ref. Note that this will discard any unstaged changes that might + have existed before invoking this command (but of course only after + committing that to the working tree wip ref). + There exists a total of three global modes that save to the wip refs, which might seem excessive, but allows fine tuning of when exactly changes are being committed to the wip refs. Enabling all modes makes @@ -7178,12 +7371,30 @@ before making changes that could cause the loss of earlier changes. When this mode is enabled, then certain commands commit the existing changes to the files they are about to make changes to. - Note that even if you enable all three modes this won’t give you -perfect protection. The most likely scenario for losing changes despite -the use of these modes is making a change outside Emacs and then -destroying it also outside Emacs. In such a scenario, Magit, being an -Emacs package, didn’t get the opportunity to keep you from shooting -yourself in the foot. + -- Function: magit-wip-commit-initial-backup + + Adding this function to ‘before-save-hook’ causes the current + version of the file to be committed to the worktree wip ref before + the modifications in the buffer are saved. It backs up the same + version of the file as ‘backup-buffer’ would but, instead of using + a backup file as ‘backup-buffer’ would, it uses the same worktree + wip ref as used by the various Magit Wip modes. Like + ‘backup-buffer’, it only does this once; unless you kill the buffer + and visit the file again only one backup will be created per Emacs + session. + + This function ignores the variables that affect ‘backup-buffer’ and + can be used along-side that function, which is recommended because + this function only backs up files that are tracked in a Git + repository. + + Note that even if you enable all three modes and add the above +function to the intended hook, this won’t give you perfect protection. +The most likely scenario for losing changes despite the use of these +modes is making a change outside Emacs and then destroying it also +outside Emacs. In some such a scenario, Magit, being an Emacs package, +didn’t get the opportunity to keep you from shooting yourself in the +foot. When you are unsure whether Magit did commit a change to the wip refs, then you can explicitly request that all changes to all tracked @@ -7220,7 +7431,7 @@ files are being committed.  File: magit.info, Node: Minor Mode for Buffers Visiting Files, Next: Minor Mode for Buffers Visiting Blobs, Prev: Wip Modes, Up: Miscellaneous -8.7 Minor Mode for Buffers Visiting Files +8.8 Minor Mode for Buffers Visiting Files ========================================= The ‘magit-file-mode’ enables certain Magit features in file-visiting @@ -7288,25 +7499,87 @@ few key bindings, but this might be extended in the future. or when ‘--follow’ is part of ‘magit-log-arguments’. When the region is active, the log is restricted to the selected line range. +‘C-c M-g t’ (‘magit-log-trace-definition’) + + This command shows the log for the definition at point. + -- User Option: magit-log-buffer-file-locked This option controls whether ‘magit-log-buffer-file’ uses a dedicated buffer. See *note Modes and Buffers::. -‘C-c M-g b’ (‘magit-blame-popup’) +‘C-c M-g B’ (‘magit-blame-popup’) - This prefix command shows the ‘magit-blame’ suffix command along - with the appropriate infix arguments in a popup buffer. See *note - Initiating a Commit::. + This prefix command shows all blaming suffix command along with the + appropriate infix arguments in a popup buffer. See *note + Blaming::. + +‘C-c M-g b’ (‘magit-blame’) + + This command shows for each line the revision in which it was + added. + +‘C-c M-g r’ (‘magit-blame-removal’) + + This command shows for each line the revision in which it was + removed. This command is only available in blob-visiting buffers. + +‘C-c M-g f’ (‘magit-blame-reverse’) + + This command shows for each line the last revision in which it + still exists. This command is only available in blob-visiting + buffers. + +‘C-c M-g e’ (‘magit-edit-line-commit’) + + This command makes the commit editable that added the current line. + + With a prefix argument it makes the commit editable that removes + the line, if any. The commit is determined using ‘git blame’ and + made editable using ‘git rebase --interactive’ if it is reachable + from ‘HEAD’, or by checking out the commit (or a branch that points + at it) otherwise. ‘C-c M-g p’ (‘magit-blob-previous’) Visit the previous blob which modified the current file. + There are a few additional commands that operate on a single file but +are not available from the file popup by default: + + -- Command: magit-file-rename + + This command renames a file read from the user. + + -- Command: magit-file-delete + + This command deletes a file read from the user. + + -- Command: magit-file-untrack + + This command untracks a file read from the user. + + -- Command: magit-file-checkout + + This command updates a file in the working tree and index to the + contents from a revision. Both the revision and file are read from + the user. + + You could add them to the popup like so: + + (magit-define-popup-action 'magit-file-popup + ?R "Rename file" 'magit-file-rename) + (magit-define-popup-action 'magit-file-popup + ?K "Delete file" 'magit-file-delete) + (magit-define-popup-action 'magit-file-popup + ?U "Untrack file" 'magit-file-untrack) + (magit-define-popup-action 'magit-file-popup + ?C "Checkout file" 'magit-file-checkout) +  File: magit.info, Node: Minor Mode for Buffers Visiting Blobs, Prev: Minor Mode for Buffers Visiting Files, Up: Miscellaneous -8.8 Minor Mode for Buffers Visiting Blobs +8.9 Minor Mode for Buffers Visiting Blobs ========================================= The ‘magit-blob-mode’ enables certain Magit features in blob-visiting @@ -7387,7 +7660,7 @@ file-visiting buffers in just one huge repository use this: • ‘/path/to/huge/repo/.dir-locals.el’ - ((nil . ((magit-refresh-buffers . nil)) + ((nil . ((magit-refresh-buffers . nil)))) If you want to apply the same settings to several, but not all, repositories then keeping the repository-local config files in sync @@ -7503,7 +7776,7 @@ current repository when the visited file changes on disk. That is implemented on top of ‘auto-revert-mode’ from the built-in library ‘autorevert’. To figure out whether that impacts performance, check whether performance is significantly worse, when many buffers exist -and/or when some buffers visit files using TRAMP. If so, then this +and/or when some buffers visit files using TRAMP. If so, then this should help. (setq auto-revert-buffer-list-filter @@ -7624,209 +7897,3 @@ another version control system: (setq vc-handled-backends (delq 'Git vc-handled-backends)) - -File: magit.info, Node: Microsoft Windows Performance, Next: MacOS Performance, Up: Performance - -Microsoft Windows Performance -............................. - -In order to update the status buffer, ‘git’ has to be run a few dozen -times. That is problematic on Microsoft Windows, because that operating -system is exceptionally slow at starting processes. Sadly this is an -issue that can only be fixed by Microsoft itself, and they don’t appear -to be particularly interested in doing so. - - Beside the subprocess issue, there are also other Windows-specific -performance issues. Some of these have workarounds. The maintainers of -"Git for Windows" try to improve performance on Windows. Always use the -latest release in order to benefit from the latest performance tweaks. -Magit too tries to work around some Windows-specific issues. - - According to some sources, setting the following Git variables can -also help. - - git config --global core.preloadindex true # default since v2.1 - git config --global core.fscache true # default since v2.8 - git config --global gc.auto 256 - - You should also check whether an anti-virus program is affecting -performance. - - -File: magit.info, Node: MacOS Performance, Prev: Microsoft Windows Performance, Up: Performance - -MacOS Performance -................. - -On macOS Emacs currently creates child processes using ‘fork’. It -appears that this also copies GUI resources. The result is that forking -takes about 30 times as long on Darwin than on Linux. And because Magit -starts many ‘git’ processes even when doing simple things, that makes -quite a difference. - - On the ‘master’ branch Emacs now uses ‘vfork’ when possible, like -this was already done on Linux, and now child creation only takes about -twice as long on Darwin. See (1) for more information. - - Nobody knows when the changes on the ‘master’ branch will be released -as ‘26.1’, but it is still a long way off. You might want to get your -hands on this change before then. The easiest way to get a patched -Emacs is to install the ‘emacs-plus’ formula (2) using ‘homebrew’. The -change has been backported, so you get it not only when using ‘--HEAD’, -but also when using ‘--devel’ or when installing the latest release (by -not using a version argument). - - Alternatively you can apply the backport (3) manually. - - ---------- Footnotes ---------- - - (1) - - - (2) - - (3) - - - -File: magit.info, Node: Plumbing, Next: FAQ, Prev: Customizing, Up: Top - -10 Plumbing -*********** - -The following sections describe how to use several of Magit’s core -abstractions to extend Magit itself or implement a separate extension. - - A few of the low-level features used by Magit have been factored out -into separate libraries/packages, so that they can be used by other -packages, without having to depend on Magit. These libraries are -described in separate manuals, see *note (with-editor)Top:: and *note -(magit-popup)Top::. - - If you are trying to find an unused key that you can bind to a -command provided by your own Magit extension, then checkout -. - -* Menu: - -* Calling Git:: -* Section Plumbing:: -* Refreshing Buffers:: -* Conventions:: - - -File: magit.info, Node: Calling Git, Next: Section Plumbing, Up: Plumbing - -10.1 Calling Git -================ - -Magit provides many specialized functions for calling Git. All of these -functions are defined in either ‘magit-git.el’ or ‘magit-process.el’ and -have one of the prefixes ‘magit-run-’, ‘magit-call-’, ‘magit-start-’, or -‘magit-git-’ (which is also used for other things). - - All of these functions accept an indefinite number of arguments, -which are strings that specify command line arguments for Git (or in -some cases an arbitrary executable). These arguments are flattened -before being passed on to the executable; so instead of strings they can -also be lists of strings and arguments that are ‘nil’ are silently -dropped. Some of these functions also require a single mandatory -argument before these command line arguments. - - Roughly speaking, these functions run Git either to get some value or -for side-effects. The functions that return a value are useful to -collect the information necessary to populate a Magit buffer, while the -others are used to implement Magit commands. - - The functions in the value-only group always run synchronously, and -they never trigger a refresh. The function in the side-effect group can -be further divided into subgroups depending on whether they run Git -synchronously or asynchronously, and depending on whether they trigger a -refresh when the executable has finished. - -* Menu: - -* Getting a Value from Git:: -* Calling Git for Effect:: - - -File: magit.info, Node: Getting a Value from Git, Next: Calling Git for Effect, Up: Calling Git - -10.1.1 Getting a Value from Git -------------------------------- - -These functions run Git in order to get a value, an exit status, or -output. Of course you could also use them to run Git commands that have -side-effects, but that should be avoided. - - -- Function: magit-git-exit-code &rest args - - Executes git with ARGS and returns its exit code. - - -- Function: magit-git-success &rest args - - Executes git with ARGS and returns ‘t’ if the exit code is ‘0’, - ‘nil’ otherwise. - - -- Function: magit-git-failure &rest args - - Executes git with ARGS and returns ‘t’ if the exit code is ‘1’, - ‘nil’ otherwise. - - -- Function: magit-git-true &rest args - - Executes git with ARGS and returns ‘t’ if the first line printed by - git is the string "true", ‘nil’ otherwise. - - -- Function: magit-git-false &rest args - - Executes git with ARGS and returns ‘t’ if the first line printed by - git is the string "false", ‘nil’ otherwise. - - -- Function: magit-git-insert &rest args - - Executes git with ARGS and inserts its output at point. - - -- Function: magit-git-string &rest args - - Executes git with ARGS and returns the first line of its output. - If there is no output or if it begins with a newline character, - then this returns ‘nil’. - - -- Function: magit-git-lines &rest args - - Executes git with ARGS and returns its output as a list of lines. - Empty lines anywhere in the output are omitted. - - -- Function: magit-git-items &rest args - - Executes git with ARGS and returns its null-separated output as a - list. Empty items anywhere in the output are omitted. - - If the value of option ‘magit-git-debug’ is non-nil and git exits - with a non-zero exit status, then warn about that in the echo area - and add a section containing git’s standard error in the current - repository’s process buffer. - - If an error occurs when using one of the above functions, then that -is usually due to a bug, i.e. using an argument which is not actually -supported. Such errors are usually not reported, but when they occur we -need to be able to debug them. - - -- User Option: magit-git-debug - - Whether to report errors that occur when using ‘magit-git-insert’, - ‘magit-git-string’, ‘magit-git-lines’, or ‘magit-git-items’. This - does not actually raise an error. Instead a message is shown in - the echo area, and git’s standard error is insert into a new - section in the current repository’s process buffer. - - -- Function: magit-git-str &rest args - - This is a variant of ‘magit-git-string’ that ignores the option - ‘magit-git-debug’. It is mainly intended to be used while handling - errors in functions that do respect that option. Using such a - function while handing an error could cause yet another error and - therefore lead to an infinite recursion. You probably won’t ever - need to use this function. - diff --git a/elpa/magit-20180404.1428/magit.info-2 b/elpa/magit-20180828.1055/magit.info-2 similarity index 86% rename from elpa/magit-20180404.1428/magit.info-2 rename to elpa/magit-20180828.1055/magit.info-2 index 0442620c..eaf8ba31 100644 --- a/elpa/magit-20180404.1428/magit.info-2 +++ b/elpa/magit-20180828.1055/magit.info-2 @@ -1,4 +1,4 @@ -This is magit.info, produced by makeinfo version 6.1 from magit.texi. +This is magit.info, produced by makeinfo version 6.5 from magit.texi. Copyright (C) 2015-2018 Jonas Bernoulli @@ -9,13 +9,219 @@ This is magit.info, produced by makeinfo version 6.1 from magit.texi. 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 + 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 + +File: magit.info, Node: Microsoft Windows Performance, Next: MacOS Performance, Up: Performance + +Microsoft Windows Performance +............................. + +In order to update the status buffer, ‘git’ has to be run a few dozen +times. That is problematic on Microsoft Windows, because that operating +system is exceptionally slow at starting processes. Sadly this is an +issue that can only be fixed by Microsoft itself, and they don’t appear +to be particularly interested in doing so. + + Beside the subprocess issue, there are also other Windows-specific +performance issues. Some of these have workarounds. The maintainers of +"Git for Windows" try to improve performance on Windows. Always use the +latest release in order to benefit from the latest performance tweaks. +Magit too tries to work around some Windows-specific issues. + + According to some sources, setting the following Git variables can +also help. + + git config --global core.preloadindex true # default since v2.1 + git config --global core.fscache true # default since v2.8 + git config --global gc.auto 256 + + You should also check whether an anti-virus program is affecting +performance. + + +File: magit.info, Node: MacOS Performance, Prev: Microsoft Windows Performance, Up: Performance + +MacOS Performance +................. + +On macOS Emacs currently creates child processes using ‘fork’. It +appears that this also copies GUI resources. The result is that forking +takes about 30 times as long on Darwin than on Linux. And because Magit +starts many ‘git’ processes even when doing simple things, that makes +quite a difference. + + On the ‘master’ branch Emacs now uses ‘vfork’ when possible, like +this was already done on Linux, and now child creation only takes about +twice as long on Darwin. See (1) for more information. + + Nobody knows when the changes on the ‘master’ branch will be released +as ‘26.1’, but it is still a long way off. You might want to get your +hands on this change before then. The easiest way to get a patched +Emacs is to install the ‘emacs-plus’ formula (2) using ‘homebrew’. The +change has been backported, so you get it not only when using ‘--HEAD’, +but also when using ‘--devel’ or when installing the latest release (by +not using a version argument). + + Alternatively you can apply the backport (3) manually. + + ---------- Footnotes ---------- + + (1) + + + (2) + + (3) + + + +File: magit.info, Node: Plumbing, Next: FAQ, Prev: Customizing, Up: Top + +10 Plumbing +*********** + +The following sections describe how to use several of Magit’s core +abstractions to extend Magit itself or implement a separate extension. + + A few of the low-level features used by Magit have been factored out +into separate libraries/packages, so that they can be used by other +packages, without having to depend on Magit. These libraries are +described in separate manuals, see *note (with-editor)Top:: and *note +(magit-popup)Top::. + + If you are trying to find an unused key that you can bind to a +command provided by your own Magit extension, then checkout +. + +* Menu: + +* Calling Git:: +* Section Plumbing:: +* Refreshing Buffers:: +* Conventions:: + + +File: magit.info, Node: Calling Git, Next: Section Plumbing, Up: Plumbing + +10.1 Calling Git +================ + +Magit provides many specialized functions for calling Git. All of these +functions are defined in either ‘magit-git.el’ or ‘magit-process.el’ and +have one of the prefixes ‘magit-run-’, ‘magit-call-’, ‘magit-start-’, or +‘magit-git-’ (which is also used for other things). + + All of these functions accept an indefinite number of arguments, +which are strings that specify command line arguments for Git (or in +some cases an arbitrary executable). These arguments are flattened +before being passed on to the executable; so instead of strings they can +also be lists of strings and arguments that are ‘nil’ are silently +dropped. Some of these functions also require a single mandatory +argument before these command line arguments. + + Roughly speaking, these functions run Git either to get some value or +for side-effects. The functions that return a value are useful to +collect the information necessary to populate a Magit buffer, while the +others are used to implement Magit commands. + + The functions in the value-only group always run synchronously, and +they never trigger a refresh. The function in the side-effect group can +be further divided into subgroups depending on whether they run Git +synchronously or asynchronously, and depending on whether they trigger a +refresh when the executable has finished. + +* Menu: + +* Getting a Value from Git:: +* Calling Git for Effect:: + + +File: magit.info, Node: Getting a Value from Git, Next: Calling Git for Effect, Up: Calling Git + +10.1.1 Getting a Value from Git +------------------------------- + +These functions run Git in order to get a value, an exit status, or +output. Of course you could also use them to run Git commands that have +side-effects, but that should be avoided. + + -- Function: magit-git-exit-code &rest args + + Executes git with ARGS and returns its exit code. + + -- Function: magit-git-success &rest args + + Executes git with ARGS and returns ‘t’ if the exit code is ‘0’, + ‘nil’ otherwise. + + -- Function: magit-git-failure &rest args + + Executes git with ARGS and returns ‘t’ if the exit code is ‘1’, + ‘nil’ otherwise. + + -- Function: magit-git-true &rest args + + Executes git with ARGS and returns ‘t’ if the first line printed by + git is the string "true", ‘nil’ otherwise. + + -- Function: magit-git-false &rest args + + Executes git with ARGS and returns ‘t’ if the first line printed by + git is the string "false", ‘nil’ otherwise. + + -- Function: magit-git-insert &rest args + + Executes git with ARGS and inserts its output at point. + + -- Function: magit-git-string &rest args + + Executes git with ARGS and returns the first line of its output. + If there is no output or if it begins with a newline character, + then this returns ‘nil’. + + -- Function: magit-git-lines &rest args + + Executes git with ARGS and returns its output as a list of lines. + Empty lines anywhere in the output are omitted. + + -- Function: magit-git-items &rest args + + Executes git with ARGS and returns its null-separated output as a + list. Empty items anywhere in the output are omitted. + + If the value of option ‘magit-git-debug’ is non-nil and git exits + with a non-zero exit status, then warn about that in the echo area + and add a section containing git’s standard error in the current + repository’s process buffer. + + If an error occurs when using one of the above functions, then that +is usually due to a bug, i.e. using an argument which is not actually +supported. Such errors are usually not reported, but when they occur we +need to be able to debug them. + + -- User Option: magit-git-debug + + Whether to report errors that occur when using ‘magit-git-insert’, + ‘magit-git-string’, ‘magit-git-lines’, or ‘magit-git-items’. This + does not actually raise an error. Instead a message is shown in + the echo area, and git’s standard error is insert into a new + section in the current repository’s process buffer. + + -- Function: magit-git-str &rest args + + This is a variant of ‘magit-git-string’ that ignores the option + ‘magit-git-debug’. It is mainly intended to be used while handling + errors in functions that do respect that option. Using such a + function while handing an error could cause yet another error and + 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 @@ -74,8 +280,8 @@ refresh because that also automatically moves to the next change. -- 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 + 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 @@ -263,7 +469,7 @@ File: magit.info, Node: Creating Sections, Next: Section Selection, Up: Secti -- Function: magit-define-section-jumper sym title &optional value - Define an interactive function to go to section SYM. TITLE is the + Define an interactive function to go to section SYM. TITLE is the displayed title of the section.  @@ -312,24 +518,24 @@ File: magit.info, Node: Matching Sections, Prev: Section Selection, Up: Secti 10.2.3 Matching Sections ------------------------ -‘M-x magit-describe-section’ (‘magit-describe-section’) +‘M-x magit-describe-section-briefly’ (‘magit-describe-section-briefly’) Show information about the section at point. This command is intended for debugging purposes. -- Function: magit-section-ident - Return an unique identifier for SECTION. The return value has the + Return an unique identifier for SECTION. The return value has the form ‘((TYPE . VALUE)...)’. -- Function: magit-get-section - Return the section identified by IDENT. IDENT has to be a list as + Return the section identified by IDENT. IDENT has to be a list as returned by ‘magit-section-ident’. -- Function: magit-section-match condition &optional section - Return ‘t’ if SECTION matches CONDITION. SECTION defaults to the + Return ‘t’ if SECTION matches CONDITION. SECTION defaults to the section at point. If SECTION is not specified and there also is no section at point, then return ‘nil’. @@ -465,8 +671,9 @@ where ‘*’ may be something like ‘diff’) with the value of ‘magit-mode-display-buffer’ with BUFFER, MODE and SWITCH-FUNC as arguments. Then it sets the local value of ‘magit-refresh-function’ to REFRESH-FUNC and that of - ‘magit-refresh-args’ to REFRESH-ARGS. Finally it creates the buffer - content by calling REFRESH-FUNC with REFRESH-ARGS as arguments. + ‘magit-refresh-args’ to REFRESH-ARGS. Finally it creates the + buffer content by calling REFRESH-FUNC with REFRESH-ARGS as + arguments. All arguments are evaluated before switching to BUFFER. @@ -481,10 +688,10 @@ where ‘*’ may be something like ‘diff’) with the value of previous window configuration as a buffer local value, so that it can later be restored by ‘magit-mode-bury-buffer’. - The buffer is displayed and selected using SWITCH-FUNCTION. If that - is ‘nil’ then ‘pop-to-buffer’ is used if the current buffer’s major - mode derives from ‘magit-mode’. Otherwise ‘switch-to-buffer’ is - used. + The buffer is displayed and selected using SWITCH-FUNCTION. If + that is ‘nil’ then ‘pop-to-buffer’ is used if the current buffer’s + major mode derives from ‘magit-mode’. Otherwise ‘switch-to-buffer’ + is used. -- Variable: magit-refresh-function @@ -752,7 +959,7 @@ A.1.4 How does branching and pushing work? ------------------------------------------ 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 ...? @@ -800,13 +1007,15 @@ A.2 FAQ - Issues and Errors * I changed several thousand files at once and now Magit is unusable:: * I am having problems committing:: * I am using MS Windows and cannot push with Magit:: -* 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. +* 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:: * 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:: +* My Git hooks work on the command-line but not inside Magit:: +* git-commit-mode isn't used when committing from the command-line:: +* Point ends up inside invisible text when jumping to a file-visiting buffer::  File: magit.info, Node: Magit is slow, Next: I changed several thousand files at once and now Magit is unusable, Up: FAQ - Issues and Errors @@ -925,7 +1134,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: A branch and tag sharing the same name breaks SOMETHING, 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 ------------------------------------------------------- @@ -951,21 +1160,9 @@ consider disabling VC when using Git: (setq vc-handled-backends nil)  -File: magit.info, Node: Emacs 245 hangs when loading Magit, Next: A branch and tag sharing the same name breaks SOMETHING, Prev: The mode-line information isn't always up-to-date, Up: FAQ - Issues and Errors - -A.2.10 Emacs 24.5 hangs when loading Magit ------------------------------------------- +File: magit.info, Node: A branch and tag sharing the same name breaks SOMETHING, Next: My Git hooks work on the command-line but not inside Magit, Prev: The mode-line information isn't always up-to-date, Up: FAQ - Issues and Errors -This is actually triggered by loading Tramp. See - for details. You -can work around the problem by setting -‘tramp-ssh-controlmaster-options’. Changing your DNS server (e.g. to -Google’s ‘8.8.8.8’) may also be sufficient to work around the issue. - - -File: magit.info, Node: A branch and tag sharing the same name breaks SOMETHING, Prev: Emacs 245 hangs when loading Magit, Up: FAQ - Issues and Errors - -A.2.11 A branch and tag sharing the same name breaks SOMETHING +A.2.10 A branch and tag sharing the same name breaks SOMETHING -------------------------------------------------------------- Or more generally, ambiguous refnames break SOMETHING. @@ -978,6 +1175,87 @@ non-ambiguous naming scheme. However, if you do work with a repository that has ambiguous refnames, please report any issues you encounter so that we can investigate whether there is a simple fix. + +File: magit.info, Node: My Git hooks work on the command-line but not inside Magit, Next: git-commit-mode isn't used when committing from the command-line, Prev: A branch and tag sharing the same name breaks SOMETHING, Up: FAQ - Issues and Errors + +A.2.11 My Git hooks work on the command-line but not inside Magit +----------------------------------------------------------------- + +When Magit calls ‘git’ it adds a few global arguments including +‘--literal-pathspecs’ and the ‘git’ process started by Magit then passes +that setting on to other ‘git’ process it starts itself. It does so by +setting the environment variable ‘GIT_LITERAL_PATHSPECS’, not by calling +subprocesses with the ‘--literal-pathspecs’. You can therefore override +this setting in hook scripts using ‘unset GIT_LITERAL_PATHSPECS’. + + +File: magit.info, Node: git-commit-mode isn't used when committing from the command-line, Next: Point ends up inside invisible text when jumping to a file-visiting buffer, Prev: My Git hooks work on the command-line but not inside Magit, Up: FAQ - Issues and Errors + +A.2.12 ‘git-commit-mode’ isn’t used when committing from the command-line +------------------------------------------------------------------------- + +The reason for this is that ‘git-commit.el’ has not been loaded yet +and/or that the server has not been started yet. These things have +always already been taken care of when you commit from Magit because in +order to do so, Magit has to be loaded and doing that involves loading +‘git-commit’ and starting the server. + + If you want to commit from the command-line, then you have to take +care of these things yourself. Your ‘init.el’ file should contain: + + (require 'git-commit) + (server-mode) + + Instead of ‘(require ’git-commit)‘ you may also use: + + (load "/path/to/magit-autoloads.el") + + You might want to do that because loading ‘git-commit’ causes large +parts of Magit to be loaded. + + There are also some variations of ‘(server-mode)’ that you might want +to try. Personally I use: + + (use-package server + :config (or (server-running-p) (server-mode))) + + Now you can use: + + $ emacs& + $ EDITOR=emacsclient git commit + + However you cannot use: + + $ killall emacs + $ EDITOR="emacsclient --alternate-editor emacs" git commit + + This will actually end up using ‘emacs’, not ‘emacsclient’. If you +do this, then can still edit the commit message but ‘git-commit-mode’ +won’t be used and you have to exit ‘emacs’ to finish the process. + + Tautology ahead. If you want to be able to use ‘emacsclient’ to +connect to a running ‘emacs’ instance, even though no ‘emacs’ instance +is running, then you cannot use ‘emacsclient’ directly. + + Instead you have to create a script that does something like this: + + Try to use ‘emacsclient’ (without using ‘--alternate-editor’). If +that succeeds, do nothing else. Otherwise start ‘emacs &’ (and +‘init.el’ must call ‘server-start’) and try to use ‘emacsclient’ again. + + +File: magit.info, Node: Point ends up inside invisible text when jumping to a file-visiting buffer, Prev: git-commit-mode isn't used when committing from the command-line, Up: FAQ - Issues and Errors + +A.2.13 Point ends up inside invisible text when jumping to a file-visiting buffer +--------------------------------------------------------------------------------- + +This can happen when you type ‘RET’ on a hunk to visit the respective +file at the respective position. One solution to this problem is to use +‘global-reveal-mode’. It makes sure that text around point is always +visible. If that is too drastic for your taste, then you may instead +use ‘magit-diff-visit-file-hook’ to reveal the text, possibly using +‘reveal-post-command’ or for Org buffers ‘org-reveal’. +  File: magit.info, Node: Debugging Tools, Next: Keystroke Index, Prev: FAQ, Up: Top @@ -1055,6 +1333,12 @@ Appendix C Keystroke Index * ! S: Running Git Manually. (line 39) * $: Viewing Git Output. (line 16) +* %: Worktree. (line 8) +* % b: Worktree. (line 13) +* % c: Worktree. (line 17) +* % g: Worktree. (line 33) +* % k: Worktree. (line 28) +* % p: Worktree. (line 21) * +: Log Buffer. (line 59) * + <1>: Refreshing Diffs. (line 68) * -: Log Buffer. (line 63) @@ -1078,7 +1362,8 @@ Appendix C Keystroke Index * A s: Cherry Picking. (line 75) * A s <1>: Cherry Picking. (line 93) * B: Bisecting. (line 8) -* b: The Branch Popup. (line 12) +* b: Blaming. (line 86) +* b <1>: The Branch Popup. (line 12) * B B: Bisecting. (line 16) * B b: Bisecting. (line 31) * b b: The Branch Popup. (line 37) @@ -1086,18 +1371,19 @@ Appendix C Keystroke Index * b c: The Branch Popup. (line 55) * B g: Bisecting. (line 36) * B k: Bisecting. (line 41) -* b k: The Branch Popup. (line 237) +* b k: The Branch Popup. (line 240) * 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 243) +* b r: The Branch Popup. (line 246) * B s: Bisecting. (line 24) * b s: The Branch Popup. (line 85) -* b x: The Branch Popup. (line 221) +* b x: The Branch Popup. (line 224) * 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. +* b y: The Branch Popup. (line 218) +* c: Blaming. (line 120) +* c <1>: Initiating a Commit. (line 8) +* c <2>: Editing Rebase Sequences. (line 72) * c a: Initiating a Commit. (line 18) * c A: Initiating a Commit. (line 66) @@ -1108,7 +1394,7 @@ Appendix C Keystroke Index * c s: Initiating a Commit. (line 54) * c S: Initiating a Commit. (line 62) * c w: Initiating a Commit. (line 32) -* C-: Diff Buffer. (line 36) +* C-: Diff Buffer. (line 48) * C-: Section Visibility. (line 13) * C-c C-a: Editing Commit Messages. (line 128) @@ -1124,6 +1410,7 @@ Appendix C Keystroke Index * C-c C-d: Refreshing Diffs. (line 80) * C-c C-d <1>: Editing Commit Messages. (line 57) +* C-c C-e: Diff Buffer. (line 74) * C-c C-f: Log Buffer. (line 23) * C-c C-f <1>: Refreshing Diffs. (line 94) * C-c C-i: Editing Commit Messages. @@ -1142,28 +1429,39 @@ Appendix C Keystroke Index (line 132) * C-c C-s: Editing Commit Messages. (line 136) -* C-c C-t: Editing Commit Messages. +* C-c C-t: Diff Buffer. (line 70) +* C-c C-t <1>: Editing Commit Messages. (line 140) * C-c C-w: Editing Commit Messages. (line 63) * C-c M-g: Minor Mode for Buffers Visiting Files. (line 19) +* C-c M-g B: Minor Mode for Buffers Visiting Files. + (line 80) * C-c M-g b: Minor Mode for Buffers Visiting Files. - (line 76) + (line 86) * C-c M-g c: Minor Mode for Buffers Visiting Files. (line 33) * C-c M-g D: Minor Mode for Buffers Visiting Files. (line 39) * C-c M-g d: Minor Mode for Buffers Visiting Files. (line 47) +* C-c M-g e: Minor Mode for Buffers Visiting Files. + (line 102) +* C-c M-g f: Minor Mode for Buffers Visiting Files. + (line 96) * C-c M-g L: Minor Mode for Buffers Visiting Files. (line 57) * C-c M-g l: Minor Mode for Buffers Visiting Files. (line 64) * C-c M-g p: Minor Mode for Buffers Visiting Files. - (line 82) + (line 112) +* C-c M-g r: Minor Mode for Buffers Visiting Files. + (line 91) * C-c M-g s: Minor Mode for Buffers Visiting Files. (line 24) +* C-c M-g t: Minor Mode for Buffers Visiting Files. + (line 71) * C-c M-g u: Minor Mode for Buffers Visiting Files. (line 28) * C-c M-s: Editing Commit Messages. @@ -1190,8 +1488,8 @@ Appendix C Keystroke Index * d w: Diffing. (line 43) * D w: Refreshing Diffs. (line 28) * DEL: Log Buffer. (line 43) -* DEL <1>: Diff Buffer. (line 68) -* DEL <2>: Blaming. (line 69) +* DEL <1>: Diff Buffer. (line 103) +* DEL <2>: Blaming. (line 73) * DEL <3>: Editing Rebase Sequences. (line 28) * e: Ediffing. (line 9) @@ -1224,7 +1522,7 @@ Appendix C Keystroke Index (line 22) * G: Automatic Refreshing of Magit Buffers. (line 31) -* j: Diff Buffer. (line 58) +* j: Diff Buffer. (line 93) * k: Viewing Git Output. (line 24) * k <1>: Applying. (line 40) * k <2>: Editing Rebase Sequences. @@ -1283,17 +1581,14 @@ Appendix C Keystroke Index (line 39) * M-p <2>: Editing Rebase Sequences. (line 43) -* M-w: Blaming. (line 100) +* M-w: Blaming. (line 112) * M-w <1>: Common Commands. (line 10) -* M-x magit-blame: Blaming. (line 14) -* M-x magit-blame-popup: Blaming. (line 37) -* 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 30) -* M-x magit-describe-section: Section Types and Values. +* M-x magit-describe-section-briefly: Section Types and Values. (line 13) -* M-x magit-describe-section <1>: Matching Sections. (line 6) +* M-x magit-describe-section-briefly <1>: Matching Sections. (line 6) * M-x magit-emacs-Q-command: Debugging Tools. (line 16) * M-x magit-find-file: Visiting Blobs. (line 6) * M-x magit-find-file-other-window: Visiting Blobs. (line 11) @@ -1309,11 +1604,11 @@ Appendix C Keystroke Index (line 18) * 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 magit-wip-commit: Wip Modes. (line 174) * M-x with-editor-debug: Debugging Tools. (line 38) * n: Section Movement. (line 16) -* n <1>: Blaming. (line 79) -* N: Blaming. (line 83) +* n <1>: Blaming. (line 91) +* N: Blaming. (line 95) * n <2>: Editing Rebase Sequences. (line 39) * n <3>: Minor Mode for Buffers Visiting Blobs. @@ -1335,8 +1630,8 @@ Appendix C Keystroke Index * O s: Subtree. (line 41) * o u: Submodule Popup. (line 38) * p: Section Movement. (line 10) -* p <1>: Blaming. (line 87) -* P: Blaming. (line 91) +* p <1>: Blaming. (line 99) +* P: Blaming. (line 103) * p <2>: Editing Rebase Sequences. (line 35) * P <1>: Pushing. (line 11) @@ -1352,7 +1647,7 @@ Appendix C Keystroke Index * P u: Pushing. (line 26) * q: Quitting Windows. (line 6) * q <1>: Log Buffer. (line 12) -* q <2>: Blaming. (line 95) +* q <2>: Blaming. (line 107) * q <3>: Minor Mode for Buffers Visiting Blobs. (line 20) * r: Rebasing. (line 9) @@ -1371,9 +1666,9 @@ Appendix C Keystroke Index * r s <1>: Rebasing. (line 99) * r u: Rebasing. (line 29) * r w: Rebasing. (line 81) -* RET: Diff Buffer. (line 6) +* RET: Diff Buffer. (line 8) * RET <1>: References Buffer. (line 166) -* RET <2>: Blaming. (line 55) +* RET <2>: Blaming. (line 59) * RET <3>: Editing Rebase Sequences. (line 16) * s: Staging and Unstaging. @@ -1384,12 +1679,11 @@ Appendix C Keystroke Index (line 59) * S-: Section Visibility. (line 22) * SPC: Log Buffer. (line 33) -* SPC <1>: Diff Buffer. (line 64) -* SPC <2>: Blaming. (line 59) +* SPC <1>: Diff Buffer. (line 99) +* SPC <2>: Blaming. (line 63) * SPC <3>: Editing Rebase Sequences. (line 21) -* t: Blaming. (line 108) -* t <1>: Tagging. (line 8) +* t: Tagging. (line 8) * T: Notes. (line 8) * T a: Notes. (line 51) * T c: Notes. (line 46) @@ -1429,11 +1723,13 @@ Appendix C Keystroke Index * x: Editing Rebase Sequences. (line 76) * x <1>: Resetting. (line 8) -* X f: Resetting. (line 37) +* X f: Resetting. (line 43) * X h: Resetting. (line 25) * X i: Resetting. (line 30) * X m: Resetting. (line 14) * X s: Resetting. (line 19) +* X w: Resetting. (line 37) +* X w <1>: Wip Modes. (line 101) * Y: Cherries. (line 17) * y: References Buffer. (line 6) * y <1>: Editing Rebase Sequences. @@ -1536,22 +1832,30 @@ Appendix D Command Index * magit-bisect-run: Bisecting. (line 24) * magit-bisect-skip: Bisecting. (line 41) * magit-bisect-start: Bisecting. (line 16) -* magit-blame: Blaming. (line 14) -* magit-blame-copy-hash: Blaming. (line 100) -* magit-blame-next-chunk: Blaming. (line 79) -* magit-blame-next-chunk-same-commit: Blaming. (line 83) -* magit-blame-popup: Blaming. (line 37) +* magit-blame: Blaming. (line 17) +* magit-blame <1>: Minor Mode for Buffers Visiting Files. + (line 86) +* magit-blame-copy-hash: Blaming. (line 112) +* magit-blame-cycle-style: Blaming. (line 120) +* magit-blame-echo: Blaming. (line 32) +* magit-blame-next-chunk: Blaming. (line 91) +* magit-blame-next-chunk-same-commit: Blaming. (line 95) +* magit-blame-popup: Blaming. (line 86) * magit-blame-popup <1>: Minor Mode for Buffers Visiting Files. - (line 76) -* magit-blame-previous-chunk: Blaming. (line 87) -* magit-blame-previous-chunk-same-commit: Blaming. (line 91) -* magit-blame-quit: Blaming. (line 95) -* magit-blame-reverse: Blaming. (line 29) -* magit-blame-toggle-headings: Blaming. (line 108) + (line 80) +* magit-blame-previous-chunk: Blaming. (line 99) +* magit-blame-previous-chunk-same-commit: Blaming. (line 103) +* magit-blame-quit: Blaming. (line 107) +* magit-blame-removal: Blaming. (line 38) +* magit-blame-removal <1>: Minor Mode for Buffers Visiting Files. + (line 91) +* magit-blame-reverse: Blaming. (line 46) +* magit-blame-reverse <1>: Minor Mode for Buffers Visiting Files. + (line 96) * magit-blob-next: Minor Mode for Buffers Visiting Blobs. (line 16) * magit-blob-previous: Minor Mode for Buffers Visiting Files. - (line 82) + (line 112) * magit-blob-previous <1>: Minor Mode for Buffers Visiting Blobs. (line 12) * magit-branch: The Branch Popup. (line 45) @@ -1560,20 +1864,20 @@ Appendix D Command Index * magit-branch-config-popup: The Branch Popup. (line 29) * magit-branch-config-popup <1>: The Branch Config Popup. (line 6) -* magit-branch-delete: The Branch Popup. (line 237) -* magit-branch-or-checkout: The Branch Popup. (line 347) -* magit-branch-orphan: The Branch Popup. (line 342) +* magit-branch-delete: The Branch Popup. (line 240) +* magit-branch-or-checkout: The Branch Popup. (line 350) +* magit-branch-orphan: The Branch Popup. (line 345) * magit-branch-popup: The Branch Popup. (line 12) * 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-rename: The Branch Popup. (line 246) +* magit-branch-reset: The Branch Popup. (line 224) * 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-checkout-pull-request: The Branch Popup. (line 218) * magit-cherry: Cherries. (line 17) * magit-cherry-apply: Cherry Picking. (line 23) * magit-cherry-donate: Cherry Picking. (line 53) @@ -1600,9 +1904,9 @@ Appendix D Command Index * magit-cycle-margin-style: Log Margin. (line 60) * magit-debug-git-executable: Git Executable. (line 45) * magit-debug-git-executable <1>: Debugging Tools. (line 30) -* magit-describe-section: Section Types and Values. +* magit-describe-section-briefly: Section Types and Values. (line 13) -* magit-describe-section <1>: Matching Sections. (line 6) +* magit-describe-section-briefly <1>: Matching Sections. (line 6) * magit-diff: Diffing. (line 29) * magit-diff-buffer-file: Minor Mode for Buffers Visiting Files. (line 47) @@ -1610,6 +1914,7 @@ Appendix D Command Index (line 39) * magit-diff-default-context: Refreshing Diffs. (line 72) * magit-diff-dwim: Diffing. (line 25) +* magit-diff-edit-hunk-commit: Diff Buffer. (line 74) * magit-diff-flip-revs: Refreshing Diffs. (line 45) * magit-diff-less-context: Refreshing Diffs. (line 64) * magit-diff-more-context: Refreshing Diffs. (line 68) @@ -1620,17 +1925,18 @@ Appendix D Command Index * magit-diff-save-default-arguments: Refreshing Diffs. (line 28) * magit-diff-set-default-arguments: Refreshing Diffs. (line 21) * magit-diff-show-or-scroll-down: Log Buffer. (line 43) -* magit-diff-show-or-scroll-down <1>: Blaming. (line 69) +* magit-diff-show-or-scroll-down <1>: Blaming. (line 73) * magit-diff-show-or-scroll-up: Log Buffer. (line 33) -* magit-diff-show-or-scroll-up <1>: Blaming. (line 59) +* magit-diff-show-or-scroll-up <1>: Blaming. (line 63) * magit-diff-staged: Diffing. (line 49) * magit-diff-switch-range-type: Refreshing Diffs. (line 40) * magit-diff-toggle-file-filter: Refreshing Diffs. (line 50) * magit-diff-toggle-refine-hunk: Refreshing Diffs. (line 36) +* magit-diff-trace-definition: Diff Buffer. (line 70) * magit-diff-unstaged: Diffing. (line 55) -* magit-diff-visit-file: Diff Buffer. (line 6) -* magit-diff-visit-file-other-window: Diff Buffer. (line 53) -* magit-diff-visit-file-worktree: Diff Buffer. (line 36) +* magit-diff-visit-file: Diff Buffer. (line 8) +* magit-diff-visit-file-other-window: Diff Buffer. (line 65) +* magit-diff-visit-file-worktree: Diff Buffer. (line 48) * magit-diff-while-committing: Refreshing Diffs. (line 80) * magit-diff-while-committing <1>: Editing Commit Messages. (line 57) @@ -1648,6 +1954,8 @@ Appendix D Command Index * magit-ediff-show-unstaged: Ediffing. (line 53) * magit-ediff-show-working-tree: Ediffing. (line 61) * magit-ediff-stage: Ediffing. (line 48) +* magit-edit-line-commit: Minor Mode for Buffers Visiting Files. + (line 102) * magit-emacs-Q-command: Debugging Tools. (line 16) * magit-fetch: Fetching. (line 24) * magit-fetch-all: Fetching. (line 38) @@ -1657,9 +1965,17 @@ Appendix D Command Index * 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) +* magit-file-checkout: Resetting. (line 43) +* magit-file-checkout <1>: Minor Mode for Buffers Visiting Files. + (line 131) +* magit-file-delete: Minor Mode for Buffers Visiting Files. + (line 123) * magit-file-popup: Minor Mode for Buffers Visiting Files. (line 19) +* magit-file-rename: Minor Mode for Buffers Visiting Files. + (line 119) +* magit-file-untrack: Minor Mode for Buffers Visiting Files. + (line 127) * magit-find-file: Visiting Blobs. (line 6) * magit-find-file-other-window: Visiting Blobs. (line 11) * magit-format-patch: Creating and Sending Patches. @@ -1673,7 +1989,7 @@ Appendix D Command Index * magit-go-forward: Log Buffer. (line 23) * magit-go-forward <1>: Refreshing Diffs. (line 94) * magit-init: Repository Setup. (line 6) -* magit-jump-to-diffstat-or-diff: Diff Buffer. (line 58) +* magit-jump-to-diffstat-or-diff: Diff Buffer. (line 93) * magit-kill-this-buffer: Minor Mode for Buffers Visiting Blobs. (line 20) * magit-list-repositories: Repository List. (line 6) @@ -1702,6 +2018,8 @@ Appendix D Command Index * magit-log-select-quit: Select from Log. (line 26) * magit-log-set-default-arguments: Refreshing Logs. (line 21) * magit-log-toggle-commit-limit: Log Buffer. (line 53) +* magit-log-trace-definition: Minor Mode for Buffers Visiting Files. + (line 71) * magit-margin-popup: Log Margin. (line 47) * magit-merge: Merging. (line 17) * magit-merge <1>: Merging. (line 88) @@ -1784,6 +2102,8 @@ Appendix D Command Index (line 87) * magit-reset-index <1>: Resetting. (line 30) * magit-reset-soft: Resetting. (line 19) +* magit-reset-worktree: Resetting. (line 37) +* magit-reset-worktree <1>: Wip Modes. (line 101) * magit-reverse: Applying. (line 44) * magit-reverse-in-index: Staging and Unstaging. (line 62) @@ -1834,7 +2154,7 @@ Appendix D Command Index * magit-shell-command-topdir: Running Git Manually. (line 34) * magit-show-commit: Diffing. (line 67) -* magit-show-commit <1>: Blaming. (line 55) +* magit-show-commit <1>: Blaming. (line 59) * magit-show-refs: References Buffer. (line 24) * magit-show-refs-current: References Buffer. (line 19) * magit-show-refs-head: References Buffer. (line 14) @@ -1884,6 +2204,7 @@ Appendix D Command Index * magit-tag-delete: Tagging. (line 18) * magit-tag-popup: Tagging. (line 8) * magit-tag-prune: Tagging. (line 24) +* magit-tag-release: Tagging. (line 28) * magit-toggle-buffer-lock: Modes and Buffers. (line 17) * magit-toggle-margin: Refreshing Logs. (line 36) * magit-toggle-margin <1>: Log Margin. (line 56) @@ -1900,11 +2221,17 @@ Appendix D Command Index * magit-version: Git Executable. (line 17) * magit-version <1>: Debugging Tools. (line 10) * 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) -* scroll-down: Diff Buffer. (line 68) -* scroll-up: Diff Buffer. (line 64) +* magit-wip-commit: Wip Modes. (line 174) +* magit-wip-log: Wip Modes. (line 85) +* magit-wip-log-current: Wip Modes. (line 93) +* magit-worktree-branch: Worktree. (line 17) +* magit-worktree-checkout: Worktree. (line 13) +* magit-worktree-checkout-pull-request: Worktree. (line 21) +* magit-worktree-delete: Worktree. (line 28) +* magit-worktree-popup: Worktree. (line 8) +* magit-worktree-status: Worktree. (line 33) +* scroll-down: Diff Buffer. (line 103) +* scroll-up: Diff Buffer. (line 99) * with-editor-cancel: Editing Commit Messages. (line 24) * with-editor-cancel <1>: Editing Rebase Sequences. @@ -1939,13 +2266,17 @@ Appendix E Function Index * git-commit-turn-on-flyspell: Editing Commit Messages. (line 201) * ido-enter-magit-status: Status Buffer. (line 47) -* magit-add-section-hook: Section Hooks. (line 18) +* magit-add-section-hook: Section Hooks. (line 20) * magit-after-save-refresh-status: Automatic Refreshing of Magit Buffers. (line 56) +* magit-blame: Blaming. (line 17) +* magit-blame-echo: Blaming. (line 32) +* magit-blame-removal: Blaming. (line 38) +* magit-blame-reverse: Blaming. (line 46) * magit-branch-config-popup: The Branch Config Popup. (line 6) -* magit-branch-or-checkout: The Branch Popup. (line 347) -* magit-branch-orphan: The Branch Popup. (line 342) +* magit-branch-or-checkout: The Branch Popup. (line 350) +* magit-branch-orphan: The Branch Popup. (line 345) * magit-branch-shelve: Auxillary Branch Commands. (line 8) * magit-branch-unshelve: Auxillary Branch Commands. @@ -1963,7 +2294,7 @@ Appendix E Function Index * magit-define-section-jumper: Creating Sections. (line 77) * magit-diff-scope: Matching Sections. (line 111) * magit-diff-type: Matching Sections. (line 88) -* magit-diff-visit-file-other-window: Diff Buffer. (line 53) +* magit-diff-visit-file-other-window: Diff Buffer. (line 65) * magit-display-buffer: Switching Buffers. (line 6) * magit-display-buffer-fullcolumn-most-v1: Switching Buffers. (line 72) * magit-display-buffer-fullframe-status-topleft-v1: Switching Buffers. @@ -1973,6 +2304,14 @@ Appendix E Function Index * magit-display-buffer-same-window-except-diff-v1: Switching Buffers. (line 50) * magit-display-buffer-traditional: Switching Buffers. (line 42) +* magit-file-checkout: Minor Mode for Buffers Visiting Files. + (line 131) +* magit-file-delete: Minor Mode for Buffers Visiting Files. + (line 123) +* magit-file-rename: Minor Mode for Buffers Visiting Files. + (line 119) +* magit-file-untrack: Minor Mode for Buffers Visiting Files. + (line 127) * magit-generate-buffer-name-default-function: Naming Buffers. (line 17) * magit-get-section: Matching Sections. (line 16) @@ -2014,6 +2353,7 @@ Appendix E Function Index * magit-insert-head-branch-header: Status Header Sections. (line 42) * magit-insert-heading: Creating Sections. (line 42) +* magit-insert-ignored-files: Status Sections. (line 100) * magit-insert-local-branches: References Sections. (line 17) * magit-insert-merge-log: Status Sections. (line 18) * magit-insert-modules: Status Module Sections. @@ -2031,7 +2371,7 @@ Appendix E Function Index * magit-insert-push-branch-header: Status Header Sections. (line 51) * magit-insert-rebase-sequence: Status Sections. (line 23) -* magit-insert-recent-commits: Status Sections. (line 107) +* magit-insert-recent-commits: Status Sections. (line 115) * magit-insert-remote-branches: References Sections. (line 21) * magit-insert-remote-header: Status Header Sections. (line 67) @@ -2048,11 +2388,11 @@ Appendix E Function Index * magit-insert-tags-header: Status Header Sections. (line 56) * magit-insert-tracked-files: Status Sections. (line 96) -* magit-insert-unpulled-cherries: Status Sections. (line 118) +* magit-insert-unpulled-cherries: Status Sections. (line 126) * magit-insert-unpulled-from-pushremote: Status Sections. (line 79) * magit-insert-unpulled-from-upstream: Status Sections. (line 74) -* magit-insert-unpulled-or-recent-commits: Status Sections. (line 100) -* magit-insert-unpushed-cherries: Status Sections. (line 125) +* magit-insert-unpulled-or-recent-commits: Status Sections. (line 108) +* magit-insert-unpushed-cherries: Status Sections. (line 133) * magit-insert-unpushed-to-pushremote: Status Sections. (line 89) * magit-insert-unpushed-to-upstream: Status Sections. (line 84) * magit-insert-unstaged-changes: Status Sections. (line 59) @@ -2067,7 +2407,7 @@ Appendix E Function Index * magit-log-maybe-update-blob-buffer: Section Movement. (line 71) * magit-log-maybe-update-revision-buffer: Section Movement. (line 64) * magit-maybe-set-dedicated: Switching Buffers. (line 97) -* magit-mode-display-buffer: Refreshing Buffers. (line 32) +* magit-mode-display-buffer: Refreshing Buffers. (line 33) * magit-mode-quit-window: Quitting Windows. (line 31) * magit-mode-setup: Refreshing Buffers. (line 17) * magit-push-implicitly: Pushing. (line 73) @@ -2119,8 +2459,10 @@ Appendix E Function Index * magit-status-maybe-update-blob-buffer: Section Movement. (line 83) * magit-status-maybe-update-revision-buffer: Section Movement. (line 77) -* magit-wip-log: Wip Modes. (line 69) -* magit-wip-log-current: Wip Modes. (line 77) +* magit-tag-release: Tagging. (line 28) +* magit-wip-commit-initial-backup: Wip Modes. (line 145) +* magit-wip-log: Wip Modes. (line 85) +* magit-wip-log-current: Wip Modes. (line 93) * with-editor-usage-message: Editing Commit Messages. (line 215) @@ -2185,15 +2527,17 @@ Appendix F Variable Index * magit-auto-revert-tracked-only: Automatic Reverting of File-Visiting Buffers. (line 55) * magit-bisect-show-graph: Bisecting. (line 55) -* magit-blame-goto-chunk-hook: Blaming. (line 126) -* magit-blame-heading-format: Blaming. (line 112) -* magit-blame-show-headings: Blaming. (line 120) -* magit-blame-time-format: Blaming. (line 116) +* magit-blame-disable-modes: Blaming. (line 150) +* magit-blame-echo-style: Blaming. (line 133) +* magit-blame-goto-chunk-hook: Blaming. (line 156) +* magit-blame-read-only: Blaming. (line 145) +* magit-blame-styles: Blaming. (line 128) +* magit-blame-time-format: Blaming. (line 140) * magit-branch-adjust-remote-upstream-alist: The Branch Popup. - (line 300) + (line 303) * magit-branch-popup-show-variables: The Branch Popup. (line 21) -* magit-branch-prefer-remote-upstream: The Branch Popup. (line 255) -* magit-branch-read-upstream-first: The Branch Popup. (line 249) +* magit-branch-prefer-remote-upstream: The Branch Popup. (line 258) +* magit-branch-read-upstream-first: The Branch Popup. (line 252) * magit-buffer-name-format: Naming Buffers. (line 27) * magit-bury-buffer-function: Quitting Windows. (line 11) * magit-cherry-margin: Cherries. (line 22) @@ -2214,7 +2558,7 @@ Appendix F Variable Index * magit-diff-paint-whitespace: Diff Options. (line 38) * magit-diff-refine-hunk: Diff Options. (line 6) * magit-diff-unmarked-lines-keep-foreground: Diff Options. (line 97) -* magit-diff-visit-previous-blob: Diff Buffer. (line 25) +* magit-diff-visit-previous-blob: Diff Buffer. (line 37) * magit-display-buffer-function: Switching Buffers. (line 23) * magit-display-buffer-noselect: Switching Buffers. (line 14) * magit-dwim-selection: Completion and Confirmation. @@ -2236,10 +2580,10 @@ Appendix F Variable Index (line 6) * magit-log-auto-more: Log Buffer. (line 67) * magit-log-buffer-file-locked: Minor Mode for Buffers Visiting Files. - (line 71) + (line 75) * magit-log-margin: Log Margin. (line 12) * magit-log-section-args: Status Options. (line 36) -* magit-log-section-commit-count: Status Sections. (line 112) +* magit-log-section-commit-count: Status Sections. (line 120) * 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. @@ -2257,10 +2601,10 @@ Appendix F Variable Index (line 151) * magit-push-current-set-remote-if-missing: Pushing. (line 96) * magit-reflog-margin: Reflog. (line 23) -* magit-refresh-args: Refreshing Buffers. (line 54) +* magit-refresh-args: Refreshing Buffers. (line 55) * magit-refresh-buffer-hook: Automatic Refreshing of Magit Buffers. (line 40) -* magit-refresh-function: Refreshing Buffers. (line 48) +* magit-refresh-function: Refreshing Buffers. (line 49) * magit-refresh-status-buffer: Automatic Refreshing of Magit Buffers. (line 46) * magit-refs-filter-alist: References Buffer. (line 149) @@ -2306,13 +2650,14 @@ Appendix F Variable Index * magit-use-sticky-arguments: Popup Buffers and Prefix Commands. (line 36) * 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) -* magit-wip-after-save-mode: Wip Modes. (line 93) -* magit-wip-before-change-mode: Wip Modes. (line 113) -* magit-wip-before-change-mode-lighter: Wip Modes. (line 145) -* magit-wip-namespace: Wip Modes. (line 149) +* magit-wip-after-apply-mode: Wip Modes. (line 126) +* magit-wip-after-apply-mode-lighter: Wip Modes. (line 186) +* magit-wip-after-save-local-mode-lighter: Wip Modes. (line 182) +* magit-wip-after-save-mode: Wip Modes. (line 120) +* magit-wip-before-change-mode: Wip Modes. (line 140) +* magit-wip-before-change-mode-lighter: Wip Modes. (line 190) +* magit-wip-merge-branch: Wip Modes. (line 63) +* magit-wip-namespace: Wip Modes. (line 194) * notes.displayRef: Notes. (line 64) * pull.rebase: The Branch Config Popup. (line 70) -- 2.47.3