From 2d91d53ab95cfa28734bb17e3d189b829de55bdf Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 12 Jan 2018 15:22:58 +0100 Subject: [PATCH] Update magit and friends Signed-off-by: Andreas Gerler --- .../git-commit-autoloads.el | 34 - .../git-commit-20160130.649/git-commit-pkg.el | 1 - elpa/git-commit-20160130.649/git-commit.el | 676 ------ .../git-commit-pkg.el | 2 - .../git-commit-autoloads.el | 9 +- .../git-commit-20170914.258/git-commit-pkg.el | 2 + .../git-commit.el | 91 +- elpa/magit-20171009.1252/magit-pkg.el | 12 - elpa/magit-20171009.1252/magit.info | 171 -- .../AUTHORS.md | 3 + .../COPYING | 0 .../dir | 0 .../git-rebase.el | 0 .../magit-apply.el | 137 +- .../magit-autoloads.el | 219 +- .../magit-autorevert.el | 0 .../magit-bisect.el | 0 .../magit-blame.el | 74 +- .../magit-bookmark.el | 0 .../magit-branch.el | 320 ++- elpa/magit-20171208.618/magit-collab.el | 129 ++ .../magit-commit.el | 60 +- .../magit-core.el | 0 .../magit-diff.el | 227 +- .../magit-ediff.el | 4 +- .../magit-extras.el | 36 +- .../magit-files.el | 153 +- .../magit-git.el | 389 +++- .../magit-imenu.el | 2 +- .../magit-log.el | 184 +- .../magit-margin.el | 0 .../magit-mode.el | 45 +- .../magit-notes.el | 140 +- .../magit-obsolete.el | 8 + elpa/magit-20171208.618/magit-pkg.el | 12 + .../magit-process.el | 60 +- .../magit-refs.el | 179 +- .../magit-remote.el | 185 +- .../magit-repos.el | 22 +- .../magit-section.el | 53 +- .../magit-sequence.el | 156 +- .../magit-stash.el | 87 +- .../magit-status.el | 19 +- .../magit-submodule.el | 44 +- .../magit-subtree.el | 0 .../magit-utils.el | 210 +- .../magit-wip.el | 0 .../magit-worktree.el | 12 +- .../magit.el | 66 +- elpa/magit-20171208.618/magit.info | 179 ++ .../magit.info-1 | 2009 ++++++++--------- .../magit.info-2 | Bin 87111 -> 122780 bytes .../magit-gitflow-autoloads.el | 22 + .../magit-gitflow-pkg.el | 2 + .../magit-gitflow.el | 565 +++++ elpa/magit-gitflow-readme.txt | 6 + .../magit-popup-pkg.el | 9 - .../dir | 0 .../magit-popup-autoloads.el | 2 +- .../magit-popup-pkg.el | 9 + .../magit-popup.el | 224 +- .../magit-popup.info | 21 +- 62 files changed, 4321 insertions(+), 2960 deletions(-) delete mode 100644 elpa/git-commit-20160130.649/git-commit-autoloads.el delete mode 100644 elpa/git-commit-20160130.649/git-commit-pkg.el delete mode 100644 elpa/git-commit-20160130.649/git-commit.el delete mode 100644 elpa/git-commit-20161108.1335/git-commit-pkg.el rename elpa/{git-commit-20161108.1335 => git-commit-20170914.258}/git-commit-autoloads.el (79%) create mode 100644 elpa/git-commit-20170914.258/git-commit-pkg.el rename elpa/{git-commit-20161108.1335 => git-commit-20170914.258}/git-commit.el (91%) delete mode 100644 elpa/magit-20171009.1252/magit-pkg.el delete mode 100644 elpa/magit-20171009.1252/magit.info rename elpa/{magit-20171009.1252 => magit-20171208.618}/AUTHORS.md (98%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/COPYING (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/dir (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/git-rebase.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-apply.el (82%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-autoloads.el (92%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-autorevert.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-bisect.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-blame.el (88%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-bookmark.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-branch.el (72%) create mode 100644 elpa/magit-20171208.618/magit-collab.el rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-commit.el (89%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-core.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-diff.el (93%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-ediff.el (99%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-extras.el (89%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-files.el (74%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-git.el (83%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-imenu.el (99%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-log.el (93%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-margin.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-mode.el (97%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-notes.el (57%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-obsolete.el (94%) create mode 100644 elpa/magit-20171208.618/magit-pkg.el rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-process.el (94%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-refs.el (81%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-remote.el (83%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-repos.el (95%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-section.el (96%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-sequence.el (85%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-stash.el (85%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-status.el (97%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-submodule.el (92%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-subtree.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-utils.el (79%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-wip.el (100%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit-worktree.el (90%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit.el (95%) create mode 100644 elpa/magit-20171208.618/magit.info rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit.info-1 (83%) rename elpa/{magit-20171009.1252 => magit-20171208.618}/magit.info-2 (69%) create mode 100644 elpa/magit-gitflow-20170929.124/magit-gitflow-autoloads.el create mode 100644 elpa/magit-gitflow-20170929.124/magit-gitflow-pkg.el create mode 100644 elpa/magit-gitflow-20170929.124/magit-gitflow.el create mode 100644 elpa/magit-gitflow-readme.txt delete mode 100644 elpa/magit-popup-20170913.343/magit-popup-pkg.el rename elpa/{magit-popup-20170913.343 => magit-popup-20171121.1110}/dir (100%) rename elpa/{magit-popup-20170913.343 => magit-popup-20171121.1110}/magit-popup-autoloads.el (91%) create mode 100644 elpa/magit-popup-20171121.1110/magit-popup-pkg.el rename elpa/{magit-popup-20170913.343 => magit-popup-20171121.1110}/magit-popup.el (87%) rename elpa/{magit-popup-20170913.343 => magit-popup-20171121.1110}/magit-popup.info (99%) diff --git a/elpa/git-commit-20160130.649/git-commit-autoloads.el b/elpa/git-commit-20160130.649/git-commit-autoloads.el deleted file mode 100644 index 823b21af..00000000 --- a/elpa/git-commit-20160130.649/git-commit-autoloads.el +++ /dev/null @@ -1,34 +0,0 @@ -;;; git-commit-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "git-commit" "git-commit.el" (22206 287 0 0)) -;;; Generated autoloads from git-commit.el - -(defvar global-git-commit-mode t "\ -Non-nil if Global-Git-Commit mode is enabled. -See the command `global-git-commit-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `global-git-commit-mode'.") - -(custom-autoload 'global-git-commit-mode "git-commit" nil) - -(autoload 'global-git-commit-mode "git-commit" "\ -Edit Git commit messages. -This global mode arranges for `git-commit-setup' to be called -when a Git commit message file is opened. That usually happens -when Git uses the Emacsclient as $GIT_EDITOR to have the user -provide such a commit message. - -\(fn &optional ARG)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; git-commit-autoloads.el ends here diff --git a/elpa/git-commit-20160130.649/git-commit-pkg.el b/elpa/git-commit-20160130.649/git-commit-pkg.el deleted file mode 100644 index 448d55f8..00000000 --- a/elpa/git-commit-20160130.649/git-commit-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "git-commit" "20160130.649" "Edit Git commit messages" '((emacs "24.4") (dash "20151021.113") (with-editor "20160128.1201")) :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc")) diff --git a/elpa/git-commit-20160130.649/git-commit.el b/elpa/git-commit-20160130.649/git-commit.el deleted file mode 100644 index 4a615753..00000000 --- a/elpa/git-commit-20160130.649/git-commit.el +++ /dev/null @@ -1,676 +0,0 @@ -;;; git-commit.el --- Edit Git commit messages -*- lexical-binding: t; -*- - -;; Copyright (C) 2010-2016 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. - -;; Authors: Jonas Bernoulli -;; Sebastian Wiesner -;; Florian Ragwitz -;; Marius Vollmer -;; Maintainer: Jonas Bernoulli - -;; Package-Requires: ((emacs "24.4") (dash "20151021.113") (with-editor "20160128.1201")) -;; Keywords: git tools vc -;; Package-Version: 20160130.649 -;; Homepage: https://github.com/magit/magit - -;; This file is not part of GNU Emacs. - -;; This file 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. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see . - -;;; Commentary: - -;; This package assists the user in writing good Git commit messages. - -;; While Git allows for the message to be provided on the command -;; line, it is preferable to tell Git to create the commit without -;; actually passing it a message. Git then invokes the `$GIT_EDITOR' -;; (or if that is undefined `$EDITOR') asking the user to provide the -;; message by editing the file ".git/COMMIT_EDITMSG" (or another file -;; in that directory, e.g. ".git/MERGE_MSG" for merge commits). - -;; When `global-git-commit-mode' is enabled, which it is by default, -;; then opening such a file causes the features described below, to -;; be enabled in that buffer. Normally this would be done using a -;; major-mode but to allow the use of any major-mode, as the user sees -;; fit, it is done here by running a setup function, which among other -;; things turns on the preferred major-mode, by default `text-mode'. - -;; Git waits for the `$EDITOR' to finish and then either creates the -;; commit using the contents of the file as commit message, or, if the -;; editor process exited with a non-zero exit status, aborts without -;; creating a commit. Unfortunately Emacsclient (which is what Emacs -;; users should be using as `$EDITOR' or at least as `$GIT_EDITOR') -;; does not differentiate between "successfully" editing a file and -;; aborting; not out of the box that is. - -;; By making use of the `with-editor' package this package provides -;; both ways of finish an editing session. In either case the file -;; is saved, but Emacseditor's exit code differs. -;; -;; C-c C-c Finish the editing session successfully by returning -;; with exit code 0. Git then creates the commit using -;; the message it finds in the file. -;; -;; C-c C-k Aborts the edit editing session by returning with exit -;; code 1. Git then aborts the commit. - -;; Aborting the commit does not cause the message to be lost, but -;; relying solely on the file not being tampered with is risky. This -;; package additionally stores all aborted messages for the duration -;; of the current session (i.e. until you close Emacs). To get back -;; an aborted message use M-p and M-n while editing a message. -;; -;; M-p Replace the buffer contents with the previous message -;; from the message ring. Of course only after storing -;; the current content there too. -;; -;; M-n Replace the buffer contents with the next message from -;; the message ring, after storing the current content. - -;; Some support for pseudo headers as used in some projects is -;; provided by these commands: -;; -;; C-c C-s Insert a Signed-off-by header. -;; C-C C-a Insert a Acked-by header. -;; C-c C-t Insert a Tested-by header. -;; C-c C-r Insert a Reviewed-by header. -;; C-c C-o Insert a Cc header. -;; C-c C-p Insert a Reported-by header. -;; C-c M-s Insert a Suggested-by header. - -;; When Git requests a commit message from the user, it does so by -;; having her edit a file which initially contains some comments, -;; instructing her what to do, and providing useful information, such -;; as which files were modified. These comments, even when left -;; intact by the user, do not become part of the commit message. This -;; package ensures these comments are propertizes as such and further -;; prettifies them by using different faces for various parts, such as -;; files. - -;; Finally this package highlights style errors, like lines that are -;; too long, or when the second line is not empty. It may even nag you -;; when you attempt to finish the commit without having fixed these -;; issues. Some people like that nagging, I don't, so you'll have to -;; enable it. Which brings me to the last point. Like any -;; respectable Emacs package, this one too is highly customizable: -;; -;; M-x customize-group RET git-commit RET - -;;; Code: -;;;; Dependencies - -(require 'dash) -(require 'log-edit) -(require 'ring) -(require 'server) -(require 'with-editor) - -(eval-when-compile (require 'recentf)) - -;;;; Declarations - -(defvar flyspell-generic-check-word-predicate) - -(declare-function magit-expand-git-file-name 'magit-git) - -;;; Options -;;;; Variables - -(defgroup git-commit nil - "Edit Git commit messages." - :prefix "git-commit-" - :group 'tools) - -;;;###autoload -(define-minor-mode global-git-commit-mode - "Edit Git commit messages. -This global mode arranges for `git-commit-setup' to be called -when a Git commit message file is opened. That usually happens -when Git uses the Emacsclient as $GIT_EDITOR to have the user -provide such a commit message." - :group 'git-commit - :type 'boolean - :global t - :init-value t - :initialize (lambda (symbol exp) - (custom-initialize-default symbol exp) - (when global-git-commit-mode - (add-hook 'find-file-hook 'git-commit-setup-check-buffer))) - (if global-git-commit-mode - (add-hook 'find-file-hook 'git-commit-setup-check-buffer) - (remove-hook 'find-file-hook 'git-commit-setup-check-buffer))) - -(defcustom git-commit-major-mode 'text-mode - "Major mode used to edit Git commit messages. -The major mode configured here is turned on by the minor mode -`git-commit-mode'." - :group 'git-commit - :type '(choice (function-item text-mode) - (const :tag "No major mode"))) - -(unless (find-lisp-object-file-name 'git-commit-setup-hook 'defvar) - (add-hook 'git-commit-setup-hook 'with-editor-usage-message) - (add-hook 'git-commit-setup-hook 'git-commit-propertize-diff) - (add-hook 'git-commit-setup-hook 'git-commit-turn-on-auto-fill) - (add-hook 'git-commit-setup-hook 'git-commit-setup-changelog-support) - (add-hook 'git-commit-setup-hook 'git-commit-save-message)) -(defcustom git-commit-setup-hook - '(git-commit-save-message - git-commit-setup-changelog-support - git-commit-turn-on-auto-fill - git-commit-propertize-diff - with-editor-usage-message) - "Hook run at the end of `git-commit-setup'." - :group 'git-commit - :type 'hook - :options '( - git-commit-save-message - git-commit-setup-changelog-support - git-commit-turn-on-auto-fill - git-commit-turn-on-flyspell - git-commit-propertize-diff - with-editor-usage-message)) - -(defcustom git-commit-finish-query-functions - '(git-commit-check-style-conventions) - "List of functions called to query before performing commit. - -The commit message buffer is current while the functions are -called. If any of them returns nil, then the commit is not -performed and the buffer is not killed. The user should then -fix the issue and try again. - -The functions are called with one argument. If it is non-nil -then that indicates that the user used a prefix argument to -force finishing the session despite issues. Functions should -usually honor this wish and return non-nil." - :options '(git-commit-check-style-conventions) - :type 'hook - :group 'git-commit) - -(defcustom git-commit-summary-max-length 50 - "Fontify characters beyond this column in summary lines as errors." - :group 'git-commit - :safe 'numberp - :type 'number) - -(defcustom git-commit-fill-column 72 - "Automatically wrap commit message lines beyond this column." - :group 'git-commit - :safe 'numberp - :type 'number) - -(defcustom git-commit-known-pseudo-headers - '("Signed-off-by" "Acked-by" "Cc" - "Suggested-by" "Reported-by" "Tested-by" "Reviewed-by") - "A list of Git pseudo headers to be highlighted." - :group 'git-commit - :safe (lambda (val) (and (listp val) (-all-p 'stringp val))) - :type '(repeat string)) - -;;;; Faces - -(defgroup git-commit-faces nil - "Faces for highlighting Git commit messages." - :prefix "git-commit-" - :group 'git-commit - :group 'faces) - -(defface git-commit-summary - '((t :inherit font-lock-type-face)) - "Face used for the summary in commit messages." - :group 'git-commit-faces) - -(defface git-commit-overlong-summary - '((t :inherit font-lock-warning-face)) - "Face used for the tail of overlong commit message summaries." - :group 'git-commit-faces) - -(defface git-commit-nonempty-second-line - '((t :inherit font-lock-warning-face)) - "Face used for non-whitespace on the second line of commit messages." - :group 'git-commit-faces) - -(defface git-commit-note - '((t :inherit font-lock-string-face)) - "Face used for notes in commit messages." - :group 'git-commit-faces) - -(defface git-commit-pseudo-header - '((t :inherit font-lock-string-face)) - "Font used for pseudo headers in commit messages." - :group 'git-commit-faces) - -(defface git-commit-known-pseudo-header - '((t :inherit font-lock-keyword-face)) - "Face used for the keywords of known pseudo headers in commit messages." - :group 'git-commit-faces) - -(defface git-commit-comment-branch - '((t :inherit font-lock-variable-name-face)) - "Face used for branch names in commit message comments." - :group 'git-commit-faces) - -(defface git-commit-comment-detached - '((t :inherit git-commit-comment-branch)) - "Face used for detached `HEAD' in commit message comments." - :group 'git-commit-faces) - -(defface git-commit-comment-heading - '((t :inherit git-commit-known-pseudo-header)) - "Face used for headings in commit message comments." - :group 'git-commit-faces) - -(defface git-commit-comment-file - '((t :inherit git-commit-pseudo-header)) - "Face used for file names in commit message comments." - :group 'git-commit-faces) - -(defface git-commit-comment-action - '((t :inherit git-commit-comment-branch)) - "Face used for actions in commit message comments." - :group 'git-commit-faces) - -;;; Keymap - -(defvar git-commit-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-s") 'git-commit-signoff) - (define-key map (kbd "C-c C-a") 'git-commit-ack) - (define-key map (kbd "C-c C-t") 'git-commit-test) - (define-key map (kbd "C-c C-r") 'git-commit-review) - (define-key map (kbd "C-c C-o") 'git-commit-cc) - (define-key map (kbd "C-c C-p") 'git-commit-reported) - (define-key map (kbd "C-c C-i") 'git-commit-suggested) - (define-key map (kbd "C-c M-s") 'git-commit-save-message) - (define-key map (kbd "M-p") 'git-commit-prev-message) - (define-key map (kbd "M-n") 'git-commit-next-message) - ;; Old bindings to avoid confusion - (define-key map (kbd "C-c C-x s") 'git-commit-signoff) - (define-key map (kbd "C-c C-x a") 'git-commit-ack) - (define-key map (kbd "C-c C-x t") 'git-commit-test) - (define-key map (kbd "C-c C-x r") 'git-commit-review) - (define-key map (kbd "C-c C-x o") 'git-commit-cc) - (define-key map (kbd "C-c C-x p") 'git-commit-reported) - map) - "Key map used by `git-commit-mode'.") - -;;; Menu - -(require 'easymenu) -(easy-menu-define git-commit-mode-menu git-commit-mode-map - "Git Commit Mode Menu" - '("Commit" - ["Previous" git-commit-prev-message t] - ["Next" git-commit-next-message t] - "-" - ["Ack" git-commit-ack :active t - :help "Insert an 'Acked-by' header"] - ["Sign-Off" git-commit-signoff :active t - :help "Insert a 'Signed-off-by' header"] - ["Tested-by" git-commit-test :active t - :help "Insert a 'Tested-by' header"] - ["Reviewed-by" git-commit-review :active t - :help "Insert a 'Reviewed-by' header"] - ["CC" git-commit-cc t - :help "Insert a 'Cc' header"] - ["Reported" git-commit-reported :active t - :help "Insert a 'Reported-by' header"] - ["Suggested" git-commit-suggested t - :help "Insert a 'Suggested-by' header"] - "-" - ["Save" git-commit-save-message t] - ["Cancel" with-editor-cancel t] - ["Commit" with-editor-finish t])) - -;;; Hooks - -(defconst git-commit-filename-regexp "/\\(\ -\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\ -\\|BRANCH_DESCRIPTION\\)\\'") - -(eval-after-load 'recentf - '(add-to-list 'recentf-exclude git-commit-filename-regexp)) - -(defun git-commit-setup-font-lock-in-buffer () - (and buffer-file-name - (string-match-p git-commit-filename-regexp buffer-file-name) - (git-commit-setup-font-lock))) - -(add-hook 'after-change-major-mode-hook 'git-commit-setup-font-lock-in-buffer) - -(defun git-commit-setup-check-buffer () - (and buffer-file-name - (string-match-p git-commit-filename-regexp buffer-file-name) - (git-commit-setup))) - -(defun git-commit-setup () - ;; cygwin git will pass a cygwin path (/cygdrive/c/foo/.git/...), - ;; try to handle this in window-nt Emacs. - (--when-let - (and (eq system-type 'windows-nt) - (not (file-accessible-directory-p default-directory)) - (if (require 'magit-git nil t) - ;; Emacs prepends a "c:". - (magit-expand-git-file-name (substring buffer-file-name 2)) - ;; Fallback if we can't load `magit-git'. - (and (string-match "\\`[a-z]:/\\(cygdrive/\\)?\\([a-z]\\)/\\(.*\\)" - buffer-file-name) - (concat (match-string 2 buffer-file-name) ":/" - (match-string 3 buffer-file-name))))) - (when (file-accessible-directory-p (file-name-directory it)) - (find-alternate-file it))) - (when git-commit-major-mode - (funcall git-commit-major-mode)) - (setq with-editor-show-usage nil) - (with-editor-mode 1) - (add-hook 'with-editor-finish-query-functions - 'git-commit-finish-query-functions nil t) - (add-hook 'with-editor-pre-finish-hook - 'git-commit-save-message nil t) - (add-hook 'with-editor-pre-cancel-hook - 'git-commit-save-message nil t) - (setq with-editor-cancel-message - 'git-commit-cancel-message) - (make-local-variable 'log-edit-comment-ring-index) - (git-commit-mode 1) - (git-commit-setup-font-lock) - (when (boundp 'save-place) - (setq save-place nil)) - (save-excursion - (goto-char (point-min)) - (when (= (line-beginning-position) - (line-end-position)) - (open-line 1))) - (run-hooks 'git-commit-setup-hook) - (set-buffer-modified-p nil)) - -(defun git-commit-setup-font-lock () - (let ((table (make-syntax-table (syntax-table)))) - (when comment-start - (modify-syntax-entry (string-to-char comment-start) "." table)) - (modify-syntax-entry ?# "." table) - (modify-syntax-entry ?\" "." table) - (modify-syntax-entry ?\' "." table) - (modify-syntax-entry ?` "." table) - (set-syntax-table table)) - (setq-local comment-start - (or (ignore-errors - (car (process-lines "git" "config" "core.commentchar"))) - "#")) - (setq-local comment-start-skip (format "^%s+[\s\t]*" comment-start)) - (setq-local comment-end-skip "\n") - (setq-local comment-use-syntax nil) - (setq-local font-lock-multiline t) - (font-lock-add-keywords nil (git-commit-mode-font-lock-keywords) t)) - -(define-minor-mode git-commit-mode - "Auxiliary minor mode used when editing Git commit messages. -This mode is only responsible for setting up some key bindings. -Don't use it directly, instead enable `global-git-commit-mode'." - :lighter "") - -(put 'git-commit-mode 'permanent-local t) - -(defun git-commit-setup-changelog-support () - "Treat ChangeLog entries as paragraphs." - (setq-local paragraph-start (concat paragraph-start "\\|\\*\\|("))) - -(defun git-commit-turn-on-auto-fill () - "Unconditionally turn on Auto Fill mode. -And set `fill-column' to `git-commit-fill-column'." - (setq fill-column git-commit-fill-column) - (turn-on-auto-fill)) - -(defun git-commit-turn-on-flyspell () - "Unconditionally turn on Flyspell mode. -Also prevent comments from being checked and -finally check current non-comment text." - (require 'flyspell) - (turn-on-flyspell) - (setq flyspell-generic-check-word-predicate - 'git-commit-flyspell-verify) - (flyspell-buffer)) - -(defun git-commit-flyspell-verify () - (not (= (char-after (line-beginning-position)) ?#))) - -(defun git-commit-finish-query-functions (force) - (run-hook-with-args-until-failure - 'git-commit-finish-query-functions force)) - -(defun git-commit-check-style-conventions (force) - "Check for violations of certain basic style conventions. -For each violation ask the user if she wants to proceed anyway. -This makes sure the summary line isn't too long and that the -second line is empty." - (or force - (save-excursion - (goto-char (point-min)) - (re-search-forward (git-commit-summary-regexp) nil t) - (if (equal (match-string 1) "") - t ; Just try; we don't know whether --allow-empty-message was used. - (and (or (equal (match-string 2) "") - (y-or-n-p "Summary line is too long. Commit anyway? ")) - (or (equal (match-string 3) "") - (y-or-n-p "Second line is not empty. Commit anyway? "))))))) - -(defun git-commit-cancel-message () - (message - (concat "Commit canceled" - (and (memq 'git-commit-save-message with-editor-pre-cancel-hook) - ". Message saved to `log-edit-comment-ring'")))) - -;;; History - -(defun git-commit-prev-message (arg) - "Cycle backward through message history, after saving current message. -With a numeric prefix ARG, go back ARG comments." - (interactive "*p") - (when (and (git-commit-save-message) (> arg 0)) - (setq log-edit-comment-ring-index - (log-edit-new-comment-index - arg (ring-length log-edit-comment-ring)))) - (save-restriction - (goto-char (point-min)) - (narrow-to-region (point) - (if (re-search-forward (concat "^" comment-start)) - (max 1 (- (point) 2)) - (point-max))) - (log-edit-previous-comment arg))) - -(defun git-commit-next-message (arg) - "Cycle forward through message history, after saving current message. -With a numeric prefix ARG, go forward ARG comments." - (interactive "*p") - (git-commit-prev-message (- arg))) - -(defun git-commit-save-message () - "Save current message to `log-edit-comment-ring'." - (interactive) - (--when-let (git-commit-buffer-message) - (unless (ring-member log-edit-comment-ring it) - (ring-insert log-edit-comment-ring it)))) - -(defun git-commit-buffer-message () - (let ((flush (concat "^" comment-start)) - (str (buffer-substring-no-properties (point-min) (point-max)))) - (with-temp-buffer - (insert str) - (goto-char (point-min)) - (flush-lines flush) - (goto-char (point-max)) - (unless (eq (char-before) ?\n) - (insert ?\n)) - (setq str (buffer-string))) - (unless (string-match "\\`[ \t\n\r]*\\'" str) - (when (string-match "\\`\n\\{2,\\}" str) - (setq str (replace-match "\n" t t str))) - (when (string-match "\n\\{2,\\}\\'" str) - (setq str (replace-match "\n" t t str))) - str))) - -;;; Headers - -(defun git-commit-ack (name mail) - "Insert a header acknowledging that you have looked at the commit." - (interactive (git-commit-self-ident)) - (git-commit-insert-header "Acked-by" name mail)) - -(defun git-commit-review (name mail) - "Insert a header acknowledging that you have reviewed the commit." - (interactive (git-commit-self-ident)) - (git-commit-insert-header "Reviewed-by" name mail)) - -(defun git-commit-signoff (name mail) - "Insert a header to sign off the commit." - (interactive (git-commit-self-ident)) - (git-commit-insert-header "Signed-off-by" name mail)) - -(defun git-commit-test (name mail) - "Insert a header acknowledging that you have tested the commit." - (interactive (git-commit-self-ident)) - (git-commit-insert-header "Tested-by" name mail)) - -(defun git-commit-cc (name mail) - "Insert a header mentioning someone who might be interested." - (interactive (git-commit-read-ident)) - (git-commit-insert-header "Cc" name mail)) - -(defun git-commit-reported (name mail) - "Insert a header mentioning the person who reported the issue." - (interactive (git-commit-read-ident)) - (git-commit-insert-header "Reported-by" name mail)) - -(defun git-commit-suggested (name mail) - "Insert a header mentioning the person who suggested the change." - (interactive (git-commit-read-ident)) - (git-commit-insert-header "Suggested-by" name mail)) - -(defun git-commit-self-ident () - (list (or (getenv "GIT_AUTHOR_NAME") - (getenv "GIT_COMMITTER_NAME") - (ignore-errors (car (process-lines "git" "config" "user.name"))) - user-full-name - (read-string "Name: ")) - (or (getenv "GIT_AUTHOR_EMAIL") - (getenv "GIT_COMMITTER_EMAIL") - (getenv "EMAIL") - (ignore-errors (car (process-lines "git" "config" "user.email"))) - (read-string "Email: ")))) - -(defun git-commit-read-ident () - (list (read-string "Name: ") - (read-string "Email: "))) - -(defun git-commit-insert-header (header name email) - (setq header (format "%s: %s <%s>" header name email)) - (save-excursion - (goto-char (point-max)) - (cond ((re-search-backward "^[-a-zA-Z]+: [^<]+? <[^>]+>" nil t) - (end-of-line) - (insert ?\n header) - (unless (= (char-after) ?\n) - (insert ?\n))) - (t - (while (re-search-backward (concat "^" comment-start) nil t)) - (unless (looking-back "\n\n" nil) - (insert ?\n)) - (insert header ?\n))) - (unless (or (eobp) (= (char-after) ?\n)) - (insert ?\n)))) - -;;; Font-Lock - -(defconst git-commit-comment-headings - '("Changes to be committed:" - "Untracked files:" - "Changed but not updated:" - "Changes not staged for commit:" - "Unmerged paths:")) - -(defun git-commit-summary-regexp () - (concat - ;; Leading empty lines and comments - (format "\\`\\(?:^\\(?:\\s-*\\|%s.*\\)\n\\)*" comment-start) - ;; Summary line - (format "\\(.\\{0,%d\\}\\)\\(.*\\)" git-commit-summary-max-length) - ;; Non-empty non-comment second line - (format "\\(?:\n%s\\|\n\\(.*\\)\\)?" comment-start))) - -(defun git-commit-mode-font-lock-keywords () - `(;; Comments - (,(format "^%s.*" comment-start) - (0 'font-lock-comment-face)) - (,(format "^%s On branch \\(.*\\)" comment-start) - (1 'git-commit-comment-branch t)) - (,(format "^%s Not currently on any branch." comment-start) - (1 'git-commit-comment-detached t)) - (,(format "^%s %s" comment-start - (regexp-opt git-commit-comment-headings t)) - (1 'git-commit-comment-heading t)) - (,(format "^%s\t\\(?:\\([^:\n]+\\):\\s-+\\)?\\(.*\\)" comment-start) - (1 'git-commit-comment-action t t) - (2 'git-commit-comment-file t)) - ;; Pseudo headers - (,(format "^\\(%s:\\)\\( .*\\)" - (regexp-opt git-commit-known-pseudo-headers)) - (1 'git-commit-known-pseudo-header) - (2 'git-commit-pseudo-header)) - ("^[-a-zA-Z]+: [^<]+? <[^>]+>" - (0 'git-commit-pseudo-header)) - ;; Summary - (,(git-commit-summary-regexp) - (1 'git-commit-summary t)) - ;; - Note (overrides summary) - ("\\[.+?\\]" - (0 'git-commit-note t)) - ;; - Non-empty second line (overrides summary and note) - (,(git-commit-summary-regexp) - (2 'git-commit-overlong-summary t t) - (3 'git-commit-nonempty-second-line t t)))) - -(defun git-commit-propertize-diff () - (save-excursion - (goto-char (point-min)) - (when (re-search-forward "^diff --git" nil t) - (let ((buffer (current-buffer))) - (insert - (with-temp-buffer - (insert - (with-current-buffer buffer - (prog1 (buffer-substring-no-properties (point) (point-max)) - (delete-region (point) (point-max))))) - (diff-mode) - (let (font-lock-verbose font-lock-support-mode) - (if (fboundp 'font-lock-flush) - (font-lock-flush) - (with-no-warnings - (font-lock-fontify-buffer)))) - (let (next (pos (point-min))) - (while (setq next (next-single-property-change pos 'face)) - (put-text-property pos next 'font-lock-face - (get-text-property pos 'face)) - (setq pos next))) - (buffer-string))))))) - -;;; git-commit.el ends soon -(provide 'git-commit) -;; Local Variables: -;; indent-tabs-mode: nil -;; End: -;;; git-commit.el ends here diff --git a/elpa/git-commit-20161108.1335/git-commit-pkg.el b/elpa/git-commit-20161108.1335/git-commit-pkg.el deleted file mode 100644 index 7de59f20..00000000 --- a/elpa/git-commit-20161108.1335/git-commit-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "git-commit" "20161108.1335" "Edit Git commit messages" '((emacs "24.4") (dash "20160820.501") (with-editor "20160929.734")) :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc")) diff --git a/elpa/git-commit-20161108.1335/git-commit-autoloads.el b/elpa/git-commit-20170914.258/git-commit-autoloads.el similarity index 79% rename from elpa/git-commit-20161108.1335/git-commit-autoloads.el rename to elpa/git-commit-20170914.258/git-commit-autoloads.el index 240d28f8..b8a20718 100644 --- a/elpa/git-commit-20161108.1335/git-commit-autoloads.el +++ b/elpa/git-commit-20170914.258/git-commit-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "git-commit" "git-commit.el" (22576 8241 0 +;;;### (autoloads nil "git-commit" "git-commit.el" (22975 34391 0 ;;;;;; 0)) ;;; Generated autoloads from git-commit.el @@ -26,6 +26,13 @@ provide such a commit message. \(fn &optional ARG)" t nil) +(defconst git-commit-filename-regexp "/\\(\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\\|\\(BRANCH\\|EDIT\\)_DESCRIPTION\\)\\'") + +(autoload 'git-commit-setup "git-commit" "\ + + +\(fn)" nil nil) + ;;;*** ;; Local Variables: diff --git a/elpa/git-commit-20170914.258/git-commit-pkg.el b/elpa/git-commit-20170914.258/git-commit-pkg.el new file mode 100644 index 00000000..fa918a29 --- /dev/null +++ b/elpa/git-commit-20170914.258/git-commit-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "git-commit" "20170914.258" "Edit Git commit messages" '((emacs "24.4") (dash "20170810") (with-editor "20170817")) :commit "746f2361ba5e0299f05a7878e530da2c7c8f749b" :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc")) diff --git a/elpa/git-commit-20161108.1335/git-commit.el b/elpa/git-commit-20170914.258/git-commit.el similarity index 91% rename from elpa/git-commit-20161108.1335/git-commit.el rename to elpa/git-commit-20170914.258/git-commit.el index f4ca62b7..4f933270 100644 --- a/elpa/git-commit-20161108.1335/git-commit.el +++ b/elpa/git-commit-20170914.258/git-commit.el @@ -1,6 +1,6 @@ ;;; git-commit.el --- Edit Git commit messages -*- lexical-binding: t; -*- -;; Copyright (C) 2010-2016 The Magit Project Contributors +;; Copyright (C) 2010-2017 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. @@ -11,8 +11,8 @@ ;; Marius Vollmer ;; Maintainer: Jonas Bernoulli -;; Package-Requires: ((emacs "24.4") (dash "20160820.501") (with-editor "20160929.734")) -;; Package-Version: 20161108.1335 +;; Package-Requires: ((emacs "24.4") (dash "20170810") (with-editor "20170817")) +;; Package-Version: 20170914.258 ;; Keywords: git tools vc ;; Homepage: https://github.com/magit/magit @@ -85,7 +85,8 @@ ;; provided by these commands: ;; ;; C-c C-s Insert a Signed-off-by header. -;; C-C C-a Insert a Acked-by header. +;; C-c C-a Insert a Acked-by header. +;; C-c C-m Insert a Modified-by header. ;; C-c C-t Insert a Tested-by header. ;; C-c C-r Insert a Reviewed-by header. ;; C-c C-o Insert a Cc header. @@ -114,6 +115,7 @@ (require 'dash) (require 'log-edit) +(require 'magit-utils nil t) (require 'ring) (require 'server) (require 'with-editor) @@ -134,6 +136,7 @@ (defgroup git-commit nil "Edit Git commit messages." :prefix "git-commit-" + :link '(info-link "(magit)Editing Commit Messages") :group 'tools) ;;;###autoload @@ -163,12 +166,6 @@ The major mode configured here is turned on by the minor mode :type '(choice (function-item text-mode) (const :tag "No major mode"))) -(unless (find-lisp-object-file-name 'git-commit-setup-hook 'defvar) - (add-hook 'git-commit-setup-hook 'with-editor-usage-message) - (add-hook 'git-commit-setup-hook 'git-commit-propertize-diff) - (add-hook 'git-commit-setup-hook 'git-commit-turn-on-auto-fill) - (add-hook 'git-commit-setup-hook 'git-commit-setup-changelog-support) - (add-hook 'git-commit-setup-hook 'git-commit-save-message)) (defcustom git-commit-setup-hook '(git-commit-save-message git-commit-setup-changelog-support @@ -178,11 +175,13 @@ The major mode configured here is turned on by the minor mode "Hook run at the end of `git-commit-setup'." :group 'git-commit :type 'hook + :get (and (featurep 'magit-utils) 'magit-hook-custom-get) :options '(git-commit-save-message git-commit-setup-changelog-support git-commit-turn-on-auto-fill git-commit-turn-on-flyspell git-commit-propertize-diff + bug-reference-mode with-editor-usage-message)) (defcustom git-commit-finish-query-functions @@ -194,7 +193,7 @@ called. If any of them returns nil, then the commit is not performed and the buffer is not killed. The user should then fix the issue and try again. -The functions are called with one argument. If it is non-nil +The functions are called with one argument. If it is non-nil, then that indicates that the user used a prefix argument to force finishing the session despite issues. Functions should usually honor this wish and return non-nil." @@ -204,7 +203,7 @@ usually honor this wish and return non-nil." (defcustom git-commit-style-convention-checks '(non-empty-second-line) "List of checks performed by `git-commit-check-style-conventions'. -Valid members are `non-empty-second-line' and `overlong-first-line'. +Valid members are `non-empty-second-line' and `overlong-summary-line'. That function is a member of `git-commit-finish-query-functions'." :options '(non-empty-second-line overlong-summary-line) :type '(list :convert-widget custom-hook-convert-widget) @@ -239,8 +238,11 @@ already using it, then you probably shouldn't start doing so." :type '(choice (const :tag "use regular fill-column") number)) +(make-obsolete-variable 'git-commit-fill-column 'fill-column + "Magit 2.11.0" 'set) + (defcustom git-commit-known-pseudo-headers - '("Signed-off-by" "Acked-by" "Cc" + '("Signed-off-by" "Acked-by" "Modified-by" "Cc" "Suggested-by" "Reported-by" "Tested-by" "Reviewed-by") "A list of Git pseudo headers to be highlighted." :group 'git-commit @@ -250,7 +252,7 @@ already using it, then you probably shouldn't start doing so." ;;;; Faces (defgroup git-commit-faces nil - "Faces for highlighting Git commit messages." + "Faces used for highlighting Git commit messages." :prefix "git-commit-" :group 'git-commit :group 'faces) @@ -314,23 +316,30 @@ already using it, then you probably shouldn't start doing so." (defvar git-commit-mode-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-s") 'git-commit-signoff) + (cond ((featurep 'jkl) + (define-key map (kbd "M-i") 'git-commit-prev-message) + (define-key map (kbd "M-k") 'git-commit-next-message)) + (t + (define-key map (kbd "M-p") 'git-commit-prev-message) + (define-key map (kbd "M-n") 'git-commit-next-message) + ;; Old bindings to avoid confusion + (define-key map (kbd "C-c C-x a") 'git-commit-ack) + (define-key map (kbd "C-c C-x i") 'git-commit-suggested) + (define-key map (kbd "C-c C-x m") 'git-commit-modified) + (define-key map (kbd "C-c C-x o") 'git-commit-cc) + (define-key map (kbd "C-c C-x p") 'git-commit-reported) + (define-key map (kbd "C-c C-x r") 'git-commit-review) + (define-key map (kbd "C-c C-x s") 'git-commit-signoff) + (define-key map (kbd "C-c C-x t") 'git-commit-test))) (define-key map (kbd "C-c C-a") 'git-commit-ack) - (define-key map (kbd "C-c C-t") 'git-commit-test) - (define-key map (kbd "C-c C-r") 'git-commit-review) + (define-key map (kbd "C-c C-i") 'git-commit-suggested) + (define-key map (kbd "C-c C-m") 'git-commit-modified) (define-key map (kbd "C-c C-o") 'git-commit-cc) (define-key map (kbd "C-c C-p") 'git-commit-reported) - (define-key map (kbd "C-c C-i") 'git-commit-suggested) + (define-key map (kbd "C-c C-r") 'git-commit-review) + (define-key map (kbd "C-c C-s") 'git-commit-signoff) + (define-key map (kbd "C-c C-t") 'git-commit-test) (define-key map (kbd "C-c M-s") 'git-commit-save-message) - (define-key map (kbd "M-p") 'git-commit-prev-message) - (define-key map (kbd "M-n") 'git-commit-next-message) - ;; Old bindings to avoid confusion - (define-key map (kbd "C-c C-x s") 'git-commit-signoff) - (define-key map (kbd "C-c C-x a") 'git-commit-ack) - (define-key map (kbd "C-c C-x t") 'git-commit-test) - (define-key map (kbd "C-c C-x r") 'git-commit-review) - (define-key map (kbd "C-c C-x o") 'git-commit-cc) - (define-key map (kbd "C-c C-x p") 'git-commit-reported) map) "Key map used by `git-commit-mode'.") @@ -347,6 +356,8 @@ already using it, then you probably shouldn't start doing so." :help "Insert an 'Acked-by' header"] ["Sign-Off" git-commit-signoff :active t :help "Insert a 'Signed-off-by' header"] + ["Modified-by" git-commit-modified :active t + :help "Insert a 'Modified-by' header"] ["Tested-by" git-commit-test :active t :help "Insert a 'Tested-by' header"] ["Reviewed-by" git-commit-review :active t @@ -364,9 +375,10 @@ already using it, then you probably shouldn't start doing so." ;;; Hooks +;;;###autoload (defconst git-commit-filename-regexp "/\\(\ \\(\\(COMMIT\\|NOTES\\|PULLREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\ -\\|BRANCH_DESCRIPTION\\)\\'") +\\|\\(BRANCH\\|EDIT\\)_DESCRIPTION\\)\\'") (eval-after-load 'recentf '(add-to-list 'recentf-exclude git-commit-filename-regexp)) @@ -385,6 +397,7 @@ already using it, then you probably shouldn't start doing so." (string-match-p git-commit-filename-regexp buffer-file-name) (git-commit-setup))) +;;;###autoload (defun git-commit-setup () ;; cygwin git will pass a cygwin path (/cygdrive/c/foo/.git/...), ;; try to handle this in window-nt Emacs. @@ -406,7 +419,7 @@ already using it, then you probably shouldn't start doing so." (regexp-quote buffer-file-name) "\\'") git-commit-major-mode)))) - (normal-mode))) + (normal-mode t))) (setq with-editor-show-usage nil) (with-editor-mode 1) (add-hook 'with-editor-finish-query-functions @@ -424,8 +437,7 @@ already using it, then you probably shouldn't start doing so." (setq save-place nil)) (save-excursion (goto-char (point-min)) - (when (= (line-beginning-position) - (line-end-position)) + (when (looking-at "\\`\\(\\'\\|\n[^\n]\\)") (open-line 1))) (run-hooks 'git-commit-setup-hook) (set-buffer-modified-p nil)) @@ -472,6 +484,7 @@ to `git-commit-fill-column'." (when (and (numberp git-commit-fill-column) (not (local-variable-p 'fill-column))) (setq fill-column git-commit-fill-column)) + (setq-local comment-auto-fill-only-comments nil) (turn-on-auto-fill)) (defun git-commit-turn-on-flyspell () @@ -577,6 +590,11 @@ With a numeric prefix ARG, go forward ARG comments." (interactive (git-commit-self-ident)) (git-commit-insert-header "Acked-by" name mail)) +(defun git-commit-modified (name mail) + "Insert a header to signal that you have modified the commit." + (interactive (git-commit-self-ident)) + (git-commit-insert-header "Modified-by" name mail)) + (defun git-commit-review (name mail) "Insert a header acknowledging that you have reviewed the commit." (interactive (git-commit-self-ident)) @@ -669,8 +687,8 @@ Added to `font-lock-extend-region-functions'." (summary-end (match-end 0))) (when (or (< summary-beg font-lock-beg summary-end) (< summary-beg font-lock-end summary-end)) - (setq font-lock-beg (min font-lock-beg summary-beg) - font-lock-end (max font-lock-end summary-end)))))))) + (setq font-lock-beg (min font-lock-beg summary-beg)) + (setq font-lock-end (max font-lock-end summary-end)))))))) (defun git-commit-mode-font-lock-keywords () `(;; Comments @@ -716,7 +734,8 @@ Added to `font-lock-extend-region-functions'." (with-current-buffer buffer (prog1 (buffer-substring-no-properties (point) (point-max)) (delete-region (point) (point-max))))) - (diff-mode) + (let ((diff-default-read-only nil)) + (diff-mode)) (let (font-lock-verbose font-lock-support-mode) (if (fboundp 'font-lock-ensure) (font-lock-ensure) @@ -731,9 +750,5 @@ Added to `font-lock-extend-region-functions'." (get-text-property pos 'face))) (buffer-string))))))) -;;; git-commit.el ends soon (provide 'git-commit) -;; Local Variables: -;; indent-tabs-mode: nil -;; End: ;;; git-commit.el ends here diff --git a/elpa/magit-20171009.1252/magit-pkg.el b/elpa/magit-20171009.1252/magit-pkg.el deleted file mode 100644 index 5fdaaabc..00000000 --- a/elpa/magit-20171009.1252/magit-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(define-package "magit" "20171009.1252" "A Git porcelain inside Emacs" - '((emacs "24.4") - (async "20170823") - (dash "20170810") - (with-editor "20170817") - (git-commit "20170823") - (magit-popup "20170824")) - :url "https://github.com/magit/magit" :keywords - '("git" "tools" "vc")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/magit-20171009.1252/magit.info b/elpa/magit-20171009.1252/magit.info deleted file mode 100644 index b08ff86c..00000000 --- a/elpa/magit-20171009.1252/magit.info +++ /dev/null @@ -1,171 +0,0 @@ -This is magit.info, produced by makeinfo version 5.2 from magit.texi. - - Copyright (C) 2015-2017 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: 301745 - -Tag Table: -(Indirect) -Node: Top752 -Node: Introduction5726 -Node: Installation10449 -Node: Installing from an Elpa Archive10789 -Node: Installing from the Git Repository11892 -Node: Post-Installation Tasks14535 -Node: Getting Started15820 -Node: Interface Concepts21167 -Node: Modes and Buffers21441 -Node: Switching Buffers23186 -Node: Naming Buffers27727 -Node: Quitting Windows30735 -Node: Automatic Refreshing of Magit Buffers32367 -Node: Automatic Saving of File-Visiting Buffers35135 -Node: Automatic Reverting of File-Visiting Buffers36320 -Node: Risk of Reverting Automatically41316 -Node: Sections43699 -Node: Section Movement44640 -Node: Section Visibility48567 -Node: Section Hooks52042 -Node: Section Types and Values54323 -Node: Section Options55593 -Node: Popup Buffers and Prefix Commands56065 -Node: Completion and Confirmation58432 -Node: Running Git61716 -Node: Viewing Git Output61952 -Node: Running Git Manually62952 -Node: Git Executable65354 -Node: Global Git Arguments67636 -Node: Inspecting68442 -Node: Status Buffer69589 -Node: Status Sections72502 -Node: Status Header Sections77017 -Node: Status Module Sections79647 -Node: Status Options82147 -Node: Repository List83901 -Node: Logging86059 -Node: Refreshing Logs88506 -Node: Log Buffer89891 -Node: Log Margin92726 -Node: Select from Log95366 -Node: Reflog97470 -Node: Cherries98987 -Node: Diffing100714 -Node: Refreshing Diffs103661 -Node: Diff Buffer107152 -Node: Diff Options109737 -Node: Revision Buffer113107 -Node: Ediffing114824 -Node: References Buffer118420 -Node: References Sections125719 -Node: Bisecting126580 -Node: Visiting Blobs128318 -Node: Blaming128827 -Node: Manipulating132256 -Node: Repository Setup132572 -Node: Staging and Unstaging133612 -Node: Staging from File-Visiting Buffers137693 -Node: Applying138861 -Node: Committing140754 -Node: Initiating a Commit141337 -Node: Editing Commit Messages144648 -Node: Branching155044 -Node: The Two Remotes155244 -Node: The Branch Popup157861 -Node: The Branch Config Popup168109 -Node: Merging174005 -Node: Resolving Conflicts176172 -Node: Rebasing181174 -Node: Editing Rebase Sequences185231 -Node: Information About In-Progress Rebase188261 -Ref: Information About In-Progress Rebase-Footnote-1195068 -Node: Cherry Picking195654 -Node: Reverting197259 -Node: Resetting198622 -Node: Stashing200039 -Node: Transferring204233 -Node: Remotes204471 -Node: Fetching205749 -Node: Pulling207105 -Node: Pushing207941 -Node: Creating and Sending Patches212675 -Node: Applying Patches213370 -Node: Miscellaneous214367 -Node: Tagging214670 -Node: Notes215454 -Node: Submodules217978 -Node: Listing Submodules218192 -Node: Submodule Popup220069 -Node: Subtree221352 -Node: Common Commands222599 -Node: Wip Modes224344 -Node: Minor Mode for Buffers Visiting Files231140 -Node: Minor Mode for Buffers Visiting Blobs234489 -Node: Customizing235302 -Node: Per-Repository Configuration236974 -Node: Essential Settings238621 -Node: Safety238945 -Node: Performance240710 -Node: Microsoft Windows Performance247570 -Node: MacOS Performance248763 -Ref: MacOS Performance-Footnote-1249999 -Ref: MacOS Performance-Footnote-2250081 -Ref: MacOS Performance-Footnote-3250141 -Node: Plumbing250307 -Node: Calling Git251131 -Node: Getting a Value from Git252654 -Node: Calling Git for Effect255758 -Node: Section Plumbing262276 -Node: Creating Sections262504 -Node: Section Selection266403 -Node: Matching Sections268083 -Node: Refreshing Buffers273515 -Node: Conventions276650 -Node: Confirmation and Completion276827 -Node: Theming Faces277725 -Node: FAQ285876 -Node: FAQ - How to …?286318 -Node: How to show git's output?286682 -Node: How to install the gitman info manual?287436 -Node: How to show diffs for gpg-encrypted files?288406 -Node: How does branching and pushing work?289002 -Node: Can Magit be used as ‘ediff-version-control-package’?289371 -Node: FAQ - Issues and Errors291367 -Node: Magit is slow292111 -Node: I changed several thousand files at once and now Magit is unusable292325 -Node: I am having problems committing293054 -Node: I am using MS Windows and cannot push with Magit293535 -Node: I am using OS X and SOMETHING works in shell but not in Magit294152 -Node: Diffs contain control sequences294958 -Node: Expanding a file to show the diff causes it to disappear296032 -Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer296589 -Node: The mode-line information isn't always up-to-date297641 -Node: Emacs 245 hangs when loading Magit298708 -Node: Debugging Tools299258 -Node: Keystroke Index301745 -Node: Command Index331095 -Node: Function Index361834 -Node: Variable Index375510 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/magit-20171009.1252/AUTHORS.md b/elpa/magit-20171208.618/AUTHORS.md similarity index 98% rename from elpa/magit-20171009.1252/AUTHORS.md rename to elpa/magit-20171208.618/AUTHORS.md index 37be5ec2..f676ae71 100644 --- a/elpa/magit-20171009.1252/AUTHORS.md +++ b/elpa/magit-20171208.618/AUTHORS.md @@ -64,6 +64,7 @@ Contributors - Andriy Kmit' - Andy Sawyer - Barak A. Pearlmutter +- Bar Magal - Bart Bakker - Basil L. Contovounesios - Bastian Beischer @@ -132,6 +133,7 @@ Contributors - Jeff Dairiki - Jeremy Meng - Jesse Alama +- Jim Blandy - Joakim Jalap - Johann Klähn - John Mastro @@ -174,6 +176,7 @@ Contributors - Mark Hepburn - Mark Karpov - Mark Oteiza +- Matthieu Hauglustaine - Matus Goljer - Michael Fogleman - Michael Griffiths diff --git a/elpa/magit-20171009.1252/COPYING b/elpa/magit-20171208.618/COPYING similarity index 100% rename from elpa/magit-20171009.1252/COPYING rename to elpa/magit-20171208.618/COPYING diff --git a/elpa/magit-20171009.1252/dir b/elpa/magit-20171208.618/dir similarity index 100% rename from elpa/magit-20171009.1252/dir rename to elpa/magit-20171208.618/dir diff --git a/elpa/magit-20171009.1252/git-rebase.el b/elpa/magit-20171208.618/git-rebase.el similarity index 100% rename from elpa/magit-20171009.1252/git-rebase.el rename to elpa/magit-20171208.618/git-rebase.el diff --git a/elpa/magit-20171009.1252/magit-apply.el b/elpa/magit-20171208.618/magit-apply.el similarity index 82% rename from elpa/magit-20171009.1252/magit-apply.el rename to elpa/magit-20171208.618/magit-apply.el index 7d5255b9..1a272f62 100644 --- a/elpa/magit-20171009.1252/magit-apply.el +++ b/elpa/magit-20171208.618/magit-apply.el @@ -36,6 +36,7 @@ ;; For `magit-apply' (declare-function magit-am-popup 'magit-sequence) +(declare-function magit-patch-apply-popup 'magit-files) ;; For `magit-discard-files' (declare-function magit-checkout-stage 'magit) (declare-function magit-checkout-read-stage 'magit) @@ -43,6 +44,9 @@ ;; For `magit-stage-untracked' (declare-function magit-submodule-add 'magit-submodule) (declare-function magit-submodule-read-name-for-path 'magit-submodule) +(declare-function borg--maybe-absorb-gitdir 'borg) +(declare-function borg--sort-submodule-sections 'borg) +(defvar borg-user-emacs-directory) (require 'dired) @@ -104,6 +108,7 @@ so causes the change to be applied to the index as well." (`(,_ region) (magit-apply-region it args)) (`(,_ hunk) (magit-apply-hunk it args)) (`(,_ hunks) (magit-apply-hunks it args)) + (`(rebase-sequence file) (magit-patch-apply-popup)) (`(,_ file) (magit-apply-diff it args)) (`(,_ files) (magit-apply-diffs it args))))) @@ -175,7 +180,7 @@ so causes the change to be applied to the index as well." (magit-refresh)))) (defun magit-apply--get-selection () - (or (magit-region-sections 'hunk 'file) + (or (magit-region-sections '(hunk file) t) (let ((section (magit-current-section))) (pcase (magit-section-type section) ((or `hunk `file) section) @@ -194,6 +199,17 @@ so causes the change to be applied to the index as well." sections)) (t sections))) +(defun magit-apply--diff-ignores-whitespace-p () + (and (cl-intersection (if (derived-mode-p 'magit-diff-mode) + (nth 2 magit-refresh-args) + magit-diff-section-arguments) + '("--ignore-space-at-eol" + "--ignore-space-change" + "--ignore-all-space" + "--ignore-blank-lines") + :test #'equal) + t)) + ;;;; Stage (defun magit-stage (&optional intent) @@ -202,17 +218,22 @@ With a prefix argument, INTENT, and an untracked file (or files) at point, stage the file but not its content." (interactive "P") (--if-let (and (derived-mode-p 'magit-mode) (magit-apply--get-selection)) - (pcase (list (magit-diff-type) (magit-diff-scope)) - (`(untracked ,_) (magit-stage-untracked intent)) - (`(unstaged region) (magit-apply-region it "--cached")) - (`(unstaged hunk) (magit-apply-hunk it "--cached")) - (`(unstaged hunks) (magit-apply-hunks it "--cached")) - (`(unstaged file) (magit-stage-1 "-u" (list (magit-section-value it)))) - (`(unstaged files) (magit-stage-1 "-u" (magit-region-values))) - (`(unstaged list) (magit-stage-1 "-u")) - (`(staged ,_) (user-error "Already staged")) - (`(committed ,_) (user-error "Cannot stage committed changes")) - (`(undefined ,_) (user-error "Cannot stage this change"))) + (pcase (list (magit-diff-type) + (magit-diff-scope) + (magit-apply--diff-ignores-whitespace-p)) + (`(untracked ,_ ,_) (magit-stage-untracked intent)) + (`(unstaged region ,_) (magit-apply-region it "--cached")) + (`(unstaged hunk ,_) (magit-apply-hunk it "--cached")) + (`(unstaged hunks ,_) (magit-apply-hunks it "--cached")) + (`(unstaged file t) (magit-apply-diff it "--cached")) + (`(unstaged files t) (magit-apply-diffs it "--cached")) + (`(unstaged list t) (magit-apply-diffs it "--cached")) + (`(unstaged file nil) (magit-stage-1 "-u" (list (magit-section-value it)))) + (`(unstaged files nil) (magit-stage-1 "-u" (magit-region-values nil t))) + (`(unstaged list nil) (magit-stage-modified)) + (`(staged ,_ ,_) (user-error "Already staged")) + (`(committed ,_ ,_) (user-error "Cannot stage committed changes")) + (`(undefined ,_ ,_) (user-error "Cannot stage this change"))) (call-interactively 'magit-stage-file))) ;;;###autoload @@ -240,12 +261,11 @@ requiring confirmation." Stage all new content of tracked files and remove tracked files that no longer exist in the working tree from the index also. With a prefix argument also stage previously untracked (but not -ignored) files. -\('git add --update|--all .')." - (interactive (progn (unless (or (not (magit-anything-staged-p)) - (magit-confirm 'stage-all-changes)) - (user-error "Abort")) - (list current-prefix-arg))) +ignored) files." + (interactive "P") + (when (magit-anything-staged-p) + (unless (magit-confirm 'stage-all-changes) + (user-error "Abort"))) (magit-with-toplevel (magit-stage-1 (if all "--all" "-u")))) @@ -260,7 +280,7 @@ ignored) files. (let* ((section (magit-current-section)) (files (pcase (magit-diff-scope) (`file (list (magit-section-value section))) - (`files (magit-region-values)) + (`files (magit-region-values nil t)) (`list (magit-untracked-files)))) plain repos) (dolist (file files) @@ -279,13 +299,29 @@ ignored) files. (goto-char (magit-section-start (magit-get-section `((file . ,repo) (untracked) (status))))) - (magit-submodule-add - (let ((default-directory - (file-name-as-directory (expand-file-name repo)))) - (or (magit-get "remote" (or (magit-get-remote) "origin") "url") - (concat (file-name-as-directory ".") repo))) - repo - (magit-submodule-read-name-for-path repo)))) + (let* ((topdir (magit-toplevel)) + (package + (and (equal (bound-and-true-p borg-user-emacs-directory) + topdir) + (file-name-nondirectory (directory-file-name repo))))) + (magit-submodule-add + (let ((default-directory + (file-name-as-directory (expand-file-name repo)))) + (or (magit-get "remote" (magit-get-some-remote) "url") + (concat (file-name-as-directory ".") repo))) + repo + (magit-submodule-read-name-for-path repo package)) + (when package + (borg--sort-submodule-sections + (expand-file-name ".gitmodules" topdir)) + (let ((default-directory borg-user-emacs-directory)) + (borg--maybe-absorb-gitdir package)) + (when (and (y-or-n-p + (format "Also build and activate `%s' drone?" package)) + (fboundp 'borg-build) + (fboundp 'borg-activate)) + (borg-build package) + (borg-activate package)))))) (magit-wip-commit-after-apply files " after stage"))) ;;;; Unstage @@ -294,19 +330,24 @@ ignored) files. "Remove the change at point from the staging area." (interactive) (--when-let (magit-apply--get-selection) - (pcase (list (magit-diff-type) (magit-diff-scope)) - (`(untracked ,_) (user-error "Cannot unstage untracked changes")) - (`(unstaged ,_) (user-error "Already unstaged")) - (`(staged region) (magit-apply-region it "--reverse" "--cached")) - (`(staged hunk) (magit-apply-hunk it "--reverse" "--cached")) - (`(staged hunks) (magit-apply-hunks it "--reverse" "--cached")) - (`(staged file) (magit-unstage-1 (list (magit-section-value it)))) - (`(staged files) (magit-unstage-1 (magit-region-values))) - (`(staged list) (magit-unstage-all)) - (`(committed ,_) (if magit-unstage-committed - (magit-reverse-in-index) - (user-error "Cannot unstage committed changes"))) - (`(undefined ,_) (user-error "Cannot unstage this change"))))) + (pcase (list (magit-diff-type) + (magit-diff-scope) + (magit-apply--diff-ignores-whitespace-p)) + (`(untracked ,_ ,_) (user-error "Cannot unstage untracked changes")) + (`(unstaged ,_ ,_) (user-error "Already unstaged")) + (`(staged region ,_) (magit-apply-region it "--reverse" "--cached")) + (`(staged hunk ,_) (magit-apply-hunk it "--reverse" "--cached")) + (`(staged hunks ,_) (magit-apply-hunks it "--reverse" "--cached")) + (`(staged file t) (magit-apply-diff it "--reverse" "--cached")) + (`(staged files t) (magit-apply-diffs it "--reverse" "--cached")) + (`(staged list t) (magit-apply-diffs it "--reverse" "--cached")) + (`(staged file nil) (magit-unstage-1 (list (magit-section-value it)))) + (`(staged files nil) (magit-unstage-1 (magit-region-values nil t))) + (`(staged list nil) (magit-unstage-all)) + (`(committed ,_ ,_) (if magit-unstage-committed + (magit-reverse-in-index) + (user-error "Cannot unstage committed changes"))) + (`(undefined ,_ ,_) (user-error "Cannot unstage this change"))))) ;;;###autoload (defun magit-unstage-file (file) @@ -337,12 +378,13 @@ without requiring confirmation." (defun magit-unstage-all () "Remove all changes from the staging area." (interactive) - (when (or (and (not (magit-anything-unstaged-p)) - (not (magit-untracked-files))) - (magit-confirm 'unstage-all-changes)) - (magit-wip-commit-before-change nil " before unstage") - (magit-run-git "reset" "HEAD" "--") - (magit-wip-commit-after-apply nil " after unstage"))) + (when (or (magit-anything-unstaged-p) + (magit-untracked-files)) + (unless (magit-confirm 'unstage-all-changes) + (user-error "Abort"))) + (magit-wip-commit-before-change nil " before unstage") + (magit-run-git "reset" "HEAD" "--") + (magit-wip-commit-after-apply nil " after unstage")) ;;;; Discard @@ -460,8 +502,9 @@ without requiring confirmation." (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash)) (dolist (file files) (if (memq (magit-diff-type) '(unstaged untracked)) - (dired-delete-file file dired-recursive-deletes - magit-delete-by-moving-to-trash) + (progn (dired-delete-file file dired-recursive-deletes + magit-delete-by-moving-to-trash) + (dired-clean-up-after-deletion file)) (pcase (nth 3 (assoc file status)) (? (delete-file file t) (magit-call-git "rm" "--cached" "--" file)) diff --git a/elpa/magit-20171009.1252/magit-autoloads.el b/elpa/magit-20171208.618/magit-autoloads.el similarity index 92% rename from elpa/magit-20171009.1252/magit-autoloads.el rename to elpa/magit-20171208.618/magit-autoloads.el index a763a273..6de1876e 100644 --- a/elpa/magit-20171009.1252/magit-autoloads.el +++ b/elpa/magit-20171208.618/magit-autoloads.el @@ -3,8 +3,8 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "git-rebase" "git-rebase.el" (23004 52629 0 -;;;;;; 0)) +;;;### (autoloads nil "git-rebase" "git-rebase.el" (23082 53692 36198 +;;;;;; 378000)) ;;; Generated autoloads from git-rebase.el (autoload 'git-rebase-mode "git-rebase" "\ @@ -23,7 +23,7 @@ running 'man git-rebase' at the command line) for details. ;;;*** -;;;### (autoloads nil "magit" "magit.el" (23004 52629 0 0)) +;;;### (autoloads nil "magit" "magit.el" (23082 53692 83927 528000)) ;;; Generated autoloads from magit.el (autoload 'magit-merge-popup "magit" nil t) @@ -131,7 +131,7 @@ defaulting to the tag at point. (autoload 'magit-run-popup "magit" nil t) (autoload 'magit-git-command "magit" "\ -Execute COMMAND asynchonously; display output. +Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. \"git \" is used as initial input, but can be deleted to run another command. @@ -142,7 +142,7 @@ of the current working tree, otherwise in `default-directory'. \(fn COMMAND)" t nil) (autoload 'magit-git-command-topdir "magit" "\ -Execute COMMAND asynchonously; display output. +Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. \"git \" is used as initial input, but can be deleted to run another command. @@ -153,7 +153,7 @@ working tree. \(fn COMMAND)" t nil) (autoload 'magit-shell-command "magit" "\ -Execute COMMAND asynchonously; display output. +Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. With a prefix argument COMMAND is run in the top-level directory of @@ -162,7 +162,7 @@ the current working tree, otherwise in `default-directory'. \(fn COMMAND)" t nil) (autoload 'magit-shell-command-topdir "magit" "\ -Execute COMMAND asynchonously; display output. +Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. COMMAND is run in the top-level directory of the current working tree. @@ -180,8 +180,8 @@ and Emacs to it. ;;;*** -;;;### (autoloads nil "magit-apply" "magit-apply.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-apply" "magit-apply.el" (23082 53692 +;;;;;; 51178 368000)) ;;; Generated autoloads from magit-apply.el (autoload 'magit-stage-file "magit-apply" "\ @@ -198,7 +198,6 @@ Stage all new content of tracked files and remove tracked files that no longer exist in the working tree from the index also. With a prefix argument also stage previously untracked (but not ignored) files. -\('git add --update|--all .'). \(fn &optional ALL)" t nil) @@ -217,8 +216,8 @@ Remove all changes from the staging area. ;;;*** -;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (23004 -;;;;;; 52629 0 0)) +;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (23082 +;;;;;; 53692 18681 289000)) ;;; Generated autoloads from magit-autorevert.el (defvar magit-revert-buffers t) @@ -247,8 +246,8 @@ See `auto-revert-mode' for more information on Auto-Revert mode. ;;;*** -;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (23082 53692 +;;;;;; 49057 714000)) ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect-popup "magit-bisect" nil t) @@ -299,13 +298,18 @@ bisect run'. ;;;*** -;;;### (autoloads nil "magit-blame" "magit-blame.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-blame" "magit-blame.el" (23082 53692 +;;;;;; 78549 426000)) ;;; 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. + +\(fn REVISION FILE &optional ARGS)" t nil) + (autoload 'magit-blame "magit-blame" "\ -Display edit history of FILE up to REVISION. +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 @@ -324,8 +328,8 @@ only arguments available from `magit-blame-popup' should be used. ;;;*** -;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (23004 -;;;;;; 52629 0 0)) +;;;### (autoloads nil "magit-bookmark" "magit-bookmark.el" (23082 +;;;;;; 53692 40396 483000)) ;;; Generated autoloads from magit-bookmark.el (autoload 'magit-bookmark--status-jump "magit-bookmark" "\ @@ -430,8 +434,8 @@ Create a Magit submodule list bookmark. ;;;*** -;;;### (autoloads nil "magit-branch" "magit-branch.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-branch" "magit-branch.el" (23082 53692 +;;;;;; 47134 909000)) ;;; Generated autoloads from magit-branch.el (autoload 'magit-branch-popup "magit" nil t) @@ -474,6 +478,32 @@ does. \(fn ARG &optional START-POINT)" t nil) +(autoload 'magit-branch-checkout "magit-branch" "\ +Checkout an existing or new local branch. + +Read a branch name from the user offering all local branches and +a subset of remote branches as candidates. Omit remote branches +for which a local branch by the same name exists from the list +of candidates. The user can also enter a completely new branch +name. + +- If the user selects an existing local branch, then check that + out. + +- If the user selects a remote branch, then create and checkout + a new local branch with the same name. Configure the selected + remote branch as push target. + +- If the user enters a new branch name, then create and check + that out, after also reading the starting-point from the user. + +In the latter two cases the upstream is also set. Whether it is +set to the chosen START-POINT or something else depends on the +value of `magit-branch-adjust-remote-upstream-alist', just like +when using `magit-branch-and-checkout'. + +\(fn BRANCH &optional START-POINT)" t nil) + (autoload 'magit-branch-orphan "magit-branch" "\ Create and checkout an orphan BRANCH with contents from revision START-POINT. @@ -481,6 +511,12 @@ Create and checkout an orphan BRANCH with contents from revision START-POINT. \(fn BRANCH START-POINT &optional ARGS)" t nil) +(autoload 'magit-branch-pull-request "magit-branch" "\ +Create and configure a new branch from a pull-request. +Please see the manual for more information. + +\(fn PR)" t nil) + (autoload 'magit-branch-spinoff "magit-branch" "\ Create new branch from the unpushed commits. @@ -504,8 +540,7 @@ to `FROM~', instead of to the last commit it shares with its upstream. Interactively, FROM is only ever non-nil, if the region selects some commits, and among those commits, FROM is the commit that is the fewest commits ahead of the source -branch. (It not yet possible to spin off a single commit, -unless it is the only unpushed commit. See #2920.) +branch. The commit at the other end of the selection actually does not matter, all commits between FROM and `HEAD' are moved to the new @@ -673,8 +708,22 @@ When `never' (the default) then the variable is never set. ;;;*** -;;;### (autoloads nil "magit-commit" "magit-commit.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-collab" "magit-collab.el" (23082 53692 +;;;;;; 71951 977000)) +;;; Generated autoloads from magit-collab.el + +(autoload 'magit-browse-pull-request "magit-collab" "\ +Visit pull-request PR using `browse-url'. + +Currently this only supports Github, but that restriction will +be lifted eventually to support other Git forges. + +\(fn PR)" t nil) + +;;;*** + +;;;### (autoloads nil "magit-commit" "magit-commit.el" (23082 53692 +;;;;;; 20776 989000)) ;;; Generated autoloads from magit-commit.el (autoload 'magit-commit "magit-commit" "\ @@ -756,8 +805,8 @@ Create a squash commit targeting COMMIT and instantly rebase. ;;;*** -;;;### (autoloads nil "magit-diff" "magit-diff.el" (23004 52629 0 -;;;;;; 0)) +;;;### (autoloads nil "magit-diff" "magit-diff.el" (23082 53692 76505 +;;;;;; 484000)) ;;; Generated autoloads from magit-diff.el (autoload 'magit-diff-popup "magit-diff" "\ @@ -820,7 +869,7 @@ While amending, invoking the command again toggles between showing just the new changes or all the changes that will be committed. -\(fn &optional ARGS FILES)" t nil) +\(fn &optional ARGS)" t nil) (autoload 'magit-diff-buffer-file "magit-diff" "\ Show diff for the blob or file visited in the current buffer. @@ -841,8 +890,8 @@ for a revision. ;;;*** -;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (23082 53692 +;;;;;; 64397 875000)) ;;; Generated autoloads from magit-ediff.el (autoload 'magit-ediff-popup "magit-ediff" nil t) @@ -930,8 +979,8 @@ stash that were staged. ;;;*** -;;;### (autoloads nil "magit-extras" "magit-extras.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-extras" "magit-extras.el" (23082 53692 +;;;;;; 22553 552000)) ;;; Generated autoloads from magit-extras.el (autoload 'magit-run-git-gui "magit-extras" "\ @@ -989,6 +1038,11 @@ is no file at point, then instead visit `default-directory'. \(fn &optional OTHER-WINDOW)" t nil) +(autoload 'magit-dired-log "magit-extras" "\ +Show log for all marked files, or the current file. + +\(fn &optional FOLLOW)" t nil) + (autoload 'magit-do-async-shell-command "magit-extras" "\ Open FILE with `dired-do-async-shell-command'. Interactively, open the file at point. @@ -1070,8 +1124,8 @@ patch application, a cherry-pick, a revert, or a bisect. ;;;*** -;;;### (autoloads nil "magit-files" "magit-files.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-files" "magit-files.el" (23082 53692 +;;;;;; 38359 350000)) ;;; Generated autoloads from magit-files.el (autoload 'magit-find-file "magit-files" "\ @@ -1118,8 +1172,8 @@ Checkout FILE from REV. ;;;*** -;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-imenu" "magit-imenu.el" (23082 53692 +;;;;;; 62457 142000)) ;;; Generated autoloads from magit-imenu.el (autoload 'magit-imenu--log-prev-index-position-function "magit-imenu" "\ @@ -1235,7 +1289,8 @@ beginning of the line. ;;;*** -;;;### (autoloads nil "magit-log" "magit-log.el" (23004 52629 0 0)) +;;;### (autoloads nil "magit-log" "magit-log.el" (23082 53692 66383 +;;;;;; 653000)) ;;; Generated autoloads from magit-log.el (autoload 'magit-log-buffer-file-popup "magit-log" "\ @@ -1318,15 +1373,15 @@ Show commits in a branch that are not merged in the upstream branch. ;;;*** -;;;### (autoloads nil "magit-notes" "magit-notes.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-notes" "magit-notes.el" (23082 53692 +;;;;;; 103906 740000)) ;;; Generated autoloads from magit-notes.el (autoload 'magit-notes-popup "magit" nil t) ;;;*** -;;;### (autoloads nil "magit-refs" "magit-refs.el" (23004 52629 0 -;;;;;; 0)) +;;;### (autoloads nil "magit-refs" "magit-refs.el" (23082 53692 24647 +;;;;;; 722000)) ;;; Generated autoloads from magit-refs.el (autoload 'magit-show-refs-popup "magit-refs" "\ @@ -1355,8 +1410,8 @@ Refs are compared with a branch read from the user. ;;;*** -;;;### (autoloads nil "magit-remote" "magit-remote.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-remote" "magit-remote.el" (23082 53692 +;;;;;; 91439 142000)) ;;; Generated autoloads from magit-remote.el (autoload 'magit-clone "magit-remote" "\ @@ -1376,11 +1431,6 @@ Rename the remote named OLD to NEW. \(fn OLD NEW)" t nil) -(autoload 'magit-remote-set-url "magit-remote" "\ -Change the url of the remote named REMOTE to URL. - -\(fn REMOTE URL)" t nil) - (autoload 'magit-remote-remove "magit-remote" "\ Delete the remote named REMOTE. @@ -1399,6 +1449,11 @@ doing that. Unset the local representation of REMOTE's default branch. Delete the symbolic-ref \"refs/remotes//HEAD\". +\(fn REMOTE)" t nil) + +(autoload 'magit-remote-config-popup "magit-remote" "\ +Popup console for setting remote variables. + \(fn REMOTE)" t nil) (autoload 'magit-fetch-popup "magit-remote" nil t) @@ -1588,8 +1643,8 @@ is asked to pull. START has to be reachable from that commit. ;;;*** -;;;### (autoloads nil "magit-repos" "magit-repos.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-repos" "magit-repos.el" (23082 53692 +;;;;;; 73874 448000)) ;;; Generated autoloads from magit-repos.el (autoload 'magit-list-repositories "magit-repos" "\ @@ -1603,8 +1658,8 @@ control which repositories are displayed. ;;;*** -;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (23004 -;;;;;; 52629 0 0)) +;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (23082 +;;;;;; 53692 87623 716000)) ;;; Generated autoloads from magit-sequence.el (autoload 'magit-sequencer-continue "magit-sequence" "\ @@ -1625,20 +1680,20 @@ This discards all changes made since the sequence started. (autoload 'magit-cherry-pick-popup "magit-sequence" nil t) (autoload 'magit-cherry-pick "magit-sequence" "\ -Cherry-pick COMMIT. +Copy COMMITS from another branch onto the current branch. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then pick all of them, without prompting. -\(fn COMMIT &optional ARGS)" t nil) +\(fn COMMITS &optional ARGS)" t nil) (autoload 'magit-cherry-apply "magit-sequence" "\ -Apply the changes in COMMIT but do not commit them. +Apply the changes in COMMITS but do not commit them. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then apply all of them, without prompting. -\(fn COMMIT &optional ARGS)" t nil) +\(fn COMMITS &optional ARGS)" t nil) (autoload 'magit-revert-popup "magit-sequence" nil t) (autoload 'magit-revert "magit-sequence" "\ @@ -1730,6 +1785,11 @@ Reword a single older commit using rebase. \(fn COMMIT ARGS)" t nil) +(autoload 'magit-rebase-remove-commit "magit-sequence" "\ +Remove a single older commit using rebase. + +\(fn COMMIT ARGS)" t nil) + (autoload 'magit-rebase-continue "magit-sequence" "\ Restart the current rebasing operation. In some cases this pops up a commit message buffer for you do @@ -1754,8 +1814,8 @@ Abort the current rebase operation, restoring the original branch. ;;;*** -;;;### (autoloads nil "magit-stash" "magit-stash.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-stash" "magit-stash.el" (23082 53692 +;;;;;; 58503 959000)) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash-popup "magit-stash" nil t) @@ -1837,6 +1897,13 @@ Create and checkout a new BRANCH from STASH. \(fn STASH BRANCH)" t nil) +(autoload 'magit-stash-branch-here "magit-stash" "\ +Create and checkout a new BRANCH and apply STASH. +The branch is created using `magit-branch', using the current +branch or `HEAD' as the string-point. + +\(fn STASH BRANCH)" t nil) + (autoload 'magit-stash-format-patch "magit-stash" "\ Create a patch from STASH @@ -1854,8 +1921,8 @@ Show all diffs of a stash in a buffer. ;;;*** -;;;### (autoloads nil "magit-status" "magit-status.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-status" "magit-status.el" (23082 53692 +;;;;;; 68460 554000)) ;;; Generated autoloads from magit-status.el (autoload 'magit-init "magit-status" "\ @@ -1886,8 +1953,8 @@ then offer to initialize it as a new repository. ;;;*** -;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (23004 -;;;;;; 52629 0 0)) +;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (23082 +;;;;;; 53692 106239 18000)) ;;; Generated autoloads from magit-submodule.el (autoload 'magit-submodule-popup "magit-submodule" nil t) @@ -1906,7 +1973,7 @@ PATH also becomes the name. (autoload 'magit-submodule-read-name-for-path "magit-submodule" "\ -\(fn PATH)" nil nil) +\(fn PATH &optional PREFER-SHORT)" nil nil) (autoload 'magit-submodule-setup "magit-submodule" "\ Clone and register missing submodules and checkout appropriate commits. @@ -1931,7 +1998,11 @@ Update each submodule's remote URL according to \".gitmodules\". (autoload 'magit-submodule-fetch "magit-submodule" "\ Fetch all submodules. -With a prefix argument fetch all remotes. + +Option `magit-submodule-fetch-jobs' controls how many submodules +are being fetched in parallel. Also fetch the super-repository, +because `git-fetch' does not support not doing that. With a +prefix argument fetch all remotes. \(fn &optional ALL)" t nil) @@ -1943,7 +2014,7 @@ Unregister the submodule at PATH. (autoload 'magit-insert-modules "magit-submodule" "\ Insert submodule sections. Hook `magit-module-sections-hook' controls which module sections -are inserted, and option `magit-insert-modules-nested' controls +are inserted, and option `magit-module-sections-nested' controls whether they are wrapped in an additional section. \(fn)" nil nil) @@ -1986,8 +2057,8 @@ Display a list of the current repository's submodules. ;;;*** -;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (23082 53692 +;;;;;; 42534 163000)) ;;; Generated autoloads from magit-subtree.el (autoload 'magit-subtree-popup "magit-subtree" nil t) @@ -2023,8 +2094,8 @@ Extract the history of the subtree PREFIX. ;;;*** -;;;### (autoloads nil "magit-utils" "magit-utils.el" (23004 52629 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-utils" "magit-utils.el" (23082 53692 +;;;;;; 17247 178000)) ;;; Generated autoloads from magit-utils.el (autoload 'magit-emacs-Q-command "magit-utils" "\ @@ -2049,7 +2120,8 @@ See info node `(magit)Debugging Tools' for more information. ;;;*** -;;;### (autoloads nil "magit-wip" "magit-wip.el" (23004 52629 0 0)) +;;;### (autoloads nil "magit-wip" "magit-wip.el" (23082 53692 28660 +;;;;;; 836000)) ;;; Generated autoloads from magit-wip.el (defvar magit-wip-after-save-mode nil "\ @@ -2117,9 +2189,10 @@ command which is about to be called are committed. ;;;*** -;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (23004 -;;;;;; 52629 0 0)) +;;;### (autoloads nil "magit-worktree" "magit-worktree.el" (23082 +;;;;;; 53692 95657 229000)) ;;; Generated autoloads from magit-worktree.el + (autoload 'magit-worktree-popup "magit-worktree" nil t) (autoload 'magit-worktree-checkout "magit-worktree" "\ Checkout BRANCH in a new worktree at PATH. @@ -2135,7 +2208,7 @@ Create a new BRANCH and check it out in a new worktree at PATH. ;;;### (autoloads nil nil ("magit-core.el" "magit-git.el" "magit-margin.el" ;;;;;; "magit-mode.el" "magit-obsolete.el" "magit-pkg.el" "magit-process.el" -;;;;;; "magit-section.el") (23004 52629 0 0)) +;;;;;; "magit-section.el") (23082 53692 93769 903000)) ;;;*** diff --git a/elpa/magit-20171009.1252/magit-autorevert.el b/elpa/magit-20171208.618/magit-autorevert.el similarity index 100% rename from elpa/magit-20171009.1252/magit-autorevert.el rename to elpa/magit-20171208.618/magit-autorevert.el diff --git a/elpa/magit-20171009.1252/magit-bisect.el b/elpa/magit-20171208.618/magit-bisect.el similarity index 100% rename from elpa/magit-20171009.1252/magit-bisect.el rename to elpa/magit-20171208.618/magit-bisect.el diff --git a/elpa/magit-20171009.1252/magit-blame.el b/elpa/magit-20171208.618/magit-blame.el similarity index 88% rename from elpa/magit-20171009.1252/magit-blame.el rename to elpa/magit-20171208.618/magit-blame.el index d2e32c7c..e9668da4 100644 --- a/elpa/magit-20171009.1252/magit-blame.el +++ b/elpa/magit-20171208.618/magit-blame.el @@ -125,14 +125,19 @@ and then turned on again when turning off the latter." (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 "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-popup) + (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) @@ -156,6 +161,7 @@ and then turned on again when turning off the latter." (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 @@ -206,15 +212,47 @@ and then turned on again when turning off the latter." (?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 "Blame" magit-blame)) + :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) - "Display edit history of FILE up to REVISION. + "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 @@ -229,18 +267,7 @@ 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 - (let ((args (magit-blame-arguments))) - (if magit-blame-mode - (--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")))))) + (interactive (magit-blame-arguments* nil)) (let ((toplevel (or (magit-toplevel) (user-error "Not in git repository")))) (let ((default-directory toplevel)) @@ -250,13 +277,17 @@ only arguments available from `magit-blame-popup' should be used. (progn (switch-to-buffer it) (save-buffer)) (find-file file)))) - (let ((default-directory toplevel)) + (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))) - (unless magit-blame-mode + (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) @@ -436,6 +467,7 @@ This is intended for debugging purposes.") 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))) @@ -502,8 +534,8 @@ then also kill the buffer." (defun magit-blame-copy-hash () "Save hash of the current chunk's commit to the kill ring. -When the region is active, then save that to the `kill-ring', -like `kill-ring-save' would." +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) diff --git a/elpa/magit-20171009.1252/magit-bookmark.el b/elpa/magit-20171208.618/magit-bookmark.el similarity index 100% rename from elpa/magit-20171009.1252/magit-bookmark.el rename to elpa/magit-20171208.618/magit-bookmark.el diff --git a/elpa/magit-20171009.1252/magit-branch.el b/elpa/magit-20171208.618/magit-branch.el similarity index 72% rename from elpa/magit-20171009.1252/magit-branch.el rename to elpa/magit-20171208.618/magit-branch.el index 02888560..274aa4e1 100644 --- a/elpa/magit-20171009.1252/magit-branch.el +++ b/elpa/magit-20171208.618/magit-branch.el @@ -32,6 +32,7 @@ ;;; Code: (require 'magit) +(require 'magit-collab) ;;; Options @@ -135,7 +136,11 @@ 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/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. +However, I recommend that you use local branches as UPSTREAM." :package-version '(magit . "2.9.0") :group 'magit-commands :type '(repeat (cons (string :tag "Use upstream") @@ -156,35 +161,38 @@ and change branch related variables." ;;; Branch Popup +(defvar magit-branch-config-variables) + ;;;###autoload (autoload 'magit-branch-popup "magit" nil t) (magit-define-popup magit-branch-popup "Popup console for branch commands." :man-page "git-branch" - :actions '((?b "Checkout" magit-checkout) - (?n "Create new branch" magit-branch) + :variables (lambda () + (and magit-branch-popup-show-variables + magit-branch-config-variables)) + :actions '((?b "Checkout" magit-checkout) nil (?C "Configure..." magit-branch-config-popup) - (?c "Checkout new branch" magit-branch-and-checkout) + (?l "Checkout local branch" magit-branch-checkout) (?s "Create new spin-off" magit-branch-spinoff) (?m "Rename" magit-branch-rename) + (?c "Checkout new branch" magit-branch-and-checkout) + (?n "Create new branch" magit-branch) + (?x "Reset" magit-branch-reset) + (?r "Checkout pull-request" magit-checkout-pull-request) + (?R "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) - (?x "Reset" magit-branch-reset) nil nil - (?k "Delete" magit-branch-delete)) + (?W "Create new worktree" magit-worktree-branch)) :default-action 'magit-checkout :max-action-columns 3 :setup-function 'magit-branch-popup-setup) -(defvar magit-branch-config-variables) - (defun magit-branch-popup-setup (val def) (magit-popup-default-setup val def) - (when magit-branch-popup-show-variables - (magit-popup-put :variables (magit-popup-convert-variables - val magit-branch-config-variables)) - (use-local-map (copy-keymap magit-popup-mode-map)) - (dolist (ev (-filter #'magit-popup-event-p (magit-popup-get :variables))) - (local-set-key (vector (magit-popup-event-key ev)) - 'magit-invoke-popup-action)))) + (use-local-map (copy-keymap magit-popup-mode-map)) + (dolist (ev (-filter #'magit-popup-event-p (magit-popup-get :variables))) + (local-set-key (vector (magit-popup-event-key ev)) + 'magit-invoke-popup-action))) ;;; Branch Commands @@ -237,13 +245,73 @@ does." (let ((arg (magit-read-other-branch-or-commit "Checkout"))) (list arg (and (not (magit-rev-verify-commit arg)) - (magit-read-starting-point - (format "Create and checkout branch `%s' starting at" arg)))))) + (magit-read-starting-point "Create and checkout branch" arg))))) (when (string-match "\\`heads/\\(.+\\)" arg) (setq arg (match-string 1 arg))) (if start-point (magit-branch-and-checkout arg start-point (magit-branch-arguments)) - (magit-run-git "checkout" arg))) + (magit-checkout arg))) + +;;;###autoload +(defun magit-branch-checkout (branch &optional start-point) + "Checkout an existing or new local branch. + +Read a branch name from the user offering all local branches and +a subset of remote branches as candidates. Omit remote branches +for which a local branch by the same name exists from the list +of candidates. The user can also enter a completely new branch +name. + +- If the user selects an existing local branch, then check that + out. + +- If the user selects a remote branch, then create and checkout + a new local branch with the same name. Configure the selected + remote branch as push target. + +- If the user enters a new branch name, then create and check + that out, after also reading the starting-point from the user. + +In the latter two cases the upstream is also set. Whether it is +set to the chosen START-POINT or something else depends on the +value of `magit-branch-adjust-remote-upstream-alist', just like +when using `magit-branch-and-checkout'." + (interactive + (let* ((current (magit-get-current-branch)) + (local (magit-list-local-branch-names)) + (remote (--filter (and (string-match "[^/]+/" it) + (not (member (substring it (match-end 0)) + (cons "HEAD" local)))) + (magit-list-remote-branch-names))) + (choices (nconc (delete current local) remote)) + (atpoint (magit-branch-at-point)) + (choice (magit-completing-read + "Checkout branch" choices + nil nil nil 'magit-revision-history + (or (car (member atpoint choices)) + (and atpoint + (car (member (and (string-match "[^/]+/" atpoint) + (substring atpoint (match-end 0))) + choices))))))) + (cond ((member choice remote) + (list (and (string-match "[^/]+/" choice) + (substring choice (match-end 0))) + choice)) + ((member choice local) + (list choice)) + (t + (list choice (magit-read-starting-point "Create" choice)))))) + (if (not start-point) + (magit-checkout branch) + (when (magit-anything-modified-p) + (user-error "Cannot checkout when there are uncommitted changes")) + (magit-branch-and-checkout branch start-point (magit-branch-arguments)) + (when (magit-remote-branch-p start-point) + (pcase-let ((`(,remote . ,remote-branch) + (magit-split-branch-name start-point))) + (when (and (equal branch remote-branch) + (not (equal remote (magit-get "remote.pushDefault")))) + (magit-set remote "branch" branch "pushRemote")))))) (defun magit-branch-maybe-adjust-upstream (branch start-point) (--when-let @@ -264,20 +332,88 @@ does." (interactive (magit-branch-read-args "Create and checkout orphan branch")) (magit-run-git "checkout" "--orphan" args branch start-point)) +;;;###autoload +(defun magit-branch-pull-request (pr) + "Create and configure a new branch from a pull-request. +Please see the manual for more information." + (interactive (list (magit-read-pull-request "Branch pull request"))) + (let-alist pr + (let* ((upstream (or (--first (magit--github-url-equal + (magit-get "remote" it "url") + .base.repo.ssh_url) + (magit-list-remotes)) + (user-error + "Upstream repository %s not available as a remote" + .base.repo.ssh_url))) + (upstream-url (magit-get "remote" upstream "url")) + (remote .head.repo.owner.login) + (branch .head.ref) + (pr-branch branch)) + (when (member branch (list .base.ref .base.default_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))) + (if (magit-remote-p remote) + (let ((url (magit-get "remote" remote "url")) + (fetch (magit-get-all "remote" remote "fetch"))) + (unless (magit--github-url-equal url .head.repo.ssh_url) + (user-error + "Remote `%s' already exists but does not point to %s" + remote url)) + (unless (member (format "+refs/heads/*:refs/remotes/%s/*" remote) + fetch) + (magit-call-git "remote" "set-branches" + "--add" remote pr-branch) + (magit-call-git "fetch" remote))) + (magit-call-git + "remote" "add" "-f" "--no-tags" + "-t" pr-branch remote + (cond ((or (string-prefix-p "git@" upstream-url) + (string-prefix-p "ssh://git@" upstream-url)) + .head.repo.ssh_url) + ((string-prefix-p "https://" upstream-url) + .head.repo.clone_url) + ((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") + (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 (number-to-string .number) "branch" branch "pullRequest") + (magit-set .title "branch" branch "description") + (magit-refresh) + branch))) + +(defun magit-checkout-pull-request (pr) + "Create, configure and checkout a new branch from a pull-request. +Please see the manual for more information." + (interactive (list (magit-read-pull-request "Checkout pull request"))) + (magit-checkout + (let ((inhibit-magit-refresh t)) + (magit-branch-pull-request pr)))) + (defun magit-branch-read-args (prompt) (let ((args (magit-branch-arguments))) (if magit-branch-read-upstream-first - (let* ((default (and (or (memq this-command magit-no-confirm-default) - (memq magit-current-popup-action - magit-no-confirm-default)) - (magit--default-starting-point))) - (choice (or default - (magit-read-starting-point prompt)))) + (let ((choice (magit-read-starting-point prompt))) (if (magit-rev-verify choice) (list (magit-read-string-ns - (if default - (format "%s (starting at %s)" prompt choice) - "Branch name") + (if magit-completing-read--silent-default + (format "%s (starting at `%s')" prompt choice) + "Name for new branch") (let ((def (mapconcat #'identity (cdr (split-string choice "/")) "/"))) @@ -286,13 +422,13 @@ does." def))) choice args) (if (eq magit-branch-read-upstream-first 'fallback) - (list choice - (magit-read-starting-point (concat prompt " " choice)) - args) + (list choice (magit-read-starting-point prompt choice) args) (user-error "Not a valid starting-point: %s" choice)))) (let ((branch (magit-read-string-ns (concat prompt " named")))) (list branch - (magit-read-starting-point (concat prompt " " branch)) + (with-no-warnings + (let ((magit-no-confirm-default nil)) + (magit-read-starting-point prompt branch))) args))))) ;;;###autoload @@ -319,14 +455,13 @@ to `FROM~', instead of to the last commit it shares with its upstream. Interactively, FROM is only ever non-nil, if the region selects some commits, and among those commits, FROM is the commit that is the fewest commits ahead of the source -branch. (It not yet possible to spin off a single commit, -unless it is the only unpushed commit. See #2920.) +branch. The commit at the other end of the selection actually does not matter, all commits between FROM and `HEAD' are moved to the new branch. If FROM is not reachable from `HEAD' or is reachable from the source branch's upstream, then an error is raised." - (interactive (list (magit-read-string "Spin off branch") + (interactive (list (magit-read-string-ns "Spin off branch") (car (last (magit-region-values 'commit))) (magit-branch-arguments))) (when (magit-branch-p branch) @@ -342,7 +477,8 @@ from the source branch's upstream, then an error is raised." (magit-rev-ancestor-p from tracked)) (user-error "Cannot spin off %s. %s is ancestor of upstream %s" branch from tracked))) - (magit-call-git "checkout" args "-b" branch current) + (let ((magit-process-raise-error t)) + (magit-call-git "checkout" args "-b" branch current)) (--when-let (magit-get-indirect-upstream-branch current) (magit-call-git "branch" "--set-upstream-to" it branch)) (when (and tracked @@ -372,7 +508,7 @@ When resetting to another branch and a prefix argument is used, then also set the target branch as the upstream of the branch that is being reset." (interactive - (let* ((atpoint (magit-branch-at-point)) + (let* ((atpoint (magit-local-branch-at-point)) (branch (magit-read-local-branch "Reset branch" atpoint))) (list branch (magit-completing-read (format "Reset %s to" branch) @@ -401,18 +537,15 @@ those, otherwise prompt for a single branch to be deleted, defaulting to the branch at point." ;; One would expect this to be a command as simple as, for example, ;; `magit-branch-rename'; but it turns out everyone wants to squeeze - ;; a bit of extra functionality into this one. And once it's there, - ;; you cannot remove it anymore. (I tried, it causes protests.) + ;; a bit of extra functionality into this one, including myself. (interactive - (let ((branches (magit-region-values 'branch)) + (let ((branches (magit-region-values 'branch t)) (force current-prefix-arg)) (if (if (> (length branches) 1) (magit-confirm t nil "Delete %i branches" branches) (setq branches - (list (magit-read-branch (if force - "Force delete branch" - "Delete branch") - (magit-get-previous-branch))))) + (list (magit-read-branch-prefer-other + (if force "Force delete branch" "Delete branch"))))) (unless force (--when-let (-remove #'magit-branch-merged-p branches) (if (magit-confirm 'delete-unmerged-branch @@ -448,8 +581,9 @@ defaulting to the branch at point." magit-this-process (apply-partially 'magit-delete-remote-branch-sentinel refs)))) ((> (length branches) 1) - (magit-run-git "branch" (if force "-D" "-d") - (delete (magit-get-current-branch) branches))) + (setq branches (delete (magit-get-current-branch) branches)) + (mapc 'magit-branch-maybe-delete-pr-remote branches) + (magit-run-git "branch" (if force "-D" "-d") branches)) (t ; And now for something completely different. (let* ((branch (car branches)) (prompt (format "Branch %s is checked out. " branch))) @@ -481,10 +615,36 @@ defaulting to the branch at point." (magit-call-git "checkout" "master")) (`abort (user-error "Abort"))) (setq force t)) + (magit-branch-maybe-delete-pr-remote branch) (magit-run-git "branch" (if force "-D" "-d") branch)))))) (put 'magit-branch-delete 'interactive-only t) +(defun magit-branch-maybe-delete-pr-remote (branch) + (-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) + refspecs) + (let ((refspec + (if (equal (magit-get "branch" branch "pushRemote") remote) + (format "+refs/heads/%s:refs/remotes/%s/%s" + branch remote branch) + (let ((merge (magit-get "branch" branch "merge"))) + (and merge + (string-prefix-p "refs/heads/" merge) + (setq merge (substring merge 11)) + (format "+refs/heads/%s:refs/remotes/%s/%s" + merge remote merge)))))) + (when (member refspec refspecs) + (if (and (= (length refspecs) 1) + (magit-confirm 'delete-pr-remote + (format "Also delete remote %s (%s)" remote + "no pull-request branch remains"))) + (magit-call-git "remote" "rm" remote) + (magit-call-git "config" "--unset" variable + (regexp-quote refspec))))))))) + (defun magit-delete-remote-branch-sentinel (refs process event) (when (memq (process-status process) '(exit signal)) (if (= (process-exit-status process) 0) @@ -507,14 +667,13 @@ defaulting to the branch at point." With prefix, forces the rename even if NEW already exists. \n(git branch -m|-M OLD NEW)." (interactive - (let ((branch (or (and (memq 'magit-branch-rename magit-no-confirm-default) - (or (magit-local-branch-at-point) - (magit-get-current-branch))) - (magit-read-local-branch "Rename branch")))) + (let ((branch (magit-read-local-branch "Rename branch"))) (list branch (magit-read-string-ns (format "Rename branch '%s' to" branch) nil 'magit-revision-history) current-prefix-arg))) + (when (string-match "\\`heads/\\(.+\\)" old) + (setq old (match-string 1 old))) (unless (string= old new) (magit-run-git "branch" (if force "-M" "-m") old new))) @@ -569,7 +728,6 @@ With prefix, forces the rename even if NEW already exists. (defvar magit-branch-config-popup `(:man-page "git-branch" :variables ,magit-branch-config-variables - :default-action magit-checkout :setup-function magit-branch-config-popup-setup)) (defun magit-branch-config-popup-setup (val def) @@ -685,16 +843,17 @@ When that variable is undefined then the value of `pull.rebase' is used instead. It defaults to `false'." (interactive (list (magit-branch-config-branch "Cycle branch..rebase for"))) - (magit-popup-set-variable (format "branch.%s.rebase" branch) - '("true" "false") - "false" "pull.rebase")) + (magit--set-popup-variable (format "branch.%s.rebase" branch) + '("true" "false") + "false" "pull.rebase")) (defun magit-format-branch*rebase () (let ((branch (magit-branch-config-branch))) - (magit-popup-format-variable (format "branch.%s.rebase" branch) - '("true" "false") - "false" "pull.rebase" - (+ (length branch) 20)))) + (magit--format-popup-variable:choices + (format "branch.%s.rebase" branch) + '("true" "false") + "false" "pull.rebase" + (+ (length branch) 20)))) ;;;###autoload (defun magit-cycle-branch*pushRemote (branch) @@ -710,16 +869,17 @@ If that variable is undefined, then the value of the Git variable which by default it is not." (interactive (list (magit-branch-config-branch "Cycle branch..pushRemote for"))) - (magit-popup-set-variable (format "branch.%s.pushRemote" branch) - (magit-list-remotes) - "remote.pushDefault")) + (magit--set-popup-variable (format "branch.%s.pushRemote" branch) + (magit-list-remotes) + "remote.pushDefault")) (defun magit-format-branch*pushRemote () (let ((branch (magit-branch-config-branch))) - (magit-popup-format-variable (format "branch.%s.pushRemote" branch) - (magit-list-remotes) - nil "remote.pushDefault" - (+ (length branch) 20)))) + (magit--format-popup-variable:choices + (format "branch.%s.pushRemote" branch) + (magit-list-remotes) + nil "remote.pushDefault" + (+ (length branch) 20)))) ;;;###autoload (defun magit-cycle-pull.rebase () @@ -732,10 +892,11 @@ variable `branch..rebase'. When `true' then pulling is done by rebasing. When `false' (the default) then pulling is done by merging." (interactive) - (magit-popup-set-variable "pull.rebase" '("true" "false") "false")) + (magit--set-popup-variable "pull.rebase" '("true" "false") "false")) (defun magit-format-pull.rebase () - (magit-popup-format-variable "pull.rebase" '("true" "false") "false" nil 19)) + (magit--format-popup-variable:choices + "pull.rebase" '("true" "false") "false" nil 19)) ;;;###autoload (defun magit-cycle-remote.pushDefault () @@ -745,11 +906,11 @@ The Git variable `remote.pushDefault' specifies the remote that local branches are usually pushed to. It can be overwritten using the Git variable `branch..pushRemote'." (interactive) - (magit-popup-set-variable "remote.pushDefault" (magit-list-remotes))) + (magit--set-popup-variable "remote.pushDefault" (magit-list-remotes))) (defun magit-format-remote.pushDefault () - (magit-popup-format-variable "remote.pushDefault" - (magit-list-remotes) nil nil 19)) + (magit--format-popup-variable:choices + "remote.pushDefault" (magit-list-remotes) nil nil 19)) ;;;###autoload (defun magit-cycle-branch*autoSetupMerge () @@ -771,12 +932,12 @@ branch. When `false' then the variables are never set." (interactive) - (magit-popup-set-variable "branch.autoSetupMerge" - '("always" "true" "false") "true")) + (magit--set-popup-variable "branch.autoSetupMerge" + '("always" "true" "false") "true")) (defun magit-format-branch*autoSetupMerge () - (magit-popup-format-variable "branch.autoSetupMerge" - '("always" "true" "false") "true" nil 23)) + (magit--format-popup-variable:choices + "branch.autoSetupMerge" '("always" "true" "false") "true" nil 23)) ;;;###autoload (defun magit-cycle-branch*autoSetupRebase () @@ -797,13 +958,14 @@ is a remote branch, but not when it is a local branch. When `never' (the default) then the variable is never set." (interactive) - (magit-popup-set-variable "branch.autoSetupRebase" - '("always" "local" "remote" "never") "never")) + (magit--set-popup-variable "branch.autoSetupRebase" + '("always" "local" "remote" "never") "never")) (defun magit-format-branch*autoSetupRebase () - (magit-popup-format-variable "branch.autoSetupRebase" - '("always" "local" "remote" "never") - "never" nil 23)) + (magit--format-popup-variable:choices + "branch.autoSetupRebase" + '("always" "local" "remote" "never") + "never" nil 23)) (provide 'magit-branch) ;;; magit-branch.el ends here diff --git a/elpa/magit-20171208.618/magit-collab.el b/elpa/magit-20171208.618/magit-collab.el new file mode 100644 index 00000000..172ca1b7 --- /dev/null +++ b/elpa/magit-20171208.618/magit-collab.el @@ -0,0 +1,129 @@ +;;; magit-collab.el --- collaboration tools -*- lexical-binding: t -*- + +;; Copyright (C) 2010-2017 The Magit Project Contributors +;; +;; You should have received a copy of the AUTHORS.md file which +;; lists all contributors. If not, see http://magit.vc/authors. + +;; Author: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli + +;; Magit is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Magit is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Magit. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; This library implements various collaboration tools. These tools +;; are only early incarnation -- implementing collaboration tools is +;; a top priority for future development. + +;; Currently these tools (including `magit-branch-pull-request', which +;; is defined elsewhere) only support Github, but support for other +;; Git forges as well as mailing list based collaboration is in +;; planning. + +;;; Code: + +(require 'magit) +(require 'ghub) + +;;; Variables + +(defvar magit-github-token-scopes '(repo) + "The Github API scopes needed by Magit. + +`repo' is the only required scope. Without this scope none of +Magit's features that use the API work. Instead of this scope +you could use `public_repo' if you are only interested in public +repositories. + +`repo' Grants read/write access to code, commit statuses, + invitations, collaborators, adding team memberships, and + deployment statuses for public and private repositories + and organizations. + +`public_repo' Grants read/write access to code, commit statuses, + collaborators, and deployment statuses for public repositories + and organizations. Also required for starring public + repositories.") + +;;; Commands + +;;;###autoload +(defun magit-browse-pull-request (pr) + "Visit pull-request PR using `browse-url'. + +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" + (--> pr + (cdr (assq 'base it)) + (cdr (assq 'repo it)) + (cdr (assq 'full_name it))) + (cdr (assq 'number pr))))) + +;;; Utilities + +(defun magit-read-pull-request (prompt) + "Read a pull request from the user, prompting with PROMPT. +Return the Git forge's API response. Currently this function +only supports Github, but that will change eventually." + (let* ((origin (magit-upstream-repository)) + (url (magit-get "remote" origin "url")) + (prs (ghub-get + (format "/repos/%s/pulls" + (and (string-match + "github.com[:/]\\(.+?\\)\\(?:\\.git\\)?\\'" url) + (match-string 1 url))) + nil :auth 'magit)) + (choice (magit-completing-read + prompt + (--map (format "%s %s" + (cdr (assq 'number it)) + (cdr (assq 'title it))) + prs) + nil t)) + (number (and (string-match "\\([0-9]+\\)" choice) + (string-to-number (match-string 1 choice))))) + (--first (eq (cdr (assq 'number it)) number) prs))) + +(defun magit-upstream-repository () + "Return the remote name of the upstream repository. + +If the Git variable `magit.upstream' is set, then return its +value. Otherwise return \"origin\". If the remote does not +exist, then raise an error." + (let ((remote (or (magit-get "magit.upstream") "origin"))) + (unless (magit-remote-p remote) + (error "No remote named `%s' exists (consider setting `magit.upstream')" + remote)) + (unless (string-match-p "github\\.com" (magit-get "remote" remote "url")) + (error "Currently only Github is supported")) + remote)) + +(defconst magit--github-url-regexp "\ +\\`\\(?:git://\\|git@\\|ssh://git@\\|https://\\)github.com[/:]\ +\\(\\([^/]+\\)/\\(.+?\\)\\)\ +\\(?:\\.git\\)?\\'") + +(defun magit--github-url-equal (r1 r2) + (or (equal r1 r2) + (let ((n1 (and (string-match magit--github-url-regexp r1) + (match-string 1 r1))) + (n2 (and (string-match magit--github-url-regexp r2) + (match-string 1 r2)))) + (and n1 n2 (equal n1 n2))))) + +(provide 'magit-collab) +;;; magit-collab.el ends here diff --git a/elpa/magit-20171009.1252/magit-commit.el b/elpa/magit-20171208.618/magit-commit.el similarity index 89% rename from elpa/magit-20171009.1252/magit-commit.el rename to elpa/magit-20171208.618/magit-commit.el index ba330936..e13f2ed5 100644 --- a/elpa/magit-20171009.1252/magit-commit.el +++ b/elpa/magit-20171208.618/magit-commit.el @@ -163,7 +163,8 @@ With a prefix argument, amend to the commit at `HEAD' instead. (when (member "--all" args) (setq this-command 'magit-commit-all)) (when (setq args (magit-commit-assert args)) - (magit-run-git-with-editor "commit" args))) + (let ((default-directory (magit-toplevel))) + (magit-run-git-with-editor "commit" args)))) ;;;###autoload (defun magit-commit-amend (&optional args) @@ -260,6 +261,15 @@ 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 commit + (when (and rebase (not (magit-rev-ancestor-p commit "HEAD"))) + (magit-read-char-case + (format "%s isn't an ancestor of HEAD. " commit) nil + (?c "[c]reate without rebasing" (setq rebase nil)) + (?s "[s]elect other" (setq commit nil)) + (?a "[a]bort" (user-error "Quit"))))) + (when commit + (setq commit (magit-rebase-interactive-assert commit))) (if (and commit (or confirmed (not (or rebase @@ -276,16 +286,19 @@ depending on the value of option `magit-commit-squash-confirm'." (-remove-first (apply-partially #'string-match-p "\\`--gpg-sign=") args))) - (magit-run-git-with-editor "commit" args))) + (magit-run-git-with-editor "commit" args)) + t) ; The commit was created; used by below lambda. (magit-log-select - `(lambda (commit) - (magit-commit-squash-internal ,option commit ',args ,rebase ,edit t) - ,@(when rebase - `((magit-rebase-interactive-1 commit - (list "--autosquash" "--autostash") - "" "true")))) + (lambda (commit) + (when (and (magit-commit-squash-internal option commit args + rebase edit t) + rebase) + (magit-rebase-interactive-1 commit + (list "--autosquash" "--autostash") + "" "true" t))) (format "Type %%p on a commit to %s into it," - (substring option 2))) + (substring option 2)) + nil nil (list "--graph")) (when magit-commit-show-diff (let ((magit-display-buffer-noselect t)) (apply #'magit-diff-staged nil (magit-diff-arguments))))))) @@ -326,28 +339,31 @@ depending on the value of option `magit-commit-squash-confirm'." ;;; Pending Diff (defun magit-commit-diff () - (-when-let (fn (and git-commit-mode - magit-commit-show-diff - (cl-case last-command - (magit-commit - (apply-partially 'magit-diff-staged nil)) - (magit-commit-all - (apply-partially 'magit-diff-working-tree nil)) - ((magit-commit-amend - magit-commit-reword - magit-rebase-reword-commit) - 'magit-diff-while-amending)))) + (when (and git-commit-mode magit-commit-show-diff) (-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. (unrecord-window-buffer nil diff-buffer)) (condition-case nil - (let ((magit-inhibit-save-previous-winconf 'unset) + (let ((args (car (magit-diff-arguments))) + (magit-inhibit-save-previous-winconf 'unset) (magit-display-buffer-noselect t) (inhibit-quit nil)) (message "Diffing changes to be committed (C-g to abort diffing)") - (funcall fn (car (magit-diff-arguments)))) + (-if-let (fn (cl-case last-command + (magit-commit + (apply-partially 'magit-diff-staged nil)) + (magit-commit-all + (apply-partially 'magit-diff-working-tree nil)) + ((magit-commit-amend + magit-commit-reword + magit-rebase-reword-commit) + 'magit-diff-while-amending))) + (funcall fn args) + (if (magit-anything-staged-p) + (magit-diff-staged nil args) + (magit-diff-while-amending args)))) (quit)))) ;; Mention `magit-diff-while-committing' because that's diff --git a/elpa/magit-20171009.1252/magit-core.el b/elpa/magit-20171208.618/magit-core.el similarity index 100% rename from elpa/magit-20171009.1252/magit-core.el rename to elpa/magit-20171208.618/magit-core.el diff --git a/elpa/magit-20171009.1252/magit-diff.el b/elpa/magit-20171208.618/magit-diff.el similarity index 93% rename from elpa/magit-20171009.1252/magit-diff.el rename to elpa/magit-20171208.618/magit-diff.el index 8f49be4d..4c9dce89 100644 --- a/elpa/magit-20171009.1252/magit-diff.el +++ b/elpa/magit-20171208.618/magit-diff.el @@ -230,7 +230,7 @@ visits the file in the working tree." (defcustom magit-diff-highlight-keywords t "Whether to highlight bracketed keywords in commit messages." - :package-version '(magit . "2.11.1") + :package-version '(magit . "2.12.0") :group 'magit-diff :type 'boolean) @@ -291,6 +291,30 @@ subject to option `magit-revision-insert-related-refs'." :group 'magit-revision :type 'boolean) +(defcustom magit-revision-use-hash-sections 'quicker + "Whether to turn hashes inside the commit message into sections. + +If non-nil, then hashes inside the commit message are turned into +`commit' sections. There is a trade off to be made between +performance and reliability: + +- `slow' calls git for every word to be absolutely sure. +- `quick' skips words less than seven characters long. +- `quicker' additionally skips words that don't contain a number. +- `quickest' uses all words that are at least seven characters + long and which contain at least one number as well as at least + one letter. + +If nil, then no hashes are turned into sections, but you can +still visit the commit at point using \"RET\"." + :package-version '(magit . "2.12.0") + :group 'magit-revision + :type '(choice (const :tag "Use sections, quickest" quickest) + (const :tag "Use sections, quicker" quicker) + (const :tag "Use sections, quick" quick) + (const :tag "Use sections, slow" slow) + (const :tag "Don't use sections" nil))) + (defcustom magit-revision-show-gravatars nil "Whether to show gravatar images in revision buffers. @@ -729,7 +753,7 @@ The information can be in three forms: If no DWIM context is found, nil is returned." (cond - ((--when-let (magit-region-values 'commit 'branch) + ((--when-let (magit-region-values '(commit branch) t) (deactivate-mark) (concat (car (last it)) ".." (car it)))) (magit-buffer-refname @@ -774,7 +798,7 @@ If no DWIM context is found, nil is returned." If MBASE is non-nil, prompt for which rev to place at the end of a \"revA...revB\" range. Otherwise, always construct \"revA..revB\" range." - (--if-let (magit-region-values 'commit 'branch) + (--if-let (magit-region-values '(commit branch) t) (let ((revA (car (last it))) (revB (car it))) (deactivate-mark) @@ -853,34 +877,39 @@ a commit read from the minibuffer." (magit-diff-setup nil nil args files)) ;;;###autoload -(defun magit-diff-while-committing (&optional args files) +(defun magit-diff-while-committing (&optional args) "While committing, show the changes that are about to be committed. While amending, invoking the command again toggles between showing just the new changes or all the changes that will be committed." - (interactive (magit-diff-arguments)) - (let ((toplevel (magit-toplevel)) + (interactive (list (car (magit-diff-arguments)))) + (unless (magit-commit-message-buffer) + (user-error "No commit in progress")) + (let ((magit-display-buffer-noselect t) (diff-buf (magit-mode-get-buffer 'magit-diff-mode))) - (if (magit-commit-message-buffer) - (if (and (or ;; most likely an explicit amend - (not (magit-anything-staged-p)) - ;; explicitly toggled from within diff - (and (eq (current-buffer) diff-buf))) - (or (not diff-buf) - (with-current-buffer diff-buf - (or ;; default to include last commit - (not (equal (magit-toplevel) toplevel)) - ;; toggle to include last commit - (not (car magit-refresh-args)))))) - (magit-diff-while-amending args files) - (magit-diff-staged nil args files)) - (user-error "No commit in progress")))) + (if (and diff-buf + (get-buffer-window diff-buf)) + (with-current-buffer diff-buf + (pcase-let ((`(,rev ,arg . ,_) magit-refresh-args)) + (cond ((and (equal rev "HEAD^") + (equal arg '("--cached"))) + (magit-diff-staged nil args)) + ((and (equal rev nil) + (equal arg '("--cached"))) + (magit-diff-while-amending args)) + ((magit-anything-staged-p) + (magit-diff-staged nil args)) + (t + (magit-diff-while-amending args))))) + (if (magit-anything-staged-p) + (magit-diff-staged nil args) + (magit-diff-while-amending args))))) (define-key git-commit-mode-map (kbd "C-c C-d") 'magit-diff-while-committing) -(defun magit-diff-while-amending (&optional args files) - (magit-diff-setup "HEAD^" (list "--cached") args files)) +(defun magit-diff-while-amending (&optional args) + (magit-diff-setup "HEAD^" (list "--cached") args nil)) ;;;###autoload (defun magit-diff-buffer-file () @@ -1423,6 +1452,7 @@ commit or stash at point, then prompt for a commit." (define-key map "\s" 'scroll-up) (define-key map "\d" 'scroll-down) (define-key map "j" 'magit-jump-to-diffstat-or-diff) + (define-key map [remap write-file] 'magit-patch-save) map) "Keymap for `magit-diff-mode'.") @@ -1462,24 +1492,22 @@ Staging and applying changes is documented in info node In such buffers the buffer-local value of `magit-refresh-args' has the same form as the arguments of this function. The value is set in `magit-mode-setup'." - (setq header-line-format - (propertize - (if (member "--no-index" const) - (apply #'format " Differences between %s and %s" files) - (concat (if rev-or-range - (if (string-match-p "\\(\\.\\.\\|\\^-\\)" - rev-or-range) - (format " Changes in %s" rev-or-range) - (format " Changes from %s to working tree" rev-or-range)) - (if (member "--cached" const) - " Staged changes" - " Unstaged changes")) - (pcase (length files) - (0) - (1 (concat " in file " (car files))) - (_ (concat " in files " - (mapconcat #'identity files ", ")))))) - 'face 'magit-header-line)) + (magit-set-header-line-format + (if (member "--no-index" const) + (apply #'format "Differences between %s and %s" files) + (concat (if rev-or-range + (if (string-match-p "\\(\\.\\.\\|\\^-\\)" + rev-or-range) + (format "Changes in %s" rev-or-range) + (format "Changes from %s to working tree" rev-or-range)) + (if (member "--cached" const) + "Staged changes" + "Unstaged changes")) + (pcase (length files) + (0) + (1 (concat " in file " (car files))) + (_ (concat " in files " + (mapconcat #'identity files ", "))))))) (magit-insert-section (diffbuf) (run-hook-with-args 'magit-diff-sections-hook rev-or-range))) @@ -1814,15 +1842,15 @@ Staging and applying changes is documented in info node 'magit-bookmark--revision-make-record)) (defun magit-revision-refresh-buffer (rev __const _args files) - (setq header-line-format - (propertize (concat " " (capitalize (magit-object-type rev)) - " " rev - (pcase (length files) - (0) - (1 (concat " limited to file " (car files))) - (_ (concat " limited to files " - (mapconcat #'identity files ", "))))) - 'face 'magit-header-line)) + (magit-set-header-line-format + (concat (capitalize (magit-object-type rev)) + " " + rev + (pcase (length files) + (0) + (1 (concat " limited to file " (car files))) + (_ (concat " limited to files " + (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))) @@ -1864,9 +1892,15 @@ or a ref which is not a branch, then it inserts nothing." (goto-char (point-max)) (insert ?\n)))) +(defvar magit-commit-message-section-map + (let ((map (make-sparse-keymap))) + (define-key map [remap magit-visit-thing] 'magit-show-commit) + map) + "Keymap for `commit-message' sections.") + (defun magit-insert-revision-message (rev) "Insert the commit message into a revision buffer." - (magit-insert-section (message) + (magit-insert-section (commit-message) (let ((beg (point))) (magit-rev-insert-format "%B" rev) (if (= (point) (+ beg 2)) @@ -1876,6 +1910,33 @@ or a ref which is not a branch, then it inserts nothing." (save-excursion (while (search-forward "\r\n" nil t) ; Remove trailing CRs. (delete-region (match-beginning 0) (1+ (match-beginning 0))))) + (when magit-revision-use-hash-sections + (save-excursion + (while (not (eobp)) + (re-search-forward "\\_<" nil 'move) + (let ((beg (point))) + (re-search-forward "\\_>" nil t) + (when (> (point) beg) + (let ((text (buffer-substring-no-properties beg (point)))) + (when (pcase magit-revision-use-hash-sections + (`quickest ; false negatives and positives + (and (>= (length text) 7) + (string-match-p "[0-9]" text) + (string-match-p "[a-z]" text))) + (`quicker ; false negatives (number-less hashes) + (and (>= (length text) 7) + (string-match-p "[0-9]" text) + (magit-rev-verify-commit text))) + (`quick ; false negatives (short hashes) + (and (>= (length text) 7) + (magit-rev-verify-commit text))) + (`slow + (magit-rev-verify-commit text))) + (put-text-property beg (point) 'face 'magit-hash) + (let ((end (point))) + (goto-char beg) + (magit-insert-section (commit text) + (goto-char end)))))))))) (save-excursion (forward-line) (put-text-property beg (point) 'face 'magit-section-secondary-heading) @@ -1890,17 +1951,26 @@ or a ref which is not a branch, then it inserts nothing." (defun magit-insert-revision-notes (rev) "Insert commit notes into a revision buffer." - (magit-insert-section (notes) - (let ((beg (point))) - (magit-git-insert "notes" "show" rev) - (if (= (point) beg) - (magit-cancel-section) - (goto-char beg) - (forward-line) - (put-text-property beg (point) 'face 'magit-section-secondary-heading) - (magit-insert-heading) - (goto-char (point-max)) - (insert ?\n))))) + (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))) + (let ((beg (point))) + (magit-git-insert "-c" (concat "core.notesRef=" ref) + "notes" "show" rev) + (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))) + (magit-insert-heading) + (goto-char (point-max)) + (insert ?\n))))))) (defun magit-insert-revision-headers (rev) "Insert headers about the commit into a revision buffer." @@ -2125,7 +2195,7 @@ is `region'. If the region is empty after a mouse click, then If optional STRICT is non-nil, then return nil if the diff type of the section at point is `untracked' or the section at point is not actually a `diff' but a `diffstat' section." - (let ((siblings (and (not ssection) (magit-region-sections)))) + (let ((siblings (and (not ssection) (magit-region-sections nil t)))) (setq section (or section (car siblings) (magit-current-section))) (when (and section (or (not strict) @@ -2203,12 +2273,19 @@ are highlighted." (let ((beg (magit-section-start section)) (cnt (magit-section-content section)) (end (magit-section-end section))) - (unless (and (region-active-p) - (= end (1+ (region-end)))) - (magit-section-make-overlay beg cnt 'magit-section-highlight) + (when (or (eq this-command 'mouse-drag-region) + (not selection)) + (unless (and (region-active-p) + (<= (region-beginning) + (magit-section-start section))) + (magit-section-make-overlay beg cnt 'magit-section-highlight)) (unless (magit-section-hidden section) (dolist (child (magit-section-children section)) - (magit-diff-highlight-recursive child selection)))) + (when (or (eq this-command 'mouse-drag-region) + (not (and (region-active-p) + (<= (region-beginning) + (magit-section-start child))))) + (magit-diff-highlight-recursive child selection))))) (when magit-diff-highlight-hunk-body (magit-section-make-overlay (1- end) end 'magit-section-highlight)))) @@ -2224,7 +2301,8 @@ are highlighted." (or (magit-section-content section) (magit-section-end section)) (pcase (list (magit-section-type section) - (and (member section selection) t)) + (and (member section selection) + (not (eq this-command 'mouse-drag-region)))) (`(file t) 'magit-diff-file-heading-selection) (`(file nil) 'magit-diff-file-heading-highlight) (`(hunk t) 'magit-diff-hunk-heading-selection) @@ -2279,17 +2357,28 @@ are highlighted." (`("=" t) 'magit-diff-their-highlight) (`(">" nil) nil))) 'magit-diff-conflict-heading) - ((looking-at (if merging "^\\(\\+\\| \\+\\)" "^\\+")) + ((looking-at (if merging "^\\(\\+\\| \\+\\)" "^\\+")) + (magit-diff-paint-tab merging) (magit-diff-paint-whitespace merging) (or stage (if highlight 'magit-diff-added-highlight 'magit-diff-added))) - ((looking-at (if merging "^\\(-\\| -\\)" "^-")) + ((looking-at (if merging "^\\(-\\| -\\)" "^-")) + (magit-diff-paint-tab merging) (if highlight 'magit-diff-removed-highlight 'magit-diff-removed)) (t + (magit-diff-paint-tab merging) (if highlight 'magit-diff-context-highlight 'magit-diff-context)))) (forward-line)))))) (magit-diff-update-hunk-refinement section)) +(defun magit-diff-paint-tab (merging) + (save-excursion + (forward-char (if merging 2 1)) + (while (= (char-after) ?\t) + (put-text-property (point) (1+ (point)) + 'display (list (list 'space :width tab-width))) + (forward-char)))) + (defun magit-diff-paint-whitespace (merging) (when (and magit-diff-paint-whitespace (or (derived-mode-p 'magit-status-mode) diff --git a/elpa/magit-20171009.1252/magit-ediff.el b/elpa/magit-20171208.618/magit-ediff.el similarity index 99% rename from elpa/magit-20171009.1252/magit-ediff.el rename to elpa/magit-20171208.618/magit-ediff.el index 369d0e26..b621629a 100644 --- a/elpa/magit-20171009.1252/magit-ediff.el +++ b/elpa/magit-20171208.618/magit-ediff.el @@ -159,8 +159,8 @@ conflicts, including those already resolved by Git, use "Stage and unstage changes to FILE using Ediff. FILE has to be relative to the top directory of the repository." (interactive - (list (magit-completing-read "Selectively stage file" nil - (magit-tracked-files) nil nil nil + (list (magit-completing-read "Selectively stage file" + (magit-tracked-files) nil nil nil nil (magit-current-file)))) (magit-with-toplevel (let* ((conf (current-window-configuration)) diff --git a/elpa/magit-20171009.1252/magit-extras.el b/elpa/magit-20171208.618/magit-extras.el similarity index 89% rename from elpa/magit-20171009.1252/magit-extras.el rename to elpa/magit-20171208.618/magit-extras.el index aca28470..d9f0889a 100644 --- a/elpa/magit-20171009.1252/magit-extras.el +++ b/elpa/magit-20171208.618/magit-extras.el @@ -133,6 +133,28 @@ is no file at point, then instead visit `default-directory'." file)) (concat default-directory "/.")))) +;;;###autoload +(defun magit-dired-log (&optional follow) + "Show log for all marked files, or the current file." + (interactive "P") + (-if-let (topdir (magit-toplevel default-directory)) + (let ((args (car (magit-log-arguments))) + (files (dired-get-marked-files nil nil #'magit-file-tracked-p))) + (unless files + (user-error "No marked file is being tracked by Git")) + (when (and follow + (not (member "--follow" args)) + (not (cdr files))) + (push "--follow" args)) + (magit-mode-setup-internal + #'magit-log-mode + (list (list (or (magit-get-current-branch) "HEAD")) + args + (let ((default-directory topdir)) + (mapcar #'file-relative-name files))) + magit-log-buffer-file-locked)) + (user-error "Not inside a Git repository"))) + ;;;###autoload (defun magit-do-async-shell-command (file) "Open FILE with `dired-do-async-shell-command'. @@ -168,12 +190,13 @@ is a matter of preference." "use `forward-line' with negative argument instead.")) (interactive "p\np") (unless arg (setq arg 1)) - (let ((hunkp (magit-diff-inside-hunk-body-p))) - (if (and hunkp (= arg 1) (magit--turn-on-shift-select-mode-p)) + (let ((stay (or (magit-diff-inside-hunk-body-p) + (magit-section-position-in-heading-p)))) + (if (and stay (= arg 1) (magit--turn-on-shift-select-mode-p)) (push-mark nil nil t) (with-no-warnings (handle-shift-selection) - (previous-line (if hunkp (max (1- arg) 1) arg) try-vscroll))))) + (previous-line (if stay (max (1- arg) 1) arg) try-vscroll))))) ;;;###autoload (defun magit-next-line (&optional arg try-vscroll) @@ -189,12 +212,13 @@ prefer is a matter of preference." (declare (interactive-only forward-line)) (interactive "p\np") (unless arg (setq arg 1)) - (let ((hunkp (magit-diff-inside-hunk-body-p))) - (if (and hunkp (= arg 1) (magit--turn-on-shift-select-mode-p)) + (let ((stay (or (magit-diff-inside-hunk-body-p) + (magit-section-position-in-heading-p)))) + (if (and stay (= arg 1) (magit--turn-on-shift-select-mode-p)) (push-mark nil nil t) (with-no-warnings (handle-shift-selection) - (next-line (if hunkp (max (1- arg) 1) arg) try-vscroll))))) + (next-line (if stay (max (1- arg) 1) arg) try-vscroll))))) ;;; Clean diff --git a/elpa/magit-20171009.1252/magit-files.el b/elpa/magit-20171208.618/magit-files.el similarity index 74% rename from elpa/magit-20171009.1252/magit-files.el rename to elpa/magit-20171208.618/magit-files.el index e1047ab7..c5d170d7 100644 --- a/elpa/magit-20171009.1252/magit-files.el +++ b/elpa/magit-20171208.618/magit-files.el @@ -227,15 +227,22 @@ directory, while reading the FILENAME." (magit-define-popup magit-file-popup "Popup console for Magit commands in file-visiting buffers." :actions '((?s "Stage" magit-stage-file) - (?d "Diff" magit-diff-buffer-file) - (?l "Log" magit-log-buffer-file) - (?b "Blame" magit-blame-popup) - (?u "Unstage" magit-unstage-file) (?D "Diff..." magit-diff-buffer-file-popup) (?L "Log..." magit-log-buffer-file-popup) - (?p "Find blob" magit-blob-previous) - (?c "Commit" magit-commit-popup)) - :max-action-columns 4) + (?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)) + :max-action-columns 5) (defvar magit-file-mode-lighter "") @@ -267,10 +274,14 @@ Currently this only adds the following key bindings. (let ((map (make-sparse-keymap))) (cond ((featurep 'jkl) (define-key map "i" 'magit-blob-previous) - (define-key map "k" 'magit-blob-next)) + (define-key map "k" 'magit-blob-next) + (define-key map "j" 'magit-blame) + (define-key map "l" 'magit-blame-reverse)) (t (define-key map "p" 'magit-blob-previous) - (define-key map "n" 'magit-blob-next))) + (define-key map "n" 'magit-blob-next) + (define-key map "b" 'magit-blame) + (define-key map "f" 'magit-blame-reverse))) (define-key map "q" 'magit-kill-this-buffer) map) "Keymap for `magit-blob-mode'.") @@ -359,24 +370,38 @@ If FILE isn't tracked in Git, fallback to using `rename-file'." (rename-file file newname current-prefix-arg) (magit-refresh))) -(defun magit-file-untrack (file) - "Untrack FILE. -Stop tracking FILE in Git but do not remove it from the working -tree." - (interactive (list (magit-read-tracked-file "Untrack file"))) - (magit-run-git "rm" "--cached" "--" file)) - -(defun magit-file-delete (file &optional force) - "Delete FILE. -With a prefix argument FORCE do so even when FILE has uncommitted -changes. - -If FILE isn't tracked in Git, fallback to using `delete-file'." - (interactive (list (magit-read-file "Delete file"))) - (if (magit-file-tracked-p file) - (magit-run-git "rm" (and force "--force") "--" file) - (delete-file (expand-file-name file (magit-toplevel)) t) - (magit-refresh))) +(defun magit-file-untrack (files &optional force) + "Untrack the selected FILES or one file read in the minibuffer. + +With a prefix argument FORCE do so even when the files have +staged as well as unstaged changes." + (interactive (list (or (--if-let (magit-region-values 'file t) + (progn + (or (magit-file-tracked-p (car it)) + (user-error "Already untracked")) + (or (magit-confirm-files 'untrack it "Untrack") + (user-error "Abort"))) + (list (magit-read-tracked-file "Untrack file")))) + current-prefix-arg)) + (magit-run-git "rm" "--cached" (and force "--force") "--" files)) + +(defun magit-file-delete (files &optional force) + "Delete the selected FILES or one file read in the minibuffer. + +With a prefix argument FORCE do so even when the files have +uncommitted changes. When the files aren't being tracked in +Git, then fallback to using `delete-file'." + (interactive (list (--if-let (magit-region-values 'file t) + (or (magit-confirm-files 'delete it "Delete") + (user-error "Abort")) + (list (magit-read-file "Delete file"))) + current-prefix-arg)) + (if (magit-file-tracked-p (car files)) + (magit-call-git "rm" (and force "--force") "--" files) + (let ((topdir (magit-toplevel))) + (dolist (file files) + (delete-file (expand-file-name file topdir) t)))) + (magit-refresh)) ;;;###autoload (defun magit-file-checkout (rev file) @@ -439,5 +464,79 @@ If DEFAULT is non-nil, use this as the default value instead of (magit-list-files) nil nil initial-contents) ",")) +;;; Patch File + +(defcustom magit-patch-save-arguments '(exclude "--stat") + "Arguments used by `magit-patch-save-arguments' (which see)" + :package-version '(magit . "2.12.0") + :group 'magit-diff + :type '(choice (const :tag "use buffer arguments" buffer) + (cons :tag "use buffer arguments except" + (const :format "" exclude) + (repeat :format "%v%i\n" + (string :tag "Argument"))) + (repeat :tag "use constant arguments" + (string :tag "Argument")))) + +(magit-define-popup magit-patch-apply-popup + "Popup console for applying a patch file." + :man-page "git-apply" + :switches '((?i "Also apply to index" "--index") + (?c "Only apply to index" "--cached") + (?3 "Fall back on 3way merge" "--3way")) + :actions '((?a "Apply patch" magit-patch-apply)) + :default-action 'magit-patch-apply) + +(defun magit-patch-apply (file &rest args) + "Apply the patch file FILE." + (interactive (list (expand-file-name + (read-file-name "Apply patch: " + default-directory nil nil + (--when-let (magit-file-at-point) + (file-relative-name it)))) + (magit-patch-apply-arguments))) + (magit-run-git "apply" args "--" file)) + +(defun magit-patch-save (file &optional arg) + "Write current diff into patch FILE. + +What arguments are used to create the patch depends on the value +of `magit-patch-save-arguments' and whether a prefix argument is +used. + +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 +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. + +If the value is a list of strings (including the empty list), +then use those arguments. With a prefix argument use the same +arguments as the buffer. + +Of course the arguments that are required to actually show the +same differences as those shown in the buffer are always used." + (interactive (list (read-file-name "Write patch file: " default-directory) + current-prefix-arg)) + (unless (derived-mode-p 'magit-diff-mode) + (user-error "Only diff buffers can be saved as patches")) + (pcase-let ((`(,rev ,const ,args ,files) magit-refresh-args)) + (when (derived-mode-p 'magit-revision-mode) + (setq rev (format "%s~..%s" rev rev))) + (cond ((eq magit-patch-save-arguments 'buffer) + (when arg + (setq args nil))) + ((eq (car-safe magit-patch-save-arguments) 'exclude) + (unless arg + (setq args (-difference args (cdr magit-patch-save-arguments))))) + ((not arg) + (setq args magit-patch-save-arguments))) + (with-temp-file file + (magit-git-insert "diff" rev "-p" const args "--" files))) + (magit-refresh)) + (provide 'magit-files) ;;; magit-files.el ends here diff --git a/elpa/magit-20171009.1252/magit-git.el b/elpa/magit-20171208.618/magit-git.el similarity index 83% rename from elpa/magit-20171009.1252/magit-git.el rename to elpa/magit-20171208.618/magit-git.el index 024caea0..3c8766d7 100644 --- a/elpa/magit-20171009.1252/magit-git.el +++ b/elpa/magit-20171208.618/magit-git.el @@ -30,14 +30,17 @@ (require 'cl-lib) (require 'dash) +(require 'magit-popup) (require 'magit-utils) (require 'magit-section) +(declare-function magit-call-git 'magit-process) (declare-function magit-maybe-make-margin-overlay 'magit-log) (declare-function magit-process-buffer 'magit-process) (declare-function magit-process-file 'magit-process) (declare-function magit-process-insert-section 'magit-process) -(defvar magit-process-error-message-re) +(declare-function magit-refresh 'magit-mode) +(defvar magit-process-error-message-regexps) (defvar magit-refresh-args) ; from `magit-mode' for `magit-current-file' (defvar magit-branch-prefer-remote-upstream) @@ -147,37 +150,6 @@ then at least its standard error is inserted into this buffer. This is only intended for debugging purposes. Do not enable this permanently, that would negatively affect performance.") -(defcustom magit-ref-namespaces - '(("^@$" magit-head nil) - ("^refs/tags/\\(.+\\)" magit-tag nil) - ("^refs/heads/\\(.+\\)" magit-branch-local nil) - ("^refs/remotes/\\(.+\\)" magit-branch-remote nil) - ("^refs/bisect/\\(bad\\)" magit-bisect-bad nil) - ("^refs/bisect/\\(skip.*\\)" magit-bisect-skip nil) - ("^refs/bisect/\\(good.*\\)" magit-bisect-good nil) - ("^refs/stash$" magit-refname-stash nil) - ("^refs/wip/\\(.+\\)" magit-refname-wip nil) - ("^\\(bad\\):" magit-bisect-bad nil) - ("^\\(skip\\):" magit-bisect-skip nil) - ("^\\(good\\):" magit-bisect-good nil) - ("\\(.+\\)" magit-refname nil)) - "How refs are formatted for display. - -Each entry controls how a certain type of ref is displayed, and -has the form (REGEXP FACE FORMATTER). REGEXP is a regular -expression used to match full refs. The first entry whose REGEXP -matches the reference is used. The first regexp submatch becomes -the \"label\" that represents the ref and is propertized with -font FONT. If FORMATTER is non-nil, it should be a function that -takes two arguments, the full ref and the face. It is supposed -to return a propertized label that represents the ref." - :package-version '(magit . "2.1.0") - :group 'magit-miscellanous - :type '(repeat - (list regexp - face - (choice (const :tag "first submatch is label" nil) - (function :tag "format using function"))))) (defcustom magit-prefer-remote-upstream nil "Whether to favor remote branches when reading the upstream branch. @@ -264,8 +236,17 @@ pass arguments through this function before handing them to Git, to do the following. * Flatten ARGS, removing nil arguments. -* Prepend `magit-git-global-arguments' to ARGS." - (append magit-git-global-arguments (-flatten args))) +* Prepend `magit-git-global-arguments' to ARGS. +* On w32 systems, encode to `w32-ansi-code-page'." + (setq args (append magit-git-global-arguments (-flatten args))) + (if (and (eq system-type 'windows-nt) (boundp 'w32-ansi-code-page)) + ;; On w32, the process arguments *must* be encoded in the + ;; current code-page (see #3250). + (mapcar (lambda (arg) + (encode-coding-string + arg (intern (format "cp%d" w32-ansi-code-page)))) + args) + args)) (defun magit-git-exit-code (&rest args) "Execute Git with ARGS, returning its exit code." @@ -328,9 +309,10 @@ add a section in the respective process buffer." (cond ((functionp magit-git-debug) (funcall magit-git-debug (buffer-string))) - ((re-search-backward - magit-process-error-message-re nil t) - (match-string 1))))) + ((run-hook-wrapped + 'magit-process-error-message-regexps + (lambda (re) (re-search-backward re nil t))) + (match-string-no-properties 1))))) (let ((magit-git-debug nil)) (with-current-buffer (magit-process-buffer t) (magit-process-insert-section default-directory @@ -430,9 +412,11 @@ 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 (magit-rev-parse-safe "--git-dir") - (setq it (file-name-as-directory (magit-expand-git-file-name it))) - (if path (expand-file-name (convert-standard-filename path) it) it))))) + (-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))) + (if path (expand-file-name (convert-standard-filename path) dir) dir))))) (defvar magit--separated-gitdirs nil) @@ -729,6 +713,10 @@ Sorted from longest to shortest CYGWIN name." "Return t if there is no commit in the current Git repository." (not (magit-rev-verify "HEAD"))) +(defun magit-merge-commit-p (commit) + "Return t if COMMIT is a merge commit." + (> (length (magit-commit-parents commit)) 1)) + (defun magit-anything-staged-p (&optional ignore-submodules &rest files) "Return t if there are any staged changes. If optional FILES is non-nil, then only changes to those files @@ -939,6 +927,7 @@ to, or to some other symbolic-ref that points to the same ref." (commit (let ((rev (magit-section-value it))) (or (magit-get-shortname rev) rev))) (tag (magit-ref-maybe-qualify (magit-section-value it) "tags/"))) + (thing-at-point 'git-revision t) (and (derived-mode-p 'magit-revision-mode 'magit-merge-preview-mode) (car magit-refresh-args)))) @@ -1049,6 +1038,14 @@ which is different from the current branch and still exists." (unless (equal remote ".") remote)))) +(defun magit-get-some-remote (&optional branch) + (or (magit-get-remote branch) + (and (magit-branch-p "master") + (magit-get-remote "master")) + (let ((remotes (magit-list-remotes))) + (or (car (member "origin" remotes)) + (car remotes))))) + (defun magit-branch-merged-p (branch &optional target) "Return non-nil if BRANCH is merged into its upstream and TARGET. @@ -1169,6 +1166,15 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (member it (magit-list-unmerged-branches upstream))) (magit-list-local-branch-names))) +(defun magit-list-branches-pointing-at (commit) + (let ((re (format "\\`%s refs/\\(heads\\|remotes\\)/\\(.*\\)\\'" + (magit-rev-verify commit)))) + (--keep (and (string-match re it) + (let ((name (match-string 2 it))) + (and (not (string-suffix-p "HEAD" name)) + name))) + (magit-git-lines "show-ref")))) + (defun magit-list-refnames (&optional namespaces) (magit-list-refs namespaces "%(refname:short)")) @@ -1203,6 +1209,12 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (defun magit-list-stashes (&optional format) (magit-git-lines "stash" "list" (concat "--format=" (or format "%gd")))) +(defun magit-list-active-notes-refs () + "Return notes refs according to `core.notesRef' and `notes.displayRef'." + (magit-git-lines "for-each-ref" "--format=%(refname)" + (or (magit-get "core.notesRef") "refs/notes/commits") + (magit-get-all "notes.displayRef"))) + (defun magit-list-notes-refnames () (--map (substring it 6) (magit-list-refnames "refs/notes"))) @@ -1332,10 +1344,6 @@ Return a list of two integers: (A>B B>A)." (--when-let (magit-git-string "rev-list" "-1" "--parents" commit) (cdr (split-string it)))) -(defun magit-assert-one-parent (commit command) - (when (> (length (magit-commit-parents commit)) 1) - (user-error "Cannot %s a merge commit" command))) - (defun magit-patch-id (rev) (with-temp-buffer (magit-process-file @@ -1362,13 +1370,27 @@ Return a list of two integers: (A>B B>A)." (put-text-property 0 (match-beginning 0) 'face 'magit-hash it) it)) -(defun magit-format-ref-label (ref &optional head) - (-let [(_re face fn) - (--first (string-match (car it) ref) magit-ref-namespaces)] - (if fn - (funcall fn ref face) - (propertize (or (match-string 1 ref) ref) - 'face (if (equal ref head) 'magit-branch-current face))))) +(defvar magit-ref-namespaces + '(("\\`HEAD\\'" . magit-head) + ("\\`refs/tags/\\(.+\\)" . magit-tag) + ("\\`refs/heads/\\(.+\\)" . magit-branch-local) + ("\\`refs/remotes/\\(.+\\)" . magit-branch-remote) + ("\\`refs/bisect/\\(bad\\)" . magit-bisect-bad) + ("\\`refs/bisect/\\(skip.*\\)" . magit-bisect-skip) + ("\\`refs/bisect/\\(good.*\\)" . magit-bisect-good) + ("\\`refs/stash$" . magit-refname-stash) + ("\\`refs/wip/\\(.+\\)" . magit-refname-wip) + ("\\`\\(bad\\):" . magit-bisect-bad) + ("\\`\\(skip\\):" . magit-bisect-skip) + ("\\`\\(good\\):" . magit-bisect-good) + ("\\`\\(.+\\)" . magit-refname)) + "How refs are formatted for display. + +Each entry controls how a certain type of ref is displayed, and +has the form (REGEXP . FACE). REGEXP is a regular expression +used to match full refs. The first entry whose REGEXP matches +the reference is used. The first regexp submatch becomes the +\"label\" that represents the ref and is propertized with FONT.") (defun magit-format-ref-labels (string) ;; To support Git <2.2.0, we remove the surrounding parentheses here @@ -1378,8 +1400,8 @@ Return a list of two integers: (A>B B>A)." (replace-regexp-in-string "\\`\\s-*(" "") (replace-regexp-in-string ")\\s-*\\'" ""))) (save-match-data - (let ((regexp "\\(, \\|tag: \\| -> \\)") - head names) + (let ((regexp "\\(, \\|tag: \\|HEAD -> \\)") + names) (if (and (derived-mode-p 'magit-log-mode) (member "--simplify-by-decoration" (cadr magit-refresh-args))) (let ((branches (magit-list-local-branch-names)) @@ -1394,10 +1416,55 @@ Return a list of two integers: (A>B B>A)." (replace-regexp-in-string "tag: " "refs/tags/" string) regexp t)))) (setq names (split-string string regexp t))) - (when (member "HEAD" names) - (setq head (magit-git-string "symbolic-ref" "HEAD") - names (cons (or head "@") (delete head (delete "HEAD" names))))) - (mapconcat (lambda (it) (magit-format-ref-label it head)) names " ")))) + (let (state head tags branches remotes other combined) + (dolist (ref names) + (let* ((face (cdr (--first (string-match (car it) ref) + magit-ref-namespaces))) + (name (propertize (or (match-string 1 ref) ref) 'face face))) + (cl-case face + ((magit-bisect-bad magit-bisect-skip magit-bisect-good) + (setq state name)) + (magit-head + (setq head (propertize "@" 'face 'magit-head))) + (magit-tag (push name tags)) + (magit-branch-local (push name branches)) + (magit-branch-remote (push name remotes)) + (t (push name other))))) + (setq remotes + (-keep + (lambda (name) + (if (string-match "\\`\\([^/]*\\)/\\(.*\\)\\'" name) + (let ((r (match-string 1 name)) + (b (match-string 2 name))) + (and (not (equal b "HEAD")) + (if (equal (concat "refs/remotes/" name) + (magit-git-string + "symbolic-ref" + (format "refs/remotes/%s/HEAD" r))) + (propertize name + 'face 'magit-branch-remote-head) + name))) + name)) + remotes)) + (dolist (name branches) + (let ((push (car (member (magit-get-push-branch name) remotes)))) + (when push + (setq remotes (delete push remotes)) + (string-match "^[^/]*/" push) + (setq push (substring push 0 (match-end 0)))) + (if (equal name (magit-get-current-branch)) + (setq head + (concat push + (propertize name 'face 'magit-branch-current))) + (push (concat push name) combined)))) + (mapconcat #'identity + (-flatten `(,state + ,head + ,@(nreverse tags) + ,@(nreverse combined) + ,@(nreverse remotes) + ,@other)) + " "))))) (defun magit-object-type (object) (magit-git-string "cat-file" "-t" object)) @@ -1454,9 +1521,9 @@ Return a list of two integers: (A>B B>A)." (defun magit-update-ref (ref message rev &optional stashish) (or (if (not (version< (magit-git-version) "2.6.0")) - (magit-git-success "update-ref" "--create-reflog" - "-m" message ref rev - (or (magit-rev-verify ref) "")) + (zerop (magit-call-git "update-ref" "--create-reflog" + "-m" message ref rev + (or (magit-rev-verify ref) ""))) ;; `--create-reflog' didn't exist before v2.6.0 (let ((oldrev (magit-rev-verify ref)) (logfile (magit-git-dir (concat "logs/" ref)))) @@ -1478,13 +1545,36 @@ Return a list of two integers: (A>B B>A)." "\\([^.][^ \t]*\\)?\\'")) ; revB (defun magit-split-range (range) - (when (string-match magit-range-re range) - (let ((beg (or (match-string 1 range) "HEAD")) - (end (or (match-string 3 range) "HEAD"))) - (cons (if (string-equal (match-string 2 range) "...") - (magit-git-string "merge-base" beg end) - beg) - end)))) + (and (string-match magit-range-re range) + (let ((beg (or (match-string 1 range) "HEAD")) + (end (or (match-string 3 range) "HEAD"))) + (cons (if (string-equal (match-string 2 range) "...") + (magit-git-string "merge-base" beg end) + beg) + end)))) + +(defvar magit-thingatpt--git-revision-chars "-./[:alnum:]@{}^~!" + "Characters allowable in filenames, excluding space and colon.") + +(put 'git-revision 'end-op + (lambda () + (re-search-forward + (concat "\\=[" magit-thingatpt--git-revision-chars "]*") + nil t))) + +(put 'git-revision 'beginning-op + (lambda () + (if (re-search-backward + (concat "[^" magit-thingatpt--git-revision-chars "]") nil t) + (forward-char) + (goto-char (point-min))))) + +(put 'git-revision 'thing-at-point 'magit-thingatpt--git-revision) + +(defun magit-thingatpt--git-revision () + (--when-let (bounds-of-thing-at-point 'git-revision) + (let ((text (buffer-substring-no-properties (car it) (cdr it)))) + (and (magit-rev-verify-commit text) text)))) ;;; Completion @@ -1508,7 +1598,7 @@ Return a list of two integers: (A>B B>A)." (defun magit-read-range-or-commit (prompt &optional secondary-default) (magit-read-range prompt - (or (--when-let (magit-region-values 'commit 'branch) + (or (--when-let (magit-region-values '(commit branch) t) (deactivate-mark) (concat (car (last it)) ".." (car it))) (magit-branch-or-commit-at-point) @@ -1592,6 +1682,18 @@ Return a list of two integers: (A>B B>A)." nil nil nil 'magit-revision-history default) (user-error "Nothing selected")))) +(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)))) + (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) + (magit-get-previous-branch) + (car atpoint))))) + (cl-defun magit-read-upstream-branch (&optional (branch (magit-get-current-branch)) prompt) (magit-completing-read @@ -1612,11 +1714,19 @@ Return a list of two integers: (A>B B>A)." (let ((previous (magit-get-previous-branch))) (and (not (equal previous branch)) previous))))) -(defun magit-read-starting-point (prompt) - (or (magit-completing-read (concat prompt " starting at") - (cons "HEAD" (magit-list-refnames)) - nil nil nil 'magit-revision-history - (magit--default-starting-point)) +(defun magit-read-starting-point (prompt &optional branch) + (or (magit-completing-read + (concat prompt + (and branch + (if (bound-and-true-p ivy-mode) + ;; Ivy-mode strips faces from prompt. + (format " `%s'" branch) + (concat " " + (propertize branch 'face 'magit-branch-local)))) + " starting at") + (cons "HEAD" (magit-list-refnames)) + nil nil nil 'magit-revision-history + (magit--default-starting-point)) (user-error "Nothing selected"))) (defun magit--default-starting-point () @@ -1632,12 +1742,11 @@ Return a list of two integers: (A>B B>A)." require-match nil 'magit-revision-history (magit-tag-at-point))) -(defun magit-read-stash (prompt &optional use-at-point) - (let ((atpoint (magit-stash-at-point))) - (or (and use-at-point atpoint) - (let ((stashes (magit-list-stashes))) - (magit-completing-read prompt stashes nil t nil nil - (or atpoint (car stashes))))))) +(defun magit-read-stash (prompt) + (let ((stashes (magit-list-stashes))) + (magit-completing-read prompt stashes nil t nil nil + (magit-stash-at-point) + (car stashes)))) (defun magit-read-remote (prompt &optional default use-only) (let ((remotes (magit-list-remotes))) @@ -1679,34 +1788,132 @@ Return a list of two integers: (A>B B>A)." configs)))) (defun magit-get (&rest keys) - "Return the value of Git config entry specified by KEYS." + "Return the value of the Git variable specified by KEYS." (car (last (apply 'magit-get-all keys)))) (defun magit-get-all (&rest keys) - "Return all values of the Git config entry specified by KEYS." + "Return all values of the Git variable specified by KEYS." (let ((magit-git-debug nil) + (arg (and (or (null (car keys)) + (string-prefix-p "--" (car keys))) + (pop keys))) (key (mapconcat 'identity keys "."))) - (if magit--refresh-cache + (if (and magit--refresh-cache (not arg)) (magit-config-get-from-cached-list key) - (magit-git-items "config" "-z" "--get-all" key)))) + (magit-git-items "config" arg "-z" "--get-all" key)))) (defun magit-get-boolean (&rest keys) - "Return the boolean value of Git config entry specified by KEYS." + "Return the boolean value of the Git variable specified by KEYS." (let ((key (mapconcat 'identity keys "."))) (if magit--refresh-cache (equal "true" (car (magit-config-get-from-cached-list key))) (magit-git-true "config" "--bool" key)))) -(defun magit-set (val &rest keys) - "Set Git config settings specified by KEYS to VAL." - (let ((key (mapconcat 'identity keys "."))) - (if val - (magit-git-success "config" key val) - (magit-git-success "config" "--unset" key)) - val)) +(defun magit-set (value &rest keys) + "Set the value of the Git variable specified by KEYS to VALUE." + (let ((arg (and (or (null (car keys)) + (string-prefix-p "--" (car keys))) + (pop keys))) + (key (mapconcat 'identity keys "."))) + (if value + (magit-git-success "config" arg key value) + (magit-git-success "config" arg "--unset" key)) + value)) (gv-define-setter magit-get (val &rest keys) `(magit-set ,val ,@keys)) +(defun magit-set-all (values &rest keys) + "Set all values of the Git variable specified by KEYS to VALUES." + (let ((arg (and (or (null (car keys)) + (string-prefix-p "--" (car keys))) + (pop keys))) + (var (mapconcat 'identity keys "."))) + (when (magit-get var) + (magit-call-git "config" arg "--unset-all" var)) + (dolist (v values) + (magit-call-git "config" arg "--add" var v)))) + +;;;; Variables in Popups + +(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)) + (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)) + (concat + (propertize (car values) 'face 'magit-popup-option-value) + (mapconcat + (lambda (value) + (concat "\n" (make-string width ?\s) + (propertize value + 'face 'magit-popup-option-value))) + (cdr values) "")) + (propertize "unset" 'face 'magit-popup-disabled-argument)))) + +(defun magit--set-popup-variable + (variable choices &optional default other) + (magit-set (--if-let (magit-git-string "config" "--local" variable) + (cadr (member it choices)) + (car choices)) + variable) + (magit-with-pre-popup-buffer + (magit-refresh)) + (message "%s %s" variable + (magit--format-popup-variable:choices* + variable choices default other))) + +(defun magit--format-popup-variable:choices + (variable choices &optional default other width) + (concat variable + (if width (make-string (- width (length variable)) ?\s) " ") + (magit--format-popup-variable:choices* + variable choices default other))) + +(defun magit--format-popup-variable:choices* + (variable choices &optional default other) + (let ((local (magit-git-string "config" "--local" variable)) + (global (magit-git-string "config" "--global" variable))) + (when other + (setq other (--when-let (magit-get other) + (concat other ":" it)))) + (concat + (propertize "[" 'face 'magit-popup-disabled-argument) + (mapconcat + (lambda (choice) + (propertize choice 'face (if (equal choice local) + 'magit-popup-option-value + 'magit-popup-disabled-argument))) + choices + (propertize "|" 'face 'magit-popup-disabled-argument)) + (when (or global other default) + (concat + (propertize "|" 'face 'magit-popup-disabled-argument) + (cond (global + (propertize (concat "global:" global) + 'face (cond (local + 'magit-popup-disabled-argument) + ((member global choices) + 'magit-popup-option-value) + (t + 'font-lock-warning-face)))) + (other + (propertize other + 'face (if local + 'magit-popup-disabled-argument + 'magit-popup-option-value))) + (default + (propertize (concat "default:" default) + 'face (if local + 'magit-popup-disabled-argument + 'magit-popup-option-value)))))) + (propertize "]" 'face 'magit-popup-disabled-argument)))) + (provide 'magit-git) ;;; magit-git.el ends here diff --git a/elpa/magit-20171009.1252/magit-imenu.el b/elpa/magit-20171208.618/magit-imenu.el similarity index 99% rename from elpa/magit-20171009.1252/magit-imenu.el rename to elpa/magit-20171208.618/magit-imenu.el index 0d7b0341..83c5b6ab 100644 --- a/elpa/magit-20171009.1252/magit-imenu.el +++ b/elpa/magit-20171208.618/magit-imenu.el @@ -33,7 +33,7 @@ ;;; Code: -(require 'subr-x) +(eval-when-compile (require 'subr-x)) (require 'magit) (require 'git-rebase) diff --git a/elpa/magit-20171009.1252/magit-log.el b/elpa/magit-20171208.618/magit-log.el similarity index 93% rename from elpa/magit-20171009.1252/magit-log.el rename to elpa/magit-20171208.618/magit-log.el index 8c07a490..63bcedc4 100644 --- a/elpa/magit-20171009.1252/magit-log.el +++ b/elpa/magit-20171208.618/magit-log.el @@ -123,7 +123,7 @@ This is useful if you use really long branch names." (defcustom magit-log-highlight-keywords t "Whether to highlight bracketed keywords in commit summaries." - :package-version '(magit . "2.11.1") + :package-version '(magit . "2.12.0") :group 'magit-log :type 'boolean) @@ -145,6 +145,11 @@ This is useful if you use really long branch names." "Face for the date part of the log output." :group 'magit-faces) +(defface magit-header-line-log-select + '((t :inherit bold)) + "Face for the `header-line' in `magit-log-select-mode'." + :group 'magit-faces) + ;;;; File Log (defcustom magit-log-buffer-file-locked t @@ -343,7 +348,7 @@ the upstream isn't ahead of the current branch) show." (?S "Show signatures" "--show-signature") (?u "Show diffs" "--patch") (?s "Show diffstats" "--stat") - (?h "Show header" "++header") + (?h "Show header" "++header" magit-log++header) (?D "Simplify by decoration" "--simplify-by-decoration") (?f "Follow renames when showing single-file log" "--follow")) :options ((?n "Limit number of commits" "-n") @@ -427,11 +432,21 @@ the upstream isn't ahead of the current branch) show." (user-error "Trace is invalid, see man git-log")))) (defun magit-log-select-order (&rest _ignored) + "Set one `---order' option in Git log. +This encompasses the options `--author-date-order', +`--date-order', and `--topo-order'." (magit-read-char-case "Order commits by " t (?t "[t]opography" "topo") (?a "[a]uthor date" "author-date") (?c "[c]ommitter date" "date"))) +;; This is a dummy procedure used to show help in `magit-log-popup'. +(defun magit-log++header () + "Insert a header after each revision summary in Git log. +Customize `magit-log-revision-headers-format' to change this +header." + nil) + (defun magit-log-get-buffer-args () (cond ((and magit-use-sticky-arguments (derived-mode-p 'magit-log-mode)) @@ -645,6 +660,7 @@ active, restrict the log to the lines that the region touches." (interactive (cons current-prefix-arg (and (region-active-p) + (magit-file-relative-name) (save-restriction (widen) (list (line-number-at-pos (region-beginning)) @@ -656,7 +672,9 @@ 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 (or (magit-file-relative-name) + (and (derived-mode-p 'dired-mode) + default-directory))) (magit-mode-setup-internal #'magit-log-mode (list (list (or magit-buffer-refname @@ -812,16 +830,17 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. "Arguments which disable the graph speedup hack.") (defun magit-log-refresh-buffer (revs args files) - (setq header-line-format - (propertize - (concat " Commits in " (mapconcat 'identity revs " ") - (and files (concat " touching " - (mapconcat 'identity files " "))) - (--some (and (string-prefix-p "-L" it) - (concat " " it)) - args)) - 'face 'magit-header-line)) - (unless (= (length files) 1) + (magit-set-header-line-format + (concat "Commits in " + (mapconcat #'identity revs " ") + (and files (concat " touching " + (mapconcat 'identity files " "))) + (--some (and (string-prefix-p "-L" it) + (concat " " it)) + args))) + (if (= (length files) 1) + (unless (magit-file-tracked-p (car files)) + (setq args (cons "--full-history" args))) (setq args (remove "--follow" args))) (when (--any-p (string-match-p (concat "^" (regexp-opt magit-log-remove-graph-args)) it) @@ -985,6 +1004,9 @@ Do not add this to a hook variable." (`bisect-log magit-log-bisect-log-re))) (magit-bind-match-strings (hash msg refs graph author date gpg cherry _ refsub side) nil + (setq msg (substring-no-properties msg)) + (when refs + (setq refs (substring-no-properties refs))) (let ((align (not (member "--stat" (cadr magit-refresh-args)))) (non-graph-re (if (eq style 'bisect-vis) magit-log-bisect-vis-re @@ -1037,14 +1059,7 @@ Do not add this to a hook variable." (?Y 'magit-signature-expired-key) (?R 'magit-signature-revoked) (?E 'magit-signature-error))))) - (let ((start 0)) - (while (string-match "\\[[^[]*\\]" msg start) - (setq start (match-end 0)) - (when magit-log-highlight-keywords - (put-text-property (match-beginning 0) - (match-end 0) - 'face 'magit-keyword msg)))) - (insert msg)) + (insert (magit-log-propertize-keywords msg))) (when (and refs magit-log-show-refname-after-summary) (insert ?\s) (insert (magit-format-ref-labels refs))) @@ -1108,6 +1123,16 @@ Do not add this to a hook variable." (insert graph ?\n)))))))) t) +(defun magit-log-propertize-keywords (msg) + (let ((start 0)) + (while (string-match "\\[[^[]*\\]" msg start) + (setq start (match-end 0)) + (when magit-log-highlight-keywords + (put-text-property (match-beginning 0) + (match-end 0) + 'face 'magit-keyword msg)))) + msg) + (defun magit-log-maybe-show-more-commits (section) "When point is at the end of a log buffer, insert more commits. @@ -1268,28 +1293,36 @@ 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) +(defun magit-log-select (pick &optional msg quit branch args) (declare (indent defun)) (magit-mode-setup #'magit-log-select-mode (or branch (magit-get-current-branch) "HEAD") - magit-log-select-arguments) + (append args magit-log-select-arguments)) (magit-log-goto-same-commit) (setq magit-log-select-pick-function pick) (setq magit-log-select-quit-function quit) (when magit-log-select-show-usage - (setq msg (substitute-command-keys - (format-spec - (if msg - (if (string-suffix-p "," msg) - (concat msg " or %q to abort") - msg) - "Type %p to select commit at point, or %q to abort") - '((?p . "\\[magit-log-select-pick]") - (?q . "\\[magit-log-select-quit]"))))) + (let ((pick (propertize (substitute-command-keys + "\\[magit-log-select-pick]") + 'face + 'magit-header-line-key)) + (quit (propertize (substitute-command-keys + "\\[magit-log-select-quit]") + 'face + 'magit-header-line-key))) + (setq msg (format-spec + (if msg + (if (string-suffix-p "," msg) + (concat msg " or %q to abort") + msg) + "Type %p to select commit at point, or %q to abort") + `((?p . ,pick) + (?q . ,quit))))) + (add-face-text-property 0 (length msg) 'magit-header-line-log-select t msg) (when (memq magit-log-select-show-usage '(both header-line)) - (setq header-line-format (propertize (concat " " msg) 'face 'bold))) + (magit-set-header-line-format msg)) (when (memq magit-log-select-show-usage '(both echo-area)) - (message "%s" msg)))) + (message "%s" (substring-no-properties msg))))) (defun magit-log-select-pick () "Select the commit at point and act on it. @@ -1298,13 +1331,13 @@ commit as argument." (interactive) (let ((fun magit-log-select-pick-function) (rev (magit-commit-at-point))) - (quit-restore-window nil 'kill) + (magit-mode-bury-buffer 'kill) (funcall fun rev))) (defun magit-log-select-quit () "Abort selecting a commit, don't act on any commit." (interactive) - (quit-restore-window nil 'kill) + (magit-mode-bury-buffer 'kill) (when magit-log-select-quit-function (funcall magit-log-select-quit-function))) @@ -1394,8 +1427,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. 'magit-bookmark--reflog-make-record)) (defun magit-reflog-refresh-buffer (ref args) - (setq header-line-format - (propertize (concat " Reflog for " ref) 'face 'magit-header-line)) + (magit-set-header-line-format (concat "Reflog for " ref)) (magit-insert-section (reflogbuf) (magit-git-wash (apply-partially 'magit-log-wash-log 'reflog) "reflog" "show" "--format=%h%x00%aN%x00%gd%x00%gs" "--date=raw" @@ -1483,15 +1515,56 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (magit-define-section-jumper magit-jump-to-unpushed-to-upstream "Unpushed to @{upstream}" unpushed "@{upstream}..") -(defun magit-insert-unpushed-to-upstream () +(defun magit-insert-unpushed-to-upstream-or-recent () + "Insert section showing unpushed or other recent commits. +If an upstream is configured for the current branch and it is +behind of the current branch, then show the commits that have +not yet been pushed into the upstream branch. If no upstream is +configured or if the upstream is not behind of the current branch, +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)) + (magit-section-hidden it) + 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)) + (magit-section-hidden it) + t))))) + +(defun magit-insert-unpushed-to-upstream (&optional collapse) "Insert commits that haven't been pushed to the upstream yet." (when (magit-git-success "rev-parse" "@{upstream}") - (magit-insert-section (unpushed "@{upstream}..") + (magit-insert-section (unpushed "@{upstream}.." collapse) (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) + "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-heading "Recent commits") + (magit-insert-log range + (cons (format "-n%d" magit-log-section-commit-count) + (--remove (string-prefix-p "-n" it) + magit-log-section-arguments)))))) + (magit-define-section-jumper magit-jump-to-unpushed-to-pushremote "Unpushed to " unpushed (concat (magit-get-push-branch) "..")) @@ -1501,39 +1574,16 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (--when-let (magit-get-push-branch) (unless (and (equal (magit-rev-name it) (magit-rev-name "@{upstream}")) - (memq 'magit-insert-unpushed-to-upstream - magit-status-sections-hook)) + (or (memq 'magit-insert-unpushed-to-upstream + magit-status-sections-hook) + (memq 'magit-insert-unpushed-to-upstream-or-recent + magit-status-sections-hook))) (magit-insert-section (unpushed (concat it "..")) (magit-insert-heading (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) (propertize it 'face 'magit-branch-remote))) (magit-insert-log (concat it "..") magit-log-section-arguments))))) -(defun magit-insert-recent-commits (&optional collapse) - "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-heading "Recent commits") - (magit-insert-log range - (cons (format "-%d" magit-log-section-commit-count) - magit-log-section-arguments))))) - -(defun magit-insert-unpulled-from-upstream-or-recent () - "Insert section showing unpulled or recent commits. -If an upstream is configured for the current branch and it is -ahead of the current branch, then show the commits that have -not yet been pulled into the current branch. If no upstream is -configured or if the upstream is not ahead of the current branch, -then show the last `magit-log-section-commit-count' commits." - (let ((upstream (magit-rev-parse "@{upstream}"))) - (if (or (not upstream) - (equal upstream (magit-rev-parse "HEAD"))) - (magit-insert-recent-commits t) - (magit-insert-unpulled-from-upstream)))) - ;;;; Auxiliary Log Sections (defun magit-insert-unpulled-cherries () diff --git a/elpa/magit-20171009.1252/magit-margin.el b/elpa/magit-20171208.618/magit-margin.el similarity index 100% rename from elpa/magit-20171009.1252/magit-margin.el rename to elpa/magit-20171208.618/magit-margin.el diff --git a/elpa/magit-20171009.1252/magit-mode.el b/elpa/magit-20171208.618/magit-mode.el similarity index 97% rename from elpa/magit-20171009.1252/magit-mode.el rename to elpa/magit-20171208.618/magit-mode.el index 4d000db6..7e1a0bfe 100644 --- a/elpa/magit-20171009.1252/magit-mode.el +++ b/elpa/magit-20171208.618/magit-mode.el @@ -173,7 +173,7 @@ This is used by `magit-generate-buffer-name-default-function'. If another `magit-generate-buffer-name-function' is used, then it may not respect this option, or on the contrary it may support additional %-sequences." - :package-version '(magit . "2.11.1") + :package-version '(magit . "2.12.0") :group 'magit-buffers :type 'string) @@ -360,10 +360,8 @@ starts complicating other things, then it will be removed." (define-key map (kbd "C-i") 'magit-section-toggle) (define-key map [C-tab] 'magit-section-cycle) (define-key map [M-tab] 'magit-section-cycle-diffs) - (define-key map [S-tab] 'magit-section-cycle-global) - ;; Next two are for backward compatibility. - (define-key map [s-tab] 'magit-section-cycle-global) - (define-key map [backtab] 'magit-section-cycle-global) + ;; [backtab] is the most portable binding for Shift+Tab. + (define-key map [backtab] 'magit-section-cycle-global) (define-key map (kbd "^") 'magit-section-up) (define-key map (kbd "p") 'magit-section-backward) (define-key map (kbd "n") 'magit-section-forward) @@ -388,6 +386,7 @@ starts complicating other things, then it will be removed." (define-key map (kbd "M-3") 'magit-section-show-level-3-all) (define-key map (kbd "M-4") 'magit-section-show-level-4-all) (define-key map "$" 'magit-process-buffer) + (define-key map "%" 'magit-worktree-popup) (define-key map "a" 'magit-cherry-apply) (define-key map "A" 'magit-cherry-pick-popup) (define-key map "b" 'magit-branch-popup) @@ -548,7 +547,11 @@ Magit is documented in info node `(magit)'." (magit-delete-region-overlays) (if (and (run-hook-with-args-until-success 'magit-region-highlight-hook (magit-current-section)) - (not magit-keep-region-overlay)) + (not magit-keep-region-overlay) + (not (= (line-number-at-pos start) + (line-number-at-pos end))) + ;; (not (eq (car-safe last-command-event) 'mouse-movement)) + ) (funcall (default-value 'redisplay-unhighlight-region-function) rol) (funcall (default-value 'redisplay-highlight-region-function) start end window rol))) @@ -842,9 +845,34 @@ latter is displayed in its place." major-mode value))) (user-error "Buffer has no value it could be locked to")))) +(defvar magit-buffer-lock-functions nil + "Provide buffer-locking support for third-party modes. +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 + + (magit-mode-setup-internal #\\='my-mode \\='(1 2 3) t) + +the function will be invoked as + + (apply lock-func \\='(1 2 3)) + +if the cons (my-mode . lock-func) is in this list. + +This variable is intended for third-party extensions; +`magit-buffer-lock-value' implements all built-in behavior. + +See also `magit-toggle-buffer-lock'.") + (cl-defun magit-buffer-lock-value (&optional (mode major-mode) (args magit-refresh-args)) + "Find an appropriate buffer lock value for MODE under ARGS. +See also `magit-buffer-lock-functions'." (cl-case mode (magit-cherry-mode (-let [(upstream head) args] @@ -872,7 +900,10 @@ latter is displayed in its place." ((magit-reflog-mode ; (ref ~args) magit-stash-mode ; (stash _const _args _files) magit-stashes-mode) ; (ref) - (car args)))) + (car args)) + (t + (--when-let (cdr (assq mode magit-buffer-lock-functions)) + (apply it args))))) (defun magit-mode-bury-buffer (&optional kill-buffer) "Bury the current buffer. diff --git a/elpa/magit-20171009.1252/magit-notes.el b/elpa/magit-20171208.618/magit-notes.el similarity index 57% rename from elpa/magit-20171009.1252/magit-notes.el rename to elpa/magit-20171208.618/magit-notes.el index 95b96fd1..866665ca 100644 --- a/elpa/magit-20171009.1252/magit-notes.el +++ b/elpa/magit-20171208.618/magit-notes.el @@ -34,7 +34,21 @@ ;;;###autoload (autoload 'magit-notes-popup "magit" nil t) (magit-define-popup magit-notes-popup "Popup console for notes commands." - :man-page "git-tag" + :man-page "git-notes" + :variables '("Configure local settings" + (?c "core.notesRef" + magit-set-core.notesRef + magit-format-core.notesRef) + (?d "notes.displayRef" + magit-set-notes.displayRef + magit-format-notes.displayRef) + "Configure global settings" + (?C "core.notesRef" + magit-set-global-core.notesRef + magit-format-global-core.notesRef) + (?D "notes.displayRef" + magit-set-global-notes.displayRef + magit-format-global-notes.displayRef)) :switches '("Switch for prune" (?n "Dry run" "--dry-run")) :options '("Option for edit and remove" @@ -44,9 +58,7 @@ :actions '((?T "Edit" magit-notes-edit) (?r "Remove" magit-notes-remove) (?m "Merge" magit-notes-merge) - (?p "Prune" magit-notes-prune) - (?s "Set ref" magit-notes-set-ref) - (?S "Set display refs" magit-notes-set-display-refs)) + (?p "Prune" magit-notes-prune)) :sequence-actions '((?c "Commit merge" magit-notes-merge-commit) (?a "Abort merge" magit-notes-merge-abort)) :sequence-predicate 'magit-notes-merging-p @@ -57,10 +69,17 @@ (and (file-directory-p dir) (directory-files dir nil "^[^.]")))) -(defun magit-notes-popup-read-ref (prompt &optional initial-input) - (magit-completing-read prompt (nconc (list "refs/" "refs/notes/") - (magit-list-notes-refnames)) - nil nil initial-input)) +(defun magit-format-core.notesRef () + (magit--format-popup-variable:value "core.notesRef" 22)) + +(defun magit-format-notes.displayRef () + (magit--format-popup-variable:values "notes.displayRef" 22)) + +(defun magit-format-global-core.notesRef () + (magit--format-popup-variable:value "core.notesRef" 22 t)) + +(defun magit-format-global-notes.displayRef () + (magit--format-popup-variable:values "notes.displayRef" 22 t)) ;;; Commands @@ -118,59 +137,62 @@ Also see `magit-notes-merge'." (magit-process-buffer)) (magit-run-git-with-editor "notes" "prune" (and dry-run "--dry-run"))) -(defun magit-notes-set-ref (ref &optional global) - "Set the current notes ref to REF. -The ref is made current by setting the value of the Git variable -`core.notesRef'. With a prefix argument GLOBAL change the global -value, else the value in the current repository. When this is -undefined, then \"refs/notes/commit\" is used. - -Other `magit-notes-*' commands, as well as the sub-commands -of Git's `note' command, default to operate on that ref." - (interactive - (list (magit-completing-read "Set notes ref" - (nconc (list "refs/" "refs/notes/") - (magit-list-notes-refnames)) - nil nil - (--when-let (magit-get "core.notesRef") - (if (string-match "^refs/notes/\\(.+\\)" it) - (match-string 1 it) - it))) - current-prefix-arg)) - (if ref - (magit-run-git "config" (and global "--global") "core.notesRef" - (if (string-prefix-p "refs/" ref) - ref - (concat "refs/notes/" ref))) - (magit-run-git "config" (and global "--global") - "--unset" "core.notesRef"))) - -(defun magit-notes-set-display-refs (refs &optional global) - "Set notes refs to be display in addition to \"core.notesRef\". -REFS is a colon separated list of notes refs. The values are -stored in the Git variable `notes.displayRef'. With a prefix -argument GLOBAL change the global values, else the values in -the current repository." - (interactive - (list (magit-completing-read "Set additional notes ref(s)" - (nconc (list "refs/" "refs/notes/") - (magit-list-notes-refnames)) - nil nil - (mapconcat #'identity - (magit-get-all "notes.displayRef") - ":")) - current-prefix-arg)) - (when (and refs (atom refs)) - (setq refs (split-string refs ":"))) - (when global - (setq global "--global")) - (magit-git-success "config" "--unset-all" global "notes.displayRef") - (dolist (ref refs) - (magit-call-git "config" "--add" global "notes.displayRef" ref)) - (magit-refresh)) +(defun magit-set-core.notesRef (ref) + "Set the local value of `core.notesRef' to REF." + (interactive (list (magit-notes-read-ref "Set local core.notesRef"))) + (magit-set ref "core.notesRef") + (magit-with-pre-popup-buffer + (magit-refresh))) + +(defun magit-set-global-core.notesRef (ref) + "Set the global value of `core.notesRef' to REF." + (interactive (list (magit-notes-read-ref "Set global core.notesRef"))) + (magit-set ref "--global" "core.notesRef") + (magit-with-pre-popup-buffer + (magit-refresh))) + +(defun magit-set-notes.displayRef (refs) + "Set the local values of `notes.displayRef' to REFS." + (interactive (list (magit-notes-read-refs "Set local notes.displayRef"))) + (magit-set-all refs "notes.displayRef") + (magit-with-pre-popup-buffer + (magit-refresh))) + +(defun magit-set-global-notes.displayRef (refs) + "Set the global values of `notes.displayRef' to REFS." + (interactive (list (magit-notes-read-refs "Set global notes.displayRef"))) + (magit-set-all refs "--global" "notes.displayRef") + (magit-with-pre-popup-buffer + (magit-refresh))) + +(defun magit-notes-read-ref (prompt) + (--when-let (magit-completing-read + prompt (magit-list-notes-refnames) nil nil + (--when-let (magit-get "core.notesRef") + (if (string-prefix-p "refs/notes/" it) + (substring it 11) + it))) + (if (string-prefix-p "refs/" it) + it + (concat "refs/notes/" it)))) + +(defun magit-notes-read-refs (prompt) + (mapcar (lambda (ref) + (if (string-prefix-p "refs/" ref) + ref + (concat "refs/notes/" ref))) + (completing-read-multiple + (concat prompt ": ") + (magit-list-notes-refnames) nil nil + (mapconcat (lambda (ref) + (if (string-prefix-p "refs/notes/" ref) + (substring ref 11) + ref)) + (magit-get-all "notes.displayRef") + ",")))) (defun magit-notes-read-args (prompt) - (list (magit-read-branch-or-commit prompt) + (list (magit-read-branch-or-commit prompt (magit-stash-at-point)) (--when-let (--first (string-match "^--ref=\\(.+\\)" it) (magit-notes-arguments)) (match-string 1 it)))) diff --git a/elpa/magit-20171009.1252/magit-obsolete.el b/elpa/magit-20171208.618/magit-obsolete.el similarity index 94% rename from elpa/magit-20171009.1252/magit-obsolete.el rename to elpa/magit-20171208.618/magit-obsolete.el index 6ddea4ba..3406b29a 100644 --- a/elpa/magit-20171009.1252/magit-obsolete.el +++ b/elpa/magit-20171208.618/magit-obsolete.el @@ -129,5 +129,13 @@ use `magit-pre-refresh-hook', `magit-post-refresh-hook', (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") + +(make-obsolete-variable 'magit-no-confirm-default + 'magit-dwim-selection "Magit 2.12.0") + (provide 'magit-obsolete) ;;; magit-obsolete.el ends here diff --git a/elpa/magit-20171208.618/magit-pkg.el b/elpa/magit-20171208.618/magit-pkg.el new file mode 100644 index 00000000..3ada08e9 --- /dev/null +++ b/elpa/magit-20171208.618/magit-pkg.el @@ -0,0 +1,12 @@ +(define-package "magit" "20171208.618" "A Git porcelain inside Emacs." + '((emacs "24.4") + (async "20170823") + (dash "20170810") + (ghub "20171207") + (git-commit "20170823") + (let-alist "1.0.5") + (magit-popup "20171121") + (with-editor "20170817"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/magit-20171009.1252/magit-process.el b/elpa/magit-20171208.618/magit-process.el similarity index 94% rename from elpa/magit-20171009.1252/magit-process.el rename to elpa/magit-20171208.618/magit-process.el index bff559de..77e5c9cd 100644 --- a/elpa/magit-20171009.1252/magit-process.el +++ b/elpa/magit-20171208.618/magit-process.el @@ -199,6 +199,11 @@ non-nil, then the password is read from the user instead." "Face for non-zero exit-status." :group 'magit-faces) +(defface magit-mode-line-process + '((t :inherit mode-line-emphasis)) + "Face for `mode-line-process' status when Git is running for side-effects." + :group 'magit-faces) + ;;; Process Mode (defvar magit-process-mode-map @@ -359,6 +364,10 @@ option `magit-git-global-arguments' specifies constant arguments. The remaining arguments ARGS specify arguments to Git, they are flattened before use." (declare (indent 1)) + (when (eq system-type 'windows-nt) + ;; On w32, git expects UTF-8 encoded input, ignore any user + ;; configuration telling us otherwise (see #3250). + (encode-coding-region (point-min) (point-max) 'utf-8-unix)) (if (file-remote-p default-directory) ;; We lack `process-file-region', so fall back to asynch + ;; waiting in remote case. @@ -497,6 +506,10 @@ Magit status buffer." (with-editor-set-process-filter process #'magit-process-filter) (set-process-sentinel process #'magit-process-sentinel) (set-process-buffer process process-buf) + (when (eq system-type 'windows-nt) + ;; On w32, git expects UTF-8 encoded input, ignore any user + ;; configuration telling us otherwise. + (set-process-coding-system process 'utf-8-unix)) (process-put process 'section section) (process-put process 'command-buf (current-buffer)) (process-put process 'default-dir default-directory) @@ -596,7 +609,8 @@ Magit status buffer." (magit-refresh)) (with-temp-buffer (setq default-directory (process-get process 'default-dir)) - (magit-refresh))))))) + (magit-refresh))))) + (force-mode-line-update t))) (defun magit-sequencer-process-sentinel (process event) "Special sentinel used by `magit-run-git-sequencer'." @@ -782,16 +796,20 @@ as argument." (defun magit-process-set-mode-line (program args) (when (equal program magit-git-executable) (setq args (nthcdr (length magit-git-global-arguments) args))) - (let ((str (concat " " program (and args (concat " " (car args)))))) + (let ((str (concat " " (propertize + (concat program (and args (concat " " (car args)))) + 'face 'magit-mode-line-process)))) (dolist (buf (magit-mode-get-buffers)) - (with-current-buffer buf (setq mode-line-process str))))) + (with-current-buffer buf + (setq mode-line-process str))))) (defun magit-process-unset-mode-line () (dolist (buf (magit-mode-get-buffers)) (with-current-buffer buf (setq mode-line-process nil)))) -(defvar magit-process-error-message-re - (concat "^\\(?:error\\|fatal\\|git\\): \\(.*\\)" paragraph-separate)) +(defvar magit-process-error-message-regexps + (list "^\\*ERROR\\*: Canceled by user$" + "^\\(?:error\\|fatal\\|git\\): \\(.*\\)$")) (define-error 'magit-git-error "Git error") @@ -839,17 +857,25 @@ as argument." (window-list)))) (magit-section-hide section))))))) (unless (= arg 0) - (let ((msg (or (and (buffer-live-p process-buf) - (with-current-buffer process-buf - (save-excursion - (goto-char (magit-section-end section)) - (--when-let (magit-section-content section) - (when (re-search-backward - magit-process-error-message-re it t) - (match-string-no-properties 1)))))) - "Git failed"))) - (if magit-process-raise-error - (signal 'magit-git-error (list (format "%s (in %s)" msg default-dir))) + (let ((msg + (or (and (buffer-live-p process-buf) + (with-current-buffer process-buf + (and (magit-section-content section) + (save-excursion + (goto-char (magit-section-end section)) + (run-hook-wrapped + 'magit-process-error-message-regexps + (lambda (re) + (save-excursion + (and (re-search-backward re nil t) + (or (match-string-no-properties 1) + (and (not magit-process-raise-error) + 'suppressed)))))))))) + "Git failed"))) + (cond + (magit-process-raise-error + (signal 'magit-git-error (list (format "%s (in %s)" msg default-dir)))) + ((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)) @@ -862,7 +888,7 @@ as argument." 'magit-process-buffer))))) (format "Hit %s to see" (key-description key)) "See") - (buffer-name process-buf))))) + (buffer-name process-buf)))))) arg) (defun magit-process-display-buffer (process) diff --git a/elpa/magit-20171009.1252/magit-refs.el b/elpa/magit-20171208.618/magit-refs.el similarity index 81% rename from elpa/magit-20171009.1252/magit-refs.el rename to elpa/magit-20171208.618/magit-refs.el index 8b85225d..ca5e649d 100644 --- a/elpa/magit-20171009.1252/magit-refs.el +++ b/elpa/magit-20171208.618/magit-refs.el @@ -219,9 +219,8 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (setq ref "HEAD")) (unless (magit-rev-verify ref) (setq magit-refs-show-commit-count nil)) - (setq header-line-format - (propertize (format " %s %s" ref (mapconcat #'identity args " ")) - 'face 'magit-header-line)) + (magit-set-header-line-format + (format "%s %s" ref (mapconcat #'identity args " "))) (magit-insert-section (branchbuf) (run-hooks 'magit-refs-sections-hook))) @@ -336,18 +335,31 @@ different, but only if you have customized the option (if (and (derived-mode-p 'magit-refs-mode) (magit-section-match '(branch tag))) (let ((ref (magit-section-value (magit-current-section)))) - (cond ((and (memq 'focus-on-ref magit-visit-ref-behavior) - current-prefix-arg) - (magit-show-refs ref)) + (cond (current-prefix-arg + (cond ((memq 'focus-on-ref magit-visit-ref-behavior) + (magit-show-refs ref)) + (magit-visit-ref-behavior + ;; Don't prompt for commit to visit. + (let ((current-prefix-arg nil)) + (call-interactively #'magit-show-commit))))) ((and (memq 'create-branch magit-visit-ref-behavior) (magit-section-match [branch remote])) (let ((branch (cdr (magit-split-branch-name ref)))) (if (magit-branch-p branch) - (if (yes-or-no-p - (format "Branch %s already exists. Reset it to %s?" - branch ref)) - (magit-call-git "checkout" "-B" branch ref) - (user-error "Abort")) + (if (magit-rev-eq branch ref) + (magit-call-git "checkout" branch) + (setq branch (propertize branch 'face 'magit-branch-local)) + (setq ref (propertize ref 'face 'magit-branch-remote)) + (pcase (prog1 (read-char-choice (format (propertize "\ +Branch %s already exists. + [c]heckout %s as-is + [r]reset %s to %s and checkout %s + [a]bort " 'face 'minibuffer-prompt) branch branch branch ref branch) + '(?c ?r ?a)) + (message "")) ; otherwise prompt sticks + (?c (magit-call-git "checkout" branch)) + (?r (magit-call-git "checkout" "-B" branch ref)) + (?a (user-error "Abort")))) (magit-call-git "checkout" "-b" branch ref)) (setcar magit-refresh-args branch) (magit-refresh))) @@ -388,25 +400,6 @@ different, but only if you have customized the option ;;;; Section Variables -(defconst magit-refs-branch-line-re - (concat "^" - "\\(?:[ \\*]\\) " - "\\(?1:([^)]+)\\|[^ ]+?\\)" ; branch - "\\(?: +\\)" - "\\(?2:[0-9a-fA-F]+\\) " ; sha1 - "\\(?:\\[" - "\\(?4:[^:]+\\)" ; upstream - "\\(?:: \\(?:" - "\\(?7:gone\\)\\|" ; gone - "\\(?:ahead \\(?5:[0-9]+\\)\\)?" ; ahead - "\\(?:, \\)?" - "\\(?:behind \\(?6:[0-9]+\\)\\)?" ; behind - "\\)\\)?" - "\\] \\)?" - "\\(?3:.*\\)")) ; message - -(defconst magit-refs-symref-line-re "^ \\([^ ]+\\) +-> \\(.+\\)") - (defvar magit-refs-local-branch-format "%4c %-25n %U%m\n" "Format used for local branches in refs buffers.") (defvar magit-refs-remote-branch-format "%4c %-25n %m\n" @@ -426,34 +419,33 @@ 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." - (let ((branch (magit-get-current-branch))) - (-when-let* ((desc (magit-get "branch" branch "description")) - (desc-lines (split-string desc "\n"))) - (magit-insert-section (branchdesc branch t) - (magit-insert-heading branch ": " (car desc-lines)) - (insert (mapconcat 'identity (cdr desc-lines) "\n")) - (insert "\n\n"))))) + (-when-let* ((branch (magit-get-current-branch)) + (desc (magit-get "branch" branch "description")) + (desc-lines (split-string desc "\n"))) + (magit-insert-section (branchdesc branch t) + (magit-insert-heading branch ": " (car desc-lines)) + (insert (mapconcat 'identity (cdr desc-lines) "\n")) + (insert "\n\n")))) (defun magit-insert-local-branches () "Insert sections showing all local branches." (magit-insert-section (local nil) (magit-insert-heading "Branches:") - (let ((current (magit-get-current-branch)) - (branches (magit-list-local-branch-names))) - (dolist (line (magit-git-lines "branch" "-vv" - (cadr magit-refresh-args))) - (cond - ((string-match magit-refs-branch-line-re line) - (magit-bind-match-strings - (branch hash message upstream ahead behind gone) line - (when (string-match-p "(HEAD detached" branch) - (setq branch nil)) - (magit-insert-branch - branch magit-refs-local-branch-format current branches - 'magit-branch-local hash message upstream ahead behind gone))) - ((string-match magit-refs-symref-line-re line) - (magit-bind-match-strings (symref ref) line - (magit-insert-symref symref ref 'magit-branch-local)))))) + (dolist (line (magit-git-lines "for-each-ref" "--format=\ +%(HEAD)%00%(refname:short)%00%(objectname:short)%00%(subject)%00\ +%(upstream:short)%00%(upstream)%00%(upstream:track)" + "refs/heads" + (cadr magit-refresh-args))) + (pcase-let ((`(,head ,branch ,hash ,message + ,upstream ,uref ,utrack) + (-replace "" nil (split-string line "\0")))) + (magit-insert-branch + branch + magit-refs-local-branch-format (and (equal head "*") branch) + 'magit-branch-local hash message upstream uref + ;; Strip the brackets here because + ;; %(upstream:track,nobracket) was added in Git v2.13. + (and utrack (substring utrack 1 -1))))) (insert ?\n) (magit-make-margin-overlay nil t))) @@ -466,20 +458,17 @@ line is inserted at all." (push (magit-get "remote" remote "pushurl"))) (format "%s (%s):" (capitalize remote) (concat pull (and pull push ", ") push)))) - (let ((current (magit-get-current-branch)) - (branches (magit-list-local-branch-names))) - (dolist (line (magit-git-lines "branch" "-vvr" - (cadr magit-refresh-args))) - (cond - ((string-match magit-refs-branch-line-re line) - (magit-bind-match-strings (branch hash message) line - (when (string-match-p (format "^%s/" remote) branch) - (magit-insert-branch - branch magit-refs-remote-branch-format current branches - 'magit-branch-remote hash message)))) - ((string-match magit-refs-symref-line-re line) - (magit-bind-match-strings (symref ref) line - (magit-insert-symref symref ref 'magit-branch-remote)))))) + (dolist (line (magit-git-lines "for-each-ref" "--format=\ +%(symref:short)%00%(refname:short)%00%(objectname:short)%00%(subject)" + (concat "refs/remotes/" remote) + (cadr magit-refresh-args))) + (pcase-let ((`(,symref ,branch ,hash ,message) + (-replace "" nil (split-string line "\0")))) + (if symref + (magit-insert-symref branch symref 'magit-branch-remote) + (magit-insert-branch + branch magit-refs-remote-branch-format nil + 'magit-branch-remote hash message)))) (insert ?\n) (magit-make-margin-overlay nil t)))) @@ -487,54 +476,47 @@ line is inserted at all." "For internal use, don't add to a hook." (unless magit-refs-show-commit-count (setq format (replace-regexp-in-string "%[0-9]\\([cC]\\)" "%1\\1" format t))) - (if (equal branch "HEAD") - (magit-insert-section it (commit (magit-rev-parse "HEAD") t) - (apply #'magit-insert-branch-1 it nil format args)) - (magit-insert-section it (branch branch t) - (apply #'magit-insert-branch-1 it branch format args)))) + (if branch + (magit-insert-section it (branch branch t) + (apply #'magit-insert-branch-1 it branch format args)) + (magit-insert-section it (commit (magit-rev-parse "HEAD") t) + (apply #'magit-insert-branch-1 it nil format args)))) (defun magit-insert-branch-1 - (section branch format current branches face - &optional hash message upstream ahead behind gone) + (section branch format current face &optional hash message + upstream uref utrack) "For internal use, don't add to a hook." - (let* ((head (or (car magit-refresh-args) current "HEAD")) + (let* ((focus (car magit-refresh-args)) + (head (or focus "HEAD")) (count (and branch (magit-refs-format-commit-count branch head format))) - (mark (cond ((or (equal branch head) - (and (not branch) (equal head "HEAD"))) - (if (equal branch current) - (propertize "@" 'face 'magit-head) - (propertize "#" 'face 'magit-tag))) - ((equal branch current) - (propertize "." 'face 'magit-head))))) + (mark (cond (current + (propertize (if (member focus (list nil branch)) "@" ".") + 'face 'magit-head)) + ((equal branch focus) + (propertize "#" 'face 'magit-tag))))) (when upstream (setq upstream (propertize upstream 'face - (if (member upstream branches) + (if (string-prefix-p "refs/heads/" uref) 'magit-branch-local 'magit-branch-remote)))) (magit-insert-heading (format-spec format - `((?a . ,(or ahead "")) - (?b . ,(or behind "")) - (?c . ,(or mark count "")) + `((?c . ,(or mark count "")) (?C . ,(or mark " ")) (?h . ,(or (propertize hash 'face 'magit-hash) "")) - (?m . ,(or message "")) + (?m . ,(magit-log-propertize-keywords (or message ""))) (?n . ,(propertize (or branch "(detached)") 'face face)) (?u . ,(or upstream "")) (?U . ,(if upstream (format (propertize "[%s%s] " 'face 'magit-dimmed) - upstream - (cond - (gone - (concat ": " (propertize gone 'face 'error))) - ((or ahead behind) - (concat ": " - (and ahead (format "ahead %s" ahead)) - (and ahead behind ", ") - (and behind (format "behind %s" behind)))) - (t ""))) + (if (equal utrack "gone") + (propertize upstream 'face 'error) + upstream) + (if (and utrack (not (equal utrack "gone"))) + (concat " " utrack) + "")) ""))))) (when (magit-buffer-margin-p) (magit-refs-format-margin branch)) @@ -605,7 +587,8 @@ line is inserted at all." (magit-refs-insert-cherry-commits-1 head ref section))) (defun magit-refs-insert-cherry-commits-1 (head ref _section) - (let ((start (point))) + (let ((start (point)) + (magit-insert-section--current nil)) (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry) "cherry" "-v" (magit-abbrev-arg) head ref magit-refresh-args) (unless (= (point) start) diff --git a/elpa/magit-20171009.1252/magit-remote.el b/elpa/magit-20171208.618/magit-remote.el similarity index 83% rename from elpa/magit-20171009.1252/magit-remote.el rename to elpa/magit-20171208.618/magit-remote.el index 89817313..29534a15 100644 --- a/elpa/magit-20171009.1252/magit-remote.el +++ b/elpa/magit-20171208.618/magit-remote.el @@ -83,7 +83,8 @@ Then show the status buffer for the new repository." (with-current-buffer (process-get process 'command-buf) (magit-status-internal directory)))))) -;;; Setup +;;; Remote +;;;; Options (defcustom magit-remote-add-set-remote.pushDefault 'ask-if-unset "Whether to set the value of `remote.pushDefault' after adding a remote. @@ -100,17 +101,35 @@ variable isn't already set." (string :tag "set if named") (const :tag "don't set"))) +(defcustom magit-remote-popup-show-variables t + "Whether the `magit-remote-popup' shows Git variables. +When set to nil, no variables are displayed directly in this +popup, instead the sub-popup `magit-remote-config-popup' has +to be used to view and change remote related variables." + :package-version '(magit . "2.12.0") + :group 'magit-commands + :type 'boolean) + +;;;; Popup + +(defvar magit-remote-config-variables) + ;;;###autoload (autoload 'magit-remote-popup "magit-remote" nil t) (magit-define-popup magit-remote-popup "Popup console for remote commands." :man-page "git-remote" :default-arguments '("-f") + :variables (lambda () + (and magit-remote-popup-show-variables + magit-remote-config-variables)) :switches '("Switches for add" (?f "Fetch after add" "-f")) - :actions '((?a "Add" magit-remote-add) - (?r "Rename" magit-remote-rename) - (?k "Remove" magit-remote-remove) - (?u "Set url" magit-remote-set-url))) + :actions '((?a "Add" magit-remote-add) + (?r "Rename" magit-remote-rename) + (?k "Remove" magit-remote-remove) + (?C "Configure..." magit-remote-config-popup))) + +;;;; Commands (defun magit-read-url (prompt &optional initial-input) (let ((url (magit-read-string-ns prompt initial-input))) @@ -143,15 +162,6 @@ variable isn't already set." (unless (string= old new) (magit-run-git "remote" "rename" old new))) -;;;###autoload -(defun magit-remote-set-url (remote url) - "Change the url of the remote named REMOTE to URL." - (interactive - (let ((remote (magit-read-remote "Set url of remote"))) - (list remote (magit-read-url - "Url" (magit-get "remote" remote "url"))))) - (magit-run-git "remote" "set-url" remote url)) - ;;;###autoload (defun magit-remote-remove (remote) "Delete the remote named REMOTE." @@ -180,6 +190,143 @@ Delete the symbolic-ref \"refs/remotes//HEAD\"." (interactive (list (magit-read-remote "Unset HEAD for remote"))) (magit-run-git "remote" "set-head" remote "--delete")) +;;;; Config Popup + +(defvar magit-remote-config--remote nil) + +;;;###autoload +(defun magit-remote-config-popup (remote) + "Popup console for setting remote variables." + (interactive + (list (if (or current-prefix-arg + (and (eq magit-current-popup 'magit-remote-popup) + magit-remote-popup-show-variables)) + (magit-read-remote "Configure remote") + (magit-remote-config--remote-1)))) + (let ((magit-remote-config--remote remote)) + (magit-invoke-popup 'magit-remote-config-popup nil nil))) + +(defvar magit-remote-config-variables + '((lambda () + (concat + (propertize "Configure " 'face 'magit-popup-heading) + (propertize (magit-remote-config--remote) 'face 'magit-branch-remote))) + (?u "remote.%s.url" + magit-set-remote*url + magit-format-remote*url) + (?U "remote.%s.fetch" + magit-set-remote*fetch + magit-format-remote*fetch) + (?s "remote.%s.pushurl" + magit-set-remote*pushurl + magit-format-remote*pushurl) + (?S "remote.%s.push" + magit-set-remote*push + magit-format-remote*push) + (?O "remote.%s.tagOpt" + magit-cycle-remote*tagOpt + magit-format-remote*tagOpt))) + +(defvar magit-remote-config-popup + `(:man-page "git-remote" + :variables ,magit-remote-config-variables + :setup-function magit-remote-config-popup-setup)) + +(defun magit-remote-config-popup-setup (val def) + (magit-popup-default-setup val def) + (setq-local magit-remote-config--remote magit-remote-config--remote)) + +(defun magit-remote-config--remote (&optional prompt) + (if prompt + (or (and (not current-prefix-arg) + (or magit-remote-config--remote + (magit-remote-config--remote-1))) + (magit-read-remote prompt)) + (or magit-remote-config--remote + (magit-remote-config--remote-1) + ""))) + +(defun magit-remote-config--remote-1 () + (let ((remote (magit-get-upstream-remote))) + (if (or (not remote) + (equal remote ".")) + (and (magit-remote-p "origin") "origin") + remote))) + +;;;; Config Commands and Inserters + +(defun magit-set-remote*url (remote urls) + "Set the variable `url' for the remote named REMOTE to URLS." + (interactive (magit-remote-config--read-args "url" "Urls: ")) + (magit-remote-config--set-url remote "url" urls)) + +(defun magit-set-remote*fetch (remote values) + "Set the variable `fetch' for the remote named REMOTE to VALUES." + (interactive (magit-remote-config--read-args "fetch" "Fetch specs: ")) + (magit-set-all values "remote" remote "fetch") + (magit-refresh)) + +(defun magit-set-remote*pushurl (remote urls) + "Set the variable `pushurl' for the remote named REMOTE to URLS." + (interactive (magit-remote-config--read-args "pushurl" "Urls: ")) + (magit-remote-config--set-url remote "pushurl" urls "--push")) + +(defun magit-set-remote*push (remote values) + "Set the variable `push' for the remote named REMOTE to VALUES." + (interactive (magit-remote-config--read-args "push" "Push specs: ")) + (magit-set-all values "remote" remote "push") + (magit-refresh)) + +(defun magit-cycle-remote*tagOpt (remote) + (interactive (list (magit-remote-config--remote))) + (magit--set-popup-variable (format "remote.%s.tagOpts" remote) + '("--no-tags" "--tags") nil)) + +(defun magit-format-remote*url () + (magit-remote-config--format-variable "url")) + +(defun magit-format-remote*fetch () + (magit-remote-config--format-variable "fetch")) + +(defun magit-format-remote*pushurl () + (magit-remote-config--format-variable "pushurl")) + +(defun magit-format-remote*push () + (magit-remote-config--format-variable "push")) + +(defun magit-format-remote*tagOpt () + (let ((remote (magit-remote-config--remote))) + (magit--format-popup-variable:choices + (format "remote.%s.tagOpts" remote) + '("--no-tags" "--tags") nil nil + (+ (length remote) 16)))) + +(defun magit-remote-config--read-args (var prompt) + (let* ((remote (magit-remote-config--remote (format "Set `%s' of remote" var))) + (value (magit-get-all "remote" remote var))) + (list remote + (mapcar (lambda (url) + (if (string-prefix-p "~" url) + (expand-file-name url) + url)) + (completing-read-multiple + prompt nil nil nil + (and value (mapconcat #'identity value ","))))))) + +(defun magit-remote-config--set-url (remote var values &optional arg) + (let ((old (magit-get-all "remote" remote var))) + (dolist (v (-difference values old)) + (magit-call-git "remote" "set-url" arg "--add" remote v)) + (dolist (v (-difference old values)) + (magit-call-git "remote" "set-url" arg "--delete" remote + (concat "^" (regexp-quote v) "$")))) + (magit-refresh)) + +(defun magit-remote-config--format-variable (variable) + (magit--format-popup-variable:values + (format "remote.%s.%s" (magit-remote-config--remote) variable) + 25)) + ;;; Fetch ;;;###autoload (autoload 'magit-fetch-popup "magit-remote" nil t) @@ -352,10 +499,10 @@ missing. To add them use something like: :max-action-columns 1) (defun magit-pull-format-branch*rebase () - (magit-popup-format-variable (format "branch.%s.rebase" - (or (magit-get-current-branch) "")) - '("true" "false") - "false" "pull.rebase")) + (magit--format-popup-variable:choices + (format "branch.%s.rebase" (or (magit-get-current-branch) "")) + '("true" "false") + "false" "pull.rebase")) (defun magit-git-pull (source args) (run-hooks 'magit-credential-hook) @@ -729,7 +876,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)) + (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-20171009.1252/magit-repos.el b/elpa/magit-20171208.618/magit-repos.el similarity index 95% rename from elpa/magit-20171009.1252/magit-repos.el rename to elpa/magit-20171208.618/magit-repos.el index 2b31ae5a..3411867f 100644 --- a/elpa/magit-20171009.1252/magit-repos.el +++ b/elpa/magit-20171208.618/magit-repos.el @@ -73,11 +73,15 @@ specify the depth directly.") :options '(hl-line-mode)) (defcustom magit-repolist-columns - '(("Name" 25 magit-repolist-column-ident nil) - ("Version" 25 magit-repolist-column-version nil) - ("BU" 3 magit-repolist-column-unpushed-to-upstream ((:right-align t))) - ("Path" 99 magit-repolist-column-path nil)) + '(("Name" 25 magit-repolist-column-ident nil) + ("Version" 25 magit-repolist-column-version nil) + ("BU" 3 magit-repolist-column-unpushed-to-upstream + ((:right-align t) + (:help-echo "Local changes not in upstream"))) + ("Path" 99 magit-repolist-column-path nil)) "List of columns displayed by `magit-list-repositories'. Each element has the form (HEADER WIDTH FORMAT PROPS). @@ -87,8 +91,10 @@ of the column. FORMAT is a function that is called with one argument, the repository identification (usually its basename), and with `default-directory' bound to the toplevel of its working tree. It has to return a string to be inserted or nil. PROPS is -an alist that supports the keys `:right-align' and `:pad-right'." - :package-version '(magit . "2.8.0") +an alist that supports the keys `:right-align' and `:pad-right'. +Some entries also use `:help-echo', but `tabulated-list' does not +actually support that yet." + :package-version '(magit . "2.12.0") :group 'magit-repolist :type `(repeat (list :tag "Column" (string :tag "Header Label") @@ -152,7 +158,7 @@ control which repositories are displayed." "Major mode for browsing a list of Git repositories." (setq x-stretch-cursor nil) (setq tabulated-list-padding 0) - (setq tabulated-list-sort-key (cons "Name" nil)) + (setq tabulated-list-sort-key (cons "Path" nil)) (setq tabulated-list-format (vconcat (mapcar (-lambda ((title width _fn props)) (nconc (list title width t) diff --git a/elpa/magit-20171009.1252/magit-section.el b/elpa/magit-20171208.618/magit-section.el similarity index 96% rename from elpa/magit-20171009.1252/magit-section.el rename to elpa/magit-20171208.618/magit-section.el index 288fe513..e1fc17b6 100644 --- a/elpa/magit-20171009.1252/magit-section.el +++ b/elpa/magit-20171208.618/magit-section.el @@ -778,7 +778,7 @@ insert a newline character if necessary." (declare (indent defun)) (when args (let ((heading (apply #'concat args))) - (insert (if (next-single-property-change 0 'face (concat "0" heading)) + (insert (if (text-property-not-all 0 (length heading) 'face nil heading) heading (propertize heading 'face 'magit-section-heading))))) (unless (bolp) @@ -898,7 +898,8 @@ This function is necessary to ensure that a representation of such a region is visible. If neither of these functions were part of the hook variable, then such a region would be invisible." - (when selection + (when (and selection + (not (and (eq this-command 'mouse-drag-region)))) (--each selection (magit-section-make-overlay (magit-section-start it) (or (magit-section-content it) @@ -1045,7 +1046,7 @@ excluding SECTION itself." (`next (cdr (member section siblings))) (_ (remq section siblings)))))) -(defun magit-region-values (&rest types) +(defun magit-region-values (&optional types multiple) "Return a list of the values of the selected sections. Also see `magit-region-sections' whose doc-string explains when a @@ -1054,18 +1055,21 @@ or is not a valid section selection, then return nil. If optional TYPES is non-nil then the selection not only has to be valid; the types of all selected sections additionally have to match one of TYPES, or nil is returned." - (mapcar 'magit-section-value (apply 'magit-region-sections types))) + (mapcar #'magit-section-value (magit-region-sections types multiple))) -(defun magit-region-sections (&rest types) +(defun magit-region-sections (&optional types multiple) "Return a list of the selected sections. When the region is active and constitutes a valid section selection, then return a list of all selected sections. This is the case when the region begins in the heading of a section and -ends in the heading of a sibling of that first section. When -the selection is not valid then return nil. Most commands that -can act on the selected sections, then instead just act on the -current section, the one point is in. +ends in the heading of the same section or in that of a sibling +section. If optional MULTIPLE is non-nil, then the region cannot +begin and end in the same section. + +When the selection is not valid, then return nil. In this case, +most commands that can act on the selected sections will instead +act on the section at point. When the region looks like it would in any other buffer then the selection is invalid. When the selection is valid then the @@ -1075,15 +1079,19 @@ here if the region looks like it usually does, then that's not a valid selection as far as this function is concerned. If optional TYPES is non-nil, then the selection not only has to -be valid; the types of all selected sections additionally have to -match one of TYPES, or nil is returned." - (when (use-region-p) +be valid; the types of all selected sections additionally have +to match one of TYPES, or nil is returned. TYPES can also be a +single type, instead of a list of types." + (when (region-active-p) (let* ((rbeg (region-beginning)) (rend (region-end)) (sbeg (get-text-property rbeg 'magit-section)) (send (get-text-property rend 'magit-section))) - (unless (memq send (list sbeg magit-root-section nil)) - (let ((siblings (magit-section-siblings sbeg 'next)) sections) + (when (and send + (not (eq send magit-root-section)) + (not (and multiple (eq send sbeg)))) + (let ((siblings (cons sbeg (magit-section-siblings sbeg 'next))) + sections) (when (and (memq send siblings) (magit-section-position-in-heading-p sbeg rbeg) (magit-section-position-in-heading-p send rend)) @@ -1091,14 +1099,23 @@ match one of TYPES, or nil is returned." (push (car siblings) sections) (when (eq (pop siblings) send) (setq siblings nil))) - (setq sections (cons sbeg (nreverse sections))) + (setq sections (nreverse sections)) + (when (and types (symbolp types)) + (setq types (list types))) (when (or (not types) (--all-p (memq (magit-section-type it) types) sections)) sections))))))) -(defun magit-section-position-in-heading-p (section pos) - "Return t if POSITION is inside the heading of SECTION." - (and (>= pos (magit-section-start section)) +(defun magit-section-position-in-heading-p (&optional section pos) + "Return t if POSITION is inside the heading of SECTION. +POSITION defaults to point and SECTION defaults to the +current section." + (unless section + (setq section (magit-current-section))) + (unless pos + (setq pos (point))) + (and section + (>= pos (magit-section-start section)) (< pos (or (magit-section-content section) (magit-section-end section))) t)) diff --git a/elpa/magit-20171009.1252/magit-sequence.el b/elpa/magit-20171208.618/magit-sequence.el similarity index 85% rename from elpa/magit-20171009.1252/magit-sequence.el rename to elpa/magit-20171208.618/magit-sequence.el index 91372687..d5da6914 100644 --- a/elpa/magit-20171009.1252/magit-sequence.el +++ b/elpa/magit-20171208.618/magit-sequence.el @@ -73,6 +73,11 @@ "Face used in sequence sections." :group 'magit-faces) +(defface magit-sequence-exec + '((t :inherit magit-hash)) + "Face used in sequence sections." + :group 'magit-faces) + ;;; Common ;;;###autoload @@ -135,30 +140,46 @@ This discards all changes made since the sequence started." (magit-cherry-pick-arguments))) ;;;###autoload -(defun magit-cherry-pick (commit &optional args) - "Cherry-pick COMMIT. +(defun magit-cherry-pick (commits &optional args) + "Copy COMMITS from another branch onto the current branch. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then pick all of them, without prompting." (interactive (magit-cherry-pick-read-args "Cherry-pick")) - (unless (--any (string-prefix-p "--mainline" it) args) - (magit-assert-one-parent (car (if (listp commit) - commit - (split-string commit "\\.\\."))) - "cherry-pick")) - (magit-run-git-sequencer "cherry-pick" args commit)) + (magit--cherry-pick commits args)) ;;;###autoload -(defun magit-cherry-apply (commit &optional args) - "Apply the changes in COMMIT but do not commit them. +(defun magit-cherry-apply (commits &optional args) + "Apply the changes in COMMITS but do not commit them. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then apply all of them, without prompting." (interactive (magit-cherry-pick-read-args "Apply changes from commit")) - (unless (--any (string-prefix-p "--mainline" it) args) - (magit-assert-one-parent commit "cherry-pick")) - (magit-run-git-sequencer "cherry-pick" "--no-commit" - (remove "--ff" args) commit)) + (magit--cherry-pick commits (cons "--no-commit" (remove "--ff" args)))) + +(defun magit--cherry-pick (commits args &optional revert) + (let ((command (if revert "revert" "cherry-pick"))) + (when (stringp commits) + (setq commits (if (string-match-p "\\.\\." commits) + (split-string commits "\\.\\.") + (list commits)))) + (magit-run-git-sequencer + (if revert "revert" "cherry-pick") + (pcase-let ((`(,merge ,non-merge) + (-separate 'magit-merge-commit-p commits))) + (cond + ((not merge) + (--remove (string-prefix-p "--mainline=" it) args)) + (non-merge + (user-error "Cannot %s merge and non-merge commits at once" + command)) + ((--first (string-prefix-p "--mainline=" it) args) + args) + (t + (cons (format "--mainline=%s" + (read-number "Replay merges relative to parent: ")) + args)))) + commits))) (defun magit-cherry-pick-in-progress-p () ;; .git/sequencer/todo does not exist when there is only one commit left. @@ -170,7 +191,9 @@ without prompting." (magit-define-popup magit-revert-popup "Popup console for revert commands." :man-page "git-revert" - :switches '((?s "Add Signed-off-by lines" "--signoff")) + :switches '((?s "Add Signed-off-by lines" "--signoff") + (?e "Edit commit message" "--edit") + (?E "Don't edit commit message" "--no-edit")) :options '((?s "Strategy" "--strategy=") (?S "Sign using gpg" "--gpg-sign=" magit-read-gpg-secret-key) (?m "Replay merge relative to parent" "--mainline=")) @@ -179,7 +202,8 @@ without prompting." :sequence-actions '((?V "Continue" magit-sequencer-continue) (?s "Skip" magit-sequencer-skip) (?a "Abort" magit-sequencer-abort)) - :sequence-predicate 'magit-sequencer-in-progress-p) + :sequence-predicate 'magit-sequencer-in-progress-p + :default-arguments '("--edit")) (defun magit-revert-read-args (prompt) (list (or (magit-region-values 'commit) @@ -193,9 +217,7 @@ Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then revert all of them, without prompting." (interactive (magit-revert-read-args "Revert commit")) - (unless (--any (string-prefix-p "--mainline" it) args) - (magit-assert-one-parent commit "revert")) - (magit-run-git-sequencer "revert" args commit)) + (magit--cherry-pick commit args t)) ;;;###autoload (defun magit-revert-no-commit (commit &optional args) @@ -204,9 +226,7 @@ Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then revert all of them, without prompting." (interactive (magit-revert-read-args "Revert changes")) - (unless (--any (string-prefix-p "--mainline" it) args) - (magit-assert-one-parent commit "revert")) - (magit-run-git-sequencer "revert" "--no-commit" args commit)) + (magit--cherry-pick commit (cons "--no-commit" args) t)) (defun magit-revert-in-progress-p () ;; .git/sequencer/todo does not exist when there is only one commit left. @@ -228,10 +248,12 @@ without prompting." (?D "Use committer date as author date" "--ignore-date")) :options '((?p "Remove leading slashes from paths" "-p" magit-popup-read-number)) - :actions '((?w "Apply patches" magit-am-apply-patches) - (?m "Apply maildir" magit-am-apply-maildir)) + :actions '((?m "Apply maildir" magit-am-apply-maildir) + (?w "Apply patches" magit-am-apply-patches) + (?a "Apply plain patch" magit-patch-apply-popup)) :default-arguments '("--3way") :default-actions 'magit-am-apply-patches + :max-action-columns 1 :sequence-actions '((?w "Continue" magit-am-continue) (?s "Skip" magit-am-skip) (?a "Abort" magit-am-abort)) @@ -314,9 +336,10 @@ This discards all changes made since the sequence started." (?e "elsewhere" magit-rebase) "Rebase" (?i "interactively" magit-rebase-interactive) - (?m "to edit a commit" magit-rebase-edit-commit) - (?s "subset" magit-rebase-subset) + (?m "to modify a commit" magit-rebase-edit-commit) + (?s "a subset" magit-rebase-subset) (?w "to reword a commit" magit-rebase-reword-commit) nil + (?k "to remove a commit" magit-rebase-remove-commit) nil (?f "to autosquash" magit-rebase-autosquash)) :sequence-actions '((?r "Continue" magit-rebase-continue) (?s "Skip" magit-rebase-skip) @@ -382,7 +405,8 @@ START has to be selected from a list of recent commits." (concat "Type %p on a commit to rebase it " "and commits above it onto " newbase ",")))) -(defun magit-rebase-interactive-1 (commit args message &optional editor) +(defun magit-rebase-interactive-1 + (commit args message &optional editor noassert confirm) (declare (indent 2)) (when commit (if (eq commit :merge-base) @@ -394,13 +418,9 @@ START has to be selected from a list of recent commits." (if (magit-commit-parents commit) (setq commit (concat commit "^")) (setq args (cons "--root" args))))) - (when (and commit - (magit-git-lines "rev-list" "--merges" (concat commit "..HEAD"))) - (magit-read-char-case "Proceed despite merge in rebase range? " nil - (?c "[c]ontinue") - (?s "[s]elect other" (setq commit nil)) - (?a "[a]bort" (user-error "Quit")))) - (if commit + (when (and commit (not noassert)) + (setq commit (magit-rebase-interactive-assert commit))) + (if (and commit (not confirm)) (let ((process-environment process-environment)) (when editor (push (concat "GIT_SEQUENCE_EDITOR=" editor) process-environment)) @@ -408,9 +428,18 @@ START has to be selected from a list of recent commits." (unless (member "--root" args) commit))) (magit-log-select `(lambda (commit) - (magit-rebase-interactive-1 commit (list ,@args) ,message ,editor)) + (magit-rebase-interactive-1 commit (list ,@args) + ,message ,editor ,noassert)) message))) +(defun magit-rebase-interactive-assert (since) + (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) + (?s "[s]elect other" nil) + (?a "[a]bort" (user-error "Quit"))) + since)) + ;;;###autoload (defun magit-rebase-interactive (commit args) "Start an interactive rebase sequence." @@ -445,6 +474,16 @@ START has to be selected from a list of recent commits." "Type %p on a commit to reword its message," "perl -i -p -e '++$x if not $x and s/^pick/reword/'")) +;;;###autoload +(defun magit-rebase-remove-commit (commit args) + "Remove a single older commit using rebase." + (interactive (list (magit-commit-at-point) + (magit-rebase-arguments))) + (magit-rebase-interactive-1 commit args + "Type %p on a commit to remove it," + "perl -i -p -e '++$x if not $x and s/^pick/# pick/'" + nil t)) + ;;;###autoload (defun magit-rebase-continue (&optional noedit) "Restart the current rebasing operation. @@ -546,9 +585,16 @@ If no such sequence is in progress, do nothing." (defun magit-sequence-insert-am-patch (type patch face) (magit-insert-section (file patch) - (insert (propertize type 'face face) - ?\s (propertize (file-name-nondirectory patch) 'face 'magit-hash) - ?\n))) + (let ((title + (with-temp-buffer + (insert-file-contents patch nil nil 4096) + (unless (re-search-forward "^Subject: " nil t) + (goto-char (point-min))) + (buffer-substring (point) (line-end-position))))) + (insert (propertize type 'face face) + ?\s (propertize (file-name-nondirectory patch) 'face 'magit-hash) + ?\s title + ?\n)))) (defun magit-insert-rebase-sequence () "Insert section for the on-going rebase sequence. @@ -569,16 +615,21 @@ If no such sequence is in progress, do nothing." (insert ?\n))))) (defun magit-rebase-insert-merge-sequence (onto) - (dolist (line (nreverse - (magit-file-lines - (magit-git-dir "rebase-merge/git-rebase-todo")))) - (when (string-match (format "^\\([^%c ]+\\) \\([^ ]+\\) .*$" - (string-to-char - (or (magit-get "core.commentChar") "#"))) - line) - (magit-bind-match-strings (action hash) line - (unless (equal action "exec") - (magit-sequence-insert-commit action hash 'magit-sequence-pick))))) + (let (exec) + (dolist (line (nreverse + (magit-file-lines + (magit-git-dir "rebase-merge/git-rebase-todo")))) + (cond ((string-prefix-p "exec" line) + (setq exec (substring line 5))) + ((string-match (format "^\\([^%c ]+\\) \\([^ ]+\\) .*$" + (string-to-char + (or (magit-get "core.commentChar") "#"))) + line) + (magit-bind-match-strings (action hash) line + (unless (equal action "exec") + (magit-sequence-insert-commit + action hash 'magit-sequence-pick exec))) + (setq exec nil))))) (magit-sequence-insert-sequence (magit-file-line (magit-git-dir "rebase-merge/stopped-sha")) onto @@ -664,10 +715,13 @@ If no such sequence is in progress, do nothing." 'magit-sequence-head 'magit-sequence-onto)))) -(defun magit-sequence-insert-commit (type hash face) +(defun magit-sequence-insert-commit (type hash face &optional exec) (magit-insert-section (commit hash) - (insert (propertize type 'face face) ?\s - (magit-format-rev-summary hash) ?\n))) + (magit-insert-heading + (concat (propertize type 'face face) "\s" + (magit-format-rev-summary hash) "\n")) + (when exec + (insert (propertize "exec" 'face 'magit-sequence-onto) "\s" exec "\n")))) (provide 'magit-sequence) ;;; magit-sequence.el ends here diff --git a/elpa/magit-20171009.1252/magit-stash.el b/elpa/magit-20171208.618/magit-stash.el similarity index 85% rename from elpa/magit-20171009.1252/magit-stash.el rename to elpa/magit-20171208.618/magit-stash.el index fee6f068..3a719586 100644 --- a/elpa/magit-20171009.1252/magit-stash.el +++ b/elpa/magit-20171208.618/magit-stash.el @@ -40,7 +40,8 @@ ;;;; Diff options (defcustom magit-stash-sections-hook - '(magit-insert-stash-worktree + '(magit-insert-stash-notes + magit-insert-stash-worktree magit-insert-stash-index magit-insert-stash-untracked) "Hook run to insert sections into stash diff buffers." @@ -100,6 +101,7 @@ AUTHOR-WIDTH has to be an integer. When the name of the author (?v "Show" magit-stash-show) (?b "Branch" magit-stash-branch) (?k "Drop" magit-stash-drop) nil + (?B "Branch here" magit-stash-branch-here) nil nil (?f "Format patch" magit-stash-format-patch)) :default-action 'magit-stash :max-action-columns 3) @@ -196,7 +198,7 @@ while two prefix arguments are equivalent to `--all'." "Apply a stash to the working tree. Try to preserve the stash index. If that fails because there are staged changes, apply without preserving the stash index." - (interactive (list (magit-read-stash "Apply stash" t))) + (interactive (list (magit-read-stash "Apply stash"))) (if (= (magit-call-git "stash" "apply" "--index" stash) 0) (magit-refresh) (magit-run-git "stash" "apply" stash))) @@ -206,7 +208,7 @@ are staged changes, apply without preserving the stash index." Try to preserve the stash index. If that fails because there are staged changes, apply without preserving the stash index and forgo removing the stash." - (interactive (list (magit-read-stash "Apply pop" t))) + (interactive (list (magit-read-stash "Pop stash"))) (if (= (magit-call-git "stash" "apply" "--index" stash) 0) (magit-stash-drop stash) (magit-run-git "stash" "apply" stash))) @@ -215,10 +217,11 @@ and forgo removing the stash." (defun magit-stash-drop (stash) "Remove a stash from the stash list. When the region is active offer to drop all contained stashes." - (interactive (list (--if-let (magit-region-values 'stash) - (or (magit-confirm t nil "Drop %i stashes" it) - (user-error "Abort")) - (magit-read-stash "Drop stash")))) + (interactive + (list (--if-let (magit-region-values 'stash) + (or (magit-confirm t "Drop %s" "Drop %i stashes" it) + (user-error "Abort")) + (magit-read-stash "Drop stash")))) (dolist (stash (if (listp stash) (nreverse (prog1 stash (setq stash (car stash)))) (list stash))) @@ -247,14 +250,25 @@ When the region is active offer to drop all contained stashes." ;;;###autoload (defun magit-stash-branch (stash branch) "Create and checkout a new BRANCH from STASH." - (interactive (list (magit-read-stash "Branch stash" t) + (interactive (list (magit-read-stash "Branch stash") (magit-read-string-ns "Branch name"))) (magit-run-git "stash" "branch" branch stash)) +;;;###autoload +(defun magit-stash-branch-here (stash branch) + "Create and checkout a new BRANCH and apply STASH. +The branch is created using `magit-branch', using the current +branch or `HEAD' as the string-point." + (interactive (list (magit-read-stash "Branch stash") + (magit-read-string-ns "Branch name"))) + (let ((inhibit-magit-refresh t)) + (magit-branch branch (or (magit-get-current-branch) "HEAD"))) + (magit-stash-apply stash)) + ;;;###autoload (defun magit-stash-format-patch (stash) "Create a patch from STASH" - (interactive (list (magit-read-stash "Create patch from stash" t))) + (interactive (list (magit-read-stash "Create patch from stash"))) (with-temp-file (magit-rev-format "0001-%f.patch" stash) (magit-git-insert "stash" "show" "-p" stash)) (magit-refresh)) @@ -349,11 +363,37 @@ When the region is active offer to drop all contained stashes." If optional REF is non-nil, show reflog for that instead. If optional HEADING is non-nil, use that as section heading instead of \"Stashes:\"." - (when (magit-rev-verify ref) - (magit-insert-section (stashes ref (not magit-status-expand-stashes)) - (magit-insert-heading heading) - (magit-git-wash (apply-partially 'magit-log-wash-log 'stash) - "reflog" "--format=%gd%x00%aN%x00%at%x00%gs" ref)))) + (let ((verified (magit-rev-verify ref)) + (autostash + (and (magit-rebase-in-progress-p) + (magit-file-line + (magit-git-dir + (-> (if (file-directory-p (magit-git-dir "rebase-merge")) + "rebase-merge/autostash" + "rebase-apply/autostash"))))))) + (when (or autostash verified) + (magit-insert-section (stashes ref (not magit-status-expand-stashes)) + (magit-insert-heading heading) + (when autostash + (pcase-let ((`(,author ,date ,msg) + (split-string + (car (magit-git-lines + "show" "-q" "--format=%aN%x00%at%x00%s" + autostash)) + "\0"))) + (magit-insert-section (stash autostash) + (insert (propertize "AUTOSTASH" 'face 'magit-hash)) + (insert " " msg "\n") + (save-excursion + (backward-char) + (magit-log-format-margin author date))))) + (if verified + (magit-git-wash (apply-partially 'magit-log-wash-log 'stash) + "reflog" "--format=%gd%x00%aN%x00%at%x00%gs" ref) + (insert ?\n) + (save-excursion + (backward-char) + (magit-make-margin-overlay))))))) ;;; List Stashes @@ -398,10 +438,10 @@ instead of \"Stashes:\"." #'magit-bookmark--stash-make-record)) (defun magit-stash-refresh-buffer (stash _const _args _files) - (setq header-line-format - (concat - "\s" (propertize (capitalize stash) 'face 'magit-section-heading) - "\s" (magit-rev-format "%s" stash))) + (magit-set-header-line-format + (concat (propertize (capitalize stash) 'face 'magit-section-heading) + " " + (magit-rev-format "%s" stash))) (setq magit-buffer-revision-hash (magit-rev-parse stash)) (magit-insert-section (stash) (run-hooks 'magit-stash-sections-hook))) @@ -414,6 +454,17 @@ instead of \"Stashes:\"." (nth 2 magit-refresh-args) "--" (or files (nth 3 magit-refresh-args))))) +(defun magit-insert-stash-notes () + "Insert section showing notes for a stash. +This shows the notes for stash@{N} but not for the other commits +that make up the stash." + (magit-insert-section section (note) + (magit-insert-heading "Notes") + (magit-git-insert "notes" "show" (car magit-refresh-args)) + (if (= (point) (magit-section-content section)) + (magit-cancel-section) + (insert "\n")))) + (defun magit-insert-stash-index () "Insert section showing staged changes of the stash." (let ((stash (car magit-refresh-args))) diff --git a/elpa/magit-20171009.1252/magit-status.el b/elpa/magit-20171208.618/magit-status.el similarity index 97% rename from elpa/magit-20171009.1252/magit-status.el rename to elpa/magit-20171208.618/magit-status.el index 3c183e34..d7718c22 100644 --- a/elpa/magit-20171009.1252/magit-status.el +++ b/elpa/magit-20171208.618/magit-status.el @@ -29,7 +29,7 @@ (require 'magit) -(require 'subr-x) +(eval-when-compile (require 'subr-x)) (defvar bookmark-make-record-function) @@ -84,10 +84,10 @@ all." magit-insert-stashes magit-insert-unpulled-from-upstream magit-insert-unpulled-from-pushremote - magit-insert-unpushed-to-upstream + magit-insert-unpushed-to-upstream-or-recent magit-insert-unpushed-to-pushremote) "Hook run to insert sections into a status buffer." - :package-version '(magit . "2.4.0") + :package-version '(magit . "2.12.0") :group 'magit-status :type 'hook) @@ -198,6 +198,14 @@ then offer to initialize it as a new repository." (put 'magit-status 'interactive-only 'magit-status-internal) +(defalias 'magit 'magit-status + "An alias for `magit-status' for better discoverability. + +Instead of invoking this alias for `magit-status' using +\"M-x magit RET\", you should bind a key to `magit-status' +and read the info node `(magit)Getting Started', which +also contains other useful hints.") + ;;;###autoload (defun magit-status-internal (directory) (magit--tramp-asserts directory) @@ -457,10 +465,7 @@ 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 (or (magit-get-remote) - (let ((remotes (magit-list-remotes))) - (or (car (member "origin" remotes)) - (car remotes))))) + (-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"))) diff --git a/elpa/magit-20171009.1252/magit-submodule.el b/elpa/magit-20171208.618/magit-submodule.el similarity index 92% rename from elpa/magit-20171009.1252/magit-submodule.el rename to elpa/magit-20171208.618/magit-submodule.el index 2dbe9cb7..5c8a7c62 100644 --- a/elpa/magit-20171009.1252/magit-submodule.el +++ b/elpa/magit-20171208.618/magit-submodule.el @@ -96,6 +96,13 @@ an alist that supports the keys `:right-align' and `:pad-right'." (symbol)) (sexp :tag "Value")))))) +(defcustom magit-submodule-fetch-jobs 4 + "Number of submodules to fetch in parallel. +Ignored for Git versions before v2.8.0." + :package-version '(magit . "2.12.0") + :group 'magit-commands + :type '(choice (const :tag "one at a time" nil) number)) + ;;; Commands ;;;###autoload (autoload 'magit-submodule-popup "magit-submodule" nil t) @@ -137,16 +144,17 @@ PATH also becomes the name." (magit-run-git "submodule" "add" (and name (list "--name" name)) url path)) ;;;###autoload -(defun magit-submodule-read-name-for-path (path) - (setq path (directory-file-name (file-relative-name path))) - (push (file-name-nondirectory path) minibuffer-history) - (magit-read-string-ns - "Submodule name" nil (cons 'minibuffer-history 2) - (or (--keep (-let [(var val) (split-string it "=")] - (and (equal val path) - (cadr (split-string var "\\.")))) - (magit-git-lines "config" "--list" "-f" ".gitmodules")) - path))) +(defun magit-submodule-read-name-for-path (path &optional prefer-short) + (let* ((path (directory-file-name (file-relative-name path))) + (name (file-name-nondirectory path))) + (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 "=")] + (and (equal val path) + (cadr (split-string var "\\.")))) + (magit-git-lines "config" "--list" "-f" ".gitmodules")) + (if prefer-short name path))))) ;;;###autoload (defun magit-submodule-setup () @@ -183,11 +191,19 @@ With a prefix argument also register submodules in \".git/config\"." ;;;###autoload (defun magit-submodule-fetch (&optional all) "Fetch all submodules. -With a prefix argument fetch all remotes." + +Option `magit-submodule-fetch-jobs' controls how many submodules +are being fetched in parallel. Also fetch the super-repository, +because `git-fetch' does not support not doing that. With a +prefix argument fetch all remotes." (interactive "P") (magit-with-toplevel - (magit-run-git-async "submodule" "foreach" - (format "git fetch %s || true" (if all "--all" ""))))) + (magit-run-git-async + "fetch" "--verbose" "--recurse-submodules" + (and magit-submodule-fetch-jobs + (version<= "2.8.0" (magit-git-version)) + (list "-j" (number-to-string magit-submodule-fetch-jobs))) + (and all "--all")))) ;;;###autoload (defun magit-submodule-deinit (path) @@ -204,7 +220,7 @@ With a prefix argument fetch all remotes." (defun magit-insert-modules () "Insert submodule sections. Hook `magit-module-sections-hook' controls which module sections -are inserted, and option `magit-insert-modules-nested' controls +are inserted, and option `magit-module-sections-nested' controls whether they are wrapped in an additional section." (-when-let (modules (magit-get-submodules)) (if magit-module-sections-nested diff --git a/elpa/magit-20171009.1252/magit-subtree.el b/elpa/magit-20171208.618/magit-subtree.el similarity index 100% rename from elpa/magit-20171009.1252/magit-subtree.el rename to elpa/magit-20171208.618/magit-subtree.el diff --git a/elpa/magit-20171009.1252/magit-utils.el b/elpa/magit-20171208.618/magit-utils.el similarity index 79% rename from elpa/magit-20171009.1252/magit-utils.el rename to elpa/magit-20171208.618/magit-utils.el index 862ec351..f6cd1a24 100644 --- a/elpa/magit-20171009.1252/magit-utils.el +++ b/elpa/magit-20171208.618/magit-utils.el @@ -74,7 +74,7 @@ or `helm--completing-read-default'." (function-item helm--completing-read-default) (function :tag "Other function"))) -(defcustom magit-no-confirm-default nil +(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 @@ -82,8 +82,7 @@ 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. -Commands have to explicitly support this option. Currently only -these commands do: +Only the following commands support this option: `magit-branch' `magit-branch-and-checkout' `magit-branch-orphan' @@ -91,25 +90,59 @@ these commands do: 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'" - :package-version '(magit . "2.9.0") - :group 'magit-miscellaneous - :type '(list :convert-widget custom-hook-convert-widget) - :options '(magit-branch - magit-branch-and-checkout - magit-branch-orphan - magit-branch-rename - magit-worktree-branch - magit-tag)) + `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)) + "When not to offer alternatives and ask for confirmation. + +Many commands by default ask the user to select from a list of +possible candidates. They do so even when there is a thing at +point that they can act on, which is then offered as the default. + +This option can be used to tell certain commands to use the thing +at point instead of asking the user to select a candidate to act +on, with or without confirmation. + +The value has the form ((COMMAND nil|PROMPT DEFAULT)...). + +- COMMAND is the command that should not prompt for a choice. + To have an effect, the command has to use the function + `magit-completing-read' or a utility function which in turn uses + that function. + +- If the command uses `magit-completing-read' multiple times, then + PROMPT can be used to only affect one of these uses. PROMPT, if + non-nil, is a regular expression that is used to match against + the PROMPT argument passed to `magit-completing-read'. + +- DEFAULT specifies how to use the default. If it is t, then + the DEFAULT argument passed to `magit-completing-read' is used + without confirmation. If it is `ask', then the user is given + a chance to abort. DEFAULT can also be nil, in which case the + 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))))) (defconst magit--confirm-actions '((const reverse) (const discard) (const rename) (const resurrect) - (const trash) (const delete) - (const abort-rebase) + (const untrack) (const trash) + (const delete) (const abort-rebase) (const abort-merge) (const merge-dirty) (const drop-stashes) (const resect-bisect) (const kill-process) (const delete-unmerged-branch) + (const delete-pr-branch) (const stage-all-changes) (const unstage-all-changes) (const safe-with-wip))) @@ -153,6 +186,8 @@ Files: \"deleting\" the deletion, which is done using the same command that was used to delete the same file in the first place. + `untrack' Untracking a file can be undone by tracking it again. + `rename' Renaming a file can easily be undone. Sequences: @@ -179,6 +214,13 @@ References: choice (or selecting another branch), but when a branch has not been merged yet, also make sure the user is aware of that. + `delete-pr-branch' When deleting a branch that was created from + a pull request and if no other branches still exist on that + remote, then `magit-branch-delete' offers to delete the remote + as well. This should be safe because it only happens if no + other refs exist in the remotes namespace, and you can recreate + the remote if necessary. + `drop-stashes' Dropping a stash is dangerous because Git stores stashes in the reflog. Once a stash is removed, there is no going back without using low-level recovery tools provided by @@ -298,45 +340,81 @@ and delay of your graphical environment or operating system." ;;; User Input -(defun magit-completing-read - (prompt collection &optional predicate require-match initial-input hist def) - "Magit wrapper around `completing-read' or an alternative function. +(defvar magit-completing-read--silent-default nil) -Option `magit-completing-read-function' can be used to wrap -around another `completing-read'-like function. Unless it -doesn't have the exact same signature, an additional wrapper is -required. Even if it has the same signature it might be a good -idea to wrap it, so that `magit-prompt-with-default' can be used. +(defun magit-completing-read (prompt collection &optional + predicate require-match initial-input + hist def fallback) + "Read a choice in the minibuffer, or use the default choice. -See `completing-read' for the meanings of the arguments, but note -that this wrapper makes the following changes: +This is the function that Magit commands use when they need the +user to select a single thing to act on. The arguments have the +same meaning as for `completing-read', except for FALLBACK, which +is unique to this function and is described below. + +Instead of asking the user to choose from a list of possible +candidates, this function may instead just return the default +specified by DEF, with or without requiring user confirmation. +Whether that is the case depends on PROMPT, `this-command' and +`magit-dwim-selection'. See the documentation of the latter for +more information. + +If it does use the default without the user even having to +confirm that, then `magit-completing-read--silent-default' is set +to t, otherwise nil. + +If it does read a value in the minibuffer, then this function +acts similarly to `completing-read', except for the following: - If REQUIRE-MATCH is nil and the user exits without a choice, - then return nil instead of an empty string. + then nil is returned instead of an empty string. - If REQUIRE-MATCH is non-nil and the users exits without a - choice, then raise an user-error. + choice, an user-error is raised. + +- FALLBACK specifies a secondary default that is only used if + the primary default DEF is nil. The secondary default is not + subject to `magit-dwim-selection' — if DEF is nil but FALLBACK + is not, then this function always asks the user to choose a + candidate, just as if both defaults were nil. - \": \" is appended to PROMPT. -- If a `magit-completing-read-function' is used which in turn - uses `magit-prompt-with-completion' and DEF is non-nil, then - PROMPT is modified to end with \" (default DEF): \". - -The use of another completing function and/or wrapper obviously -results in additional differences." - (let ((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))) - (if (string= reply "") - (if require-match - (user-error "Nothing selected") - nil) - reply))) +- PROMPT is modified to end with \" (default DEF|FALLBACK): \" + provided that DEF or FALLBACK is non-nil, that neither + `ivy-mode' nor `helm-mode' is enabled, and that + `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 (eq dwim 'ask) + (if (y-or-n-p (format "%s %s? " prompt def)) + def + (user-error "Abort")) + (setq magit-completing-read--silent-default t) + def) + (unless def + (setq def fallback)) + (let ((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))) + (if (string= reply "") + (if require-match + (user-error "Nothing selected") + nil) + reply)))) (defun magit--completion-table (collection) (lambda (string pred action) @@ -600,6 +678,48 @@ Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines." (insert-file-contents file) (split-string (buffer-string) "\n" (not keep-empty-lines))))) +(defun magit-set-header-line-format (string) + "Set the header-line using STRING. +Propertize STRING with the `magit-header-line' face if no face is +present, and pad the left and right sides of STRING equally such +that it will align with the text area." + (let* ((header-line + (concat (propertize " " + 'display + '(space :align-to 0)) + string + (propertize + " " + 'display + `(space :width (+ left-fringe + left-margin + ,@(and (eq (car (window-current-scroll-bars)) + 'left) + '(scroll-bar))))))) + (len (length header-line))) + (setq header-line-format + (if (text-property-not-all 0 len 'face nil header-line) + (let ((face (get-text-property 0 'face string))) + (when (and (atom face) + (magit-face-property-all face string)) + (add-face-text-property 0 1 face nil header-line) + (add-face-text-property (1- len) len face nil header-line)) + header-line) + (propertize header-line + 'face + 'magit-header-line))))) + +(defun magit-face-property-all (face string) + "Return non-nil if FACE is present in all of STRING." + (cl-loop for pos = 0 then (next-single-property-change pos 'face string) + unless pos + return t + for current = (get-text-property pos 'face string) + unless (if (consp current) + (memq face current) + (eq face current)) + return nil)) + ;;; Missing from Emacs (defun magit-kill-this-buffer () diff --git a/elpa/magit-20171009.1252/magit-wip.el b/elpa/magit-20171208.618/magit-wip.el similarity index 100% rename from elpa/magit-20171009.1252/magit-wip.el rename to elpa/magit-20171208.618/magit-wip.el diff --git a/elpa/magit-20171009.1252/magit-worktree.el b/elpa/magit-20171208.618/magit-worktree.el similarity index 90% rename from elpa/magit-20171009.1252/magit-worktree.el rename to elpa/magit-20171208.618/magit-worktree.el index d7e62613..6a3e5ed5 100644 --- a/elpa/magit-20171009.1252/magit-worktree.el +++ b/elpa/magit-20171208.618/magit-worktree.el @@ -34,11 +34,21 @@ ;;; Commands +;;;###autoload (autoload 'magit-worktree-popup "magit-worktree" nil t) +(magit-define-popup magit-worktree-popup + "Popup console for worktree commands." + :man-page "git-worktree" + :actions '((?b "Create new worktree" magit-worktree-checkout) + (?c "Create new branch and worktree" magit-worktree-branch) + (?k "Delete worktree" magit-worktree-delete) + (?g "Show status for worktree" magit-worktree-status)) + :max-action-columns 1) + ;;;###autoload (defun magit-worktree-checkout (path branch) "Checkout BRANCH in a new worktree at PATH." (interactive - (let ((branch (magit-read-local-branch "Checkout"))) + (let ((branch (magit-read-local-branch-or-commit "Checkout"))) (list (read-directory-name (format "Checkout %s in new worktree: " branch)) branch))) (magit-run-git "worktree" "add" (expand-file-name path) branch) diff --git a/elpa/magit-20171009.1252/magit.el b/elpa/magit-20171208.618/magit.el similarity index 95% rename from elpa/magit-20171009.1252/magit.el rename to elpa/magit-20171208.618/magit.el index ee2322b9..94c52202 100644 --- a/elpa/magit-20171009.1252/magit.el +++ b/elpa/magit-20171208.618/magit.el @@ -16,7 +16,6 @@ ;; Rémi Vanicat ;; Yann Hodique -;; Package-Requires: ((emacs "24.4") (async "20170823") (dash "20170810") (with-editor "20170817") (git-commit "20170823") (magit-popup "20170824")) ;; Keywords: git tools vc ;; Homepage: https://github.com/magit/magit @@ -75,7 +74,15 @@ (defface magit-header-line '((t :inherit magit-section-heading)) - "Face for the `header-line'." + "Face for the `header-line' in some Magit modes. +Note that some modes, such as `magit-log-select-mode', have their +own faces for the `header-line', or for parts of the +`header-line'." + :group 'magit-faces) + +(defface magit-header-line-key + '((t :inherit magit-popup-key)) + "Face for keys in the `header-line'." :group 'magit-faces) (defface magit-dimmed @@ -102,6 +109,12 @@ "Face for remote branch head labels shown in log buffer." :group 'magit-faces) +(defface magit-branch-remote-head + '((((class color) (background light)) :inherit magit-branch-remote :box t) + (((class color) (background dark)) :inherit magit-branch-remote :box t)) + "Face for current branch." + :group 'magit-faces) + (defface magit-branch-local '((((class color) (background light)) :foreground "SkyBlue4") (((class color) (background dark)) :foreground "LightSkyBlue1")) @@ -268,10 +281,9 @@ inspect the merge and change the commit message. (defun magit-merge-preview-refresh-buffer (rev) (let* ((branch (magit-get-current-branch)) (head (or branch (magit-rev-verify "HEAD")))) - (setq header-line-format - (propertize (format "Preview merge of %s into %s" - rev (or branch "HEAD")) - 'face 'magit-header-line)) + (magit-set-header-line-format (format "Preview merge of %s into %s" + rev + (or branch "HEAD"))) (magit-insert-section (diffbuf) (magit-git-wash #'magit-diff-wash-diffs "merge-tree" (magit-git-string "merge-base" head rev) head rev)))) @@ -420,8 +432,9 @@ With a prefix argument also reset the working tree. "Popup console for tag commands." :man-page "git-tag" :switches '((?a "Annotate" "--annotate") - (?s "Sign" "--sign") - (?f "Force" "--force")) + (?f "Force" "--force") + (?s "Sign" "--sign")) + :options '((?f "Sign" "--local-user=" magit-read-gpg-secret-key)) :actions '((?t "Create" magit-tag) (?k "Delete" magit-tag-delete) (?p "Prune" magit-tag-prune)) @@ -433,10 +446,7 @@ With a prefix argument also reset the working tree. With a prefix argument annotate the tag. \n(git tag [--annotate] NAME REV)" (interactive (list (magit-read-tag "Tag name") - (or (and (memq 'magit-tag magit-no-confirm-default) - (or (magit-branch-or-commit-at-point) - (magit-get-current-branch))) - (magit-read-branch-or-commit "Place tag on")) + (magit-read-branch-or-commit "Place tag on") (let ((args (magit-tag-arguments))) (when current-prefix-arg (cl-pushnew "--annotate" args)) @@ -450,9 +460,11 @@ If the region marks multiple tags (and nothing else), then offer to delete those, otherwise prompt for a single tag to be deleted, defaulting to the tag at point. \n(git tag -d TAGS)" - (interactive (list (--if-let (magit-region-values 'tag) - (magit-confirm t nil "Delete %i tags" it) - (magit-read-tag "Delete tag" t)))) + (interactive + (list (--if-let (magit-region-values 'tag) + (or (magit-confirm t "Delete %s" "Delete %i tags" it) + (user-error "Abort")) + (magit-read-tag "Delete tag" t)))) (magit-run-git "tag" "-d" tags)) (defun magit-tag-prune (tags remote-tags remote) @@ -512,6 +524,7 @@ defaulting to the tag at point. (?y "Show Refs" magit-show-refs-popup) (?z "Stashing" magit-stash-popup) (?! "Running" magit-run-popup) + (?% "Worktree" magit-worktree-popup) "Applying changes" (?a "Apply" magit-apply) (?s "Stage" magit-stage) @@ -588,7 +601,7 @@ This affects `magit-git-command', `magit-git-command-topdir', ;;;###autoload (defun magit-git-command (command) - "Execute COMMAND asynchonously; display output. + "Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. \"git \" is used as initial input, but can be deleted to run another command. @@ -600,7 +613,7 @@ of the current working tree, otherwise in `default-directory'." ;;;###autoload (defun magit-git-command-topdir (command) - "Execute COMMAND asynchonously; display output. + "Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. \"git \" is used as initial input, but can be deleted to run another command. @@ -612,7 +625,7 @@ working tree." ;;;###autoload (defun magit-shell-command (command) - "Execute COMMAND asynchonously; display output. + "Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. With a prefix argument COMMAND is run in the top-level directory of @@ -622,7 +635,7 @@ the current working tree, otherwise in `default-directory'." ;;;###autoload (defun magit-shell-command-topdir (command) - "Execute COMMAND asynchonously; display output. + "Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. COMMAND is run in the top-level directory of the current working tree." @@ -971,13 +984,14 @@ See info node `(magit)Debugging Tools' for more information." (with-current-buffer (get-buffer-create "*magit-git-debug*") (pop-to-buffer (current-buffer)) (erase-buffer) - (insert (format "magit-git-executable: %S" magit-git-executable) - (unless (file-name-absolute-p magit-git-executable) - (format " [%S]" (executable-find magit-git-executable))) - (format " (%s)\n" - (let* ((errmsg nil) - (magit-git-debug (lambda (err) (setq errmsg err)))) - (or (magit-git-version t) errmsg)))) + (insert (concat + (format "magit-git-executable: %S" magit-git-executable) + (and (not (file-name-absolute-p magit-git-executable)) + (format " [%S]" (executable-find magit-git-executable))) + (format " (%s)\n" + (let* ((errmsg nil) + (magit-git-debug (lambda (err) (setq errmsg err)))) + (or (magit-git-version t) errmsg))))) (insert (format "exec-path: %S\n" exec-path)) (--when-let (cl-set-difference (-filter #'file-exists-p (remq nil (parse-colon-path diff --git a/elpa/magit-20171208.618/magit.info b/elpa/magit-20171208.618/magit.info new file mode 100644 index 00000000..d42b0eea --- /dev/null +++ b/elpa/magit-20171208.618/magit.info @@ -0,0 +1,179 @@ +This is magit.info, produced by makeinfo version 5.2 from magit.texi. + + Copyright (C) 2015-2017 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: 300804 + +Tag Table: +(Indirect) +Node: Top752 +Node: Introduction6085 +Node: Installation10808 +Node: Installing from an Elpa Archive11148 +Node: Installing from the Git Repository12251 +Node: Post-Installation Tasks14945 +Node: Getting Started16230 +Node: Interface Concepts21577 +Node: Modes and Buffers21909 +Node: Switching Buffers23654 +Node: Naming Buffers28195 +Node: Quitting Windows31204 +Node: Automatic Refreshing of Magit Buffers32836 +Node: Automatic Saving of File-Visiting Buffers35604 +Node: Automatic Reverting of File-Visiting Buffers36789 +Node: Risk of Reverting Automatically41785 +Node: Sections44168 +Node: Section Movement45109 +Node: Section Visibility49036 +Node: Section Hooks52511 +Node: Section Types and Values54792 +Node: Section Options56062 +Node: Popup Buffers and Prefix Commands56534 +Node: Completion Confirmation and the Selection58915 +Node: Action Confirmation59352 +Node: Completion and Confirmation65592 +Node: The Selection68778 +Node: The hunk-internal region71677 +Node: Support for Completion Frameworks72766 +Node: Additional Completion Options77582 +Node: Running Git78181 +Node: Viewing Git Output78431 +Node: Running Git Manually79600 +Node: Git Executable82002 +Node: Global Git Arguments84284 +Node: Inspecting85090 +Node: Status Buffer86237 +Node: Status Sections89150 +Node: Status Header Sections93665 +Node: Status Module Sections96295 +Node: Status Options98796 +Node: Repository List100550 +Node: Logging102708 +Node: Refreshing Logs105155 +Node: Log Buffer106540 +Node: Log Margin110011 +Node: Select from Log112651 +Node: Reflog114755 +Node: Cherries116272 +Node: Diffing117999 +Node: Refreshing Diffs120946 +Node: Diff Buffer124437 +Node: Diff Options127022 +Node: Revision Buffer130393 +Node: Ediffing132931 +Node: References Buffer136527 +Node: References Sections143827 +Node: Bisecting144688 +Node: Visiting Blobs146426 +Node: Blaming146935 +Node: Manipulating151723 +Node: Repository Setup152039 +Node: Staging and Unstaging153079 +Node: Staging from File-Visiting Buffers157160 +Node: Applying158328 +Node: Committing160221 +Node: Initiating a Commit160804 +Node: Editing Commit Messages164115 +Node: Branching174511 +Node: The Two Remotes174711 +Node: The Branch Popup177328 +Node: The Branch Config Popup194175 +Node: Merging200079 +Node: Resolving Conflicts202246 +Node: Rebasing207247 +Node: Editing Rebase Sequences211403 +Node: Information About In-Progress Rebase214433 +Ref: Information About In-Progress Rebase-Footnote-1223181 +Node: Cherry Picking223777 +Node: Reverting225515 +Node: Resetting226878 +Node: Stashing228295 +Node: Transferring232807 +Node: Remotes233045 +Node: The Remote Popup233201 +Node: The Remote Config Popup235578 +Node: Fetching237230 +Node: Pulling238586 +Node: Pushing239422 +Node: Creating and Sending Patches244157 +Node: Applying Patches244994 +Node: Miscellaneous246580 +Node: Tagging246883 +Node: Notes247667 +Node: Submodules249978 +Node: Listing Submodules250192 +Node: Submodule Popup252069 +Node: Subtree253354 +Node: Common Commands254601 +Node: Wip Modes256347 +Node: Minor Mode for Buffers Visiting Files263144 +Node: Minor Mode for Buffers Visiting Blobs266493 +Node: Customizing267306 +Node: Per-Repository Configuration268974 +Node: Essential Settings270621 +Node: Safety270945 +Node: Performance272710 +Node: Microsoft Windows Performance279558 +Node: MacOS Performance280749 +Ref: MacOS Performance-Footnote-1281985 +Ref: MacOS Performance-Footnote-2282067 +Ref: MacOS Performance-Footnote-3282127 +Node: Plumbing282293 +Node: Calling Git283116 +Node: Getting a Value from Git284641 +Node: Calling Git for Effect287727 +Node: Section Plumbing294245 +Node: Creating Sections294473 +Node: Section Selection298372 +Node: Matching Sections300804 +Node: Refreshing Buffers306237 +Node: Conventions309372 +Node: Theming Faces309564 +Node: FAQ317679 +Node: FAQ - How to …?318121 +Node: How to show git's output?318485 +Node: How to install the gitman info manual?319239 +Node: How to show diffs for gpg-encrypted files?320209 +Node: How does branching and pushing work?320805 +Node: Can Magit be used as ‘ediff-version-control-package’?321174 +Node: FAQ - Issues and Errors323169 +Node: Magit is slow323973 +Node: I changed several thousand files at once and now Magit is unusable324187 +Node: I am having problems committing324916 +Node: I am using MS Windows and cannot push with Magit325397 +Node: I am using OS X and SOMETHING works in shell but not in Magit326014 +Node: Diffs contain control sequences326820 +Node: Expanding a file to show the diff causes it to disappear327894 +Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer328451 +Node: The mode-line information isn't always up-to-date329503 +Node: Emacs 245 hangs when loading Magit330570 +Node: A branch and tag sharing the same name breaks SOMETHING331184 +Node: Debugging Tools331990 +Node: Keystroke Index333725 +Node: Command Index363659 +Node: Function Index395121 +Node: Variable Index409097 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20171009.1252/magit.info-1 b/elpa/magit-20171208.618/magit.info-1 similarity index 83% rename from elpa/magit-20171009.1252/magit.info-1 rename to elpa/magit-20171208.618/magit.info-1 index 07cfe092..b7944ac6 100644 --- a/elpa/magit-20171009.1252/magit.info-1 +++ b/elpa/magit-20171208.618/magit.info-1 @@ -30,7 +30,7 @@ to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains. - This manual is for Magit version 2.11.0 (2.11.0-55-g7edecce4+1). + This manual is for Magit version 2.11.0 (2.11.0-311-gc6ef61b2e+1). Copyright (C) 2015-2017 Jonas Bernoulli @@ -65,22 +65,18 @@ itself deserve to be called porcelains. — The Detailed Node Listing — - Installation * Installing from an Elpa Archive:: * Installing from the Git Repository:: * Post-Installation Tasks:: - - - Interface Concepts * Modes and Buffers:: * Sections:: * Popup Buffers and Prefix Commands:: -* Completion and Confirmation:: +* Completion, Confirmation and the Selection: Completion Confirmation and the Selection. * Running Git:: Modes and Buffers @@ -102,6 +98,14 @@ Sections * Section Options:: +Completion, Confirmation and the Selection + +* Action Confirmation:: +* Completion and Confirmation:: +* The Selection:: +* The hunk-internal region:: +* Support for Completion Frameworks:: +* Additional Completion Options:: Running Git @@ -111,6 +115,7 @@ Running Git * Git Executable:: * Global Git Arguments:: + Inspecting * Status Buffer:: @@ -131,7 +136,6 @@ Status Buffer * Status Options:: - Logging * Refreshing Logs:: @@ -150,11 +154,11 @@ Diffing * Revision Buffer:: - References Buffer * References Sections:: + Manipulating * Repository Setup:: @@ -169,13 +173,11 @@ Manipulating * Resetting:: * Stashing:: - Staging and Unstaging * Staging from File-Visiting Buffers:: - Committing * Initiating a Commit:: @@ -189,8 +191,6 @@ Branching * The Branch Config Popup:: - - Rebasing * Editing Rebase Sequences:: @@ -201,6 +201,7 @@ Cherry Picking * Reverting:: + Transferring * Remotes:: @@ -210,6 +211,10 @@ Transferring * Creating and Sending Patches:: * Applying Patches:: +Remotes + +* The Remote Popup:: +* The Remote Config Popup:: Miscellaneous @@ -223,24 +228,23 @@ Miscellaneous * Minor Mode for Buffers Visiting Files:: * Minor Mode for Buffers Visiting Blobs:: - - Submodules * Listing Submodules:: * Submodule Popup:: + Customizing * Per-Repository Configuration:: * Essential Settings:: - Essential Settings * Safety:: * Performance:: + Plumbing * Calling Git:: @@ -261,12 +265,11 @@ Section Plumbing * Matching Sections:: - Conventions -* Confirmation and Completion:: * Theming Faces:: + FAQ * FAQ - How to …?:: @@ -293,6 +296,9 @@ FAQ - Issues and Errors * 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:: + +  File: magit.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top @@ -435,16 +441,16 @@ File: magit.info, Node: Installing from the Git Repository, Next: Post-Install 2.2 Installing from the Git Repository ====================================== -Magit depends on the ‘dash’ and ‘with-editor’ library which are -available from Melpa and Melpa-Stable. Install them using ‘M-x -package-install RET RET’. Of course you may also install them -manually from their development repository, but I won’t cover that here. +Magit depends on the ‘dash’, ‘magit-popup’ and ‘with-editor’ libraries +which are available from Melpa and Melpa-Stable. Install them using +‘M-x package-install RET RET’. Of course you may also install +them manually from their development repository. - (An older release of Magit is also available from Marmalade, but no -new versions will be uploaded in the future. Marmalade’s maintainer has -stopped responding to requests from package maintainers who are having -difficulties or require him to create an account so that they can upload -their packages in the first place.) + (An ancient release of Magit is also available from Marmalade, but no +new versions will be uploaded. Marmalade is unmaintained — its +maintainer has stopped responding to support requests from package +authors or even just to create new accounts so that new authors can +upload their packages in the first place.) Then clone the Magit repository: @@ -455,13 +461,14 @@ their packages in the first place.) $ make - If you haven’t installed ‘dash’ and ‘with-editor’ using Elpa or at -‘/path/to/magit/../’, then you have to tell ‘make’ where to -find them. To do so create ‘/path/to/magit/config.mk’ with the -following content before running ‘make’: + If you haven’t installed ‘dash’, ‘magit-popup’ and ‘with-editor’ from +Melpa or at ‘/path/to/magit/../’, then you have to tell ‘make’ +where to find them. To do so create the file ‘/path/to/magit/config.mk’ +with the following content before running ‘make’: LOAD_PATH = -L /path/to/magit/lisp LOAD_PATH += -L /path/to/dash + LOAD_PATH += -L /path/to/magit-popup LOAD_PATH += -L /path/to/with-editor Finally add this to your init file: @@ -648,7 +655,7 @@ File: magit.info, Node: Interface Concepts, Next: Inspecting, Prev: Getting S * Modes and Buffers:: * Sections:: * Popup Buffers and Prefix Commands:: -* Completion and Confirmation:: +* Completion, Confirmation and the Selection: Completion Confirmation and the Selection. * Running Git::  @@ -863,6 +870,7 @@ File: magit.info, Node: Naming Buffers, Next: Quitting Windows, Prev: Switchi Like ‘%t’, but append an asterisk if and only if ‘magit-uniquify-buffer-names’ is nil. + The value should always contain ‘%m’ or ‘%M’, ‘%v’ or ‘%V’, and ‘%t’ or ‘%T’. If ‘magit-uniquify-buffer-names’ is non-nil, then the value must end with ‘%t’ or ‘%T’ (see issue #2841). @@ -1490,7 +1498,7 @@ certain type of sections. As you can see there are not many of those. only affects sections that could benefit from this information.  -File: magit.info, Node: Popup Buffers and Prefix Commands, Next: Completion and Confirmation, Prev: Sections, Up: Interface Concepts +File: magit.info, Node: Popup Buffers and Prefix Commands, Next: Completion Confirmation and the Selection, Prev: Sections, Up: Interface Concepts 4.3 Popup Buffers and Prefix Commands ===================================== @@ -1544,80 +1552,416 @@ differently, depending on the value of ‘magit-use-sticky-arguments’. ‘magit-diff-arguments’ is always used.  -File: magit.info, Node: Completion and Confirmation, Next: Running Git, Prev: Popup Buffers and Prefix Commands, Up: Interface Concepts +File: magit.info, Node: Completion Confirmation and the Selection, Next: Running Git, Prev: Popup Buffers and Prefix Commands, Up: Interface Concepts + +4.4 Completion, Confirmation and the Selection +============================================== + +* Menu: + +* Action Confirmation:: +* Completion and Confirmation:: +* The Selection:: +* The hunk-internal region:: +* Support for Completion Frameworks:: +* Additional Completion Options:: + + +File: magit.info, Node: Action Confirmation, Next: Completion and Confirmation, Up: Completion Confirmation and the Selection + +4.4.1 Action Confirmation +------------------------- + +By default many actions that could potentially lead to data loss have to +be confirmed. This includes many very common actions, so this can +quickly become annoying. Many of these actions can be undone and if you +have thought about how to undo certain mistakes, then it should be safe +to disable confirmation for the respective actions. + + The option ‘magit-no-confirm’ can be used to tell Magit to perform +certain actions without the user having to confirm them. Note that +while this option can only be used to disable confirmation for a +specific set of actions, the next section explains another way of +telling Magit to ask fewer questions. + + -- User Option: magit-no-confirm + + The value of this option is a list of symbols, representing actions + that do not have to be confirmed by the user before being carried + out. + + By default many potentially dangerous commands ask the user for + confirmation. Each of the below symbols stands for an action + which, when invoked unintentionally or without being fully aware of + the consequences, could lead to tears. In many cases there are + several commands that perform variations of a certain action, so we + don’t use the command names but more generic symbols. + + • Applying changes: + + • ‘discard’ Discarding one or more changes (i.e. hunks or + the complete diff for a file) loses that change, + obviously. + + • ‘reverse’ Reverting one or more changes can usually be + undone by reverting the reversion. + + • ‘stage-all-changes’, ‘unstage-all-changes’ When there are + both staged and unstaged changes, then un-/staging + everything would destroy that distinction. Of course + that also applies when un-/staging a single change, but + then less is lost and one does that so often that having + to confirm every time would be unacceptable. + + • Files: + + • ‘delete’ When a file that isn’t yet tracked by Git is + deleted, then it is completely lost, not just the last + changes. Very dangerous. + + • ‘trash’ Instead of deleting a file it can also be move to + the system trash. Obviously much less dangerous than + deleting it. + + Also see option ‘magit-delete-by-moving-to-trash’. + + • ‘resurrect’ A deleted file can easily be resurrected by + "deleting" the deletion, which is done using the same + command that was used to delete the same file in the + first place. + + • ‘untrack’ Untracking a file can be undone by tracking it + again. + + • ‘rename’ Renaming a file can easily be undone. + + • Sequences: + + • ‘reset-bisect’ Aborting (known to Git as "resetting") a + bisect operation loses all information collected so far. + + • ‘abort-rebase’ Aborting a rebase throws away all already + modified commits, but it’s possible to restore those from + the reflog. + + • ‘abort-merge’ Aborting a merge throws away all conflict + resolutions which have already been carried out by the + user. + + • ‘merge-dirty’ Merging with a dirty worktree can make it + hard to go back to the state before the merge was + initiated. + + • References: + + • ‘delete-unmerged-branch’ Once a branch has been deleted, + it can only be restored using low-level recovery tools + provided by Git. And even then the reflog is gone. The + user always has to confirm the deletion of a branch by + accepting the default choice (or selecting another + branch), but when a branch has not been merged yet, also + make sure the user is aware of that. + + • ‘delete-pr-branch’ When deleting a branch that was + created from a pull request and if no other branches + still exist on that remote, then ‘magit-branch-delete’ + offers to delete the remote as well. This should be safe + because it only happens if no other refs exist in the + remotes namespace, and you can recreate the remote if + necessary. + + • ‘drop-stashes’ Dropping a stash is dangerous because Git + stores stashes in the reflog. Once a stash is removed, + there is no going back without using low-level recovery + tools provided by Git. When a single stash is dropped, + then the user always has to confirm by accepting the + default (or selecting another). This action only + concerns the deletion of multiple stashes at once. + + • Various: + + • ‘kill-process’ There seldom is a reason to kill a + process. + + • Global settings: + + Instead of adding all of the above symbols to the value of + this option, you can also set it to the atom ‘t’, which has + the same effect as adding all of the above symbols. Doing + that most certainly is a bad idea, especially because other + symbols might be added in the future. So even if you don’t + want to be asked for confirmation for any of these actions, + you are still better of adding all of the respective symbols + individually. + + When ‘magit-wip-before-change-mode’ is enabled, then the + following actions can be undone fairly easily: ‘discard’, + ‘reverse’, ‘stage-all-changes’, and ‘unstage-all-changes’. If + and only if this mode is enabled, then ‘safe-with-wip’ has the + same effect as adding all of these symbols individually. + + +File: magit.info, Node: Completion and Confirmation, Next: The Selection, Prev: Action Confirmation, Up: Completion Confirmation and the Selection + +4.4.2 Completion and Confirmation +--------------------------------- + +Many Magit commands ask the user to select from a list of possible +things to act on, while offering the most likely choice as the default. +For many of these commands the default is the thing at point, provided +that it actually is a valid thing to act on. For many commands that act +on a branch, the current branch serves as the default if there is no +branch at point. + + These commands combine asking for confirmation and asking for a +target to act on into a single action. The user can confirm the default +target using ‘RET’ or abort using ‘C-g’. This is similar to a +‘y-or-n-p’ prompt, but the keys to confirm or abort differ. + + At the same time the user is also given the opportunity to select +another target, which is useful because for some commands and/or in some +situations you might want to select the action before selecting the +target by moving to it. + + However you might find that for some commands you always want to use +the default target, if any, or even that you want the command to act on +the default without requiring any confirmation at all. The option +‘magit-dwim-selection’ can be used to configure certain commands to that +effect. + + Note that when the region is active then many commands act on the +things that are selected using a mechanism based on the region, in many +cases after asking for confirmation. This region-based mechanism is +called the "selection" and is described in detail in the next section. +When a selection exists that is valid for the invoked command, then that +command never offers to act on something else, and whether it asks for +confirmation is not controlled by this option. + + Also note that Magit asks for confirmation of certain actions that +are not coupled with completion (or the selection). Such dialogs are +also not affected by this option and are described in the previous +section. + + -- User Option: magit-dwim-selection + + This option can be used to tell certain commands to use the thing at +point instead of asking the user to select a candidate to act on, with +or without confirmation. + + The value has the form ‘((COMMAND nil|PROMPT DEFAULT)...)’. + + • COMMAND is the command that should not prompt for a choice. To + have an effect, the command has to use the function + ‘magit-completing-read’ or a utility function which in turn uses + that function. + + • If the command uses ‘magit-completing-read’ multiple times, then + PROMPT can be used to only affect one of these uses. PROMPT, if + non-nil, is a regular expression that is used to match against the + PROMPT argument passed to ‘magit-completing-read’. + + • DEFAULT specifies how to use the default. If it is ‘t’, then the + DEFAULT argument passed to ‘magit-completing-read’ is used without + confirmation. If it is ‘ask’, then the user is given a chance to + abort. DEFAULT can also be ‘nil’, in which case the entry has no + effect. + + +File: magit.info, Node: The Selection, Next: The hunk-internal region, Prev: Completion and Confirmation, Up: Completion Confirmation and the Selection + +4.4.3 The Selection +------------------- + +If the region is active, then many Magit commands act on the things that +are selected using a mechanism based on the region instead of one single +thing. When the region is not active, then these commands act on the +thing at point or read a single thing to act on. This is described in +the previous section — this section only covers how multiple things are +selected, how that is visualized, and how certain commands behave when +that is the case. + + Magit’s mechanism for selecting multiple things, or rather sections +that represent these things, is based on the Emacs region, but the area +that Magit considers to be selected is typically larger than the region +and additional restrictions apply. + + Magit makes a distinction between a region that qualifies as forming +a valid Magit selection and a region that does not. If the region does +not qualify, then it is displayed as it is in other Emacs buffers. If +the region does qualify as a Magit selection, then the selection is +always visualized, while the region itself is only visualized if it +begins and ends on the same line. + + For a region to qualify as a Magit selection, it must begin in the +heading of one section and end in the heading of a sibling section. +Note that if the end of the region is at the very beginning of section +heading (i.e. at the very beginning of a line) then that section is +considered to be *inside* the selection. + + This is not consistent with how the region is normally treated in +Emacs — if the region ends at the beginning of a line, then that line is +outside the region. Due to how Magit visualizes the selection, it +should be obvious that this difference exists. + + Not every command acts on every valid selection. Some commands do +not even consider the location of point, others may act on the section +at point but not support acting on the selection, and even commands that +do support the selection of course only do so if it selects things that +they can act on. + + This is the main reason why the selection must include the section at +point. Even if a selection exists, the invoked command may disregard +it, in which case it may act on the current section only. It is much +safer to only act on the current section but not the other selected +sections than it is to act on the current section *instead* of the +selected sections. The latter would be much more surprising and if the +current section always is part of the selection, then that cannot +happen. + + -- Variable: magit-keep-region-overlay + + This variable controls whether the region is visualized as usual + even when a valid Magit selection or a hunk-internal region exists. + See the doc-string for more information. + + +File: magit.info, Node: The hunk-internal region, Next: Support for Completion Frameworks, Prev: The Selection, Up: Completion Confirmation and the Selection + +4.4.4 The hunk-internal region +------------------------------ + +Somewhat related to the Magit selection described in the previous +section is the hunk-internal region. + + Like the selection, the hunk-internal region is based on the Emacs +region but causes that region to not be visualized as it would in other +Emacs buffers, and includes the line on which the region ends even if it +ends at the very beginning of that line. + + Unlike the selection, which is based on a region that must begin in +the heading of one section and ends in the section of a sibling section, +the hunk-internal region must begin inside the *body* of a hunk section +and end in the body of the *same* section. + + The hunk-internal region is honored by "apply" commands, which can, +among other targets, act on a hunk. If the hunk-internal region is +active, then such commands act only on the marked part of the hunk +instead of on the complete hunk. + + +File: magit.info, Node: Support for Completion Frameworks, Next: Additional Completion Options, Prev: The hunk-internal region, Up: Completion Confirmation and the Selection -4.4 Completion and Confirmation -=============================== +4.4.5 Support for Completion Frameworks +--------------------------------------- -Many commands read a value from the user. By default this is done using -the built-in function ‘completing-read’, but Magit can instead use -another completion framework. +The built-in option ‘completing-read-function’ specifies the low-level +function used by ‘completing-read’ to ask a user to select from a list +of choices. Its default value is ‘completing-read-default’. +Alternative completion frameworks typically activate themselves by +substituting their own implementation. + + Mostly for historic reasons Magit provides a similar option named +‘magit-completing-read-function’, which only controls the low-level +function used by ‘magit-completing-read’. This option also makes it +possible to use a different completing mechanism for Magit than for the +rest of Emacs, but doing that is not recommend. + + You most likely don’t have to customize the magit-specific option to +use an alternative completion framework. For example, if you enable +‘ivy-mode’, then Magit will respect that, and if you enable ‘helm-mode’, +then you are done too. + + However if you want to use Ido, then ‘ido-mode’ won’t do the trick. +You will also have to install the ‘ido-completing-read+’ package and use +‘magit-ido-completing-read’ as ‘magit-completing-read-function’. -- User Option: magit-completing-read-function - The value of this variable is the function used to perform - completion. Because functions _intended_ to replace - ‘completing-read’ often are not fully compatible drop-in - replacements, and also because Magit expects them to add the - default choice to the prompt themselves, such functions should not - be used directly. Instead a wrapper function has to be used. + The value of this variable is the low-level function used to + perform completion by code that uses ‘magit-completing-read’ (as + opposed to the built-in ‘completing-read’). - Currently only the real ‘completing-read’ and Ido -(http://www.emacswiki.org/emacs/InteractivelyDoThings) are fully -supported. More frameworks will be supported in the future. + The default value, ‘magit-builtin-completing-read’, is suitable for + the standard completion mechanism, ‘ivy-mode’, and ‘helm-mode’ at + least. + + The built-in ‘completing-read’ and ‘completing-read-default’ are + *not* suitable to be used here. ‘magit-builtin-completing-read’ + performs some additional work, and any function used in its place + has to do the same. -- Function: magit-builtin-completing-read prompt choices &optional predicate require-match initial-input hist def - Perform completion using ‘completion-read’. + This function performs completion using the built-in + ‘completion-read’ and does some additional magit-specific work. -- Function: magit-ido-completing-read prompt choices &optional predicate require-match initial-input hist def - Perform completion using ‘ido-completing-read+’ from the package by - the same name (which you have to explicitly install). Ido itself - comes with a supposed drop-in replacement ‘ido-completing-read’, - but that has too many deficits to serve our needs. + This function performs completion using ‘ido-completing-read+’ from + the package by the same name (which you have to explicitly install) + and does some additional magit-specific work. - -- User Option: magit-list-refs-sortby + We have to use ‘ido-completing-read+’ instead of the + ‘ido-completing-read’ that comes with Ido itself, because the + latter, while intended as a drop-in replacement, cannot serve that + purpose because it violates too many of the implicit conventions. - For many commands that read a ref or refs from the user, the value - of this option can be used to control the order of the refs. Valid - values include any key accepted by the ‘--sort’ flag of ‘git - for-each-ref’. By default, refs are sorted alphabetically by their - full name (e.g., "refs/heads/master"). + -- Function: magit-completing-read prompt choices &optional predicate + require-match initial-input hist def fallback - By default many commands that could potentially lead to data loss -have to be confirmed. This includes many very common commands, so this -can become annoying quickly. Many of these actions can be undone, -provided ‘magit-wip-before-change-mode’ is turned on (which it is not by -default, due to performance concerns). + This is the function that Magit commands use when they need the + user to select a single thing to act on. The arguments have the + same meaning as for ‘completing-read’, except for FALLBACK, which + is unique to this function and is described below. - -- User Option: magit-no-confirm + Instead of asking the user to choose from a list of possible + candidates, this function may just return the default specified by + DEF, with or without requiring user confirmation. Whether that is + the case depends on PROMPT, ‘this-command’ and + ‘magit-dwim-selection’. See the documentation of the latter for + more information. + + If it does read a value in the minibuffer, then this function acts + similar to ‘completing-read’, except for the following: + + • If REQUIRE-MATCH is ‘nil’ and the user exits without a choice, + then ‘nil’ is returned instead of an empty string. - The value of this option is a list of symbols, representing - commands which do not have to be confirmed by the user before being - carried out. + • If REQUIRE-MATCH is non-nil and the users exits without a + choice, an user-error is raised. - When the global mode ‘magit-wip-before-change-mode’ is enabled then - many commands can be undone. If that mode is enabled then adding - ‘safe-with-wip’ to this list has the same effect as adding - ‘discard’, ‘reverse’, ‘stage-all-changes’, and - ‘unstage-all-changes’. + • FALLBACK specifies a secondary default that is only used if + the primary default DEF is ‘nil’. The secondary default is + not subject to ‘magit-dwim-selection’ — if DEF is ‘nil’ but + FALLBACK is not, then this function always asks the user to + choose a candidate, just as if both defaults were ‘nil’. - (add-to-list 'magit-no-confirm 'safe-with-wip) + • ": " is appended to PROMPT. - For a list of all symbols that can be added to the value of this - variable, see the doc-string. + • PROMPT is modified to end with \" (default DEF|FALLBACK): \" + provided that DEF or FALLBACK is non-nil, that neither + ‘ivy-mode’ nor ‘helm-mode’ is enabled, and that + ‘magit-completing-read-function’ is set to its default value + of ‘magit-builtin-completing-read’. - Note that there are commands that ignore this option and always -require confirmation, or which can be told not to do so using another -dedicated option. Also most commands, when acting on multiple sections -at once always, require confirmation, even when they do respect this -option when acting on a single section. + +File: magit.info, Node: Additional Completion Options, Prev: Support for Completion Frameworks, Up: Completion Confirmation and the Selection + +4.4.6 Additional Completion Options +----------------------------------- + + -- User Option: magit-list-refs-sortby + + For many commands that read a ref or refs from the user, the value + of this option can be used to control the order of the refs. Valid + values include any key accepted by the ‘--sort’ flag of ‘git + for-each-ref’. By default, refs are sorted alphabetically by their + full name (e.g., "refs/heads/master").  -File: magit.info, Node: Running Git, Prev: Completion and Confirmation, Up: Interface Concepts +File: magit.info, Node: Running Git, Prev: Completion Confirmation and the Selection, Up: Interface Concepts 4.5 Running Git =============== @@ -1637,8 +1981,11 @@ File: magit.info, Node: Viewing Git Output, Next: Running Git Manually, Up: R Magit runs Git either for side-effects (e.g. when pushing) or to get some value (e.g. the name of the current branch). When Git is run for -side-effects then the output goes into a per-repository log buffer, -which can be consulted when things don’t go as expected. +side-effects, the mode line displays a process status indicator (using +the ‘magit-mode-line-process’ face), and the process output goes into a +per-repository log buffer, which can be consulted when things don’t go +as expected. Process errors are indicated at the top of the status +buffer. ‘$’ (‘magit-process’) @@ -2135,7 +2482,7 @@ variable. Insert submodule sections. Hook ‘magit-module-sections-hook’ controls which module sections - are inserted, and option ‘magit-insert-modules-nested’ controls + are inserted, and option ‘magit-module-sections-nested’ controls whether they are wrapped in an additional section. • Option: magit-module-sections-hook @@ -2492,6 +2839,26 @@ File: magit.info, Node: Log Buffer, Next: Log Margin, Prev: Refreshing Logs, Whether to show the refnames after the commit summaries. This is useful if you use really long branch names. + Magit displays references in logs a bit differently from how Git does +it. + + Local branches are blue and remote branches are green. Of course +that depends on the used theme, as do the colors used for other types of +references. The current branch has a box around it, as do remote +branches that are their respective remote’s ‘HEAD’ branch. + + If a local branch and its push-target point at the same commit, then +their names are combined to preserve space and to make that relationship +visible. For example: + + origin/feature + [green][blue-] + + instead of + + feature origin/feature + [blue-] [green-------] + For a description of ‘magit-log-margin’ see *note Log Margin::.  @@ -3029,7 +3396,7 @@ File: magit.info, Node: Diff Options, Next: Revision Buffer, Prev: Diff Buffe ‘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. + region by placing delimiting horizontal 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 ff. @@ -3076,6 +3443,28 @@ File: magit.info, Node: Revision Buffer, Prev: Diff Options, Up: Diffing committer image, accordingly. Either the car or the cdr may be nil. + -- User Option: magit-revision-use-hash-sections + + Whether to turn hashes inside the commit message into sections. + + If non-nil, then hashes inside the commit message are turned into + ‘commit’ sections. There is a trade off to be made between + performance and reliability: + + • ‘slow’ calls git for every word to be absolutely sure. + + • ‘quick’ skips words less than seven characters long. + + • ‘quicker’ additionally skips words that don’t contain a + number. + + • ‘quickest’ uses all words that are at least seven characters + long and which contain at least one number as well as at least + one letter. + + If nil, then no hashes are turned into sections, but you can still + visit the commit at point using "RET". + The diffs shown in the revision buffer may be automatically restricted to a subset of the changed files. If the revision buffer is displayed from a log buffer, the revision buffer will share the same @@ -3226,6 +3615,7 @@ File: magit.info, Node: References Buffer, Next: Bisecting, Prev: Ediffing, • ‘branch’ Show counts for branches only. • ‘nil’ Never show counts. + The default is ‘nil’ because anything else can be very expensive. -- User Option: magit-refs-margin @@ -3497,101 +3887,127 @@ 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. + ‘M-x magit-blame’ (‘magit-blame’) - Display edit history of FILE up to REVISION. + This command augments each line or chunk of lines in the current + file- or blob-visiting buffer with information about what commits + last touched these lines. + + If the buffer visits a revision of that file, then history up to + that revision is considered. Otherwise, the file’s full history is + considered, including uncommitted changes. - 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 in the current buffer then + blaming is done recursively, by visiting REVISION:FILE (using + ‘magit-find-file’), where REVISION is the revision before the + revision that added the current line or chunk of lines. - If Magit-Blame mode is already turned on then blame recursively, by - visiting REVISION:FILE (using ‘magit-find-file’), where revision is - the revision before the revision that added the lines at point. +‘M-x magit-blame-reverse’ (‘magit-blame-reverse’) - ARGS is a list of additional arguments to pass to ‘git blame’; only - arguments available from ‘magit-blame-popup’ should be used. + 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. + + Like ‘magit-blame’, this command can be used recursively. ‘M-x magit-blame-popup’ (‘magit-blame-popup’) This prefix command shows the above suffix command along with the appropriate infix arguments in a popup buffer. + 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. + + 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. + ‘RET’ (‘magit-show-commit’) - Show the commit at point. If there is no commit at point or with a - prefix argument, prompt for a commit. + This command shows the commit that last touched the line at point. ‘SPC’ (‘magit-diff-show-or-scroll-up’) - Update the commit or diff buffer for the thing at point. + This command updates the commit buffer. - Either show the commit or stash at point in the appropriate buffer, - or if that buffer is already being displayed in the current frame - and contains information about that commit or stash, then instead - scroll the buffer up. If there is no commit or stash at point, - then prompt for a commit. + This either shows the commit that last touched the line at point in + the appropriate buffer, or if that buffer is already being + displayed in the current frame and if that buffer contains + information about that commit, then the buffer is scrolled up + instead. ‘DEL’ (‘magit-diff-show-or-scroll-down’) - Update the commit or diff buffer for the thing at point. + This command updates the commit buffer. - Either show the commit or stash at point in the appropriate buffer, - or if that buffer is already being displayed in the current frame - and contains information about that commit or stash, then instead - scroll the buffer down. If there is no commit or stash at point, - then prompt for a commit. + This either shows the commit that last touched the line at point in + the appropriate buffer, or if that buffer is already being + displayed in the current frame and if that buffer contains + information about that commit, then the buffer is scrolled down + instead. ‘n’ (‘magit-blame-next-chunk’) - Move to the next chunk. + This command moves to the next chunk. ‘N’ (‘magit-blame-next-chunk-same-commit’) - Move to the next chunk from the same commit. + This command moves to the next chunk from the same commit. ‘p’ (‘magit-blame-previous-chunk’) - Move to the previous chunk. + This command moves to the previous chunk. ‘P’ (‘magit-blame-previous-chunk-same-commit’) - Move to the previous chunk from the same commit. + This command moves to the previous chunk from the same commit. ‘q’ (‘magit-blame-quit’) - Turn off Magit-Blame mode. If the buffer was created during a - recursive blame, then also kill the buffer. + This command turns off Magit-Blame mode. If the buffer was created + during a recursive blame, then it also kills the buffer. ‘M-w’ (‘magit-blame-copy-hash’) - Save the hash of the current chunk’s commit to the kill ring. + This command saves the hash of the current chunk’s commit to the + kill ring. - When the region is active, then save that to the ‘kill-ring’, like - ‘kill-ring-save’ would. + 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’) - Show or hide blame chunk headings. + This command shows or hides blame chunk headings. -- User Option: magit-blame-heading-format - Format string used for blame headings. + The format string used for blame headings. -- User Option: magit-blame-time-format - Format string used for time strings in blame headings. + The format string used for time strings in blame headings. -- User Option: magit-blame-show-headings - Whether to initially show blame block headings. The headings can - also be toggled locally using command + This option controls whether blame block headings are initially + shown. The headings can also be toggled locally using the command ‘magit-blame-toggle-headings’. -- User Option: magit-blame-goto-chunk-hook - Hook run by ‘magit-blame-next-chunk’ and + This hook is run by ‘magit-blame-next-chunk’ and ‘magit-blame-previous-chunk’.  @@ -4278,9 +4694,17 @@ features are available from separate popups. Whether the ‘magit-branch-popup’ shows Git variables. This defaults to t to avoid changing key bindings. When set to nil, no variables are displayed directly in this popup, and the sub-popup - ‘magit-branch-config-popup’ has to be used indead to view and + ‘magit-branch-config-popup’ has to be used instead to view and change branch related variables. +‘b C’ (‘magit-branch-config-popup’) + + This command shows branch related variables in a separate popup. + By default this asks the user for which branch the variables should + be shown. When ‘magit-branch-popup-show-variables’ is ‘nil’, then + it shows the variables for the current branch, unless a prefix + argument is used. + ‘b b’ (‘magit-checkout’) Checkout a revision read in the minibuffer and defaulting to the @@ -4306,6 +4730,29 @@ features are available from separate popups. Also see option ‘magit-branch-prefer-remote-upstream’. +‘b l’ (‘magit-branch-checkout’) + + This command checks out an existing or new local branch. It reads + a branch name from the user offering all local branches and a + subset of remote branches as candidates. Remote branches for which + a local branch by the same name exists are omitted from the list of + candidates. The user can also enter a completely new branch name. + + • If the user selects an existing local branch, then that is + checked out. + + • If the user selects a remote branch, then it creates and + checks out a new local branch with the same name, and + configures the selected remote branch as the push target. + + • If the user enters a new branch name, then it creates and + checks that out, after also reading the starting-point from + the user. + + In the latter two cases the upstream is also set. Whether it is + set to the chosen starting point or something else depends on the + value of ‘magit-branch-adjust-remote-upstream-alist’. + ‘b s’ (‘magit-branch-spinoff’) This command creates and checks out a new branch starting at and @@ -4327,15 +4774,121 @@ features are available from separate popups. ‘FROM~’, instead of to the last commit it shares with its upstream. Interactively, FROM is only ever non-nil, if the region selects some commits, and among those commits, FROM is the commit that is - the fewest commits ahead of the source branch. (It not yet - possible to spin off a single commit, unless it is the only - unpushed commit. See #2920.) + the fewest commits ahead of the source branch. The commit at the other end of the selection actually does not matter, all commits between FROM and ‘HEAD’ are moved to the new branch. If FROM is not reachable from ‘HEAD’ or is reachable from the source branch’s upstream, then an error is raised. +‘b p’ (‘magit-branch-pull-request’) + + This command creates and configures a new branch from a Github + pull-request, creating and configuring a new remote if necessary. + + The name of the local branch is the same as the name of the remote + branch that you are being asked to merge, unless the contributor + could not be bother to properly name the branch before opening the + pull-request. The most likely such case is when you are being + asked to merge something like "fork/master" into "origin/master". + In such cases the local branch will be named "pr-N", where ‘N’ is + the pull-request number. + + These variables are always set by this command: + + • ‘branch..pullRequest’ is set to the pull-request number. + + • ‘branch..description’ is set to the pull-request title. + + • ‘branch..rebase’ is set to ‘true’ because there should + be no merge commits among the commits in a pull-request. + + This command also configures the upstream and the push-remote of + the local branch that it creates. + + The branch against which the pull-request was opened, is always + used as the upstream. This makes it easy to see what commits you + are being asked to merge in the section titled something like + "Unmerged into origin/master". + + Like for other commands that create a branch it depends on the + option ‘magit-branch-prefer-remote-upstream’ whether the remote + branch itself or the respective local branch is used as the + upstream, so this section may also be titled e.g. "Unmerged into + master". + + When necessary and possible, then the remote pull-request branch is + configured to be used as the push-target. This makes it easy to + see what further changes the contributor has made since you last + reviewed their changes in the section titled something like + "Unpulled from origin/new-feature" or "Unpulled from + 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’.) + + • If the pull-request branch is located inside a fork, then you + usually are 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. + + • If you are not allowed to push to the pull-request branch + on the fork, then a branch by the same name located in + the upstream repository is configured as the push-target. + + • A — sadly rather common — special case is when the + contributor didn’t bother to use a dedicated branch for + the pull-request. + + The most likely such case is when you are being asked to + 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. + + To enable you to easily push somewhere anyway, the local + branch is named "pr-N" (where ‘N’ is the pull-request + number) and the upstream repository is used as the + push-remote. + + • Finally, if you are allowed to push to the pull-request + branch and the contributor had the foresight to use a + dedicated branch, then the fork is configured as the + push-remote. + + The push-remote is configured using + ‘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. + + When you later delete the local pull-request branch, then you are + offered to also delete the corresponding remote, provided it is not + the upstream remote and that the tracking branch that corresponds + to the deleted branch is the only remaining tracked branch. If you + don’t confirm, then only the tracking branch itself is deleted in + addition to the local branch. + + Do not delete the tracking branch instead of the local branch. The + cleanup mentioned in the previous paragraph is not performed if you + do that. + +‘b p’ (‘magit-checkout-pull-request’) + + This command creates and configures a new branch from a pull + request, the same way ‘magit-branch-pull-request’ does. + Additionally it checks out the new branch. + ‘b x’ (‘magit-branch-reset’) This command resets a branch, defaulting to the branch at point, to @@ -4428,7 +4981,7 @@ features are available from separate popups. would be wasteful. Instead a branch like "maint" or "master" should be used as the upstream. - This option allows specifing the branch that should be used as the + This option allows specifying the branch that should be used as the upstream when branching certain remote branches. The value is an alist of the form ‘((UPSTREAM . RULE)...)’. The first matching element is used, the following elements are ignored. @@ -4490,7 +5043,7 @@ File: magit.info, Node: The Branch Config Popup, Prev: The Branch Popup, Up: 6.5.3 The Branch Config Popup ----------------------------- - -- Command: magit-branch-popup + -- Command: magit-branch-config-popup This prefix command shows the following branch-related Git variables in a popup buffer. The values can be changed from that @@ -4562,6 +5115,7 @@ branch-specific variables are not set. • When ‘true’ then pulling is done by rebasing. • When ‘false’ (the default) then pulling is done by merging. + Since it is never a good idea to merge the upstream branch into a feature or hotfix branch and most branches are such branches, you should consider setting this to ‘true’, and ‘branch.master.rebase’ @@ -4800,7 +5354,7 @@ to use Ediff is beyond the scope of this manual, instead see *note (ediff)Top::. If you are unsure whether you should Smerge or Ediff, then use the -former. It is much easier to understand and use, and except for truely +former. It is much easier to understand and use, and except for truly complex conflicts, the latter is usually overkill.  @@ -4888,6 +5442,10 @@ is not enabled in the popup. Reword a single older commit using rebase. +‘r k’ (‘magit-rebase-remove-commit’) + + Remove a single older commit using rebase. + When a rebase is in progress, then the popup buffer features these commands instead. @@ -5028,17 +5586,17 @@ File: magit.info, Node: Information About In-Progress Rebase, Prev: Editing Re ------------------------------------------ While a rebase sequence is in progress, the status buffer features a -section which lists the commits that have already been applied as well -as the commits that still have to be applied. +section that lists the commits that have already been applied as well as +the commits that still have to be applied. The commits are split in two halves. When rebase stops at a commit, -either because the user has to deal with a conflict or explicitly -requested that rebase stops at that commit, then point is placed on the -commit that separates the two groups, i.e. on ‘HEAD’. The commits -above it have not been applied yet, while it and the commits below it -have already been applied. In between these two groups of applied and -yet-to-be applied commits, there sometimes is a commit which has been -dropped. +either because the user has to deal with a conflict or because s/he +explicitly requested that rebase stops at that commit, then point is +placed on the commit that separates the two groups, i.e. on ‘HEAD’. +The commits above it have not been applied yet, while the ‘HEAD’ and the +commits below it have already been applied. In between these two groups +of applied and yet-to-be applied commits, there sometimes is a commit +which has been dropped. Each commit is prefixed with a word and these words are additionally shown in different colors to indicate the status of the commits. @@ -5054,8 +5612,8 @@ 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 blue - commit at the same time, if you create one or more new commits + 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. • Red commits have been dropped. They are shown for reference only, @@ -5070,78 +5628,113 @@ shown in different colors to indicate the status of the commits. meaning here as they do in the buffer used to edit the rebase sequence. See *note Editing Rebase Sequences::. - • The commit prefixed with ‘onto’ is the commit on top of which all - the other commits are being re-applied. Like the commits that have - already been re-applied, it is reachable from ‘HEAD’, but unlike - those it has not actually been re-applied during the current - session - it wasn’t touched at all. - - • Commits prefixed with ‘done’ have already been re-applied. Not all - commits that have already been applied are prefixed with this word, - though. - - • When a commit is prefixed with ‘void’, then that indicates that - Magit knows for sure that all the changes in that commit have been - applied using several new commits. This commit is no longer - reachable from ‘HEAD’, and it also isn’t one of the commits that - will be applied when resuming the session. - - • When a commit is prefixed with ‘join’, then that indicates that the - rebase sequence stopped at that commit due to a conflict - you now - have to join (merge) the changes with what has already been - applied. In a sense this is the commit rebase stopped at, but - while its effect is already in the index and in the worktree (with - conflict markers), the commit itself has not actually been applied - yet (it isn’t the ‘HEAD’). So it is shown in yellow, like the - other commits that still have to be applied. - - • When a commit is prefixed with ‘goal’, ‘same’, or ‘work’, then that - indicates that you reset to an earlier commit (and that this commit - therefore is no longer reachable from ‘HEAD’), but that it might - still be possible to create a new commit with the exact same tree - or at least the same patch-id (1), without manually editing any - file. Or at the very least that there are some uncommitted - remaining, which may or may not originate from that commit. - - • When a commit is prefixed with ‘goal’, then that indicates - that it is still possible to create a commit with the exact - same tree (the "goal") without manually editing a file, by - simply committing the index (or, provided nothing is already - staged, by staging all unstaged changes and then committing - that). This is the case when the original tree exists in the - index or worktree in untainted form. - - • When a commit is prefixed with ‘same’, then that indicates - that it is no longer possible to create a commit with the - exact same tree, but that it is still possible to create a - commit with the same patch-id. This would be the case if you - created a new commit with other changes, but the changes from - the original commit still exist in the index and/or working - tree in untainted form. - - • When a commit is prefixed with ‘work’, then that indicates - that you are working with the changes from that commit after - resetting to an earlier commit. There are changes in the - index and/or working tree and some of them likely originate - from that commit. - - • When a commit is prefixed with ‘poof’ or ‘gone’, then that - indicates that you reset to an earlier commit (and that this commit - therefore is no longer reachable from ‘HEAD’), and that there are - no uncommitted changes remaining which might allow you to create a - new commit with the same tree or at least the same patch-id. - - • When a commit is prefixed with ‘poof’, then that indicates - that it is no longer reachable from ‘HEAD’, but that it has - been replaced with one or more commits, which together have - the exact same effect. - - • When a commit is prefixed with ‘gone’, then that indicates - that it is no longer reachable from ‘HEAD’ and that we also - cannot determine whether its changes are still in effect in - one or more new commits. They might be, but if so, then there - must also be other changes which makes it impossible to know - for sure. + • Commits prefixed with ‘done’ and ‘onto’ have already been applied. + It is possible for such a commit to be the ‘HEAD’, in which case it + is blue. Otherwise it is grey. + + • The commit prefixed with ‘onto’ is the commit on top of which + all the other commits are being re-applied. This commit + itself did not have to be re-applied, it is the commit rebase + did rewind to before starting to re-apply other commits. + + • Commits prefixed with ‘done’ have already been re-applied. + This includes commits that have been re-applied but also new + commits that you have created during the rebase. + + • All other commits, those not prefixed with any of the above words, + are in some way related to the commit at which rebase stopped. + + To determine whether a commit is related to the stopped-at commit + their hashes, trees and patch-ids (1) are being compared. The + commit message is not used for this purpose. + + Generally speaking commits that are related to the stopped-at + commit can have any of the used colors, though not all color/word + combinations are possible. + + Words used for stopped-at commits are: + + • When a commit is prefixed with ‘void’, then that indicates + that Magit knows for sure that all the changes in that commit + have been applied using several new commits. This commit is + no longer reachable from ‘HEAD’, and it also isn’t one of the + commits that will be applied when resuming the session. + + • When a commit is prefixed with ‘join’, then that indicates + that the rebase sequence stopped at that commit due to a + conflict - you now have to join (merge) the changes with what + has already been applied. In a sense this is the commit + rebase stopped at, but while its effect is already in the + index and in the worktree (with conflict markers), the commit + itself has not actually been applied yet (it isn’t the + ‘HEAD’). So it is shown in yellow, like the other commits + that still have to be applied. + + • When a commit is prefixed with ‘stop’ or a _blue_ or _green_ + ‘same’, then that indicates that rebase stopped at this + commit, that it is still applied or has been applied again, + and that at least its patch-id is unchanged. + + • When a commit is prefixed with ‘stop’, then that + indicates that rebase stopped at that commit because you + requested that earlier, and its patch-id is unchanged. + It might even still be the exact same commit. + + • When a commit is prefixed with a _blue_ or _green_ + ‘same’, then that indicates that while its tree or hash + changed, its patch-id did not. If it is blue, then it is + the ‘HEAD’ commit (as always for blue). When it is + green, then it no longer is ‘HEAD’ because other commit + have been created since (but before continuing the + rebase). + + • When a commit is prefixed with ‘goal’, a _yellow_ ‘same,’ or + ‘work’, then that indicates that rebase applied that commit + but that you then reset ‘HEAD’ to an earlier commit (likely to + split it up into multiple commits), and that there are some + uncommitted changes remaining which likely (but not + necessarily) originate from that commit. + + • When a commit is prefixed with ‘goal’, then that + indicates that it is still possible to create a new + commit with the exact same tree (the "goal") without + manually editing any files, by committing the index, or + by staging all changes and then committing that. This is + the case when the original tree still exists in the index + or worktree in untainted form. + + • When a commit is prefixed with a yellow ‘same’, then that + indicates that it is no longer possible to create a + commit with the exact same tree, but that it is still + possible to create a commit with the same patch-id. This + would be the case if you created a new commit with other + changes, but the changes from the original commit still + exist in the index or working tree in untainted form. + + • When a commit is prefixed with ‘work’, then that + indicates that you reset ‘HEAD’ to an earlier commit, and + that there are some staged and/or unstaged changes + (likely, but not necessarily) originating from that + commit. However it is no longer possible to create a new + commit with the same tree or at least the same patch-id + because you have already made other changes. + + • When a commit is prefixed with ‘poof’ or ‘gone’, then that + indicates that rebase applied that commit but that you then + reset ‘HEAD’ to an earlier commit (likely to split it up into + multiple commits), and that there are no uncommitted changes. + + • When a commit is prefixed with ‘poof’, then that + indicates that it is no longer reachable from ‘HEAD’, but + that it has been replaced with one or more commits, which + together have the exact same effect. + + • When a commit is prefixed with ‘gone’, then that + indicates that it is no longer reachable from ‘HEAD’ and + that we also cannot determine whether its changes are + still in effect in one or more new commits. They might + be, but if so, then there must also be other changes + which makes it impossible to know for sure. Do not worry if you do not fully understand the above. That’s okay, you will acquire a good enough understanding through practice. @@ -5155,15 +5748,15 @@ commits which have already been applied. ---------- Footnotes ---------- - (1) The patch-id is a hash of the _changes_ introduced by commit. It -differs from hash of the commit itself, which is a hash of the result of -applying that change (i.e. the resulting trees and blobs) as well as -author and committer information, the commit message, and the hashes of -the parents of the commit. The patch-id hash on the other hand is -created only from the added and removed lines, even line numbers and -whitespace are created when calculating the hash. The patch-ids of two -commits can be used to answer the question "Do these two commits make -the same change?". + (1) The patch-id is a hash of the _changes_ introduced by a commit. +It differs from the hash of the commit itself, which is a hash of the +result of applying that change (i.e. the resulting trees and blobs) as +well as author and committer information, the commit message, and the +hashes of the parents of the commit. The patch-id hash on the other +hand is created only from the added and removed lines, even line numbers +and whitespace changes are ignored when calculating this hash. The +patch-ids of two commits can be used to answer the question "Do these +commits make the same change?".  File: magit.info, Node: Cherry Picking, Next: Resetting, Prev: Rebasing, Up: Manipulating @@ -5183,16 +5776,17 @@ features the following commands. ‘A A’ (‘magit-cherry-pick’) - Cherry-pick a commit. Prompt for a commit, defaulting to the - commit at point. If the region selects multiple commits, then pick - all of them, without prompting. + This command copies COMMITS from another branch onto the current + branch. If the region selects multiple commits, then those are + copied, without prompting. Otherwise the user is prompted for a + commit or range, defaulting to the commit at point. ‘A a’ (‘magit-cherry-apply’) - Apply the changes in a commit to the working tree, but do not - commit them. Prompt for a commit, defaulting to the commit at - point. If the region selects multiple commits, then apply all of - them, without prompting. + This command applies the changes in COMMITS from another branch + onto the current branch. If the region selects multiple commits, + then those are used, without prompting. Otherwise the user is + prompted for a commit or range, defaulting to the commit at point. This command also has a top-level binding, which can be invoked without using the popup by typing ‘a’ at the top-level. @@ -5384,7 +5978,14 @@ Also see *note (gitman)git-stash::. ‘z b’ (‘magit-stash-branch’) - Create and checkout a new BRANCH from STASH. + 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’) + + Create and checkout a new BRANCH using ‘magit-branch’ with the + current branch or ‘HEAD’ as the starting-point. Then apply STASH, + dropping it if it applies cleanly. ‘z f’ (‘magit-stash-format-patch’) @@ -5445,13 +6046,46 @@ File: magit.info, Node: Remotes, Next: Fetching, Up: Transferring 7.1 Remotes =========== -Also see *note (gitman)git-remote::. +* Menu: + +* The Remote Popup:: +* The Remote Config Popup:: + + +File: magit.info, Node: The Remote Popup, Next: The Remote Config Popup, Up: Remotes + +7.1.1 The Remote Popup +---------------------- + +The popup ‘magit-remote-popup’ is used to add remotes and to make +changes to existing remotes. This popup only deals with remotes +themselves, not with branches or the transfer of commits. Those +features are available from separate popups. + + Also see *note (gitman)git-remote::. ‘M’ (‘magit-remote-popup’) This prefix command shows the following suffix commands along with the appropriate infix arguments in a popup buffer. + -- User Option: magit-remote-popup-show-variables + + This option controls whether the ‘magit-remote-popup’ shows remote + related Git variables. When set to nil, no variables are displayed + directly in this popup, and the sub-popup + ‘magit-remote-config-popup’ has to be used instead to view and + change remote related variables. + +‘M C’ (‘magit-remote-config-popup’) + + This command shows remote related variables in a separate popup. + By default this asks the user for which remote the variables should + be shown. When ‘magit-remote-popup-show-variables’ is ‘nil’, then + it shows the variables for the upstream of the current branch or + "origin" it that branch has no remote upstream. To select another + remote use a prefix argument. + ‘M a’ (‘magit-remote-add’) Add a remote and fetch it. The remote name and url are read in the @@ -5482,6 +6116,55 @@ Also see *note (gitman)git-remote::. the name of the added remote is equal to that string and the variable isn’t already set. + +File: magit.info, Node: The Remote Config Popup, Prev: The Remote Popup, Up: Remotes + +7.1.2 The Remote Config Popup +----------------------------- + + -- Command: magit-remote-config-popup + + This prefix command shows the following remote-related Git + variables in a popup buffer. The values can be changed from that + buffer. + + This popup is a sub-popup of the ‘magit-remote-popup’ in which "C" + is bound to this popup. + + The following variables are used to configure a specific remote. The +values are being displayed for the upstream remote of the current +branch. To change the value for another remote invoke +‘magit-remote-config-popup’ with a prefix argument. + + -- Variable: remote.NAME.url + + 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 + 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 + 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. + + -- Variable: remote.NAME.tagOpts + + This variable specifies what tags are fetched by default. If the + value is ‘--no-tags’ then no tags are fetched. If the value is + ‘--tags’, then all tags are fetched. If this variable has not + value, then only tags are fetched that are reachable from fetched + branches. +  File: magit.info, Node: Fetching, Next: Pulling, Prev: Remotes, Up: Transferring @@ -5596,8 +6279,8 @@ _push-remote_, see *note Branching::. Push the current branch to its upstream branch. When ‘magit-push-current-set-remote-if-missing’ is non-nil and the - push-remote is not configured, then read the upstram from the user, - set it, and then push to it. With a prefix argument the + push-remote is not configured, then read the upstream from the + user, set it, and then push to it. With a prefix argument the push-remote can be changed before pushed to it. ‘P e’ (‘magit-push-current’) @@ -5704,13 +6387,16 @@ File: magit.info, Node: Creating and Sending Patches, Next: Applying Patches, Request that upstream pulls from your public repository. + It is also possible to save a plain patch file by using ‘C-x C-w’ +inside a ‘magit-diff-mode’ or ‘magit-revision-mode’ buffer. +  File: magit.info, Node: Applying Patches, Prev: Creating and Sending Patches, Up: Transferring 7.6 Applying Patches ==================== -Also see *note (gitman)git-am::. +Also see *note (gitman)git-am::. and *note (gitman)git-apply::. ‘w’ (‘magit-am-popup’) @@ -5727,6 +6413,9 @@ Also see *note (gitman)git-am::. Apply the patches from a maildir. + When an "am" operation is in progress, then the popup buffer features +these commands instead. + ‘w w’ (‘magit-am-continue’) Resume the current patch applying sequence. @@ -5740,6 +6429,19 @@ Also see *note (gitman)git-am::. Abort the current patch applying sequence. This discards all changes made since the sequence started. + In addition to the commands listed at the top, the "am" popup also +has a binding for the related "patch" popup. + +‘w a’ (‘magit-patch-apply-popup’) + + This prefix command shows the following suffix commands along with + the appropriate infix arguments in a popup buffer. + +‘w a a’ (‘magit-patch-apply’) + + This command applies a simple patch file, which may not contain any + Git metadata in addition to the actual diff. +  File: magit.info, Node: Miscellaneous, Next: Customizing, Prev: Transferring, Up: Top @@ -5818,25 +6520,6 @@ Also see *note (gitman)git-notes::. Remove notes about unreachable commits. -‘T s’ (‘magit-notes-set-ref’) - - Set the current notes ref to a the value read from the user. The - ref is made current by setting the value of the Git variable - ‘core.notesRef’. With a prefix argument change the global value - instead of the value in the current repository. When this is - undefined, then "refs/notes/commit" is used. - - Other ‘magit-notes-*’ commands, as well as the sub-commands of - Git’s ‘note’ command, default to operate on that ref. - -‘T S’ (‘magit-notes-set-display-refs’) - - Set notes refs to be display in addition to "core.notesRef". This - reads a colon separated list of notes refs from the user. The - values are stored in the Git variable ‘notes.displayRef’. With a - prefix argument GLOBAL change the global values instead of the - values in the current repository. - It is possible to merge one note ref into another. That may result in conflicts which have to resolved in the temporary worktree ".git/NOTES_MERGE_WORKTREE". @@ -5859,6 +6542,22 @@ following suffix commands, instead of those listed above. Abort the current notes ref merge. + The following variables control what notes reference ‘magit-notes-*’, +‘git notes’ and ‘git show’ act on and display. Both the local and +global values are displayed and can be modified. + + -- Variable: core.notesRef + + This variable specifies the notes ref that is displayed by default + and which commands act on by default. + + -- Variable: notes.displayRef + + This variable specifies additional notes ref to be displayed in + addition to the ref specified by ‘core.notesRef’. It can have + multiple values and may end with ‘*’ to display all refs in the + ‘refs/notes/’ namespace (or ‘**’ if some names contain slashes). +  File: magit.info, Node: Submodules, Next: Subtree, Prev: Notes, Up: Miscellaneous @@ -5956,7 +6655,7 @@ File: magit.info, Node: Submodule Popup, Prev: Listing Submodules, Up: Submod Fetch submodule. With a prefix argument fetch all remotes. -‘o i’ (‘magit-submodule-init’) +‘o d’ (‘magit-submodule-deinit’) Unregister the submodule at PATH. @@ -6028,7 +6727,7 @@ beside the ones below, but these didn’t fit well anywhere else. ‘C-w’ (‘magit-copy-buffer-revision’) - This command save the revision being displayed in the current + This command saves the revision being displayed in the current buffer to the ‘kill-ring’ and also pushes it to the ‘magit-revision-stack’. It is mainly intended for use in ‘magit-revision-mode’ buffers, the only buffers where it is always @@ -6108,7 +6807,7 @@ 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. - To view the log for the a branch and its wip refs use the commands + 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 all commits that ever existed on a wip ref. You can then recover lost @@ -6135,7 +6834,7 @@ which might seem excessive, but allows fine tuning of when exactly changes are being committed to the wip refs. Enabling all modes makes it less likely that a change slips through the cracks. - Setting the below variable directly does not take effect; either + Setting the following variables directly does not take effect; either customize them or call the respective mode function. -- User Option: magit-wip-after-save-mode @@ -6257,7 +6956,7 @@ few key bindings, but this might be extended in the future. -- User Option: magit-diff-buffer-file-locked This option controls whether ‘magit-diff-buffer-file’ uses a - decicated buffer. See *note Modes and Buffers::. + dedicated buffer. See *note Modes and Buffers::. ‘C-c M-g L’ (‘magit-log-buffer-file-popup’) @@ -6276,7 +6975,7 @@ few key bindings, but this might be extended in the future. -- User Option: magit-log-buffer-file-locked This option controls whether ‘magit-log-buffer-file’ uses a - decicated buffer. See *note Modes and Buffers::. + dedicated buffer. See *note Modes and Buffers::. ‘C-c M-g b’ (‘magit-blame-popup’) @@ -6341,7 +7040,7 @@ the following. active or inactive depending on the value of ‘magit-fetch-arguments’ only, but that doesn’t keep the Git variable from being honored by the suffix commands anyway. So - pruning might happen despite the the ‘--prune’ arguments being + pruning might happen despite the ‘--prune’ arguments being displayed in a way that seems to indicate that no pruning will happen. @@ -6471,24 +7170,24 @@ but also requires major refactoring. Meanwhile you can tell Magit to only automatically refresh the current Magit buffer, but not the status buffer. If you do that, then -the status buffer is only refreshed automatically if it itself is the -current buffer. +the status buffer is only refreshed automatically if it is the current +buffer. (setq magit-refresh-status-buffer nil) You should also check whether any third-party packages have added anything to ‘magit-refresh-buffer-hook’, ‘magit-status-refresh-hook’, ‘magit-pre-refresh-hook’, and ‘magit-post-refresh-hook’. If so, then -check whether those additions impacts performance significantly. -Setting ‘magit-refresh-verbose’ and then inspecting the output in the +check whether those additions impact performance significantly. Setting +‘magit-refresh-verbose’ and then inspecting the output in the ‘*Messages*’ buffer, should help doing so. - Magit also reverts buffers which visit files located inside the -current repository, when the visited file changes on disk. That is + Magit also reverts buffers for visited files located inside the +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 @@ -6588,24 +7287,24 @@ using: Then you can type ‘C-c C-d’ to show the diff when you actually want to see it, but only then. Alternatively you can leave the hook alone -and just type ‘C-g’ in those cases when it takes to long to generate the -diff. If you do that, then you will end up with a broken diff buffer, -but doing it this way has the advantage that you usually get to see the -diff, which is useful because it increases the odds that you spot -potential issues. +and just type ‘C-g’ in those cases when it takes too long to generate +the diff. If you do that, then you will end up with a broken diff +buffer, but doing it this way has the advantage that you usually get to +see the diff, which is useful because it increases the odds that you +spot potential issues. The Built-In VC Package ....................... Emacs comes with a version control interface called "VC", see *note -(emacs)Version Control::. It is enabled be default and if you don’t use -it in addition to Magit, then you should disable it to keep it from +(emacs)Version Control::. It is enabled be default, and if you don’t +use it in addition to Magit, then you should disable it to keep it from performing unnecessary work: (setq vc-handled-backends nil) - You can also disable its use only for Git but keep using it when -using another version control system: + You can also disable its use for Git but keep using it when using +another version control system: (setq vc-handled-backends (delq 'Git vc-handled-backends)) @@ -6621,21 +7320,21 @@ 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 also exist other Window-specific -performance issues, some of which can be worked around. The maintainers -of "Git for Windows" try to reduce their effect, and in order to benefit -from the latest performance tweaks, should always use the latest -release. Magit too tries to work around some Windows-specific issues. + 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 + 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 slowing things -down. + You should also check whether an anti-virus program is affecting +performance.  File: magit.info, Node: MacOS Performance, Prev: Microsoft Windows Performance, Up: Performance @@ -6688,7 +7387,7 @@ 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 bound to a + If you are trying to find an unused key that you can bind to a command provided by your own Magit extension, then checkout . @@ -6711,15 +7410,15 @@ have one of the prefixes ‘magit-run-’, ‘magit-call-’, ‘magit-start-’ ‘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 +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-effect. The functions that return a value are useful to + 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. @@ -6740,9 +7439,9 @@ File: magit.info, Node: Getting a Value from Git, Next: Calling Git for Effect 10.1.1 Getting a Value from Git ------------------------------- -These functions run Git in order to get a value, either its exit status -or its output. Of course you could also use them to run Git commands -that have side-effects, but that should be avoided. +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 @@ -6793,10 +7492,10 @@ that have side-effects, but that should be avoided. and add a section containing git’s standard error in the current repository’s process buffer. - When an error occurs when using one of the above functions, then that -is usually due to a bug, i.e. the use of 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. + 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 @@ -7105,721 +7804,3 @@ File: magit.info, Node: Section Selection, Next: Matching Sections, Prev: Cre types of all selected sections additionally have to match one of TYPES, or nil is returned. - -File: magit.info, Node: Matching Sections, Prev: Section Selection, Up: Section Plumbing - -10.2.3 Matching Sections ------------------------- - -‘M-x magit-describe-section’ (‘magit-describe-section’) - - 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 - form ‘((TYPE . VALUE)...)’. - - -- Function: magit-get-section - - 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 - section at point. If SECTION is not specified and there also is no - section at point, then return ‘nil’. - - CONDITION can take the following forms: - • ‘(CONDITION...)’ - - matches if any of the CONDITIONs matches. - - • ‘[TYPE...]’ - - matches if the first TYPE matches the type of the section, the - second matches that of its parent, and so on. - - • ‘[* TYPE...]’ - - matches sections that match [TYPE…] and also recursively all - their child sections. - - • ‘TYPE’ - - matches sections of TYPE regardless of the types of the parent - sections. - Each TYPE is a symbol. Note that it is not necessary to specify - all TYPEs up to the root section as printed by - ‘magit-describe-type’, unless of course you want to be that - precise. - - -- Function: magit-section-when condition &rest body - - If the section at point matches CONDITION evaluate BODY. - - If the section matches, then evaluate BODY forms sequentially with - ‘it’ bound to the section and return the value of the last form. - If there are no BODY forms, then return the value of the section. - If the section does not match or if there is no section at point - then return nil. - - See ‘magit-section-match’ for the forms CONDITION can take. - - -- Function: magit-section-case &rest clauses - - Choose among clauses on the type of the section at point. - - Each clause looks like (CONDITION BODY…). The type of the section - is compared against each CONDITION; the BODY forms of the first - match are evaluated sequentially and the value of the last form is - returned. Inside BODY the symbol ‘it’ is bound to the section at - point. If no clause succeeds or if there is no section at point - return nil. - - See ‘magit-section-match’ for the forms CONDITION can take. - Additionally a CONDITION of t is allowed in the final clause and - matches if no other CONDITION match, even if there is no section at - point. - - -- Variable: magit-root-section - - The root section in the current buffer. All other sections are - descendants of this section. The value of this variable is set by - ‘magit-insert-section’ and you should never modify it. - - For diff related sections a few additional tools exist. - - -- Function: magit-diff-type &optional section - - Return the diff type of SECTION. - - The returned type is one of the symbols ‘staged’, ‘unstaged’, - ‘committed’, or ‘undefined’. This type serves a similar purpose as - the general type common to all sections (which is stored in the - ‘type’ slot of the corresponding ‘magit-section’ struct) but takes - additional information into account. When the SECTION isn’t - related to diffs and the buffer containing it also isn’t a - diff-only buffer, then return nil. - - Currently the type can also be one of ‘tracked’ and ‘untracked’, - but these values are not handled explicitly in every place they - should be. A possible fix could be to just return nil here. - - The section has to be a ‘diff’ or ‘hunk’ section, or a section - whose children are of type ‘diff’. If optional SECTION is nil, - return the diff type for the current section. In buffers whose - major mode is ‘magit-diff-mode’ SECTION is ignored and the type is - determined using other means. In ‘magit-revision-mode’ buffers the - type is always ‘committed’. - - -- Function: magit-diff-scope &optional section strict - - Return the diff scope of SECTION or the selected section(s). - - A diff’s "scope" describes what part of a diff is selected, it is a - symbol, one of ‘region’, ‘hunk’, ‘hunks’, ‘file’, ‘files’, or - ‘list’. Do not confuse this with the diff "type", as returned by - ‘magit-diff-type’. - - If optional SECTION is non-nil, then return the scope of that, - ignoring the sections selected by the region. Otherwise return the - scope of the current section, or if the region is active and - selects a valid group of diff related sections, the type of these - sections, i.e. ‘hunks’ or ‘files’. If SECTION (or if the current - section that is nil) is a ‘hunk’ section and the region starts and - ends inside the body of a that section, then the type is ‘region’. - - If optional STRICT is non-nil then return nil if the diff type of - the section at point is ‘untracked’ or the section at point is not - actually a ‘diff’ but a ‘diffstat’ section. - - -File: magit.info, Node: Refreshing Buffers, Next: Conventions, Prev: Section Plumbing, Up: Plumbing - -10.3 Refreshing Buffers -======================= - -All commands that create a new Magit buffer or change what is being -displayed in an existing buffer do so by calling ‘magit-mode-setup’. -Among other things, that function sets the buffer local values of -‘default-directory’ (to the top-level of the repository), -‘magit-refresh-function’, and ‘magit-refresh-args’. - - Buffers are refreshed by calling the function that is the local value -of ‘magit-refresh-function’ (a function named ‘magit-*-refresh-buffer’, -where ‘*’ may be something like ‘diff’) with the value of -‘magit-refresh-args’ as arguments. - - -- Macro: magit-mode-setup buffer switch-func mode refresh-func - &optional refresh-args - - This function displays and selects BUFFER, turns on MODE, and - refreshes a first time. - - This function displays and optionally selects BUFFER by calling - ‘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. - - All arguments are evaluated before switching to BUFFER. - - -- Function: magit-mode-display-buffer buffer mode &optional - switch-function - - This function display BUFFER in some window and select it. BUFFER - may be a buffer or a string, the name of a buffer. The buffer is - returned. - - Unless BUFFER is already displayed in the selected frame, store the - 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. - - -- Variable: magit-refresh-function - - The value of this buffer-local variable is the function used to - refresh the current buffer. It is called with ‘magit-refresh-args’ - as arguments. - - -- Variable: magit-refresh-args - - The list of arguments used by ‘magit-refresh-function’ to refresh - the current buffer. ‘magit-refresh-function’ is called with these - arguments. - - The value is usually set using ‘magit-mode-setup’, but in some - cases it’s also useful to provide commands which can change the - value. For example, the ‘magit-diff-refresh-popup’ can be used to - change any of the arguments used to display the diff, without - having to specify again which differences should be shown. - ‘magit-diff-more-context’, ‘magit-diff-less-context’, and - ‘magit-diff-default-context’ change just the ‘-U’ argument. In - both case this is done by changing the value of this variable and - then calling this ‘magit-refresh-function’. - - -File: magit.info, Node: Conventions, Prev: Refreshing Buffers, Up: Plumbing - -10.4 Conventions -================ - -* Menu: - -* Confirmation and Completion:: -* Theming Faces:: - - -File: magit.info, Node: Confirmation and Completion, Next: Theming Faces, Up: Conventions - -10.4.1 Confirmation and Completion ----------------------------------- - -Dangerous operations that may lead to data loss have to be confirmed by -default. With a multi-section selection, this is done using questions -that can be answered with "yes" or "no". When the region isn’t active, -or if it doesn’t constitute a valid section selection, then such -commands instead read a single item in the minibuffer. When the value -of the current section is among the possible choices, then that is -presented as default choice. To confirm the action on a single item, -the user has to answer ‘RET’ (instead of "yes"), and to abort, ‘C-g’ -(instead of "no"). But alternatively the user may also select another -item, just like if the command had been invoked with no suitable section -at point at all. - - -File: magit.info, Node: Theming Faces, Prev: Confirmation and Completion, Up: Conventions - -10.4.2 Theming Faces --------------------- - -The default theme uses blue for local branches, green for remote -branches, and goldenrod (brownish yellow) for tags. When creating a new -theme, you should probably follow that example. If your theme already -uses other colors, then stick to that. - - In older releases these reference faces used to have a background -color and a box around them. The basic default faces no longer do so, -to make Magit buffers much less noisy, and you should follow that -example at least with regards to boxes. (Boxes were used in the past to -work around a conflict between the highlighting overlay and text -property backgrounds. That’s no longer necessary because highlighting -no longer causes other background colors to disappear.) Alternatively -you can keep the background color and/or box, but then have to take -special care to adjust ‘magit-branch-current’ accordingly. By default -it looks mostly like ‘magit-branch-local’, but with a box (by default -the former is the only face that uses a box, exactly so that it sticks -out). If the former also uses a box, then you have to make sure that it -differs in some other way from the latter. - - The most difficult faces to theme are those related to diffs, -headings, highlighting, and the region. There are faces that fall into -all four groups - expect to spend some time getting this right. - - The ‘region’ face in the default theme, in both the light and dark -variants, as well as in many other themes, distributed with Emacs or by -third-parties, is very ugly. It is common to use a background color -that really sticks out, which is ugly but if that were the only problem -then it would be acceptable. Unfortunately many themes also set the -foreground color, which ensures that all text within the region is -readable. Without doing that there might be cases where some foreground -color is too close to the region background color to still be readable. -But it also means that text within the region loses all syntax -highlighting. - - I consider the work that went into getting the ‘region’ face right to -be a good indicator for the general quality of a theme. My -recommendation for the ‘region’ face is this: use a background color -slightly different from the background color of the ‘default’ face, and -do not set the foreground color at all. So for a light theme you might -use a light (possibly tinted) gray as the background color of ‘default’ -and a somewhat darker gray for the background of ‘region’. That should -usually be enough to not collide with the foreground color of any other -face. But if some other faces also set a light gray as background -color, then you should also make sure it doesn’t collide with those (in -some cases it might be acceptable though). - - Magit only uses the ‘region’ face when the region is "invalid" by its -own definition. In a Magit buffer the region is used to either select -multiple sibling sections, so that commands which support it act on all -of these sections instead of just the current section, or to select -lines within a single hunk section. In all other cases, the section is -considered invalid and Magit won’t act on it. But such invalid sections -happen, either because the user has not moved point enough yet to make -it valid or because she wants to use a non-magit command to act on the -region, e.g. ‘kill-region’. - - So using the regular ‘region’ face for invalid sections is a feature. -It tells the user that Magit won’t be able to act on it. It’s -acceptable if that face looks a bit odd and even (but less so) if it -collides with the background colors of section headings and other things -that have a background color. - - Magit highlights the current section. If a section has subsections, -then all of them are highlighted. This is done using faces that have -"highlight" in their names. For most sections, -‘magit-section-highlight’ is used for both the body and the heading. -Like the ‘region’ face, it should only set the background color to -something similar to that of ‘default’. The highlight background color -must be different from both the ‘region’ background color and the -‘default’ background color. - - For diff related sections Magit uses various faces to highlight -different parts of the selected section(s). Note that hunk headings, -unlike all other section headings, by default have a background color, -because it is useful to have very visible separators between hunks. -That face ‘magit-diff-hunk-heading’, should be different from both -‘magit-diff-hunk-heading-highlight’ and ‘magit-section-highlight’, as -well as from ‘magit-diff-context’ and ‘magit-diff-context-highlight’. -By default we do that by changing the foreground color. Changing the -background color would lead to complications, and there are already -enough we cannot get around. (Also note that it is generally a good -idea for section headings to always be bold, but only for sections that -have subsections). - - When there is a valid region selecting diff-related sibling sections, -i.e. multiple files or hunks, then the bodies of all these sections use -the respective highlight faces, but additionally the headings instead -use one of the faces ‘magit-diff-file-heading-selection’ or -‘magit-diff-hunk-heading-selection’. These faces have to be different -from the regular highlight variants to provide explicit visual -indication that the region is active. - - When theming diff related faces, start by setting the option -‘magit-diff-refine-hunk’ to ‘all’. You might personally prefer to only -refine the current hunk or not use hunk refinement at all, but some of -the users of your theme want all hunks to be refined, so you have to -cater to that. - - (Also turn on ‘magit-diff-highlight-indentation’, -‘magit-diff-highlight-trailing’, and ‘magit-diff-paint-whitespace’; and -insert some whitespace errors into the code you use for testing.) - - For e.g. "added lines" you have to adjust three faces: -‘magit-diff-added’, ‘magit-diff-added-highlight’, and -‘smerge-refined-added’. Make sure that the latter works well with both -of the former, as well as ‘smerge-other’ and ‘diff-added’. Then do the -same for the removed lines, context lines, lines added by us, and lines -added by them. Also make sure the respective added, removed, and -context faces use approximately the same saturation for both the -highlighted and unhighlighted variants. Also make sure the file and -diff headings work nicely with context lines (e.g. make them look -different). Line faces should set both the foreground and the -background color. For example, for added lines use two different -greens. - - It’s best if the foreground color of both the highlighted and the -unhighlighted variants are the same, so you will need to have to find a -color that works well on the highlight and unhighlighted background, the -refine background, and the highlight context background. When there is -an hunk internal region, then the added- and removed-lines background -color is used only within that region. Outside the region the -highlighted context background color is used. This makes it easier to -see what is being staged. With an hunk internal region the hunk heading -is shown using ‘magit-diff-hunk-heading-selection’, and so are the thin -lines that are added around the lines that fall within the region. The -background color of that has to be distinct enough from the various -other involved background colors. - - Nobody said this would be easy. If your theme restricts itself to a -certain set of colors, then you should make an exception here. -Otherwise it would be impossible to make the diffs look good in each and -every variation. Actually you might want to just stick to the default -definitions for these faces. You have been warned. Also please note -that if you do not get this right, this will in some cases look to users -like bugs in Magit - so please do it right or not at all. - - -File: magit.info, Node: FAQ, Next: Debugging Tools, Prev: Plumbing, Up: Top - -Appendix A FAQ -************** - -The next two nodes lists frequently asked questions. For a list of -frequently *and recently* asked questions, i.e. questions that haven’t -made it into the manual yet, see -. - - Please also use the *note Debugging Tools::. - -* Menu: - -* FAQ - How to …?:: -* FAQ - Issues and Errors:: - - -File: magit.info, Node: FAQ - How to …?, Next: FAQ - Issues and Errors, Up: FAQ - -A.1 FAQ - How to …? -=================== - -* Menu: - -* How to show git's output?:: -* How to install the gitman info manual?:: -* How to show diffs for gpg-encrypted files?:: -* How does branching and pushing work?:: -* Can Magit be used as ‘ediff-version-control-package’?:: - - -File: magit.info, Node: How to show git's output?, Next: How to install the gitman info manual?, Up: FAQ - How to …? - -A.1.1 How to show git’s output? -------------------------------- - -To show the output of recently run git commands, press ‘$’ (or, if that -isn’t available, ‘M-x magit-process-buffer’). This will show a buffer -containing a section per git invocation; as always press ‘TAB’ to expand -or collapse them. - - By default git’s output is only inserted into the process buffer if -it is run for side-effects. When the output is consumed in some way -then also inserting it into the process buffer would be to expensive. -For debugging purposes it’s possible to do so anyway by setting -‘magit-git-debug’ to ‘t’. - - -File: magit.info, Node: How to install the gitman info manual?, Next: How to show diffs for gpg-encrypted files?, Prev: How to show git's output?, Up: FAQ - How to …? - -A.1.2 How to install the gitman info manual? --------------------------------------------- - -Git’s manpages can be exported as an info manual called ‘gitman’. -Magit’s own info manual links to nodes in that manual instead of the -actual manpages because Info doesn’t support linking to manpages. - - Unfortunately some distributions do not install the ‘gitman’ manual -by default and you will have to install a separate documentation package -to get it. - - Magit patches Info adding the ability to visit links to the ‘gitman’ -Info manual by instead viewing the respective manpage. If you prefer -that approach, then set the value of ‘magit-view-git-manual-method’ to -one of the supported packages ‘man’ or ‘woman’, e.g.: - - (setq magit-view-git-manual-method 'man) - - -File: magit.info, Node: How to show diffs for gpg-encrypted files?, Next: How does branching and pushing work?, Prev: How to install the gitman info manual?, Up: FAQ - How to …? - -A.1.3 How to show diffs for gpg-encrypted files? ------------------------------------------------- - -Git supports showing diffs for encrypted files, but has to be told to do -so. Since Magit just uses Git to get the diffs, configuring Git also -affects the diffs displayed inside Magit. - - git config --global diff.gpg.textconv "gpg --no-tty --decrypt" - echo "*.gpg filter=gpg diff=gpg" > .gitattributes - - -File: magit.info, Node: How does branching and pushing work?, Next: Can Magit be used as ‘ediff-version-control-package’?, Prev: How to show diffs for gpg-encrypted files?, Up: FAQ - How to …? - -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 …? - -A.1.5 Can Magit be used as ‘ediff-version-control-package’? ------------------------------------------------------------ - -No, it cannot. For that to work the functions ‘ediff-magit-internal’ -and ‘ediff-magit-merge-internal’ would have to be implemented, and they -are not. These two functions are only used by the three commands -‘ediff-revision’, ‘ediff-merge-revisions-with-ancestor’, and -‘ediff-merge-revisions’. - - These commands only delegate the task of populating buffers with -certain revisions to the "internal" functions. The equally important -task of determining which revisions are to be compared/merged is not -delegated. Instead this is done without any support whatsoever, from -the version control package/system - meaning that the user has to enter -the revisions explicitly. Instead of implementing -‘ediff-magit-internal’ we provide ‘magit-ediff-compare’, which handles -both tasks like it is 2005. - - The other commands ‘ediff-merge-revisions’ and -‘ediff-merge-revisions-with-ancestor’ are normally not what you want -when using a modern version control system like Git. Instead of letting -the user resolve only those conflicts which Git could not resolve on its -own, they throw away all work done by Git and then expect the user to -manually merge all conflicts, including those that had already been -resolved. That made sense back in the days when version control systems -couldn’t merge (or so I have been told), but not anymore. Once in a -blue moon you might actually want to see all conflicts, in which case -you *can* use these commands, which then use ‘ediff-vc-merge-internal’. -So we don’t actually have to implement ‘ediff-magit-merge-internal’. -Instead we provide the more useful command ‘magit-ediff-resolve’ which -only shows yet-to-be resolved conflicts. - - -File: magit.info, Node: FAQ - Issues and Errors, Prev: FAQ - How to …?, Up: FAQ - -A.2 FAQ - Issues and Errors -=========================== - -* Menu: - -* Magit is slow:: -* 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. -* 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. - - -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 - -A.2.1 Magit is slow -------------------- - -See *note Performance::. - - -File: magit.info, Node: I changed several thousand files at once and now Magit is unusable, Next: I am having problems committing, Prev: Magit is slow, Up: FAQ - Issues and Errors - -A.2.2 I changed several thousand files at once and now Magit is unusable ------------------------------------------------------------------------- - -Magit is *currently* not expected to work under such conditions. It -sure would be nice if it did, and v2.5 will hopefully be a big step into -that direction. But it might take until v3.1 to accomplish fully -satisfactory performance, because that requires some heavy refactoring. - - But for now we recommend you use the command line to complete this -one commit. Also see *note Performance::. - - -File: magit.info, Node: I am having problems committing, Next: I am using MS Windows and cannot push with Magit, Prev: I changed several thousand files at once and now Magit is unusable, Up: FAQ - Issues and Errors - -A.2.3 I am having problems committing -------------------------------------- - -That likely means that Magit is having problems finding an appropriate -emacsclient executable. See *note (with-editor)Configuring -With-Editor:: and *note (with-editor)Debugging::. - - -File: magit.info, Node: I am using MS Windows and cannot push with Magit, Next: I am using OS X and SOMETHING works in shell but not in Magit, Prev: I am having problems committing, Up: FAQ - Issues and Errors - -A.2.4 I am using MS Windows and cannot push with Magit ------------------------------------------------------- - -It’s almost certain that Magit is only incidental to this issue. It is -much more likely that this is a configuration issue, even if you can -push on the command line. - - Detailed setup instructions can be found at -. - - -File: magit.info, Node: I am using OS X and SOMETHING works in shell but not in Magit, Next: Diffs contain control sequences, Prev: I am using MS Windows and cannot push with Magit, Up: FAQ - Issues and Errors - -A.2.5 I am using OS X and SOMETHING works in shell, but not in Magit --------------------------------------------------------------------- - -This usually occurs because Emacs doesn’t have the same environment -variables as your shell. Try installing and configuring -. By default it -synchronizes ‘$PATH’, which helps Magit find the same ‘git’ as the one -you are using on the shell. - - If SOMETHING is "passphrase caching with gpg-agent for commit and/or -tag signing", then you’ll also need to synchronize ‘$GPG_AGENT_INFO’. - - -File: magit.info, Node: Diffs contain control sequences, Next: Expanding a file to show the diff causes it to disappear, Prev: I am using OS X and SOMETHING works in shell but not in Magit, Up: FAQ - Issues and Errors - -A.2.6 Diffs contain control sequences -------------------------------------- - -This happens when you configure Git to always color diffs and/or all of -its output. The valid values for relevant Git variables ‘color.ui’ and -‘color.diff’ are ‘false’, ‘true’ and ‘always’, and the default is -‘true’. You should leave it that because then you get colorful output -in terminals but git’s output is consumed by something else, then no -colors are used. - - If you actually use some other tool which expects that requires that -you force git to output control sequences (which is highly unlikely), -then you can override these settings just for Magit by using: - - (setq magit-git-global-arguments - (nconc magit-git-global-arguments - '("-c" "color.ui=false" - "-c" "color.diff=false"))) - - -File: magit.info, Node: Expanding a file to show the diff causes it to disappear, Next: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Prev: Diffs contain control sequences, Up: FAQ - Issues and Errors - -A.2.7 Expanding a file to show the diff causes it to disappear --------------------------------------------------------------- - -This is probably caused by a change of a ‘diff.*’ Git variable. You -probably set that variable for a reason, and should therefore only undo -that setting in Magit by customizing ‘magit-git-global-arguments’. - - -File: magit.info, Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Next: The mode-line information isn't always up-to-date, Prev: Expanding a file to show the diff causes it to disappear, Up: FAQ - Issues and Errors - -A.2.8 Point is wrong in the ‘COMMIT_EDITMSG’ buffer ---------------------------------------------------- - -Neither Magit nor ‘git-commit‘ fiddle with point in the buffer used to -write commit messages, so something else must be doing it. - - You have probably globally enabled a mode which does restore point in -file-visiting buffers. It might be a bit surprising, but when you write -a commit message, then you are actually editing a file. - - So you have to figure out which package is doing. ‘saveplace’, -‘pointback’, and ‘session’ are likely candidates. These snippets might -help: - - (setq session-name-disable-regexp "\\(?:\\`'\\.git/[A-Z_]+\\'\\)") - - (with-eval-after-load 'pointback - (lambda () - (when (or git-commit-mode git-rebase-mode) - (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 - -A.2.9 The mode-line information isn’t always up-to-date -------------------------------------------------------- - -Magit is not responsible for the version control information that is -being displayed in the mode-line and looks something like ‘Git-master’. -The built-in "Version Control" package, also known as "VC", updates that -information, and can be told to do so more often: - - (setq auto-revert-check-vc-info t) - - But doing so isn’t good for performance. For more (overly -optimistic) information see *note (emacs)VC Mode Line::. - - If you don’t really care about seeing that information in the -mode-line, but just don’t want to see _incorrect_ information, then -consider disabling VC when using Git: - - (setq vc-handled-backends (delq 'Git vc-handled-backends)) - - Or to disable it completely: - - (setq vc-handled-backends nil) - - -File: magit.info, Node: Emacs 245 hangs when loading Magit, 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 ------------------------------------------- - -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: Debugging Tools, Next: Keystroke Index, Prev: FAQ, Up: Top - -B Debugging Tools -***************** - -Magit and its dependencies provide a few debugging tools, and we -appreciate it very much if you use those tools before reporting an -issue. Please include all relevant output when reporting an issue. - -‘M-x magit-version’ (‘magit-version’) - - This command shows the currently used versions of Magit, Git, and - Emacs in the echo area. Non-interactively this just returns the - Magit version. - -‘M-x magit-emacs-Q-command’ (‘magit-emacs-Q-command’) - - This command shows a debugging shell command in the echo area and - adds it to the kill ring. Paste that command into a shell an run - it. - - This shell command starts ‘emacs’ with only ‘magit’ and its - dependencies loaded. Neither your configuration nor other - installed packages are loaded. This makes it easier to determine - whether some issue lays with Magit or something else. - -‘M-x magit-debug-git-executable’ (‘magit-debug-git-executable’) - - This command displays a buffer containing information about the - available and used ‘git’ executable(s), and can be useful when - investigating ‘exec-path’ issues. - - Also see *note Git Executable::. - -‘M-x with-editor-debug’ (‘with-editor-debug’) - - This command displays a buffer containing information about the - available and used ‘git’ executable(s), and can be useful when - investigating why Magit (or rather ‘with-editor’) cannot find an - appropriate ‘emacsclient’ executable. - - Also see *note (with-editor)Debugging::. - - Please also see the *note FAQ::. - diff --git a/elpa/magit-20171009.1252/magit.info-2 b/elpa/magit-20171208.618/magit.info-2 similarity index 69% rename from elpa/magit-20171009.1252/magit.info-2 rename to elpa/magit-20171208.618/magit.info-2 index 0f870e099c9057b35123bd35e5695a721f3cc91b..03eb25d5d217ed71452b814cfcd8ea6e8b588cca 100644 GIT binary patch literal 122780 zcmdVD+jZu(Hxuhr}!lS|? z5aOyIWAEF2F%Q;Hvj5-Amb>|Bg_9_thOSOf$iv*0EjybnTgMmEBEkRW)8t*YDyI1&xwm(aoUQV?ePf-ypYDxD3I81C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gitflow-autoloads.el new file mode 100644 index 00000000..2bfad37e --- /dev/null +++ b/elpa/magit-gitflow-20170929.124/magit-gitflow-autoloads.el @@ -0,0 +1,22 @@ +;;; magit-gitflow-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "magit-gitflow" "magit-gitflow.el" (23053 36961 +;;;;;; 0 0)) +;;; Generated autoloads from magit-gitflow.el + +(autoload 'turn-on-magit-gitflow "magit-gitflow" "\ +Unconditionally turn on `magit-gitflow-mode'. + +\(fn)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; magit-gitflow-autoloads.el ends here diff --git a/elpa/magit-gitflow-20170929.124/magit-gitflow-pkg.el b/elpa/magit-gitflow-20170929.124/magit-gitflow-pkg.el new file mode 100644 index 00000000..ac187030 --- /dev/null +++ b/elpa/magit-gitflow-20170929.124/magit-gitflow-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "magit-gitflow" "20170929.124" "gitflow extension for magit" '((magit "2.1.0") (magit-popup "2.2.0")) :commit "cc41b561ec6eea947fe9a176349fb4f771ed865b" :url "https://github.com/jtatarik/magit-gitflow" :keywords '("vc" "tools")) diff --git a/elpa/magit-gitflow-20170929.124/magit-gitflow.el b/elpa/magit-gitflow-20170929.124/magit-gitflow.el new file mode 100644 index 00000000..758a1298 --- /dev/null +++ b/elpa/magit-gitflow-20170929.124/magit-gitflow.el @@ -0,0 +1,565 @@ +;;; magit-gitflow.el --- gitflow extension for magit -*- lexical-binding: t; -*- + +;; Copyright (C) 2014, 2015, 2016, 2017 Jan Tatarik + +;; Author: Jan Tatarik +;; Keywords: vc tools +;; Package-Version: 20170929.124 +;; URL: https://github.com/jtatarik/magit-gitflow +;; Package: magit-gitflow +;; Package-Requires: ((magit "2.1.0") (magit-popup "2.2.0")) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;; +;; Gitflow plugin for Magit. +;; +;; (require 'magit-gitflow) +;; (add-hook 'magit-mode-hook 'turn-on-magit-gitflow) +;; +;; C-f in magit status buffer will invoke the gitflow popup. +;; + +;;; Code: + +(require 'magit) +(require 'magit-popup) +(require 'magit-process) +(require 'subr-x) + +(defvar magit-gitflow-mode-lighter " GitFlow") + +(defvar magit-gitflow-popup-key "C-f") + +(defvar magit-gitflow-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd magit-gitflow-popup-key) 'magit-gitflow-popup) + map)) + +(define-minor-mode magit-gitflow-mode + "GitFlow support for Magit." + :lighter magit-gitflow-mode-lighter + :keymap magit-gitflow-mode-map + (or (derived-mode-p 'magit-mode) + (user-error "This mode only makes sense with magit"))) + +;;;###autoload +(defun turn-on-magit-gitflow () + "Unconditionally turn on `magit-gitflow-mode'." + (magit-gitflow-mode 1)) + +(easy-menu-define magit-gitflow-extension-menu nil + "GitFlow extension menu" + '("GitFlow" :visible magit-gitflow-mode + + ("Initialization/setup" + ["Initialize defaults" magit-gitflow-init + :help "Initialize GitFlow in the current repository"] + ["Set feature prefix" magit-gitflow-init-feature] + ["Set release prefix" magit-gitflow-init-release] + ["Set hotfix prefix" magit-gitflow-init-hotfix] + ["Set support prefix" magit-gitflow-init-support] + ["Set versiontag prefix" magit-gitflow-init-versiontag]) + + ("Feature" + ["Start" magit-gitflow-feature-start-popup] + ["Finish" magit-gitflow-feature-finish-popup] + ["Publish" magit-gitflow-feature-publish] + ["Delete" magit-gitflow-feature-delete-popup] + ["Track" magit-gitflow-feature-track] + ["Diff" magit-gitflow-feature-diff] + ["Rebase" magit-gitflow-feature-rebase-popup]) + + ("Bugfix" + ["Start" magit-gitflow-bugfix-start-popup] + ["Finish" magit-gitflow-bugfix-finish-popup] + ["Publish" magit-gitflow-bugfix-publish] + ["Delete" magit-gitflow-bugfix-delete-popup] + ["Track" magit-gitflow-bugfix-track] + ["Diff" magit-gitflow-bugfix-diff] + ["Rebase" magit-gitflow-bugfix-rebase-popup]) + + ("Release" + ["Start" magit-gitflow-release-start-popup] + ["Finish" magit-gitflow-release-finish-popup] + ["Publish" magit-gitflow-release-publish] + ["Delete" magit-gitflow-release-delete-popup] + ["Track" magit-gitflow-release-track]) + + ("Hotfix" + ["Start" magit-gitflow-hotfix-start-popup] + ["Finish" magit-gitflow-hotfix-finish-popup] + ["Publish" magit-gitflow-hotfix-publish] + ["Delete" magit-gitflow-hotfix-delete-popup]) + + ["Support" magit-gitflow-support-start-popup])) + + +(easy-menu-add-item 'magit-mode-menu '("Extensions") + magit-gitflow-extension-menu) + + +;;; Commands + +(magit-define-popup magit-gitflow-popup + "Popup console for GitFlow commands." + 'magit-popups + :actions '((?i "Init" magit-gitflow-init-popup) + (?f "Feature" magit-gitflow-feature-popup) + (?b "Bugfix" magit-gitflow-bugfix-popup) + (?r "Release" magit-gitflow-release-popup) + (?h "Hotfix" magit-gitflow-hotfix-popup) + (?s "Support" magit-gitflow-support-start-popup))) + +;; +;; git flow INIT +;; + +(magit-define-popup magit-gitflow-init-popup + "Popup console for GitFlow 'init' command." + 'magit-gitflow-popup + :actions '((?i "Initialize defaults" magit-gitflow-init) + (?f "Feature prefix" magit-gitflow-init-feature) + (?b "Bugfix prefix" magit-gitflow-init-bugfix) + (?r "Release prefix" magit-gitflow-init-release) + (?h "Hotfix prefix" magit-gitflow-init-hotfix) + (?s "Support prefix" magit-gitflow-init-support) + (?v "Version tag prefix" magit-gitflow-init-versiontag)) + :switches '((?f "Force reinitialization" "--force"))) + +;; +;; git flow FEATURE +;; + +(magit-define-popup magit-gitflow-feature-popup + "Popup console for GitFlow 'feature' command." + 'magit-gitflow-popup + :actions '((?s "Start" magit-gitflow-feature-start-popup) + (?f "Finish" magit-gitflow-feature-finish-popup) + (?p "Publish" magit-gitflow-feature-publish) + (?d "Delete" magit-gitflow-feature-delete-popup) + (?t "Track" magit-gitflow-feature-track) + (?D "Diff" magit-gitflow-feature-diff) + (?r "Rebase" magit-gitflow-feature-rebase-popup))) + +(magit-define-popup magit-gitflow-feature-start-popup + "Popup console for GitFlow 'feature start' command." + 'magit-gitflow-feature-popup + :actions '((?s "Start" magit-gitflow-feature-start)) + :switches '((?F "Fetch" "--fetch"))) + +(magit-define-popup magit-gitflow-feature-finish-popup + "Popup console for GitFlow 'feature finish' command." + 'magit-gitflow-feature-popup + :actions '((?f "Finish" magit-gitflow-feature-finish)) + :switches '((?F "Fetch" "--fetch") + (?r "Rebase" "--rebase") + (?p "Preserve merges" "--preserve-merges") + (?k "Keep branch" "--keep") + (?R "Keep remote branch" "--keepremote") + (?L "Keep local branch" "--keeplocal") + (?D "Force delete branch" "--force_delete") + (?S "Squash" "--squash") + (?n "No fast-forward" "--no-ff"))) + +(magit-define-popup magit-gitflow-feature-delete-popup + "Popup console for GitFlow 'feature delete' command." + 'magit-gitflow-feature-popup + :actions '((?d "Delete" magit-gitflow-feature-delete)) + :switches '((?f "Force" "--force") + (?r "Delete remote" "--remote"))) + + +(magit-define-popup magit-gitflow-feature-rebase-popup + "Popup console for GitFlow 'feature rebase' command." + 'magit-gitflow-feature-popup + :actions '((?r "Rebase" magit-gitflow-feature-rebase)) + :switches '((?i "Interactive" "--interactive") + (?p "Preserve merges" "--preserve-merges"))) + + +;; +;; git flow BUGFIX +;; + +(magit-define-popup magit-gitflow-bugfix-popup + "Popup console for GitFlow 'bugfix' command." + 'magit-gitflow-popup + :actions '((?s "Start" magit-gitflow-bugfix-start-popup) + (?f "Finish" magit-gitflow-bugfix-finish-popup) + (?p "Publish" magit-gitflow-bugfix-publish) + (?d "Delete" magit-gitflow-bugfix-delete-popup) + (?t "Track" magit-gitflow-bugfix-track) + (?D "Diff" magit-gitflow-bugfix-diff) + (?r "Rebase" magit-gitflow-bugfix-rebase-popup))) + +(magit-define-popup magit-gitflow-bugfix-start-popup + "Popup console for GitFlow 'bugfix start' command." + 'magit-gitflow-bugfix-popup + :actions '((?s "Start" magit-gitflow-bugfix-start)) + :switches '((?F "Fetch" "--fetch"))) + +(magit-define-popup magit-gitflow-bugfix-finish-popup + "Popup console for GitFlow 'bugfix finish' command." + 'magit-gitflow-bugfix-popup + :actions '((?f "Finish" magit-gitflow-bugfix-finish)) + :switches '((?F "Fetch" "--fetch") + (?r "Rebase" "--rebase") + (?p "Preserve merges" "--preserve-merges") + (?k "Keep branch" "--keep") + (?R "Keep remote branch" "--keepremote") + (?L "Keep local branch" "--keeplocal") + (?D "Force delete branch" "--force_delete") + (?S "Squash" "--squash") + (?n "No fast-forward" "--no-ff"))) + +(magit-define-popup magit-gitflow-bugfix-delete-popup + "Popup console for GitFlow 'bugfix delete' command." + 'magit-gitflow-bugfix-popup + :actions '((?d "Delete" magit-gitflow-bugfix-delete)) + :switches '((?f "Force" "--force") + (?r "Delete remote" "--remote"))) + + +(magit-define-popup magit-gitflow-bugfix-rebase-popup + "Popup console for GitFlow 'bugfix rebase' command." + 'magit-gitflow-bugfix-popup + :actions '((?r "Rebase" magit-gitflow-bugfix-rebase)) + :switches '((?i "Interactive" "--interactive") + (?p "Preserve merges" "--preserve-merges"))) + + +;; +;; git flow RELEASE +;; + +(magit-define-popup magit-gitflow-release-popup + "Popup console for GitFlow 'release' command." + 'magit-gitflow-popup + :actions '((?s "Start" magit-gitflow-release-start) + (?f "Finish" magit-gitflow-release-finish-popup) + (?p "Publish" magit-gitflow-release-publish) + (?d "Delete" magit-gitflow-release-delete-popup) + (?t "Track" magit-gitflow-release-track))) + +(magit-define-popup magit-gitflow-release-start-popup + "Popup console for GitFlow 'release start' command." + 'magit-gitflow-release-popup + :actions '((?s "Start" magit-gitflow-release-start)) + :switches '((?F "Fetch" "--fetch"))) + +(magit-define-popup magit-gitflow-release-finish-popup + "Popup console for GitFlow 'release finish' command." + 'magit-gitflow-release-popup + :actions '((?f "Finish" magit-gitflow-release-finish)) + :options '((?u "Signing key" "--signingkey=" read-file-name) + (?m "Tag message" "--message=" read-string) + (?f "Tag message file" "--messagefile=" read-file-name)) + :switches '((?F "Fetch before finish" "--fetch") + (?s "Sign" "--sign") + (?p "Push after finish" "--push") + (?k "Keep branch" "--keep") + (?R "Keep remote branch" "--keepremote") + (?L "Keep local branch" "--keeplocal") + (?D "Force delete branch" "--force_delete") + (?n "Don't tag" "--notag") + (?b "Don't back-merge master" "--nobackmerge") + (?S "Squash" "--squash"))) + +(magit-define-popup magit-gitflow-release-delete-popup + "Popup console for GitFlow 'release delete' command." + 'magit-gitflow-release-popup + :actions '((?d "Delete" magit-gitflow-release-delete)) + :switches '((?f "Force" "--force") + (?r "Delete remote branch" "--remote"))) + +;; +;; git flow HOTFIX +;; + +(magit-define-popup magit-gitflow-hotfix-popup + "Popup console for GitFlow 'hotfix' command." + 'magit-gitflow-popup + :actions '((?s "Start" magit-gitflow-hotfix-start-popup) + (?f "Finish" magit-gitflow-hotfix-finish-popup) + (?p "Publish" magit-gitflow-hotfix-publish) + (?d "Delete" magit-gitflow-hotfix-delete-popup))) + +(magit-define-popup magit-gitflow-hotfix-start-popup + "Popup console for GitFlow 'hotfix start' command." + 'magit-gitflow-hotfix-popup + :actions '((?s "Start" magit-gitflow-hotfix-start)) + :switches '((?F "Fetch" "--fetch"))) + +(magit-define-popup magit-gitflow-hotfix-finish-popup + "Popup console for GitFlow 'hotfix finish' command." + 'magit-gitflow-hotfix-popup + :actions '((?f "Finish" magit-gitflow-hotfix-finish)) + :options '((?u "Signing key" "--signingkey=" read-file-name) + (?m "Tag message" "--message=" read-string) + (?f "Tag message file" "--messagefile=" read-file-name)) + :switches '((?F "Fetch before finish" "--fetch") + (?s "Sign" "--sign") + (?p "Push after finish" "--push") + (?k "Keep branch" "--keep") + (?R "Keep remote branch" "--keepremote") + (?L "Keep local branch" "--keeplocal") + (?D "Force delete branch" "--force_delete") + (?n "Don't tag" "--notag") + (?b "Don't back-merge master" "--nobackmerge"))) + +(magit-define-popup magit-gitflow-hotfix-delete-popup + "Popup console for GitFlow 'hotfix delete' command." + 'magit-gitflow-hotfix-popup + :actions '((?d "Delete" magit-gitflow-hotfix-delete)) + :switches '((?f "Force" "--force") + (?r "Delete remote branch" "--remote"))) + + +;; +;; git flow SUPPORT +;; + +(magit-define-popup magit-gitflow-support-start-popup + "Popup console for GitFlow 'support start' command." + 'magit-gitflow-popup + :actions '((?s "Start" magit-gitflow-support-start)) + :switches '((?F "Fetch" "--fetch"))) + + + +;;; Utilities + +(defun magit-run-gitflow (&rest args) + "Execute 'git flow' with given ARGS." + (apply #'magit-run-git "flow" args)) + +(defun magit-gitflow-get-config-key (key) + "Read gitconfig value for gitflow KEY." + (or (magit-get (format "gitflow.%s" key)) + (user-error "Not a gitflow-enabled repo, please run 'git flow init' first"))) + +(defmacro define-magit-gitflow-cmd (cmd) + "Define function to execute 'git flow CMD' commands. + +The new function will be called magit-run-gitflow-CMD." + (let ((defun-name (intern (format "magit-run-gitflow-%s" cmd))) + (version-prompt (format "%s name" (upcase-initials cmd))) + (config-key (format "prefix.%s" cmd))) + + `(defun ,defun-name (args) + (let* ((prefix (magit-gitflow-get-config-key ,config-key)) + (current-branch (magit-get-current-branch)) + (current-feature (if (string-prefix-p prefix current-branch) + (substring current-branch (length prefix)) + ""))) + + (magit-run-gitflow ,cmd args + magit-current-popup-args + (string-remove-prefix + prefix + (magit-completing-read ,version-prompt + (magit-list-refnames "refs/heads") + (lambda (ref) (string-prefix-p prefix ref)) + t + current-branch))))))) + +(define-magit-gitflow-cmd "feature") +(define-magit-gitflow-cmd "bugfix") +(define-magit-gitflow-cmd "release") +(define-magit-gitflow-cmd "hotfix") + + +(defmacro define-magit-gitflow-branch-cmd (branch cmd) + "Define function that executes 'git flow BRANCH CMD' commands. + +The new function will be called magit-gitflow-BRANCH-CMD." + + (let ((branch-execute (intern (format "magit-run-gitflow-%s" branch))) + (defun-name (intern (format "magit-gitflow-%s-%s" branch cmd)))) + + `(defun ,defun-name () + (interactive) + (,branch-execute ,cmd)))) + + +;; +;; git flow INIT +;; +(defun magit-gitflow-init () + (interactive) + (magit-run-gitflow "init" "-d" magit-current-popup-args)) + +(defun magit-gitflow-init-prefix (key prompt) + (let* ((config-key (format "gitflow.prefix.%s" key)) + (default-prefix (or (magit-get config-key) ""))) + (magit-set + (read-string prompt default-prefix) config-key))) + +(defun magit-gitflow-init-feature () + (interactive) + (magit-gitflow-init-prefix "feature" "Feature branch prefix: ")) + +(defun magit-gitflow-init-bugfix () + (interactive) + (magit-gitflow-init-prefix "bugfix" "Bugfix branch prefix: ")) + +(defun magit-gitflow-init-release () + (interactive) + (magit-gitflow-init-prefix "release" "Release branch prefix: ")) + +(defun magit-gitflow-init-hotfix () + (interactive) + (magit-gitflow-init-prefix "hotfix" "Hotfix branch prefix: ")) + +(defun magit-gitflow-init-support () + (interactive) + (magit-gitflow-init-prefix "support" "Support branch prefix: ")) + +(defun magit-gitflow-init-versiontag () + (interactive) + (magit-gitflow-init-prefix "versiontag" "Version tag prefix: ")) + + +;; +;; git flow FEATURE +;; +(defun magit-gitflow-feature-start (name) + (interactive "sFeature name: ") + (magit-run-gitflow "feature" "start" magit-current-popup-args name)) + +(define-magit-gitflow-branch-cmd "feature" "finish") +(define-magit-gitflow-branch-cmd "feature" "publish") +(define-magit-gitflow-branch-cmd "feature" "delete") + +(defun magit-gitflow-feature-rebase () + (interactive) + (let* ((prefix (magit-gitflow-get-config-key "prefix.feature")) + (current-branch (magit-get-current-branch)) + (args (append '("feature" "rebase") magit-current-popup-args (list (string-remove-prefix prefix current-branch))))) + + (when (string-prefix-p prefix current-branch) + (magit-run-git-with-editor "flow" args)))) + +(defun magit-gitflow-feature-diff () + (interactive) + (let* ((prefix (magit-gitflow-get-config-key "prefix.feature")) + (current-branch (magit-get-current-branch)) + (base (magit-get (format "gitflow.branch.%s.base" current-branch)))) + + (when (and (string-prefix-p prefix current-branch) base) + (magit-diff base current-branch)))) + +(defun magit-gitflow-feature-track () + (interactive) + (let ((prefix (magit-gitflow-get-config-key "prefix.feature"))) + (magit-run-gitflow "feature" "track" + (string-remove-prefix prefix (magit-read-remote-branch "Feature" "origin"))))) + + +;; +;; git flow BUGFIX +;; +(defun magit-gitflow-bugfix-start (name) + (interactive "sBugfix name: ") + (magit-run-gitflow "bugfix" "start" magit-current-popup-args name)) + +(define-magit-gitflow-branch-cmd "bugfix" "finish") +(define-magit-gitflow-branch-cmd "bugfix" "publish") +(define-magit-gitflow-branch-cmd "bugfix" "delete") + +(defun magit-gitflow-bugfix-rebase () + (interactive) + (let* ((prefix (magit-gitflow-get-config-key "prefix.bugfix")) + (current-branch (magit-get-current-branch)) + (args (append '("bugfix" "rebase") magit-current-popup-args (list (string-remove-prefix prefix current-branch))))) + + (when (string-prefix-p prefix current-branch) + (magit-run-git-with-editor "flow" args)))) + +(defun magit-gitflow-bugfix-diff () + (interactive) + (let* ((prefix (magit-gitflow-get-config-key "prefix.bugfix")) + (current-branch (magit-get-current-branch)) + (base (magit-get (format "gitflow.branch.%s.base" current-branch)))) + + (when (and (string-prefix-p prefix current-branch) base) + (magit-diff base current-branch)))) + +(defun magit-gitflow-bugfix-track () + (interactive) + (let ((prefix (magit-gitflow-get-config-key "prefix.bugfix"))) + (magit-run-gitflow "bugfix" "track" + (string-remove-prefix prefix (magit-read-remote-branch "Bugfix" "origin"))))) + +;; +;; git flow RELEASE +;; +(defun magit-gitflow-release-start (version) + (interactive "sRelease name: ") + (magit-run-gitflow "release" "start" magit-current-popup-args version)) + +(defun magit-gitflow-release-finish () + (interactive) + (let* ((prefix (magit-gitflow-get-config-key "prefix.release")) + (current-branch (magit-get-current-branch)) + (current-release (if (string-prefix-p prefix current-branch) + (substring current-branch (length prefix)) + "")) + (args (append '("release" "finish") magit-current-popup-args (list (read-string "Release name: " current-release))))) + (magit-run-git-with-editor "flow" args))) + +(define-magit-gitflow-branch-cmd "release" "publish") +(define-magit-gitflow-branch-cmd "release" "delete") + +(defun magit-gitflow-release-track () + (interactive) + (let ((prefix (magit-gitflow-get-config-key "prefix.release"))) + (magit-run-gitflow "release" "track" + (string-remove-prefix prefix (magit-read-remote-branch "Release" "origin"))))) + + +;; +;; git flow HOTFIX +;; +(defun magit-gitflow-hotfix-start (version) + (interactive "sHotfix name: ") + (magit-run-gitflow "hotfix" "start" magit-current-popup-args version)) + +(defun magit-gitflow-hotfix-finish () + (interactive) + (let* ((prefix (magit-gitflow-get-config-key "prefix.hotfix")) + (current-branch (magit-get-current-branch)) + (current-hotfix (if (string-prefix-p prefix current-branch) + (substring current-branch (length prefix)) + "")) + (args (append '("hotfix" "finish") magit-current-popup-args (list (read-string "Hotfix name: " current-hotfix))))) + (magit-run-git-with-editor "flow" args))) + +(define-magit-gitflow-branch-cmd "hotfix" "publish") +(define-magit-gitflow-branch-cmd "hotfix" "delete") + + +;; +;; git flow SUPPORT +;; +(defun magit-gitflow-support-start () + (interactive) + (magit-run-gitflow "support" "start" magit-current-popup-args + (read-string "Support branch name: ") + (magit-read-local-branch-or-ref "Base"))) + +(provide 'magit-gitflow) +;;; magit-gitflow.el ends here diff --git a/elpa/magit-gitflow-readme.txt b/elpa/magit-gitflow-readme.txt new file mode 100644 index 00000000..828725f8 --- /dev/null +++ b/elpa/magit-gitflow-readme.txt @@ -0,0 +1,6 @@ +Gitflow plugin for Magit. + +(require 'magit-gitflow) +(add-hook 'magit-mode-hook 'turn-on-magit-gitflow) + +C-f in magit status buffer will invoke the gitflow popup. diff --git a/elpa/magit-popup-20170913.343/magit-popup-pkg.el b/elpa/magit-popup-20170913.343/magit-popup-pkg.el deleted file mode 100644 index a802f86e..00000000 --- a/elpa/magit-popup-20170913.343/magit-popup-pkg.el +++ /dev/null @@ -1,9 +0,0 @@ -(define-package "magit-popup" "20170913.343" "Define prefix-infix-suffix command combos" - '((emacs "24.4") - (async "20170823") - (dash "20170810")) - :url "https://github.com/magit/magit" :keywords - '("bindings")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/magit-popup-20170913.343/dir b/elpa/magit-popup-20171121.1110/dir similarity index 100% rename from elpa/magit-popup-20170913.343/dir rename to elpa/magit-popup-20171121.1110/dir diff --git a/elpa/magit-popup-20170913.343/magit-popup-autoloads.el b/elpa/magit-popup-20171121.1110/magit-popup-autoloads.el similarity index 91% rename from elpa/magit-popup-20170913.343/magit-popup-autoloads.el rename to elpa/magit-popup-20171121.1110/magit-popup-autoloads.el index 4bd55557..7283367b 100644 --- a/elpa/magit-popup-20170913.343/magit-popup-autoloads.el +++ b/elpa/magit-popup-20171121.1110/magit-popup-autoloads.el @@ -4,7 +4,7 @@ (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) ;;;### (autoloads nil nil ("magit-popup-pkg.el" "magit-popup.el") -;;;;;; (22975 34389 0 0)) +;;;;;; (23082 53687 368743 885000)) ;;;*** diff --git a/elpa/magit-popup-20171121.1110/magit-popup-pkg.el b/elpa/magit-popup-20171121.1110/magit-popup-pkg.el new file mode 100644 index 00000000..527aa3e9 --- /dev/null +++ b/elpa/magit-popup-20171121.1110/magit-popup-pkg.el @@ -0,0 +1,9 @@ +(define-package "magit-popup" "20171121.1110" "Define prefix-infix-suffix command combos" + '((emacs "24.4") + (async "1.9.2") + (dash "2.13.0")) + :url "https://github.com/magit/magit-popup" :keywords + '("bindings")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/magit-popup-20170913.343/magit-popup.el b/elpa/magit-popup-20171121.1110/magit-popup.el similarity index 87% rename from elpa/magit-popup-20170913.343/magit-popup.el rename to elpa/magit-popup-20171121.1110/magit-popup.el index c7e2b2e0..756419b7 100644 --- a/elpa/magit-popup-20170913.343/magit-popup.el +++ b/elpa/magit-popup-20171121.1110/magit-popup.el @@ -12,26 +12,26 @@ ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli -;; Package-Requires: ((emacs "24.4") (async "20170823") (dash "20170810")) +;; Package-Requires: ((emacs "24.4") (async "1.9.2") (dash "2.13.0")) ;; Keywords: bindings -;; Homepage: https://github.com/magit/magit +;; Homepage: https://github.com/magit/magit-popup -;; Magit is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by +;; Magit-Popup is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; -;; Magit 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. +;; Magit-Popup is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with Magit. If not, see http://www.gnu.org/licenses. +;; along with Magit-Popup. If not, see http://www.gnu.org/licenses. ;;; Commentary: -;; This library implements a generic interface for toggling switches +;; This package implements a generic interface for toggling switches ;; and setting options and then invoking an Emacs command which does ;; something with these arguments. The prototypical use is for the ;; command to call an external process, passing on the arguments as @@ -52,6 +52,7 @@ (require 'cl-lib) (require 'dash) (require 'format-spec) +(eval-when-compile (require 'subr-x)) (and (require 'async-bytecomp nil t) (cl-intersection '(all magit) @@ -63,12 +64,6 @@ (declare-function Man-find-section 'man) (declare-function Man-next-section 'man) -;; For the `:variable' event type. -(declare-function magit-git-string 'magit-git) -(declare-function magit-refresh 'magit-mode) -(declare-function magit-get 'magit-git) -(declare-function magit-set 'magit-git) - ;; For branch actions. (declare-function magit-branch-set-face 'magit-git) @@ -294,6 +289,9 @@ Don't confuse this with `magit-current-popup-args'.") (defvar-local magit-previous-popup nil) +(defvar-local magit-pre-popup-buffer nil + "The buffer that was current before invoking the active popup.") + (defun magit-popup-get (prop) "While a popup is active, get the value of PROP." (if (memq prop '(:switches :options :variables :actions)) @@ -354,6 +352,20 @@ or `:only' which doesn't change the behaviour." (lambda (arg) (-contains-p filter arg))) magit-current-popup-args))) +(defvar magit-current-pre-popup-buffer nil + "The buffer that was current before invoking the active popup. +This is bound when invoking an action or variable.") + +(defmacro magit-with-pre-popup-buffer (&rest body) + "Execute the forms in BODY in the buffer that current before the popup. +If `magit-current-pre-popup-buffer' is non-nil use that, else if +`magit-pre-popup-buffer' is non-nil use that, otherwise (when no +popup is involved) execute the forms in the current buffer." + (declare (indent 0)) + `(--if-let (or magit-current-pre-popup-buffer magit-pre-popup-buffer) + (with-current-buffer it ,@body) + ,@body)) + (defun magit-popup-arg-match (pattern string) (if (or (string-match-p "=$" pattern) (string-match-p "^-[A-Z]$" pattern)) @@ -388,7 +400,11 @@ or `:only' which doesn't change the behaviour." (let ((a (nth 2 it))) (make-magit-popup-event :key (car it) :dsc (cadr it) :arg a - :use (and (member a val) t))))) + :use (and (member a val) t) + ;; For arguments implemented in lisp, this function's + ;; doc-string is used by `magit-popup-help'. That is + ;; the only thing it is used for. + :fun (and (string-prefix-p "\+\+" a) (nth 3 it)))))) (defun magit-popup-convert-options (val def) (magit-popup-convert-events def @@ -839,12 +855,13 @@ TYPE is one of `:action', `:sequence-action', `:switch', or (cond ((or action variable) (let* ((magit-current-popup magit-this-popup) (magit-current-popup-args (magit-popup-get-args)) + (magit-current-pre-popup-buffer magit-pre-popup-buffer) (command (magit-popup-event-fun (or action variable))) (magit-current-popup-action command)) (when action (magit-popup-quit)) - (call-interactively command) (setq this-command command) + (call-interactively command) (unless action (magit-refresh-popup-buffer)))) ((eq event ?q) @@ -854,16 +871,6 @@ TYPE is one of `:action', `:sequence-action', `:switch', or (t (user-error "%c isn't bound to any action" event))))) -(defun magit-popup-set-variable - (variable choices &optional default other) - (magit-set (--if-let (magit-git-string "config" "--local" variable) - (cadr (member it choices)) - (car choices)) - variable) - (magit-refresh) - (message "%s %s" variable - (magit-popup-format-variable-1 variable choices default other))) - (defun magit-popup-quit () "Quit the current popup command without invoking an action." (interactive) @@ -932,9 +939,19 @@ and are defined in `magit-popup-mode-map' (which see)." (lookup-key (current-global-map) key)))) (pcase def (`magit-invoke-popup-switch - (magit-popup-manpage man (magit-popup-lookup int :switches))) + (--if-let (magit-popup-lookup int :switches) + (if (and (string-prefix-p "++" (magit-popup-event-arg it)) + (magit-popup-event-fun it)) + (magit-popup-describe-function (magit-popup-event-fun it)) + (magit-popup-manpage man it)) + (user-error "%c isn't bound to any switch" int))) (`magit-invoke-popup-option - (magit-popup-manpage man (magit-popup-lookup int :options))) + (--if-let (magit-popup-lookup int :options) + (if (and (string-prefix-p "++" (magit-popup-event-arg it)) + (magit-popup-event-fun it)) + (magit-popup-describe-function (magit-popup-event-fun it)) + (magit-popup-manpage man it)) + (user-error "%c isn't bound to any option" int))) (`magit-popup-help (magit-popup-manpage man nil)) ((or `self-insert-command @@ -954,14 +971,27 @@ and are defined in `magit-popup-mode-map' (which see)." (user-error "No man page associated with %s" (magit-popup-get :man-page))) (when arg - (setq arg (magit-popup-event-arg arg))) + (setq arg (magit-popup-event-arg arg)) + (when (string-prefix-p "--" arg) + ;; handle '--' option and the '--[no-]' shorthand + (setq arg (cond ((string= "-- " arg) + "\\(?:\\[--\\] \\)?<[^[:space:]]+>\\.\\.\\.") + ((string-prefix-p "--no-" arg) + (concat "--" + "\\[?no-\\]?" + (substring arg 5))) + (t + (concat "--" + "\\(?:\\[no-\\]\\)?" + (substring arg 2))))))) (let ((winconf (current-window-configuration)) buffer) (pcase magit-popup-manpage-package (`woman (delete-other-windows) (split-window-below) (with-no-warnings ; display-buffer-function is obsolete (let ((display-buffer-alist nil) - (display-buffer-function nil)) + (display-buffer-function nil) + (display-buffer-overriding-action nil)) (woman topic))) (setq buffer (current-buffer))) (`man (cl-letf (((symbol-function #'fboundp) (lambda (_) nil))) @@ -975,12 +1005,48 @@ and are defined in `magit-popup-mode-map' (which see)." (fit-window-to-buffer (next-window)) (if (and arg (Man-find-section "OPTIONS") - (re-search-forward (format "^[\t\s]+\\(-., \\)*?%s[=\n]" arg) - (save-excursion - (Man-next-section 1) - (point)) - t)) - (goto-char (1+ (match-beginning 0))) + (let ((case-fold-search nil) + ;; This matches preceding/proceeding options. + ;; Options such as '-a', '-S[]', and + ;; '--grep=' are matched by this regex + ;; without the shy group. The '. ' in the shy + ;; group is for options such as '-m + ;; parent-number', and the '-[^[:space:]]+ ' is + ;; for options such as '--mainline parent-number' + (others "-\\(?:. \\|-[^[:space:]]+ \\)?[^[:space:]]+")) + (re-search-forward + ;; should start with whitespace, and may have any + ;; number of options before/after + (format "^[\t\s]+\\(?:%s, \\)*?\\(?1:%s\\)%s\\(?:, %s\\)*$" + others + ;; options don't necessarily end in an '=' + ;; (e.g., '--gpg-sign[=]') + (string-remove-suffix "=" arg) + ;; Simple options don't end in an '='. + ;; Splitting this into 2 cases should make + ;; getting false positives less likely. + (if (string-suffix-p "=" arg) + ;; [^[:space:]]*[^.[:space:]] matches + ;; the option value, which is usually + ;; after the option name and either '=' + ;; or '[='. The value can't end in a + ;; period, as that means it's being used + ;; at the end of a sentence. The space + ;; is for options such as '--mainline + ;; parent-number'. + "\\(?: \\|\\[?=\\)[^[:space:]]*[^.[:space:]]" + ;; Either this doesn't match anything + ;; (e.g., '-a'), or the option is followed + ;; by a value delimited by a '[', '<', or + ;; ':'. A space might appear before this + ;; value, as in '-f '. The space + ;; alternative is for options such as '-m + ;; parent-number'. + "\\(?:\\(?: \\| ?[\\[<:]\\)[^[:space:]]*[^.[:space:]]\\)?") + others) + nil + t))) + (goto-char (match-beginning 1)) (goto-char (point-min)))))) (defun magit-popup-describe-function (function) @@ -990,7 +1056,9 @@ and are defined in `magit-popup-mode-map' (which see)." (other-window 1) (with-no-warnings ; display-buffer-function is obsolete (let ((display-buffer-alist '(("" display-buffer-use-some-window))) - (display-buffer-function nil)) + (display-buffer-function nil) + (display-buffer-overriding-action nil) + (help-window-select nil)) (describe-function function))) (fit-window-to-buffer) (other-window 1) @@ -1037,23 +1105,28 @@ restored." (funcall it)) (magit-popup-put :actions (magit-popup-convert-actions val (magit-popup-get :sequence-actions))) - (magit-popup-put :variables (magit-popup-convert-variables - val (plist-get def :variables))) - (magit-popup-put :switches (magit-popup-convert-switches - val (plist-get def :switches))) - (magit-popup-put :options (magit-popup-convert-options - val (plist-get def :options))) - (magit-popup-put :actions (magit-popup-convert-actions - val (plist-get def :actions))))) + (let ((vars (plist-get def :variables))) + (when (functionp vars) + (setq vars (funcall vars))) + (when vars + (magit-popup-put :variables (magit-popup-convert-variables val vars)))) + (magit-popup-put :switches (magit-popup-convert-switches + val (plist-get def :switches))) + (magit-popup-put :options (magit-popup-convert-options + val (plist-get def :options))) + (magit-popup-put :actions (magit-popup-convert-actions + val (plist-get def :actions))))) (defun magit-popup-mode-setup (popup mode) (setq magit-previous-popup magit-current-popup) (let ((val (symbol-value (plist-get (symbol-value popup) :variable))) - (def (symbol-value popup))) + (def (symbol-value popup)) + (buf (current-buffer))) (magit-popup-mode-display-buffer (get-buffer-create (format "*%s*" popup)) (or mode 'magit-popup-mode)) (setq magit-this-popup popup) + (setq magit-pre-popup-buffer buf) (if (bound-and-true-p magit-popup-setup-hook) ; obsolete (run-hook-with-args 'magit-popup-setup-hook val def) (funcall (or (magit-popup-get :setup-function) @@ -1084,9 +1157,9 @@ of events shared by all popups and before point is adjusted.") (save-excursion (--if-let (magit-popup-get :refresh-function) (funcall it) + (magit-popup-insert-section 'magit-popup-variable-button) (magit-popup-insert-section 'magit-popup-switch-button) (magit-popup-insert-section 'magit-popup-option-button) - (magit-popup-insert-section 'magit-popup-variable-button) (magit-popup-insert-section 'magit-popup-action-button)) (run-hooks 'magit-refresh-popup-buffer-hook) (when magit-popup-show-common-commands @@ -1189,61 +1262,13 @@ of events shared by all popups and before point is adjusted.") (?d . ,(funcall (magit-popup-event-arg ev))))) 'type type 'event (magit-popup-event-key ev)))) -(defun magit-popup-format-variable - (variable choices &optional default other width) - (concat variable - (if width (make-string (- width (length variable)) ?\s) " ") - (magit-popup-format-variable-1 variable choices default other))) - -(defun magit-popup-format-variable-1 - (variable choices &optional default other) - "Print popup entry for git VARIABLE with possible CHOICES. -DEFAULT is git's default choice for VARIABLE. OTHER is a git -variable whose value may be used as a default." - (let ((local (magit-git-string "config" "--local" variable)) - (global (magit-git-string "config" "--global" variable))) - (when other - (setq other (--when-let (magit-get other) - (concat other ":" it)))) - (concat - (propertize "[" 'face 'magit-popup-disabled-argument) - (mapconcat - (lambda (choice) - (propertize choice 'face (if (equal choice local) - 'magit-popup-option-value - 'magit-popup-disabled-argument))) - choices - (propertize "|" 'face 'magit-popup-disabled-argument)) - (when (or global other default) - (concat - (propertize "|" 'face 'magit-popup-disabled-argument) - (cond (global - (propertize (concat "global:" global) - 'face (cond (local - 'magit-popup-disabled-argument) - ((member global choices) - 'magit-popup-option-value) - (t - 'font-lock-warning-face)))) - (other - (propertize other - 'face (if local - 'magit-popup-disabled-argument - 'magit-popup-option-value))) - (default - (propertize (concat "default:" default) - 'face (if local - 'magit-popup-disabled-argument - 'magit-popup-option-value)))))) - (propertize "]" 'face 'magit-popup-disabled-argument)))) - (defun magit-popup-format-action-button (type ev) (let* ((dsc (magit-popup-event-dsc ev)) (fun (and (functionp dsc) dsc))) (when fun (setq dsc (-when-let (branch (funcall fun)) - (if (next-single-property-change 0 'face (concat "0" branch)) + (if (text-property-not-all 0 (length branch) 'face nil branch) branch (magit-branch-set-face branch))))) (when dsc @@ -1298,4 +1323,7 @@ variable whose value may be used as a default." (font-lock-add-keywords 'emacs-lisp-mode magit-popup-font-lock-keywords) (provide 'magit-popup) +;; Local Variables: +;; indent-tabs-mode: nil +;; End: ;;; magit-popup.el ends here diff --git a/elpa/magit-popup-20170913.343/magit-popup.info b/elpa/magit-popup-20171121.1110/magit-popup.info similarity index 99% rename from elpa/magit-popup-20170913.343/magit-popup.info rename to elpa/magit-popup-20171121.1110/magit-popup.info index f1537b58..fa8f72f7 100644 --- a/elpa/magit-popup-20170913.343/magit-popup.info +++ b/elpa/magit-popup-20171121.1110/magit-popup.info @@ -28,6 +28,8 @@ this library implements a similar abstraction; a new kind of prefix command that is associated with a specific set of infix arguments and suffix commands. + This manual is for Magit-Popup version 2.12.0. + Copyright (C) 2015-2017 Jonas Bernoulli You can redistribute this document and/or modify it under the terms @@ -48,19 +50,17 @@ suffix commands. — The Detailed Node Listing — - Usage * Customizing Existing Popups:: * Other Options:: - - Defining Prefix and Suffix Commands * Defining Prefix Commands:: * Defining Suffix Commands:: +  File: magit-popup.info, Node: Introduction, Next: Usage, Prev: Top, Up: Top @@ -405,6 +405,7 @@ File: magit-popup.info, Node: Other Options, Prev: Customizing Existing Popups • ‘nil’ Ignore prefix arguments. + This option can be overridden for individual popups. ‘magit-show-refs-popup’ for example defaults to invoking the default action directly. It only shows the popup buffer when a @@ -691,13 +692,13 @@ directly.  Tag Table: Node: Top768 -Node: Introduction1944 -Node: Usage4643 -Node: Customizing Existing Popups9340 -Node: Other Options15086 -Node: Defining Prefix and Suffix Commands16628 -Node: Defining Prefix Commands18780 -Node: Defining Suffix Commands25755 +Node: Introduction1995 +Node: Usage4694 +Node: Customizing Existing Popups9391 +Node: Other Options15137 +Node: Defining Prefix and Suffix Commands16680 +Node: Defining Prefix Commands18832 +Node: Defining Suffix Commands25807  End Tag Table -- 2.47.3